<?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;

/**
 * Advertiser defined events and their attributes. All the values in the
 * nested fields are required.
 *
 * Generated from protobuf message <code>google.ads.googleads.v24.common.EventAttribute</code>
 */
class EventAttribute extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. Advertiser defined event to be used for remarketing. The accepted
     * values are "Viewed", "Cart", "Purchased" and "Recommended".
     *
     * Generated from protobuf field <code>string event = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $event = '';
    /**
     * Required. Timestamp at which the event happened.
     * 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.
     *
     * Generated from protobuf field <code>string event_date_time = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $event_date_time = '';
    /**
     * Required. Item attributes of the event.
     *
     * Generated from protobuf field <code>repeated .google.ads.googleads.v24.common.EventItemAttribute item_attribute = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    private $item_attribute;

    /**
     * Constructor.
     *
     * @param array $data {
     *                    Optional. Data for populating the Message object.
     *
     * @type string $event
     *           Required. Advertiser defined event to be used for remarketing. The accepted
     *           values are "Viewed", "Cart", "Purchased" and "Recommended".
     * @type string $event_date_time
     *           Required. Timestamp at which the event happened.
     *           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.
     * @type \Google\Ads\GoogleAds\V24\Common\EventItemAttribute[] $item_attribute
     *           Required. Item attributes of the event.
     * }
     */
    public function __construct($data = null)
    {
        \GPBMetadata\Google\Ads\GoogleAds\V24\Common\OfflineUserData::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. Advertiser defined event to be used for remarketing. The accepted
     * values are "Viewed", "Cart", "Purchased" and "Recommended".
     *
     * Generated from protobuf field <code>string event = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     *
     * @return string
     */
    public function getEvent()
    {
        return $this->event;
    }

    /**
     * Required. Advertiser defined event to be used for remarketing. The accepted
     * values are "Viewed", "Cart", "Purchased" and "Recommended".
     *
     * Generated from protobuf field <code>string event = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     *
     * @param  string $var
     * @return $this
     */
    public function setEvent($var)
    {
        GPBUtil::checkString($var, true);
        $this->event = $var;

        return $this;
    }

    /**
     * Required. Timestamp at which the event happened.
     * 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.
     *
     * Generated from protobuf field <code>string event_date_time = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     *
     * @return string
     */
    public function getEventDateTime()
    {
        return $this->event_date_time;
    }

    /**
     * Required. Timestamp at which the event happened.
     * 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.
     *
     * Generated from protobuf field <code>string event_date_time = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     *
     * @param  string $var
     * @return $this
     */
    public function setEventDateTime($var)
    {
        GPBUtil::checkString($var, true);
        $this->event_date_time = $var;

        return $this;
    }

    /**
     * Required. Item attributes of the event.
     *
     * Generated from protobuf field <code>repeated .google.ads.googleads.v24.common.EventItemAttribute item_attribute = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     *
     * @return RepeatedField<\Google\Ads\GoogleAds\V24\Common\EventItemAttribute>
     */
    public function getItemAttribute()
    {
        return $this->item_attribute;
    }

    /**
     * Required. Item attributes of the event.
     *
     * Generated from protobuf field <code>repeated .google.ads.googleads.v24.common.EventItemAttribute item_attribute = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     *
     * @param  \Google\Ads\GoogleAds\V24\Common\EventItemAttribute[] $var
     * @return $this
     */
    public function setItemAttribute($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Ads\GoogleAds\V24\Common\EventItemAttribute::class);
        $this->item_attribute = $arr;

        return $this;
    }

}

