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

namespace Google\Cloud\DiscoveryEngine\V1;

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

/**
 * Request for the
 * [AssistantService.StreamAssist][google.cloud.discoveryengine.v1.AssistantService.StreamAssist]
 * method.
 *
 * Generated from protobuf message <code>google.cloud.discoveryengine.v1.StreamAssistRequest</code>
 */
class StreamAssistRequest extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. The resource name of the
     * [Assistant][google.cloud.discoveryengine.v1.Assistant]. Format:
     * `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/assistants/{assistant}`
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     */
    protected $name = '';
    /**
     * Optional. Current user query.
     * Empty query is only supported if `file_ids` are provided. In this case, the
     * answer will be generated based on those context files.
     *
     * Generated from protobuf field <code>.google.cloud.discoveryengine.v1.Query query = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $query = null;
    /**
     * Optional. The session to use for the request. If specified, the assistant
     * has access to the session history, and the query and the answer are stored
     * there.
     * If `-` is specified as the session ID, or it is left empty, then a new
     * session is created with an automatically generated ID.
     * Format:
     * `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/sessions/{session}`
     *
     * Generated from protobuf field <code>string session = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = {</code>
     */
    protected $session = '';
    /**
     * Optional. Information about the user initiating the query.
     *
     * Generated from protobuf field <code>.google.cloud.discoveryengine.v1.AssistUserMetadata user_metadata = 6 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $user_metadata = null;
    /**
     * Optional. Specification of tools that are used to serve the request.
     *
     * Generated from protobuf field <code>.google.cloud.discoveryengine.v1.StreamAssistRequest.ToolsSpec tools_spec = 18 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $tools_spec = null;
    /**
     * Optional. Specification of the generation configuration for the request.
     *
     * Generated from protobuf field <code>.google.cloud.discoveryengine.v1.StreamAssistRequest.GenerationSpec generation_spec = 19 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $generation_spec = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $name
     *           Required. The resource name of the
     *           [Assistant][google.cloud.discoveryengine.v1.Assistant]. Format:
     *           `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/assistants/{assistant}`
     *     @type \Google\Cloud\DiscoveryEngine\V1\Query $query
     *           Optional. Current user query.
     *           Empty query is only supported if `file_ids` are provided. In this case, the
     *           answer will be generated based on those context files.
     *     @type string $session
     *           Optional. The session to use for the request. If specified, the assistant
     *           has access to the session history, and the query and the answer are stored
     *           there.
     *           If `-` is specified as the session ID, or it is left empty, then a new
     *           session is created with an automatically generated ID.
     *           Format:
     *           `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/sessions/{session}`
     *     @type \Google\Cloud\DiscoveryEngine\V1\AssistUserMetadata $user_metadata
     *           Optional. Information about the user initiating the query.
     *     @type \Google\Cloud\DiscoveryEngine\V1\StreamAssistRequest\ToolsSpec $tools_spec
     *           Optional. Specification of tools that are used to serve the request.
     *     @type \Google\Cloud\DiscoveryEngine\V1\StreamAssistRequest\GenerationSpec $generation_spec
     *           Optional. Specification of the generation configuration for the request.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Discoveryengine\V1\AssistantService::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. The resource name of the
     * [Assistant][google.cloud.discoveryengine.v1.Assistant]. Format:
     * `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/assistants/{assistant}`
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * Required. The resource name of the
     * [Assistant][google.cloud.discoveryengine.v1.Assistant]. Format:
     * `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/assistants/{assistant}`
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     * @param string $var
     * @return $this
     */
    public function setName($var)
    {
        GPBUtil::checkString($var, True);
        $this->name = $var;

        return $this;
    }

    /**
     * Optional. Current user query.
     * Empty query is only supported if `file_ids` are provided. In this case, the
     * answer will be generated based on those context files.
     *
     * Generated from protobuf field <code>.google.cloud.discoveryengine.v1.Query query = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return \Google\Cloud\DiscoveryEngine\V1\Query|null
     */
    public function getQuery()
    {
        return $this->query;
    }

    public function hasQuery()
    {
        return isset($this->query);
    }

    public function clearQuery()
    {
        unset($this->query);
    }

    /**
     * Optional. Current user query.
     * Empty query is only supported if `file_ids` are provided. In this case, the
     * answer will be generated based on those context files.
     *
     * Generated from protobuf field <code>.google.cloud.discoveryengine.v1.Query query = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param \Google\Cloud\DiscoveryEngine\V1\Query $var
     * @return $this
     */
    public function setQuery($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\DiscoveryEngine\V1\Query::class);
        $this->query = $var;

        return $this;
    }

    /**
     * Optional. The session to use for the request. If specified, the assistant
     * has access to the session history, and the query and the answer are stored
     * there.
     * If `-` is specified as the session ID, or it is left empty, then a new
     * session is created with an automatically generated ID.
     * Format:
     * `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/sessions/{session}`
     *
     * Generated from protobuf field <code>string session = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = {</code>
     * @return string
     */
    public function getSession()
    {
        return $this->session;
    }

    /**
     * Optional. The session to use for the request. If specified, the assistant
     * has access to the session history, and the query and the answer are stored
     * there.
     * If `-` is specified as the session ID, or it is left empty, then a new
     * session is created with an automatically generated ID.
     * Format:
     * `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/sessions/{session}`
     *
     * Generated from protobuf field <code>string session = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = {</code>
     * @param string $var
     * @return $this
     */
    public function setSession($var)
    {
        GPBUtil::checkString($var, True);
        $this->session = $var;

        return $this;
    }

    /**
     * Optional. Information about the user initiating the query.
     *
     * Generated from protobuf field <code>.google.cloud.discoveryengine.v1.AssistUserMetadata user_metadata = 6 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return \Google\Cloud\DiscoveryEngine\V1\AssistUserMetadata|null
     */
    public function getUserMetadata()
    {
        return $this->user_metadata;
    }

    public function hasUserMetadata()
    {
        return isset($this->user_metadata);
    }

    public function clearUserMetadata()
    {
        unset($this->user_metadata);
    }

    /**
     * Optional. Information about the user initiating the query.
     *
     * Generated from protobuf field <code>.google.cloud.discoveryengine.v1.AssistUserMetadata user_metadata = 6 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param \Google\Cloud\DiscoveryEngine\V1\AssistUserMetadata $var
     * @return $this
     */
    public function setUserMetadata($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\DiscoveryEngine\V1\AssistUserMetadata::class);
        $this->user_metadata = $var;

        return $this;
    }

    /**
     * Optional. Specification of tools that are used to serve the request.
     *
     * Generated from protobuf field <code>.google.cloud.discoveryengine.v1.StreamAssistRequest.ToolsSpec tools_spec = 18 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return \Google\Cloud\DiscoveryEngine\V1\StreamAssistRequest\ToolsSpec|null
     */
    public function getToolsSpec()
    {
        return $this->tools_spec;
    }

    public function hasToolsSpec()
    {
        return isset($this->tools_spec);
    }

    public function clearToolsSpec()
    {
        unset($this->tools_spec);
    }

    /**
     * Optional. Specification of tools that are used to serve the request.
     *
     * Generated from protobuf field <code>.google.cloud.discoveryengine.v1.StreamAssistRequest.ToolsSpec tools_spec = 18 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param \Google\Cloud\DiscoveryEngine\V1\StreamAssistRequest\ToolsSpec $var
     * @return $this
     */
    public function setToolsSpec($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\DiscoveryEngine\V1\StreamAssistRequest\ToolsSpec::class);
        $this->tools_spec = $var;

        return $this;
    }

    /**
     * Optional. Specification of the generation configuration for the request.
     *
     * Generated from protobuf field <code>.google.cloud.discoveryengine.v1.StreamAssistRequest.GenerationSpec generation_spec = 19 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return \Google\Cloud\DiscoveryEngine\V1\StreamAssistRequest\GenerationSpec|null
     */
    public function getGenerationSpec()
    {
        return $this->generation_spec;
    }

    public function hasGenerationSpec()
    {
        return isset($this->generation_spec);
    }

    public function clearGenerationSpec()
    {
        unset($this->generation_spec);
    }

    /**
     * Optional. Specification of the generation configuration for the request.
     *
     * Generated from protobuf field <code>.google.cloud.discoveryengine.v1.StreamAssistRequest.GenerationSpec generation_spec = 19 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param \Google\Cloud\DiscoveryEngine\V1\StreamAssistRequest\GenerationSpec $var
     * @return $this
     */
    public function setGenerationSpec($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\DiscoveryEngine\V1\StreamAssistRequest\GenerationSpec::class);
        $this->generation_spec = $var;

        return $this;
    }

}

