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

namespace Google\Cloud\Dialogflow\Cx\V3;

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

/**
 * Example represents a sample execution of the playbook in the conversation.
 * An example consists of a list of ordered actions performed by end user
 * or Dialogflow agent according the playbook instructions to fulfill the task.
 *
 * Generated from protobuf message <code>google.cloud.dialogflow.cx.v3.Example</code>
 */
class Example extends \Google\Protobuf\Internal\Message
{
    /**
     * The unique identifier of the playbook example.
     * Format:
     * `projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>/playbooks/<PlaybookID>/examples/<ExampleID>`.
     *
     * Generated from protobuf field <code>string name = 1;</code>
     */
    protected $name = '';
    /**
     * Optional. The input to the playbook in the example.
     *
     * Generated from protobuf field <code>.google.cloud.dialogflow.cx.v3.PlaybookInput playbook_input = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $playbook_input = null;
    /**
     * Optional. The output of the playbook in the example.
     *
     * Generated from protobuf field <code>.google.cloud.dialogflow.cx.v3.PlaybookOutput playbook_output = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $playbook_output = null;
    /**
     * Required. The ordered list of actions performed by the end user and the
     * Dialogflow agent.
     *
     * Generated from protobuf field <code>repeated .google.cloud.dialogflow.cx.v3.Action actions = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    private $actions;
    /**
     * Required. The display name of the example.
     *
     * Generated from protobuf field <code>string display_name = 6 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $display_name = '';
    /**
     * Optional. The high level concise description of the example. The max number
     * of characters is 200.
     *
     * Generated from protobuf field <code>string description = 8 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $description = '';
    /**
     * Output only. Estimated number of tokes current example takes when sent to
     * the LLM.
     *
     * Generated from protobuf field <code>int64 token_count = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $token_count = 0;
    /**
     * Output only. The timestamp of initial example creation.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp create_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $create_time = null;
    /**
     * Output only. Last time the example was updated.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp update_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $update_time = null;
    /**
     * Required. Example's output state.
     *
     * Generated from protobuf field <code>.google.cloud.dialogflow.cx.v3.OutputState conversation_state = 12 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $conversation_state = 0;
    /**
     * Optional. The language code of the example.
     * If not specified, the agent's default language is used.
     * Note: languages must be enabled in the agent before they can be used.
     * Note: example's language code is not currently used in dialogflow agents.
     *
     * Generated from protobuf field <code>string language_code = 13 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $language_code = '';

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $name
     *           The unique identifier of the playbook example.
     *           Format:
     *           `projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>/playbooks/<PlaybookID>/examples/<ExampleID>`.
     *     @type \Google\Cloud\Dialogflow\Cx\V3\PlaybookInput $playbook_input
     *           Optional. The input to the playbook in the example.
     *     @type \Google\Cloud\Dialogflow\Cx\V3\PlaybookOutput $playbook_output
     *           Optional. The output of the playbook in the example.
     *     @type array<\Google\Cloud\Dialogflow\Cx\V3\Action>|\Google\Protobuf\Internal\RepeatedField $actions
     *           Required. The ordered list of actions performed by the end user and the
     *           Dialogflow agent.
     *     @type string $display_name
     *           Required. The display name of the example.
     *     @type string $description
     *           Optional. The high level concise description of the example. The max number
     *           of characters is 200.
     *     @type int|string $token_count
     *           Output only. Estimated number of tokes current example takes when sent to
     *           the LLM.
     *     @type \Google\Protobuf\Timestamp $create_time
     *           Output only. The timestamp of initial example creation.
     *     @type \Google\Protobuf\Timestamp $update_time
     *           Output only. Last time the example was updated.
     *     @type int $conversation_state
     *           Required. Example's output state.
     *     @type string $language_code
     *           Optional. The language code of the example.
     *           If not specified, the agent's default language is used.
     *           Note: languages must be enabled in the agent before they can be used.
     *           Note: example's language code is not currently used in dialogflow agents.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Dialogflow\Cx\V3\Example::initOnce();
        parent::__construct($data);
    }

    /**
     * The unique identifier of the playbook example.
     * Format:
     * `projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>/playbooks/<PlaybookID>/examples/<ExampleID>`.
     *
     * Generated from protobuf field <code>string name = 1;</code>
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * The unique identifier of the playbook example.
     * Format:
     * `projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>/playbooks/<PlaybookID>/examples/<ExampleID>`.
     *
     * 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;
    }

    /**
     * Optional. The input to the playbook in the example.
     *
     * Generated from protobuf field <code>.google.cloud.dialogflow.cx.v3.PlaybookInput playbook_input = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return \Google\Cloud\Dialogflow\Cx\V3\PlaybookInput|null
     */
    public function getPlaybookInput()
    {
        return $this->playbook_input;
    }

    public function hasPlaybookInput()
    {
        return isset($this->playbook_input);
    }

    public function clearPlaybookInput()
    {
        unset($this->playbook_input);
    }

