<?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 [ConversationsService.IngestContextReferences][].
 *
 * Generated from protobuf message <code>google.cloud.dialogflow.v2.IngestContextReferencesRequest</code>
 */
class IngestContextReferencesRequest extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. Resource identifier of the conversation to ingest context
     * information for. Format: `projects/<Project ID>/locations/<Location
     * ID>/conversations/<Conversation ID>`.
     *
     * Generated from protobuf field <code>string conversation = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     */
    protected $conversation = '';
    /**
     * Required. The context references to ingest. 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 = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    private $context_references;

    /**
     * @param string $conversation      Required. Resource identifier of the conversation to ingest context
     *                                  information for. Format: `projects/<Project ID>/locations/<Location
     *                                  ID>/conversations/<Conversation ID>`. Please see
     *                                  {@see ConversationsClient::conversationName()} for help formatting this field.
     * @param array  $contextReferences Required. The context references to ingest. 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.
     *
     * @return \Google\Cloud\Dialogflow\V2\IngestContextReferencesRequest
     *
     * @experimental
     */
    public static function build(string $conversation, array $contextReferences): self
    {
        return (new self())
            ->setConversation($conversation)
            ->setContextReferences($contextReferences);
    }

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $conversation
     *           Required. Resource identifier of the conversation to ingest context
     *           information for. Format: `projects/<Project ID>/locations/<Location
     *           ID>/conversations/<Conversation ID>`.
     *     @type array|\Google\Protobuf\Internal\MapField $context_references
     *           Required. The context references to ingest. 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.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Dialogflow\V2\Conversation::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. Resource identifier of the conversation to ingest context
     * information for. Format: `projects/<Project ID>/locations/<Location
     * ID>/conversations/<Conversation ID>`.
     *
     * Generated from protobuf field <code>string conversation = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     * @return string
     */
    public function getConversation()
    {
        return $this->conversation;
    }

    /**
     * Required. Resource identifier of the conversation to ingest context
     * information for. Format: `projects/<Project ID>/locations/<Location
     * ID>/conversations/<Conversation ID>`.
     *
     * Generated from protobuf field <code>string conversation = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     * @param string $var
     * @return $this
     */
    public function setConversation($var)
    {
        GPBUtil::checkString($var, True);
        $this->conversation = $var;

        return $this;
    }

    /**
     * Required. The context references to ingest. 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 = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return \Google\Protobuf\Internal\MapField
     */
    public function getContextReferences()
    {
        return $this->context_references;
    }

    /**
     * Required. The context references to ingest. 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 = 2 [(.google.api.field_behavior) = REQUIRED];</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;
    }

}

