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

namespace Google\Cloud\Compute\V1;

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

/**
 *
 * Generated from protobuf message <code>google.cloud.compute.v1.DistributionPolicy</code>
 */
class DistributionPolicy extends \Google\Protobuf\Internal\Message
{
    /**
     * The distribution shape to which the group converges either proactively or on resize events (depending on the value set in updatePolicy.instanceRedistributionType).
     * Check the TargetShape enum for the list of possible values.
     *
     * Generated from protobuf field <code>optional string target_shape = 338621299;</code>
     */
    private $target_shape = null;
    /**
     * Zones where the regional managed instance group will create and manage its instances.
     *
     * Generated from protobuf field <code>repeated .google.cloud.compute.v1.DistributionPolicyZoneConfiguration zones = 116085319;</code>
     */
    private $zones;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $target_shape
     *           The distribution shape to which the group converges either proactively or on resize events (depending on the value set in updatePolicy.instanceRedistributionType).
     *           Check the TargetShape enum for the list of possible values.
     *     @type array<\Google\Cloud\Compute\V1\DistributionPolicyZoneConfiguration>|\Google\Protobuf\Internal\RepeatedField $zones
     *           Zones where the regional managed instance group will create and manage its instances.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce();
        parent::__construct($data);
    }

    /**
     * The distribution shape to which the group converges either proactively or on resize events (depending on the value set in updatePolicy.instanceRedistributionType).
     * Check the TargetShape enum for the list of possible values.
     *
     * Generated from protobuf field <code>optional string target_shape = 338621299;</code>
     * @return string
     */
    public function getTargetShape()
    {
        return isset($this->target_shape) ? $this->target_shape : '';
    }

    public function hasTargetShape()
    {
        return isset($this->target_shape);
    }

    public function clearTargetShape()
    {
        unset($this->target_shape);
    }

    /**
     * The distribution shape to which the group converges either proactively or on resize events (depending on the value set in updatePolicy.instanceRedistributionType).
     * Check the TargetShape enum for the list of possible values.
     *
     * Generated from protobuf field <code>optional string target_shape = 338621299;</code>
     * @param string $var
     * @return $this
     */
    public function setTargetShape($var)
    {
        GPBUtil::checkString($var, True);
        $this->target_shape = $var;

        return $this;
    }

    /**
     * Zones where the regional managed instance group will create and manage its instances.
     *
     * Generated from protobuf field <code>repeated .google.cloud.compute.v1.DistributionPolicyZoneConfiguration zones = 116085319;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getZones()
    {
        return $this->zones;
    }

    /**
     * Zones where the regional managed instance group will create and manage its instances.
     *
     * Generated from protobuf field <code>repeated .google.cloud.compute.v1.DistributionPolicyZoneConfiguration zones = 116085319;</code>
     * @param array<\Google\Cloud\Compute\V1\DistributionPolicyZoneConfiguration>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setZones($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\DistributionPolicyZoneConfiguration::class);
        $this->zones = $arr;

        return $this;
    }

}

