<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/redis/cluster/v1/cloud_redis_cluster.proto

namespace Google\Cloud\Redis\Cluster\V1;

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

/**
 * Zone distribution config for allocation of cluster resources.
 *
 * Generated from protobuf message <code>google.cloud.redis.cluster.v1.ZoneDistributionConfig</code>
 */
class ZoneDistributionConfig extends \Google\Protobuf\Internal\Message
{
    /**
     * Optional. The mode of zone distribution. Defaults to MULTI_ZONE, when not
     * specified.
     *
     * Generated from protobuf field <code>.google.cloud.redis.cluster.v1.ZoneDistributionConfig.ZoneDistributionMode mode = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $mode = 0;
    /**
     * Optional. When SINGLE ZONE distribution is selected, zone field would be
     * used to allocate all resources in that zone. This is not applicable to
     * MULTI_ZONE, and would be ignored for MULTI_ZONE clusters.
     *
     * Generated from protobuf field <code>string zone = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $zone = '';

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $mode
     *           Optional. The mode of zone distribution. Defaults to MULTI_ZONE, when not
     *           specified.
     *     @type string $zone
     *           Optional. When SINGLE ZONE distribution is selected, zone field would be
     *           used to allocate all resources in that zone. This is not applicable to
     *           MULTI_ZONE, and would be ignored for MULTI_ZONE clusters.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Redis\Cluster\V1\CloudRedisCluster::initOnce();
        parent::__construct($data);
    }

    /**
     * Optional. The mode of zone distribution. Defaults to MULTI_ZONE, when not
     * specified.
     *
     * Generated from protobuf field <code>.google.cloud.redis.cluster.v1.ZoneDistributionConfig.ZoneDistributionMode mode = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return int
     */
    public function getMode()
    {
        return $this->mode;
    }

    /**
     * Optional. The mode of zone distribution. Defaults to MULTI_ZONE, when not
     * specified.
     *
     * Generated from protobuf field <code>.google.cloud.redis.cluster.v1.ZoneDistributionConfig.ZoneDistributionMode mode = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param int $var
     * @return $this
     */
    public function setMode($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\Redis\Cluster\V1\ZoneDistributionConfig\ZoneDistributionMode::class);
        $this->mode = $var;

        return $this;
    }

    /**
     * Optional. When SINGLE ZONE distribution is selected, zone field would be
     * used to allocate all resources in that zone. This is not applicable to
     * MULTI_ZONE, and would be ignored for MULTI_ZONE clusters.
     *
     * Generated from protobuf field <code>string zone = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return string
     */
    public function getZone()
    {
        return $this->zone;
    }

    /**
     * Optional. When SINGLE ZONE distribution is selected, zone field would be
     * used to allocate all resources in that zone. This is not applicable to
     * MULTI_ZONE, and would be ignored for MULTI_ZONE clusters.
     *
     * Generated from protobuf field <code>string zone = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param string $var
     * @return $this
     */
    public function setZone($var)
    {
        GPBUtil::checkString($var, True);
        $this->zone = $var;

        return $this;
    }

}

