<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/discoveryengine/v1/user_event_service.proto

namespace Google\Cloud\DiscoveryEngine\V1;

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

/**
 * Request message for CollectUserEvent method.
 *
 * Generated from protobuf message <code>google.cloud.discoveryengine.v1.CollectUserEventRequest</code>
 */
class CollectUserEventRequest extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. The parent DataStore resource name, such as
     * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`.
     *
     * Generated from protobuf field <code>string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     */
    protected $parent = '';
    /**
     * Required. URL encoded UserEvent proto with a length limit of 2,000,000
     * characters.
     *
     * Generated from protobuf field <code>string user_event = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $user_event = '';
    /**
     * The URL including cgi-parameters but excluding the hash fragment with a
     * length limit of 5,000 characters. This is often more useful than the
     * referer URL, because many browsers only send the domain for third-party
     * requests.
     *
     * Generated from protobuf field <code>optional string uri = 3;</code>
     */
    protected $uri = null;
    /**
     * The event timestamp in milliseconds. This prevents browser caching of
     * otherwise identical get requests. The name is abbreviated to reduce the
     * payload bytes.
     *
     * Generated from protobuf field <code>optional int64 ets = 4;</code>
     */
    protected $ets = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $parent
     *           Required. The parent DataStore resource name, such as
     *           `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`.
     *     @type string $user_event
     *           Required. URL encoded UserEvent proto with a length limit of 2,000,000
     *           characters.
     *     @type string $uri
     *           The URL including cgi-parameters but excluding the hash fragment with a
     *           length limit of 5,000 characters. This is often more useful than the
     *           referer URL, because many browsers only send the domain for third-party
     *           requests.
     *     @type int|string $ets
     *           The event timestamp in milliseconds. This prevents browser caching of
     *           otherwise identical get requests. The name is abbreviated to reduce the
     *           payload bytes.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Discoveryengine\V1\UserEventService::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. The parent DataStore resource name, such as
     * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`.
     *
     * Generated from protobuf field <code>string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     * @return string
     */
    public function getParent()
    {
        return $this->parent;
    }

    /**
     * Required. The parent DataStore resource name, such as
     * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`.
     *
     * Generated from protobuf field <code>string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     * @param string $var
     * @return $this
     */
    public function setParent($var)
    {
        GPBUtil::checkString($var, True);
        $this->parent = $var;

        return $this;
    }

    /**
     * Required. URL encoded UserEvent proto with a length limit of 2,000,000
     * characters.
     *
     * Generated from protobuf field <code>string user_event = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return string
     */
    public function getUserEvent()
    {
        return $this->user_event;
    }

    /**
     * Required. URL encoded UserEvent proto with a length limit of 2,000,000
     * characters.
     *
     * Generated from protobuf field <code>string user_event = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param string $var
     * @return $this
     */
    public function setUserEvent($var)
    {
        GPBUtil::checkString($var, True);
        $this->user_event = $var;

        return $this;
    }

    /**
     * The URL including cgi-parameters but excluding the hash fragment with a
     * length limit of 5,000 characters. This is often more useful than the
     * referer URL, because many browsers only send the domain for third-party
     * requests.
     *
     * Generated from protobuf field <code>optional string uri = 3;</code>
     * @return string
     */
    public function getUri()
    {
        return isset($this->uri) ? $this->uri : '';
    }

    public function hasUri()
    {
        return isset($this->uri);
    }

    public function clearUri()
    {
        unset($this->uri);
    }

    /**
     * The URL including cgi-parameters but excluding the hash fragment with a
     * length limit of 5,000 characters. This is often more useful than the
     * referer URL, because many browsers only send the domain for third-party
     * requests.
     *
     * Generated from protobuf field <code>optional string uri = 3;</code>
     * @param string $var
     * @return $this
     */
    public function setUri($var)
    {
        GPBUtil::checkString($var, True);
        $this->uri = $var;

        return $this;
    }

    /**
     * The event timestamp in milliseconds. This prevents browser caching of
     * otherwise identical get requests. The name is abbreviated to reduce the
     * payload bytes.
     *
     * Generated from protobuf field <code>optional int64 ets = 4;</code>
     * @return int|string
     */
    public function getEts()
    {
        return isset($this->ets) ? $this->ets : 0;
    }

    public function hasEts()
    {
        return isset($this->ets);
    }

    public function clearEts()
    {
        unset($this->ets);
    }

    /**
     * The event timestamp in milliseconds. This prevents browser caching of
     * otherwise identical get requests. The name is abbreviated to reduce the
     * payload bytes.
     *
     * Generated from protobuf field <code>optional int64 ets = 4;</code>
     * @param int|string $var
     * @return $this
     */
    public function setEts($var)
    {
        GPBUtil::checkInt64($var);
        $this->ets = $var;

        return $this;
    }

}

