<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/memcache/v1beta2/cloud_memcache.proto

namespace Google\Cloud\Memcache\V1beta2;

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

/**
 * Generated from protobuf message <code>google.cloud.memcache.v1beta2.Instance</code>
 */
class Instance extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. Unique name of the resource in this scope including project and
     * location using the form:
     *     `projects/{project_id}/locations/{location_id}/instances/{instance_id}`
     * Note: Memcached instances are managed and addressed at regional level so
     * location_id here refers to a GCP region; however, users may choose which
     * zones Memcached nodes within an instances should be provisioned in.
     * Refer to [zones] field for more details.
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    private $name = '';
    /**
     * Optional. User provided name for the instance only used for display
     * purposes. Cannot be more than 80 characters.
     *
     * Generated from protobuf field <code>string display_name = 2;</code>
     */
    private $display_name = '';
    /**
     * Optional. Resource labels to represent user-provided metadata.
     * Refer to cloud documentation on labels for more details.
     * https://cloud.google.com/compute/docs/labeling-resources
     *
     * Generated from protobuf field <code>map<string, string> labels = 3;</code>
     */
    private $labels;
    /**
     * Optional. The full name of the Google Compute Engine
     * [network](https://cloud.google.com/compute/docs/networks-and-firewalls#networks) to which the
     * instance is connected. If left unspecified, the `default` network
     * will be used.
     *
     * Generated from protobuf field <code>string authorized_network = 4;</code>
     */
    private $authorized_network = '';
    /**
     * Optional. Zones where Memcached nodes should be provisioned in.
     * Memcached nodes will be equally distributed across these zones. If not
     * provided, the service will by default create nodes in all zones in the
     * region for the instance.
     *
     * Generated from protobuf field <code>repeated string zones = 5;</code>
     */
    private $zones;
    /**
     * Required. Number of nodes in the Memcached instance.
     *
     * Generated from protobuf field <code>int32 node_count = 6 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    private $node_count = 0;
    /**
     * Required. Configuration for Memcached nodes.
     *
     * Generated from protobuf field <code>.google.cloud.memcache.v1beta2.Instance.NodeConfig node_config = 7 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    private $node_config = null;
    /**
     * Optional. The major version of Memcached software.
     * If not provided, latest supported version will be used. Currently the
     * latest supported major version is MEMCACHE_1_5.
     * The minor version will be automatically determined by our system based on
     * the latest supported minor version.
     *
     * Generated from protobuf field <code>.google.cloud.memcache.v1beta2.MemcacheVersion memcache_version = 9;</code>
     */
    private $memcache_version = 0;
    /**
     * Optional: User defined parameters to apply to the memcached process
     * on each node.
     *
     * Generated from protobuf field <code>.google.cloud.memcache.v1beta2.MemcacheParameters parameters = 11;</code>
     */
    private $parameters = null;
    /**
     * Output only. List of Memcached nodes.
     * Refer to [Node] message for more details.
     *
     * Generated from protobuf field <code>repeated .google.cloud.memcache.v1beta2.Instance.Node memcache_nodes = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    private $memcache_nodes;
    /**
     * Output only. The time the instance was created.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp create_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    private $create_time = null;
    /**
     * Output only. The time the instance was updated.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp update_time = 14 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    private $update_time = null;
    /**
     * Output only. The state of this Memcached instance.
     *
     * Generated from protobuf field <code>.google.cloud.memcache.v1beta2.Instance.State state = 15 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    private $state = 0;
    /**
     * Output only. The full version of memcached server running on this instance.
     * System automatically determines the full memcached version for an instance
     * based on the input MemcacheVersion.
     * The full version format will be "memcached-1.5.16".
     *
     * Generated from protobuf field <code>string memcache_full_version = 18 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    private $memcache_full_version = '';
    /**
     * List of messages that describe current statuses of memcached instance.
     *
     * Generated from protobuf field <code>repeated .google.cloud.memcache.v1beta2.Instance.InstanceMessage instance_messages = 19;</code>
     */
    private $instance_messages;
    /**
     * Output only. Endpoint for Discovery API
     *
     * Generated from protobuf field <code>string discovery_endpoint = 20 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    private $discovery_endpoint = '';

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $name
     *           Required. Unique name of the resource in this scope including project and
     *           location using the form:
     *               `projects/{project_id}/locations/{location_id}/instances/{instance_id}`
     *           Note: Memcached instances are managed and addressed at regional level so
     *           location_id here refers to a GCP region; however, users may choose which
     *           zones Memcached nodes within an instances should be provisioned in.
     *           Refer to [zones] field for more details.
     *     @type string $display_name
     *           Optional. User provided name for the instance only used for display
     *           purposes. Cannot be more than 80 characters.
     *     @type array|\Google\Protobuf\Internal\MapField $labels
     *           Optional. Resource labels to represent user-provided metadata.
     *           Refer to cloud documentation on labels for more details.
     *           https://cloud.google.com/compute/docs/labeling-resources
     *     @type string $authorized_network
     *           Optional. The full name of the Google Compute Engine
     *           [network](https://cloud.google.com/compute/docs/networks-and-firewalls#networks) to which the
     *           instance is connected. If left unspecified, the `default` network
     *           will be used.
     *     @type string[]|\Google\Protobuf\Internal\RepeatedField $zones
     *           Optional. Zones where Memcached nodes should be provisioned in.
     *           Memcached nodes will be equally distributed across these zones. If not
     *           provided, the service will by default create nodes in all zones in the
     *           region for the instance.
     *     @type int $node_count
     *           Required. Number of nodes in the Memcached instance.
     *     @type \Google\Cloud\Memcache\V1beta2\Instance\NodeConfig $node_config
     *           Required. Configuration for Memcached nodes.
     *     @type int $memcache_version
     *           Optional. The major version of Memcached software.
     *           If not provided, latest supported version will be used. Currently the
     *           latest supported major version is MEMCACHE_1_5.
     *           The minor version will be automatically determined by our system based on
     *           the latest supported minor version.
     *     @type \Google\Cloud\Memcache\V1beta2\MemcacheParameters $parameters
     *           Optional: User defined parameters to apply to the memcached process
     *           on each node.
     *     @type \Google\Cloud\Memcache\V1beta2\Instance\Node[]|\Google\Protobuf\Internal\RepeatedField $memcache_nodes
     *           Output only. List of Memcached nodes.
     *           Refer to [Node] message for more details.
     *     @type \Google\Protobuf\Timestamp $create_time
     *           Output only. The time the instance was created.
     *     @type \Google\Protobuf\Timestamp $update_time
     *           Output only. The time the instance was updated.
     *     @type int $state
     *           Output only. The state of this Memcached instance.
     *     @type string $memcache_full_version
     *           Output only. The full version of memcached server running on this instance.
     *           System automatically determines the full memcached version for an instance
     *           based on the input MemcacheVersion.
     *           The full version format will be "memcached-1.5.16".
     *     @type \Google\Cloud\Memcache\V1beta2\Instance\InstanceMessage[]|\Google\Protobuf\Internal\RepeatedField $instance_messages
     *           List of messages that describe current statuses of memcached instance.
     *     @type string $discovery_endpoint
     *           Output only. Endpoint for Discovery API
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Memcache\V1Beta2\CloudMemcache::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. Unique name of the resource in this scope including project and
     * location using the form:
     *     `projects/{project_id}/locations/{location_id}/instances/{instance_id}`
     * Note: Memcached instances are managed and addressed at regional level so
     * location_id here refers to a GCP region; however, users may choose which
     * zones Memcached nodes within an instances should be provisioned in.
     * Refer to [zones] field for more details.
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * Required. Unique name of the resource in this scope including project and
     * location using the form:
     *     `projects/{project_id}/locations/{location_id}/instances/{instance_id}`
     * Note: Memcached instances are managed and addressed at regional level so
     * location_id here refers to a GCP region; however, users may choose which
     * zones Memcached nodes within an instances should be provisioned in.
     * Refer to [zones] field for more details.
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param string $var
     * @return $this
     */
    public function setName($var)
    {
        GPBUtil::checkString($var, True);
        $this->name = $var;

        return $this;
    }

    /**
     * Optional. User provided name for the instance only used for display
     * purposes. Cannot be more than 80 characters.
     *
     * Generated from protobuf field <code>string display_name = 2;</code>
     * @return string
     */
    public function getDisplayName()
    {
        return $this->display_name;
    }

    /**
     * Optional. User provided name for the instance only used for display
     * purposes. Cannot be more than 80 characters.
     *
     * Generated from protobuf field <code>string display_name = 2;</code>
     * @param string $var
     * @return $this
     */
    public function setDisplayName($var)
    {
        GPBUtil::checkString($var, True);
        $this->display_name = $var;

        return $this;
    }

    /**
     * Optional. Resource labels to represent user-provided metadata.
     * Refer to cloud documentation on labels for more details.
     * https://cloud.google.com/compute/docs/labeling-resources
     *
     * Generated from protobuf field <code>map<string, string> labels = 3;</code>
     * @return \Google\Protobuf\Internal\MapField
     */
    public function getLabels()
    {
        return $this->labels;
    }

    /**
     * Optional. Resource labels to represent user-provided metadata.
     * Refer to cloud documentation on labels for more details.
     * https://cloud.google.com/compute/docs/labeling-resources
     *
     * Generated from protobuf field <code>map<string, string> labels = 3;</code>
     * @param array|\Google\Protobuf\Internal\MapField $var
     * @return $this
     */
    public function setLabels($var)
    {
        $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING);
        $this->labels = $arr;

        return $this;
    }

    /**
     * Optional. The full name of the Google Compute Engine
     * [network](https://cloud.google.com/compute/docs/networks-and-firewalls#networks) to which the
     * instance is connected. If left unspecified, the `default` network
     * will be used.
     *
     * Generated from protobuf field <code>string authorized_network = 4;</code>
     * @return string
     */
    public function getAuthorizedNetwork()
    {
        return $this->authorized_network;
    }

    /**
     * Optional. The full name of the Google Compute Engine
     * [network](https://cloud.google.com/compute/docs/networks-and-firewalls#networks) to which the
     * instance is connected. If left unspecified, the `default` network
     * will be used.
     *
     * Generated from protobuf field <code>string authorized_network = 4;</code>
     * @param string $var
     * @return $this
     */
    public function setAuthorizedNetwork($var)
    {
        GPBUtil::checkString($var, True);
        $this->authorized_network = $var;

        return $this;
    }

    /**
     * Optional. Zones where Memcached nodes should be provisioned in.
     * Memcached nodes will be equally distributed across these zones. If not
     * provided, the service will by default create nodes in all zones in the
     * region for the instance.
     *
     * Generated from protobuf field <code>repeated string zones = 5;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getZones()
    {
        return $this->zones;
    }

    /**
     * Optional. Zones where Memcached nodes should be provisioned in.
     * Memcached nodes will be equally distributed across these zones. If not
     * provided, the service will by default create nodes in all zones in the
     * region for the instance.
     *
     * Generated from protobuf field <code>repeated string zones = 5;</code>
     * @param string[]|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setZones($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
        $this->zones = $arr;

        return $this;
    }

    /**
     * Required. Number of nodes in the Memcached instance.
     *
     * Generated from protobuf field <code>int32 node_count = 6 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return int
     */
    public function getNodeCount()
    {
        return $this->node_count;
    }

    /**
     * Required. Number of nodes in the Memcached instance.
     *
     * Generated from protobuf field <code>int32 node_count = 6 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param int $var
     * @return $this
     */
    public function setNodeCount($var)
    {
        GPBUtil::checkInt32($var);
        $this->node_count = $var;

        return $this;
    }

    /**
     * Required. Configuration for Memcached nodes.
     *
     * Generated from protobuf field <code>.google.cloud.memcache.v1beta2.Instance.NodeConfig node_config = 7 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return \Google\Cloud\Memcache\V1beta2\Instance\NodeConfig
     */
    public function getNodeConfig()
    {
        return $this->node_config;
    }

    /**
     * Required. Configuration for Memcached nodes.
     *
     * Generated from protobuf field <code>.google.cloud.memcache.v1beta2.Instance.NodeConfig node_config = 7 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param \Google\Cloud\Memcache\V1beta2\Instance\NodeConfig $var
     * @return $this
     */
    public function setNodeConfig($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Memcache\V1beta2\Instance_NodeConfig::class);
        $this->node_config = $var;

        return $this;
    }

    /**
     * Optional. The major version of Memcached software.
     * If not provided, latest supported version will be used. Currently the
     * latest supported major version is MEMCACHE_1_5.
     * The minor version will be automatically determined by our system based on
     * the latest supported minor version.
     *
     * Generated from protobuf field <code>.google.cloud.memcache.v1beta2.MemcacheVersion memcache_version = 9;</code>
     * @return int
     */
    public function getMemcacheVersion()
    {
        return $this->memcache_version;
    }

    /**
     * Optional. The major version of Memcached software.
     * If not provided, latest supported version will be used. Currently the
     * latest supported major version is MEMCACHE_1_5.
     * The minor version will be automatically determined by our system based on
     * the latest supported minor version.
     *
     * Generated from protobuf field <code>.google.cloud.memcache.v1beta2.MemcacheVersion memcache_version = 9;</code>
     * @param int $var
     * @return $this
     */
    public function setMemcacheVersion($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\Memcache\V1beta2\MemcacheVersion::class);
        $this->memcache_version = $var;

        return $this;
    }

    /**
     * Optional: User defined parameters to apply to the memcached process
     * on each node.
     *
     * Generated from protobuf field <code>.google.cloud.memcache.v1beta2.MemcacheParameters parameters = 11;</code>
     * @return \Google\Cloud\Memcache\V1beta2\MemcacheParameters
     */
    public function getParameters()
    {
        return $this->parameters;
    }

    /**
     * Optional: User defined parameters to apply to the memcached process
     * on each node.
     *
     * Generated from protobuf field <code>.google.cloud.memcache.v1beta2.MemcacheParameters parameters = 11;</code>
     * @param \Google\Cloud\Memcache\V1beta2\MemcacheParameters $var
     * @return $this
     */
    public function setParameters($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Memcache\V1beta2\MemcacheParameters::class);
        $this->parameters = $var;

        return $this;
    }

    /**
     * Output only. List of Memcached nodes.
     * Refer to [Node] message for more details.
     *
     * Generated from protobuf field <code>repeated .google.cloud.memcache.v1beta2.Instance.Node memcache_nodes = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getMemcacheNodes()
    {
        return $this->memcache_nodes;
    }

    /**
     * Output only. List of Memcached nodes.
     * Refer to [Node] message for more details.
     *
     * Generated from protobuf field <code>repeated .google.cloud.memcache.v1beta2.Instance.Node memcache_nodes = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param \Google\Cloud\Memcache\V1beta2\Instance\Node[]|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setMemcacheNodes($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Memcache\V1beta2\Instance\Node::class);
        $this->memcache_nodes = $arr;

        return $this;
    }

    /**
     * Output only. The time the instance was created.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp create_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return \Google\Protobuf\Timestamp
     */
    public function getCreateTime()
    {
        return $this->create_time;
    }

    /**
     * Output only. The time the instance was created.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp create_time = 13 [(.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. The time the instance was updated.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp update_time = 14 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return \Google\Protobuf\Timestamp
     */
    public function getUpdateTime()
    {
        return $this->update_time;
    }

    /**
     * Output only. The time the instance was updated.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp update_time = 14 [(.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;
    }

    /**
     * Output only. The state of this Memcached instance.
     *
     * Generated from protobuf field <code>.google.cloud.memcache.v1beta2.Instance.State state = 15 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return int
     */
    public function getState()
    {
        return $this->state;
    }

    /**
     * Output only. The state of this Memcached instance.
     *
     * Generated from protobuf field <code>.google.cloud.memcache.v1beta2.Instance.State state = 15 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param int $var
     * @return $this
     */
    public function setState($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\Memcache\V1beta2\Instance_State::class);
        $this->state = $var;

        return $this;
    }

    /**
     * Output only. The full version of memcached server running on this instance.
     * System automatically determines the full memcached version for an instance
     * based on the input MemcacheVersion.
     * The full version format will be "memcached-1.5.16".
     *
     * Generated from protobuf field <code>string memcache_full_version = 18 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return string
     */
    public function getMemcacheFullVersion()
    {
        return $this->memcache_full_version;
    }

    /**
     * Output only. The full version of memcached server running on this instance.
     * System automatically determines the full memcached version for an instance
     * based on the input MemcacheVersion.
     * The full version format will be "memcached-1.5.16".
     *
     * Generated from protobuf field <code>string memcache_full_version = 18 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param string $var
     * @return $this
     */
    public function setMemcacheFullVersion($var)
    {
        GPBUtil::checkString($var, True);
        $this->memcache_full_version = $var;

        return $this;
    }

    /**
     * List of messages that describe current statuses of memcached instance.
     *
     * Generated from protobuf field <code>repeated .google.cloud.memcache.v1beta2.Instance.InstanceMessage instance_messages = 19;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getInstanceMessages()
    {
        return $this->instance_messages;
    }

    /**
     * List of messages that describe current statuses of memcached instance.
     *
     * Generated from protobuf field <code>repeated .google.cloud.memcache.v1beta2.Instance.InstanceMessage instance_messages = 19;</code>
     * @param \Google\Cloud\Memcache\V1beta2\Instance\InstanceMessage[]|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setInstanceMessages($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Memcache\V1beta2\Instance\InstanceMessage::class);
        $this->instance_messages = $arr;

        return $this;
    }

    /**
     * Output only. Endpoint for Discovery API
     *
     * Generated from protobuf field <code>string discovery_endpoint = 20 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return string
     */
    public function getDiscoveryEndpoint()
    {
        return $this->discovery_endpoint;
    }

    /**
     * Output only. Endpoint for Discovery API
     *
     * Generated from protobuf field <code>string discovery_endpoint = 20 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param string $var
     * @return $this
     */
    public function setDiscoveryEndpoint($var)
    {
        GPBUtil::checkString($var, True);
        $this->discovery_endpoint = $var;

        return $this;
    }

}

