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

namespace Google\Cloud\Dialogflow\V2;

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

/**
 * Represents a conversation model.
 *
 * Generated from protobuf message <code>google.cloud.dialogflow.v2.ConversationModel</code>
 */
class ConversationModel extends \Google\Protobuf\Internal\Message
{
    /**
     * ConversationModel resource name. Format:
     * `projects/<Project ID>/conversationModels/<Conversation Model ID>`
     *
     * Generated from protobuf field <code>string name = 1;</code>
     */
    private $name = '';
    /**
     * Required. The display name of the model. At most 64 bytes long.
     *
     * Generated from protobuf field <code>string display_name = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    private $display_name = '';
    /**
     * Output only. Creation time of this model.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    private $create_time = null;
    /**
     * Required. Datasets used to create model.
     *
     * Generated from protobuf field <code>repeated .google.cloud.dialogflow.v2.InputDataset datasets = 4 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    private $datasets;
    /**
     * Output only. State of the model. A model can only serve prediction requests
     * after it gets deployed.
     *
     * Generated from protobuf field <code>.google.cloud.dialogflow.v2.ConversationModel.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    private $state = 0;
    /**
     * Language code for the conversation model. If not specified, the language
     * is en-US. Language at ConversationModel should be set for all non en-us
     * languages.
     * This should be a [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt)
     * language tag. Example: "en-US".
     *
     * Generated from protobuf field <code>string language_code = 19;</code>
     */
    private $language_code = '';
    protected $model_metadata;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $name
     *           ConversationModel resource name. Format:
     *           `projects/<Project ID>/conversationModels/<Conversation Model ID>`
     *     @type string $display_name
     *           Required. The display name of the model. At most 64 bytes long.
     *     @type \Google\Protobuf\Timestamp $create_time
     *           Output only. Creation time of this model.
     *     @type array<\Google\Cloud\Dialogflow\V2\InputDataset>|\Google\Protobuf\Internal\RepeatedField $datasets
     *           Required. Datasets used to create model.
     *     @type int $state
     *           Output only. State of the model. A model can only serve prediction requests
     *           after it gets deployed.
     *     @type string $language_code
     *           Language code for the conversation model. If not specified, the language
     *           is en-US. Language at ConversationModel should be set for all non en-us
     *           languages.
     *           This should be a [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt)
     *           language tag. Example: "en-US".
     *     @type \Google\Cloud\Dialogflow\V2\ArticleSuggestionModelMetadata $article_suggestion_model_metadata
     *           Metadata for article suggestion models.
     *     @type \Google\Cloud\Dialogflow\V2\SmartReplyModelMetadata $smart_reply_model_metadata
     *           Metadata for smart reply models.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationModel::initOnce();
        parent::__construct($data);
    }

    /**
     * ConversationModel resource name. Format:
     * `projects/<Project ID>/conversationModels/<Conversation Model ID>`
     *
     * Generated from protobuf field <code>string name = 1;</code>
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * ConversationModel resource name. Format:
     * `projects/<Project ID>/conversationModels/<Conversation Model ID>`
     *
     * Generated from protobuf field <code>string name = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setName($var)
    {
        GPBUtil::checkString($var, True);
        $this->name = $var;

        return $this;
    }

    /**
     * Required. The display name of the model. At most 64 bytes long.
     *
     * Generated from protobuf field <code>string display_name = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return string
     */
    public function getDisplayName()
    {
        return $this->display_name;
    }

    /**
     * Required. The display name of the model. At most 64 bytes long.
     *
     * Generated from protobuf field <code>string display_name = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param string $var
     * @return $this
     */
    public function setDisplayName($var)
    {
        GPBUtil::checkString($var, True);
        $this->display_name = $var;

        return $this;
    }

    /**
     * Output only. Creation time of this model.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getCreateTime()
    {
        return $this->create_time;
    }

    public function hasCreateTime()
    {
        return isset($this->create_time);
    }

    public function clearCreateTime()
    {
        unset($this->create_time);
    }

    /**
     * Output only. Creation time of this model.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setCreateTime($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->create_time = $var;

        return $this;
    }

    /**
     * Required. Datasets used to create model.
     *
     * Generated from protobuf field <code>repeated .google.cloud.dialogflow.v2.InputDataset datasets = 4 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getDatasets()
    {
        return $this->datasets;
    }

    /**
     * Required. Datasets used to create model.
     *
     * Generated from protobuf field <code>repeated .google.cloud.dialogflow.v2.InputDataset datasets = 4 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param array<\Google\Cloud\Dialogflow\V2\InputDataset>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setDatasets($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\InputDataset::class);
        $this->datasets = $arr;

        return $this;
    }

    /**
     * Output only. State of the model. A model can only serve prediction requests
     * after it gets deployed.
     *
     * Generated from protobuf field <code>.google.cloud.dialogflow.v2.ConversationModel.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return int
     */
    public function getState()
    {
        return $this->state;
    }

    /**
     * Output only. State of the model. A model can only serve prediction requests
     * after it gets deployed.
     *
     * Generated from protobuf field <code>.google.cloud.dialogflow.v2.ConversationModel.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param int $var
     * @return $this
     */
    public function setState($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\ConversationModel\State::class);
        $this->state = $var;

        return $this;
    }

    /**
     * Language code for the conversation model. If not specified, the language
     * is en-US. Language at ConversationModel should be set for all non en-us
     * languages.
     * This should be a [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt)
     * language tag. Example: "en-US".
     *
     * Generated from protobuf field <code>string language_code = 19;</code>
     * @return string
     */
    public function getLanguageCode()
    {
        return $this->language_code;
    }

    /**
     * Language code for the conversation model. If not specified, the language
     * is en-US. Language at ConversationModel should be set for all non en-us
     * languages.
     * This should be a [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt)
     * language tag. Example: "en-US".
     *
     * Generated from protobuf field <code>string language_code = 19;</code>
     * @param string $var
     * @return $this
     */
    public function setLanguageCode($var)
    {
        GPBUtil::checkString($var, True);
        $this->language_code = $var;

        return $this;
    }

    /**
     * Metadata for article suggestion models.
     *
     * Generated from protobuf field <code>.google.cloud.dialogflow.v2.ArticleSuggestionModelMetadata article_suggestion_model_metadata = 8;</code>
     * @return \Google\Cloud\Dialogflow\V2\ArticleSuggestionModelMetadata|null
     */
    public function getArticleSuggestionModelMetadata()
    {
        return $this->readOneof(8);
    }

    public function hasArticleSuggestionModelMetadata()
    {
        return $this->hasOneof(8);
    }

    /**
     * Metadata for article suggestion models.
     *
     * Generated from protobuf field <code>.google.cloud.dialogflow.v2.ArticleSuggestionModelMetadata article_suggestion_model_metadata = 8;</code>
     * @param \Google\Cloud\Dialogflow\V2\ArticleSuggestionModelMetadata $var
     * @return $this
     */
    public function setArticleSuggestionModelMetadata($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\ArticleSuggestionModelMetadata::class);
        $this->writeOneof(8, $var);

        return $this;
    }

    /**
     * Metadata for smart reply models.
     *
     * Generated from protobuf field <code>.google.cloud.dialogflow.v2.SmartReplyModelMetadata smart_reply_model_metadata = 9;</code>
     * @return \Google\Cloud\Dialogflow\V2\SmartReplyModelMetadata|null
     */
    public function getSmartReplyModelMetadata()
    {
        return $this->readOneof(9);
    }

    public function hasSmartReplyModelMetadata()
    {
        return $this->hasOneof(9);
    }

    /**
     * Metadata for smart reply models.
     *
     * Generated from protobuf field <code>.google.cloud.dialogflow.v2.SmartReplyModelMetadata smart_reply_model_metadata = 9;</code>
     * @param \Google\Cloud\Dialogflow\V2\SmartReplyModelMetadata $var
     * @return $this
     */
    public function setSmartReplyModelMetadata($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\SmartReplyModelMetadata::class);
        $this->writeOneof(9, $var);

        return $this;
    }

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

}