    /**
     * Optional. The input to the playbook in the example.
     *
     * Generated from protobuf field <code>.google.cloud.dialogflow.cx.v3.PlaybookInput playbook_input = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param \Google\Cloud\Dialogflow\Cx\V3\PlaybookInput $var
     * @return $this
     */
    public function setPlaybookInput($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\Cx\V3\PlaybookInput::class);
        $this->playbook_input = $var;

        return $this;
    }

    /**
     * Optional. The output of the playbook in the example.
     *
     * Generated from protobuf field <code>.google.cloud.dialogflow.cx.v3.PlaybookOutput playbook_output = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return \Google\Cloud\Dialogflow\Cx\V3\PlaybookOutput|null
     */
    public function getPlaybookOutput()
    {
        return $this->playbook_output;
    }

    public function hasPlaybookOutput()
    {
        return isset($this->playbook_output);
    }

    public function clearPlaybookOutput()
    {
        unset($this->playbook_output);
    }

    /**
     * Optional. The output of the playbook in the example.
     *
     * Generated from protobuf field <code>.google.cloud.dialogflow.cx.v3.PlaybookOutput playbook_output = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param \Google\Cloud\Dialogflow\Cx\V3\PlaybookOutput $var
     * @return $this
     */
    public function setPlaybookOutput($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\Cx\V3\PlaybookOutput::class);
        $this->playbook_output = $var;

        return $this;
    }

    /**
     * Required. The ordered list of actions performed by the end user and the
     * Dialogflow agent.
     *
     * Generated from protobuf field <code>repeated .google.cloud.dialogflow.cx.v3.Action actions = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getActions()
    {
        return $this->actions;
    }

    /**
     * Required. The ordered list of actions performed by the end user and the
     * Dialogflow agent.
     *
     * Generated from protobuf field <code>repeated .google.cloud.dialogflow.cx.v3.Action actions = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param array<\Google\Cloud\Dialogflow\Cx\V3\Action>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setActions($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\Cx\V3\Action::class);
        $this->actions = $arr;

        return $this;
    }

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

    /**
     * Required. The display name of the example.
     *
     * Generated from protobuf field <code>string display_name = 6 [(.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;
    }

    /**
     * Optional. The high level concise description of the example. The max number
     * of characters is 200.
     *
     * Generated from protobuf field <code>string description = 8 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return string
     */
    public function getDescription()
    {
        return $this->description;
    }

    /**
     * Optional. The high level concise description of the example. The max number
     * of characters is 200.
     *
     * Generated from protobuf field <code>string description = 8 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param string $var
     * @return $this
     */
    public function setDescription($var)
    {
        GPBUtil::checkString($var, True);
        $this->description = $var;

        return $this;
    }

    /**
     * Output only. Estimated number of tokes current example takes when sent to
     * the LLM.
     *
     * Generated from protobuf field <code>int64 token_count = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return int|string
     */
    public function getTokenCount()
    {
        return $this->token_count;
    }

    /**
     * Output only. Estimated number of tokes current example takes when sent to
     * the LLM.
     *
     * Generated from protobuf field <code>int64 token_count = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param int|string $var
     * @return $this
     */
    public function setTokenCount($var)
    {
        GPBUtil::checkInt64($var);
        $this->token_count = $var;

        return $this;
    }

    /**
     * Output only. The timestamp of initial example creation.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp create_time = 10 [(.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. The timestamp of initial example creation.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp create_time = 10 [(.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;
    }

    /**
     * Output only. Last time the example was updated.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp update_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getUpdateTime()
    {
        return $this->update_time;
    }

    public function hasUpdateTime()
    {
        return isset($this->update_time);
    }

    public function clearUpdateTime()
    {
        unset($this->update_time);
    }

    /**
     * Output only. Last time the example was updated.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp update_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setUpdateTime($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->update_time = $var;

        return $this;
    }

    /**
     * Required. Example's output state.
     *
     * Generated from protobuf field <code>.google.cloud.dialogflow.cx.v3.OutputState conversation_state = 12 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return int
     */
    public function getConversationState()
    {
        return $this->conversation_state;
    }

    /**
     * Required. Example's output state.
     *
     * Generated from protobuf field <code>.google.cloud.dialogflow.cx.v3.OutputState conversation_state = 12 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param int $var
     * @return $this
     */
    public function setConversationState($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\Cx\V3\OutputState::class);
        $this->conversation_state = $var;

        return $this;
    }

    /**
     * Optional. The language code of the example.
     * If not specified, the agent's default language is used.
     * Note: languages must be enabled in the agent before they can be used.
     * Note: example's language code is not currently used in dialogflow agents.
     *
     * Generated from protobuf field <code>string language_code = 13 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return string
     */
    public function getLanguageCode()
    {
        return $this->language_code;
    }

    /**
     * Optional. The language code of the example.
     * If not specified, the agent's default language is used.
     * Note: languages must be enabled in the agent before they can be used.
     * Note: example's language code is not currently used in dialogflow agents.
     *
     * Generated from protobuf field <code>string language_code = 13 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param string $var
     * @return $this
     */
    public function setLanguageCode($var)
    {
        GPBUtil::checkString($var, True);
        $this->language_code = $var;

        return $this;
    }

}

