<?php
// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: google/ads/googleads/v24/common/offline_user_data.proto

namespace Google\Ads\GoogleAds\V24\Common;

use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\GPBUtil;
use Google\Protobuf\RepeatedField;

/**
 * Attribute of the store sales transaction.
 *
 * Generated from protobuf message <code>google.ads.googleads.v24.common.TransactionAttribute</code>
 */
class TransactionAttribute extends \Google\Protobuf\Internal\Message
{
    /**
     * Timestamp when transaction occurred. Required.
     * The format is "YYYY-MM-DD HH:MM:SS[+/-HH:MM]", where [+/-HH:MM] is an
     * optional timezone offset from UTC. If the offset is absent, the API will
     * use the account's timezone as default.
     * Examples: "2018-03-05 09:15:00" or "2018-02-01 14:34:30+03:00"
     *
     * Generated from protobuf field <code>optional string transaction_date_time = 8;</code>
     */
    protected $transaction_date_time = null;
    /**
     * Transaction amount in micros. Required.
     * Transaction amount in micros needs to be greater than 1000.
     * If item Attributes are provided, it represents the total value of the
     * items, after multiplying the unit price per item by the quantity provided
     * in the ItemAttributes.
     *
     * Generated from protobuf field <code>optional double transaction_amount_micros = 9;</code>
     */
    protected $transaction_amount_micros = null;
    /**
     * Transaction currency code. ISO 4217 three-letter code is used. Required.
     *
     * Generated from protobuf field <code>optional string currency_code = 10;</code>
     */
    protected $currency_code = null;
    /**
     * The resource name of conversion action to report conversions to.
     * Required.
     *
     * Generated from protobuf field <code>optional string conversion_action = 11;</code>
     */
    protected $conversion_action = null;
    /**
     * Transaction order id. Useful to group transactions which are part of the
     * same order.
     *
     * Generated from protobuf field <code>optional string order_id = 12;</code>
     */
    protected $order_id = null;
    /**
     * Store attributes of the transaction.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v24.common.StoreAttribute store_attribute = 6;</code>
     */
    protected $store_attribute = null;
    /**
     * Value of the custom variable for each transaction.
     * Allowed only if a custom key is provided in the store sales metadata.
     *
     * Generated from protobuf field <code>optional string custom_value = 13;</code>
     */
    protected $custom_value = null;
    /**
     * Item attributes of the transaction.
     * Accessible only to customers on the allow-list.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v24.common.ItemAttribute item_attribute = 14;</code>
     */
    protected $item_attribute = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *                    Optional. Data for populating the Message object.
     *
     * @type string $transaction_date_time
     *           Timestamp when transaction occurred. Required.
     *           The format is "YYYY-MM-DD HH:MM:SS[+/-HH:MM]", where [+/-HH:MM] is an
     *           optional timezone offset from UTC. If the offset is absent, the API will
     *           use the account's timezone as default.
     *           Examples: "2018-03-05 09:15:00" or "2018-02-01 14:34:30+03:00"
     * @type float $transaction_amount_micros
     *           Transaction amount in micros. Required.
     *           Transaction amount in micros needs to be greater than 1000.
     *           If item Attributes are provided, it represents the total value of the
     *           items, after multiplying the unit price per item by the quantity provided
     *           in the ItemAttributes.
     * @type string $currency_code
     *           Transaction currency code. ISO 4217 three-letter code is used. Required.
     * @type string $conversion_action
     *           The resource name of conversion action to report conversions to.
     *           Required.
     * @type string $order_id
     *           Transaction order id. Useful to group transactions which are part of the
     *           same order.
     * @type \Google\Ads\GoogleAds\V24\Common\StoreAttribute $store_attribute
     *           Store attributes of the transaction.
     * @type string $custom_value
     *           Value of the custom variable for each transaction.
     *           Allowed only if a custom key is provided in the store sales metadata.
     * @type \Google\Ads\GoogleAds\V24\Common\ItemAttribute $item_attribute
     *           Item attributes of the transaction.
     *           Accessible only to customers on the allow-list.
     * }
     */
    public function __construct($data = null)
    {
        \GPBMetadata\Google\Ads\GoogleAds\V24\Common\OfflineUserData::initOnce();
        parent::__construct($data);
    }

    /**
     * Timestamp when transaction occurred. Required.
     * The format is "YYYY-MM-DD HH:MM:SS[+/-HH:MM]", where [+/-HH:MM] is an
     * optional timezone offset from UTC. If the offset is absent, the API will
     * use the account's timezone as default.
     * Examples: "2018-03-05 09:15:00" or "2018-02-01 14:34:30+03:00"
     *
     * Generated from protobuf field <code>optional string transaction_date_time = 8;</code>
     *
     * @return string
     */
    public function getTransactionDateTime()
    {
        return isset($this->transaction_date_time) ? $this->transaction_date_time : '';
    }

    public function hasTransactionDateTime()
    {
        return isset($this->transaction_date_time);
    }

    public function clearTransactionDateTime()
    {
        unset($this->transaction_date_time);
    }

    /**
     * Timestamp when transaction occurred. Required.
     * The format is "YYYY-MM-DD HH:MM:SS[+/-HH:MM]", where [+/-HH:MM] is an
     * optional timezone offset from UTC. If the offset is absent, the API will
     * use the account's timezone as default.
     * Examples: "2018-03-05 09:15:00" or "2018-02-01 14:34:30+03:00"
     *
     * Generated from protobuf field <code>optional string transaction_date_time = 8;</code>
     *
     * @param  string $var
     * @return $this
     */
    public function setTransactionDateTime($var)
    {
        GPBUtil::checkString($var, true);
        $this->transaction_date_time = $var;

        return $this;
    }

    /**
     * Transaction amount in micros. Required.
     * Transaction amount in micros needs to be greater than 1000.
     * If item Attributes are provided, it represents the total value of the
     * items, after multiplying the unit price per item by the quantity provided
     * in the ItemAttributes.
     *
     * Generated from protobuf field <code>optional double transaction_amount_micros = 9;</code>
     *
     * @return float
     */
    public function getTransactionAmountMicros()
    {
        return isset($this->transaction_amount_micros) ? $this->transaction_amount_micros : 0.0;
    }

    public function hasTransactionAmountMicros()
    {
        return isset($this->transaction_amount_micros);
    }

    public function clearTransactionAmountMicros()
    {
        unset($this->transaction_amount_micros);
    }

    /**
     * Transaction amount in micros. Required.
     * Transaction amount in micros needs to be greater than 1000.
     * If item Attributes are provided, it represents the total value of the
     * items, after multiplying the unit price per item by the quantity provided
     * in the ItemAttributes.
     *
     * Generated from protobuf field <code>optional double transaction_amount_micros = 9;</code>
     *
     * @param  float $var
     * @return $this
     */
    public function setTransactionAmountMicros($var)
    {
        GPBUtil::checkDouble($var);
        $this->transaction_amount_micros = $var;

        return $this;
    }

    /**
     * Transaction currency code. ISO 4217 three-letter code is used. Required.
     *
     * Generated from protobuf field <code>optional string currency_code = 10;</code>
     *
     * @return string
     */
    public function getCurrencyCode()
    {
        return isset($this->currency_code) ? $this->currency_code : '';
    }

    public function hasCurrencyCode()
    {
        return isset($this->currency_code);
    }

    public function clearCurrencyCode()
    {
        unset($this->currency_code);
    }

    /**
     * Transaction currency code. ISO 4217 three-letter code is used. Required.
     *
     * Generated from protobuf field <code>optional string currency_code = 10;</code>
     *
     * @param  string $var
     * @return $this
     */
    public function setCurrencyCode($var)
    {
        GPBUtil::checkString($var, true);
        $this->currency_code = $var;

        return $this;
    }

    /**
     * The resource name of conversion action to report conversions to.
     * Required.
     *
     * Generated from protobuf field <code>optional string conversion_action = 11;</code>
     *
     * @return string
     */
    public function getConversionAction()
    {
        return isset($this->conversion_action) ? $this->conversion_action : '';
    }

    public function hasConversionAction()
    {
        return isset($this->conversion_action);
    }

    public function clearConversionAction()
    {
        unset($this->conversion_action);
    }

    /**
     * The resource name of conversion action to report conversions to.
     * Required.
     *
     * Generated from protobuf field <code>optional string conversion_action = 11;</code>
     *
     * @param  string $var
     * @return $this
     */
    public function setConversionAction($var)
    {
        GPBUtil::checkString($var, true);
        $this->conversion_action = $var;

        return $this;
    }

    /**
     * Transaction order id. Useful to group transactions which are part of the
     * same order.
     *
     * Generated from protobuf field <code>optional string order_id = 12;</code>
     *
     * @return string
     */
    public function getOrderId()
    {
        return isset($this->order_id) ? $this->order_id : '';
    }

    public function hasOrderId()
    {
        return isset($this->order_id);
    }

    public function clearOrderId()
    {
        unset($this->order_id);
    }

    /**
     * Transaction order id. Useful to group transactions which are part of the
     * same order.
     *
     * Generated from protobuf field <code>optional string order_id = 12;</code>
     *
     * @param  string $var
     * @return $this
     */
    public function setOrderId($var)
    {
        GPBUtil::checkString($var, true);
        $this->order_id = $var;

        return $this;
    }

    /**
     * Store attributes of the transaction.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v24.common.StoreAttribute store_attribute = 6;</code>
     *
     * @return \Google\Ads\GoogleAds\V24\Common\StoreAttribute|null
     */
    public function getStoreAttribute()
    {
        return $this->store_attribute;
    }

    public function hasStoreAttribute()
    {
        return isset($this->store_attribute);
    }

    public function clearStoreAttribute()
    {
        unset($this->store_attribute);
    }

    /**
     * Store attributes of the transaction.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v24.common.StoreAttribute store_attribute = 6;</code>
     *
     * @param  \Google\Ads\GoogleAds\V24\Common\StoreAttribute $var
     * @return $this
     */
    public function setStoreAttribute($var)
    {
        GPBUtil::checkMessage($var, \Google\Ads\GoogleAds\V24\Common\StoreAttribute::class);
        $this->store_attribute = $var;

        return $this;
    }

    /**
     * Value of the custom variable for each transaction.
     * Allowed only if a custom key is provided in the store sales metadata.
     *
     * Generated from protobuf field <code>optional string custom_value = 13;</code>
     *
     * @return string
     */
    public function getCustomValue()
    {
        return isset($this->custom_value) ? $this->custom_value : '';
    }

    public function hasCustomValue()
    {
        return isset($this->custom_value);
    }

    public function clearCustomValue()
    {
        unset($this->custom_value);
    }

    /**
     * Value of the custom variable for each transaction.
     * Allowed only if a custom key is provided in the store sales metadata.
     *
     * Generated from protobuf field <code>optional string custom_value = 13;</code>
     *
     * @param  string $var
     * @return $this
     */
    public function setCustomValue($var)
    {
        GPBUtil::checkString($var, true);
        $this->custom_value = $var;

        return $this;
    }

    /**
     * Item attributes of the transaction.
     * Accessible only to customers on the allow-list.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v24.common.ItemAttribute item_attribute = 14;</code>
     *
     * @return \Google\Ads\GoogleAds\V24\Common\ItemAttribute|null
     */
    public function getItemAttribute()
    {
        return $this->item_attribute;
    }

    public function hasItemAttribute()
    {
        return isset($this->item_attribute);
    }

    public function clearItemAttribute()
    {
        unset($this->item_attribute);
    }

    /**
     * Item attributes of the transaction.
     * Accessible only to customers on the allow-list.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v24.common.ItemAttribute item_attribute = 14;</code>
     *
     * @param  \Google\Ads\GoogleAds\V24\Common\ItemAttribute $var
     * @return $this
     */
    public function setItemAttribute($var)
    {
        GPBUtil::checkMessage($var, \Google\Ads\GoogleAds\V24\Common\ItemAttribute::class);
        $this->item_attribute = $var;

        return $this;
    }

}

