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

namespace Google\Cloud\Spanner\Admin\Instance\V1;

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

/**
 * A possible configuration for a Cloud Spanner instance. Configurations
 * define the geographic placement of nodes and their replication.
 *
 * Generated from protobuf message <code>google.spanner.admin.instance.v1.InstanceConfig</code>
 */
class InstanceConfig extends \Google\Protobuf\Internal\Message
{
    /**
     * A unique identifier for the instance configuration.  Values
     * are of the form
     * `projects/<project>/instanceConfigs/[a-z][-a-z0-9]*`
     *
     * Generated from protobuf field <code>string name = 1;</code>
     */
    private $name = '';
    /**
     * The name of this instance configuration as it appears in UIs.
     *
     * Generated from protobuf field <code>string display_name = 2;</code>
     */
    private $display_name = '';
    /**
     * The geographic placement of nodes in this instance configuration and their
     * replication properties.
     *
     * Generated from protobuf field <code>repeated .google.spanner.admin.instance.v1.ReplicaInfo replicas = 3;</code>
     */
    private $replicas;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $name
     *           A unique identifier for the instance configuration.  Values
     *           are of the form
     *           `projects/<project>/instanceConfigs/[a-z][-a-z0-9]*`
     *     @type string $display_name
     *           The name of this instance configuration as it appears in UIs.
     *     @type \Google\Cloud\Spanner\Admin\Instance\V1\ReplicaInfo[]|\Google\Protobuf\Internal\RepeatedField $replicas
     *           The geographic placement of nodes in this instance configuration and their
     *           replication properties.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Spanner\Admin\Instance\V1\SpannerInstanceAdmin::initOnce();
        parent::__construct($data);
    }

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

    /**
     * A unique identifier for the instance configuration.  Values
     * are of the form
     * `projects/<project>/instanceConfigs/[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;
    }

    /**
     * The name of this instance configuration as it appears in UIs.
     *
     * Generated from protobuf field <code>string display_name = 2;</code>
     * @return string
     */
    public function getDisplayName()
    {
        return $this->display_name;
    }

    /**
     * The name of this instance configuration as it appears in UIs.
     *
     * 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;
    }

    /**
     * The geographic placement of nodes in this instance configuration and their
     * replication properties.
     *
     * Generated from protobuf field <code>repeated .google.spanner.admin.instance.v1.ReplicaInfo replicas = 3;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getReplicas()
    {
        return $this->replicas;
    }

    /**
     * The geographic placement of nodes in this instance configuration and their
     * replication properties.
     *
     * Generated from protobuf field <code>repeated .google.spanner.admin.instance.v1.ReplicaInfo replicas = 3;</code>
     * @param \Google\Cloud\Spanner\Admin\Instance\V1\ReplicaInfo[]|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setReplicas($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Spanner\Admin\Instance\V1\ReplicaInfo::class);
        $this->replicas = $arr;

        return $this;
    }

}

