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

namespace Google\Cloud\Memorystore\V1;

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

/**
 * Zone distribution configuration for allocation of instance resources.
 *
 * Generated from protobuf message <code>google.cloud.memorystore.v1.ZoneDistributionConfig</code>
 */
class ZoneDistributionConfig extends \Google\Protobuf\Internal\Message
{
    /**
     * Optional. Defines zone where all resources will be allocated with
     * SINGLE_ZONE mode. Ignored for MULTI_ZONE mode.
     *
     * Generated from protobuf field <code>string zone = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $zone = '';
    /**
     * Optional. Current zone distribution mode. Defaults to MULTI_ZONE.
     *
     * Generated from protobuf field <code>.google.cloud.memorystore.v1.ZoneDistributionConfig.ZoneDistributionMode mode = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $mode = 0;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $zone
     *           Optional. Defines zone where all resources will be allocated with
     *           SINGLE_ZONE mode. Ignored for MULTI_ZONE mode.
     *     @type int $mode
     *           Optional. Current zone distribution mode. Defaults to MULTI_ZONE.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Memorystore\V1\Memorystore::initOnce();
        parent::__construct($data);
    }

    /**
     * Optional. Defines zone where all resources will be allocated with
     * SINGLE_ZONE mode. Ignored for MULTI_ZONE mode.
     *
     * Generated from protobuf field <code>string zone = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return string
     */
    public function getZone()
    {
        return $this->zone;
    }

    /**
     * Optional. Defines zone where all resources will be allocated with
     * SINGLE_ZONE mode. Ignored for MULTI_ZONE mode.
     *
     * 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;
    }

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

    /**
     * Optional. Current zone distribution mode. Defaults to MULTI_ZONE.
     *
     * Generated from protobuf field <code>.google.cloud.memorystore.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\Memorystore\V1\ZoneDistributionConfig\ZoneDistributionMode::class);
        $this->mode = $var;

        return $this;
    }

}

