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

namespace Google\Cloud\Dialogflow\V2;

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

/**
 * You can create multiple versions of your agent and publish them to separate
 * environments.
 * When you edit an agent, you are editing the draft agent. At any point, you
 * can save the draft agent as an agent version, which is an immutable snapshot
 * of your agent.
 * When you save the draft agent, it is published to the default environment.
 * When you create agent versions, you can publish them to custom environments.
 * You can create a variety of custom environments for:
 * - testing
 * - development
 * - production
 * - etc.
 * For more information, see the [versions and environments
 * guide](https://cloud.google.com/dialogflow/docs/agents-versions).
 *
 * Generated from protobuf message <code>google.cloud.dialogflow.v2.Environment</code>
 */
class Environment extends \Google\Protobuf\Internal\Message
{
    /**
     * Output only. The unique identifier of this agent environment.
     * Format: `projects/<Project ID>/agent/environments/<Environment ID>`.
     * For Environment ID, "-" is reserved for 'draft' environment.
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    private $name = '';
    /**
     * Optional. The developer-provided description for this environment.
     * The maximum length is 500 characters. If exceeded, the request is rejected.
     *
     * Generated from protobuf field <code>string description = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    private $description = '';
    /**
     * Optional. The agent version loaded into this environment.
     * Format: `projects/<Project ID>/agent/versions/<Version ID>`.
     *
     * Generated from protobuf field <code>string agent_version = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    private $agent_version = '';
    /**
     * Output only. The state of this environment. This field is read-only, i.e., it cannot be
     * set by create and update methods.
     *
     * Generated from protobuf field <code>.google.cloud.dialogflow.v2.Environment.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    private $state = 0;
    /**
     * Output only. The last update time of this environment. This field is read-only, i.e., it
     * cannot be set by create and update methods.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    private $update_time = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $name
     *           Output only. The unique identifier of this agent environment.
     *           Format: `projects/<Project ID>/agent/environments/<Environment ID>`.
     *           For Environment ID, "-" is reserved for 'draft' environment.
     *     @type string $description
     *           Optional. The developer-provided description for this environment.
     *           The maximum length is 500 characters. If exceeded, the request is rejected.
     *     @type string $agent_version
     *           Optional. The agent version loaded into this environment.
     *           Format: `projects/<Project ID>/agent/versions/<Version ID>`.
     *     @type int $state
     *           Output only. The state of this environment. This field is read-only, i.e., it cannot be
     *           set by create and update methods.
     *     @type \Google\Protobuf\Timestamp $update_time
     *           Output only. The last update time of this environment. This field is read-only, i.e., it
     *           cannot be set by create and update methods.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Dialogflow\V2\Environment::initOnce();
        parent::__construct($data);
    }

    /**
     * Output only. The unique identifier of this agent environment.
     * Format: `projects/<Project ID>/agent/environments/<Environment ID>`.
     * For Environment ID, "-" is reserved for 'draft' environment.
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * Output only. The unique identifier of this agent environment.
     * Format: `projects/<Project ID>/agent/environments/<Environment ID>`.
     * For Environment ID, "-" is reserved for 'draft' environment.
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param string $var
     * @return $this
     */
    public function setName($var)
    {
        GPBUtil::checkString($var, True);
        $this->name = $var;

        return $this;
    }

    /**
     * Optional. The developer-provided description for this environment.
     * The maximum length is 500 characters. If exceeded, the request is rejected.
     *
     * Generated from protobuf field <code>string description = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return string
     */
    public function getDescription()
    {
        return $this->description;
    }

    /**
     * Optional. The developer-provided description for this environment.
     * The maximum length is 500 characters. If exceeded, the request is rejected.
     *
     * Generated from protobuf field <code>string description = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param string $var
     * @return $this
     */
    public function setDescription($var)
    {
        GPBUtil::checkString($var, True);
        $this->description = $var;

        return $this;
    }

    /**
     * Optional. The agent version loaded into this environment.
     * Format: `projects/<Project ID>/agent/versions/<Version ID>`.
     *
     * Generated from protobuf field <code>string agent_version = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return string
     */
    public function getAgentVersion()
    {
        return $this->agent_version;
    }

    /**
     * Optional. The agent version loaded into this environment.
     * Format: `projects/<Project ID>/agent/versions/<Version ID>`.
     *
     * Generated from protobuf field <code>string agent_version = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param string $var
     * @return $this
     */
    public function setAgentVersion($var)
    {
        GPBUtil::checkString($var, True);
        $this->agent_version = $var;

        return $this;
    }

    /**
     * Output only. The state of this environment. This field is read-only, i.e., it cannot be
     * set by create and update methods.
     *
     * Generated from protobuf field <code>.google.cloud.dialogflow.v2.Environment.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return int
     */
    public function getState()
    {
        return $this->state;
    }

    /**
     * Output only. The state of this environment. This field is read-only, i.e., it cannot be
     * set by create and update methods.
     *
     * Generated from protobuf field <code>.google.cloud.dialogflow.v2.Environment.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param int $var
     * @return $this
     */
    public function setState($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\Environment\State::class);
        $this->state = $var;

        return $this;
    }

    /**
     * Output only. The last update time of this environment. This field is read-only, i.e., it
     * cannot be set by create and update methods.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return \Google\Protobuf\Timestamp
     */
    public function getUpdateTime()
    {
        return isset($this->update_time) ? $this->update_time : null;
    }

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

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

    /**
     * Output only. The last update time of this environment. This field is read-only, i.e., it
     * cannot be set by create and update methods.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp update_time = 5 [(.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;
    }

}

