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

namespace Google\Cloud\DiscoveryEngine\V1beta;

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

/**
 * External conversation proto definition.
 *
 * Generated from protobuf message <code>google.cloud.discoveryengine.v1beta.Conversation</code>
 */
class Conversation extends \Google\Protobuf\Internal\Message
{
    /**
     * Immutable. Fully qualified name
     * `project/&#42;&#47;locations/global/collections/{collection}/dataStore/&#42;&#47;conversations/&#42;`
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = IMMUTABLE];</code>
     */
    protected $name = '';
    /**
     * The state of the Conversation.
     *
     * Generated from protobuf field <code>.google.cloud.discoveryengine.v1beta.Conversation.State state = 2;</code>
     */
    protected $state = 0;
    /**
     * A unique identifier for tracking users.
     *
     * Generated from protobuf field <code>string user_pseudo_id = 3;</code>
     */
    protected $user_pseudo_id = '';
    /**
     * Conversation messages.
     *
     * Generated from protobuf field <code>repeated .google.cloud.discoveryengine.v1beta.ConversationMessage messages = 4;</code>
     */
    private $messages;
    /**
     * Output only. The time the conversation started.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp start_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $start_time = null;
    /**
     * Output only. The time the conversation finished.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp end_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $end_time = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $name
     *           Immutable. Fully qualified name
     *           `project/&#42;&#47;locations/global/collections/{collection}/dataStore/&#42;&#47;conversations/&#42;`
     *     @type int $state
     *           The state of the Conversation.
     *     @type string $user_pseudo_id
     *           A unique identifier for tracking users.
     *     @type array<\Google\Cloud\DiscoveryEngine\V1beta\ConversationMessage>|\Google\Protobuf\Internal\RepeatedField $messages
     *           Conversation messages.
     *     @type \Google\Protobuf\Timestamp $start_time
     *           Output only. The time the conversation started.
     *     @type \Google\Protobuf\Timestamp $end_time
     *           Output only. The time the conversation finished.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Discoveryengine\V1Beta\Conversation::initOnce();
        parent::__construct($data);
    }

    /**
     * Immutable. Fully qualified name
     * `project/&#42;&#47;locations/global/collections/{collection}/dataStore/&#42;&#47;conversations/&#42;`
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = IMMUTABLE];</code>
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * Immutable. Fully qualified name
     * `project/&#42;&#47;locations/global/collections/{collection}/dataStore/&#42;&#47;conversations/&#42;`
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = IMMUTABLE];</code>
     * @param string $var
     * @return $this
     */
    public function setName($var)
    {
        GPBUtil::checkString($var, True);
        $this->name = $var;

        return $this;
    }

    /**
     * The state of the Conversation.
     *
     * Generated from protobuf field <code>.google.cloud.discoveryengine.v1beta.Conversation.State state = 2;</code>
     * @return int
     */
    public function getState()
    {
        return $this->state;
    }

    /**
     * The state of the Conversation.
     *
     * Generated from protobuf field <code>.google.cloud.discoveryengine.v1beta.Conversation.State state = 2;</code>
     * @param int $var
     * @return $this
     */
    public function setState($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\DiscoveryEngine\V1beta\Conversation\State::class);
        $this->state = $var;

        return $this;
    }

    /**
     * A unique identifier for tracking users.
     *
     * Generated from protobuf field <code>string user_pseudo_id = 3;</code>
     * @return string
     */
    public function getUserPseudoId()
    {
        return $this->user_pseudo_id;
    }

    /**
     * A unique identifier for tracking users.
     *
     * Generated from protobuf field <code>string user_pseudo_id = 3;</code>
     * @param string $var
     * @return $this
     */
    public function setUserPseudoId($var)
    {
        GPBUtil::checkString($var, True);
        $this->user_pseudo_id = $var;

        return $this;
    }

    /**
     * Conversation messages.
     *
     * Generated from protobuf field <code>repeated .google.cloud.discoveryengine.v1beta.ConversationMessage messages = 4;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getMessages()
    {
        return $this->messages;
    }

    /**
     * Conversation messages.
     *
     * Generated from protobuf field <code>repeated .google.cloud.discoveryengine.v1beta.ConversationMessage messages = 4;</code>
     * @param array<\Google\Cloud\DiscoveryEngine\V1beta\ConversationMessage>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setMessages($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DiscoveryEngine\V1beta\ConversationMessage::class);
        $this->messages = $arr;

        return $this;
    }

    /**
     * Output only. The time the conversation started.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp start_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getStartTime()
    {
        return $this->start_time;
    }

    public function hasStartTime()
    {
        return isset($this->start_time);
    }

    public function clearStartTime()
    {
        unset($this->start_time);
    }

    /**
     * Output only. The time the conversation started.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp start_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setStartTime($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->start_time = $var;

        return $this;
    }

    /**
     * Output only. The time the conversation finished.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp end_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getEndTime()
    {
        return $this->end_time;
    }

    public function hasEndTime()
    {
        return isset($this->end_time);
    }

    public function clearEndTime()
    {
        unset($this->end_time);
    }

    /**
     * Output only. The time the conversation finished.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp end_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setEndTime($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->end_time = $var;

        return $this;
    }

}

