<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/bigtable/admin/v2/instance.proto

namespace Google\Cloud\Bigtable\Admin\V2;

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

/**
 * A resizable group of nodes in a particular cloud location, capable
 * of serving all [Tables][google.bigtable.admin.v2.Table] in the parent
 * [Instance][google.bigtable.admin.v2.Instance].
 *
 * Generated from protobuf message <code>google.bigtable.admin.v2.Cluster</code>
 */
class Cluster extends \Google\Protobuf\Internal\Message
{
    /**
     * (`OutputOnly`)
     * The unique name of the cluster. Values are of the form
     * `projects/<project>/instances/<instance>/clusters/[a-z][-a-z0-9]*`.
     *
     * Generated from protobuf field <code>string name = 1;</code>
     */
    private $name = '';
    /**
     * (`CreationOnly`)
     * The location where this cluster's nodes and storage reside. For best
     * performance, clients should be located as close as possible to this
     * cluster. Currently only zones are supported, so values should be of the
     * form `projects/<project>/locations/<zone>`.
     *
     * Generated from protobuf field <code>string location = 2;</code>
     */
    private $location = '';
    /**
     * (`OutputOnly`)
     * The current state of the cluster.
     *
     * Generated from protobuf field <code>.google.bigtable.admin.v2.Cluster.State state = 3;</code>
     */
    private $state = 0;
    /**
     * The number of nodes allocated to this cluster. More nodes enable higher
     * throughput and more consistent performance.
     *
     * Generated from protobuf field <code>int32 serve_nodes = 4;</code>
     */
    private $serve_nodes = 0;
    /**
     * (`CreationOnly`)
     * The type of storage used by this cluster to serve its
     * parent instance's tables, unless explicitly overridden.
     *
     * Generated from protobuf field <code>.google.bigtable.admin.v2.StorageType default_storage_type = 5;</code>
     */
    private $default_storage_type = 0;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $name
     *           (`OutputOnly`)
     *           The unique name of the cluster. Values are of the form
     *           `projects/<project>/instances/<instance>/clusters/[a-z][-a-z0-9]*`.
     *     @type string $location
     *           (`CreationOnly`)
     *           The location where this cluster's nodes and storage reside. For best
     *           performance, clients should be located as close as possible to this
     *           cluster. Currently only zones are supported, so values should be of the
     *           form `projects/<project>/locations/<zone>`.
     *     @type int $state
     *           (`OutputOnly`)
     *           The current state of the cluster.
     *     @type int $serve_nodes
     *           The number of nodes allocated to this cluster. More nodes enable higher
     *           throughput and more consistent performance.
     *     @type int $default_storage_type
     *           (`CreationOnly`)
     *           The type of storage used by this cluster to serve its
     *           parent instance's tables, unless explicitly overridden.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Bigtable\Admin\V2\Instance::initOnce();
        parent::__construct($data);
    }

    /**
     * (`OutputOnly`)
     * The unique name of the cluster. Values are of the form
     * `projects/<project>/instances/<instance>/clusters/[a-z][-a-z0-9]*`.
     *
     * Generated from protobuf field <code>string name = 1;</code>
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * (`OutputOnly`)
     * The unique name of the cluster. Values are of the form
     * `projects/<project>/instances/<instance>/clusters/[a-z][-a-z0-9]*`.
     *
     * 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;
    }

    /**
     * (`CreationOnly`)
     * The location where this cluster's nodes and storage reside. For best
     * performance, clients should be located as close as possible to this
     * cluster. Currently only zones are supported, so values should be of the
     * form `projects/<project>/locations/<zone>`.
     *
     * Generated from protobuf field <code>string location = 2;</code>
     * @return string
     */
    public function getLocation()
    {
        return $this->location;
    }

    /**
     * (`CreationOnly`)
     * The location where this cluster's nodes and storage reside. For best
     * performance, clients should be located as close as possible to this
     * cluster. Currently only zones are supported, so values should be of the
     * form `projects/<project>/locations/<zone>`.
     *
     * Generated from protobuf field <code>string location = 2;</code>
     * @param string $var
     * @return $this
     */
    public function setLocation($var)
    {
        GPBUtil::checkString($var, True);
        $this->location = $var;

        return $this;
    }

    /**
     * (`OutputOnly`)
     * The current state of the cluster.
     *
     * Generated from protobuf field <code>.google.bigtable.admin.v2.Cluster.State state = 3;</code>
     * @return int
     */
    public function getState()
    {
        return $this->state;
    }

    /**
     * (`OutputOnly`)
     * The current state of the cluster.
     *
     * Generated from protobuf field <code>.google.bigtable.admin.v2.Cluster.State state = 3;</code>
     * @param int $var
     * @return $this
     */
    public function setState($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\Bigtable\Admin\V2\Cluster_State::class);
        $this->state = $var;

        return $this;
    }

    /**
     * The number of nodes allocated to this cluster. More nodes enable higher
     * throughput and more consistent performance.
     *
     * Generated from protobuf field <code>int32 serve_nodes = 4;</code>
     * @return int
     */
    public function getServeNodes()
    {
        return $this->serve_nodes;
    }

    /**
     * The number of nodes allocated to this cluster. More nodes enable higher
     * throughput and more consistent performance.
     *
     * Generated from protobuf field <code>int32 serve_nodes = 4;</code>
     * @param int $var
     * @return $this
     */
    public function setServeNodes($var)
    {
        GPBUtil::checkInt32($var);
        $this->serve_nodes = $var;

        return $this;
    }

    /**
     * (`CreationOnly`)
     * The type of storage used by this cluster to serve its
     * parent instance's tables, unless explicitly overridden.
     *
     * Generated from protobuf field <code>.google.bigtable.admin.v2.StorageType default_storage_type = 5;</code>
     * @return int
     */
    public function getDefaultStorageType()
    {
        return $this->default_storage_type;
    }

    /**
     * (`CreationOnly`)
     * The type of storage used by this cluster to serve its
     * parent instance's tables, unless explicitly overridden.
     *
     * Generated from protobuf field <code>.google.bigtable.admin.v2.StorageType default_storage_type = 5;</code>
     * @param int $var
     * @return $this
     */
    public function setDefaultStorageType($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\Bigtable\Admin\V2\StorageType::class);
        $this->default_storage_type = $var;

        return $this;
    }

}

