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

namespace Google\Cloud\Dialogflow\V2;

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

/**
 * The request message for
 * [Conversations.GenerateStatelessSuggestion][google.cloud.dialogflow.v2.Conversations.GenerateStatelessSuggestion].
 *
 * Generated from protobuf message <code>google.cloud.dialogflow.v2.GenerateStatelessSuggestionRequest</code>
 */
class GenerateStatelessSuggestionRequest extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. The parent resource to charge for the Suggestion's generation.
     * Format: `projects/<Project ID>/locations/<Location ID>`.
     *
     * Generated from protobuf field <code>string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     */
    protected $parent = '';
    /**
     * Optional. A section of ingested context information. The key is the name of
     * the context reference and the value contains the contents of the context
     * reference. The key is used to incorporate ingested context references to
     * enhance the generator.
     *
     * Generated from protobuf field <code>map<string, .google.cloud.dialogflow.v2.Conversation.ContextReference> context_references = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    private $context_references;
    /**
     * Optional. Context of the conversation, including transcripts.
     *
     * Generated from protobuf field <code>.google.cloud.dialogflow.v2.ConversationContext conversation_context = 5 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $conversation_context = null;
    /**
     * Optional. A list of trigger events. Generator will be triggered only if
     * it's trigger event is included here.
     *
     * Generated from protobuf field <code>repeated .google.cloud.dialogflow.v2.TriggerEvent trigger_events = 6 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    private $trigger_events;
    protected $generator_resource;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $parent
     *           Required. The parent resource to charge for the Suggestion's generation.
     *           Format: `projects/<Project ID>/locations/<Location ID>`.
     *     @type \Google\Cloud\Dialogflow\V2\Generator $generator
     *           Uncreated generator. It should be a complete generator that includes all
     *           information about the generator.
     *     @type string $generator_name
     *           The resource name of the existing created generator. Format:
     *           `projects/<Project ID>/locations/<Location ID>/generators/<Generator ID>`
     *     @type array|\Google\Protobuf\Internal\MapField $context_references
     *           Optional. A section of ingested context information. The key is the name of
     *           the context reference and the value contains the contents of the context
     *           reference. The key is used to incorporate ingested context references to
     *           enhance the generator.
     *     @type \Google\Cloud\Dialogflow\V2\ConversationContext $conversation_context
     *           Optional. Context of the conversation, including transcripts.
     *     @type array<int>|\Google\Protobuf\Internal\RepeatedField $trigger_events
     *           Optional. A list of trigger events. Generator will be triggered only if
     *           it's trigger event is included here.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Dialogflow\V2\Conversation::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. The parent resource to charge for the Suggestion's generation.
     * Format: `projects/<Project ID>/locations/<Location ID>`.
     *
     * 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 resource to charge for the Suggestion's generation.
     * Format: `projects/<Project ID>/locations/<Location ID>`.
     *
     * 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;
    }

    /**
     * Uncreated generator. It should be a complete generator that includes all
     * information about the generator.
     *
     * Generated from protobuf field <code>.google.cloud.dialogflow.v2.Generator generator = 2;</code>
     * @return \Google\Cloud\Dialogflow\V2\Generator|null
     */
    public function getGenerator()
    {
        return $this->readOneof(2);
    }

    public function hasGenerator()
    {
        return $this->hasOneof(2);
    }

    /**
     * Uncreated generator. It should be a complete generator that includes all
     * information about the generator.
     *
     * Generated from protobuf field <code>.google.cloud.dialogflow.v2.Generator generator = 2;</code>
     * @param \Google\Cloud\Dialogflow\V2\Generator $var
     * @return $this
     */
    public function setGenerator($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\Generator::class);
        $this->writeOneof(2, $var);

        return $this;
    }

    /**
     * The resource name of the existing created generator. Format:
     * `projects/<Project ID>/locations/<Location ID>/generators/<Generator ID>`
     *
     * Generated from protobuf field <code>string generator_name = 3;</code>
     * @return string
     */
    public function getGeneratorName()
    {
        return $this->readOneof(3);
    }

    public function hasGeneratorName()
    {
        return $this->hasOneof(3);
    }

    /**
     * The resource name of the existing created generator. Format:
     * `projects/<Project ID>/locations/<Location ID>/generators/<Generator ID>`
     *
     * Generated from protobuf field <code>string generator_name = 3;</code>
     * @param string $var
     * @return $this
     */
    public function setGeneratorName($var)
    {
        GPBUtil::checkString($var, True);
        $this->writeOneof(3, $var);

        return $this;
    }

    /**
     * Optional. A section of ingested context information. The key is the name of
     * the context reference and the value contains the contents of the context
     * reference. The key is used to incorporate ingested context references to
     * enhance the generator.
     *
     * Generated from protobuf field <code>map<string, .google.cloud.dialogflow.v2.Conversation.ContextReference> context_references = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return \Google\Protobuf\Internal\MapField
     */
    public function getContextReferences()
    {
        return $this->context_references;
    }

    /**
     * Optional. A section of ingested context information. The key is the name of
     * the context reference and the value contains the contents of the context
     * reference. The key is used to incorporate ingested context references to
     * enhance the generator.
     *
     * Generated from protobuf field <code>map<string, .google.cloud.dialogflow.v2.Conversation.ContextReference> context_references = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param array|\Google\Protobuf\Internal\MapField $var
     * @return $this
     */
    public function setContextReferences($var)
    {
        $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\Conversation\ContextReference::class);
        $this->context_references = $arr;

        return $this;
    }

    /**
     * Optional. Context of the conversation, including transcripts.
     *
     * Generated from protobuf field <code>.google.cloud.dialogflow.v2.ConversationContext conversation_context = 5 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return \Google\Cloud\Dialogflow\V2\ConversationContext|null
     */
    public function getConversationContext()
    {
        return $this->conversation_context;
    }

    public function hasConversationContext()
    {
        return isset($this->conversation_context);
    }

    public function clearConversationContext()
    {
        unset($this->conversation_context);
    }

    /**
     * Optional. Context of the conversation, including transcripts.
     *
     * Generated from protobuf field <code>.google.cloud.dialogflow.v2.ConversationContext conversation_context = 5 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param \Google\Cloud\Dialogflow\V2\ConversationContext $var
     * @return $this
     */
    public function setConversationContext($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\ConversationContext::class);
        $this->conversation_context = $var;

        return $this;
    }

    /**
     * Optional. A list of trigger events. Generator will be triggered only if
     * it's trigger event is included here.
     *
     * Generated from protobuf field <code>repeated .google.cloud.dialogflow.v2.TriggerEvent trigger_events = 6 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getTriggerEvents()
    {
        return $this->trigger_events;
    }

    /**
     * Optional. A list of trigger events. Generator will be triggered only if
     * it's trigger event is included here.
     *
     * Generated from protobuf field <code>repeated .google.cloud.dialogflow.v2.TriggerEvent trigger_events = 6 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param array<int>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setTriggerEvents($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Cloud\Dialogflow\V2\TriggerEvent::class);
        $this->trigger_events = $arr;

        return $this;
    }

    /**
     * @return string
     */
    public function getGeneratorResource()
    {
        return $this->whichOneof("generator_resource");
    }

}

