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

namespace Google\Cloud\Batch\V1\AllocationPolicy;

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

/**
 * Generated from protobuf message <code>google.cloud.batch.v1.AllocationPolicy.LocationPolicy</code>
 */
class LocationPolicy extends \Google\Protobuf\Internal\Message
{
    /**
     * A list of allowed location names represented by internal URLs.
     * Each location can be a region or a zone.
     * Only one region or multiple zones in one region is supported now.
     * For example,
     * ["regions/us-central1"] allow VMs in any zones in region us-central1.
     * ["zones/us-central1-a", "zones/us-central1-c"] only allow VMs
     * in zones us-central1-a and us-central1-c.
     * All locations end up in different regions would cause errors.
     * For example,
     * ["regions/us-central1", "zones/us-central1-a", "zones/us-central1-b",
     * "zones/us-west1-a"] contains 2 regions "us-central1" and
     * "us-west1". An error is expected in this case.
     *
     * Generated from protobuf field <code>repeated string allowed_locations = 1;</code>
     */
    private $allowed_locations;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type array<string>|\Google\Protobuf\Internal\RepeatedField $allowed_locations
     *           A list of allowed location names represented by internal URLs.
     *           Each location can be a region or a zone.
     *           Only one region or multiple zones in one region is supported now.
     *           For example,
     *           ["regions/us-central1"] allow VMs in any zones in region us-central1.
     *           ["zones/us-central1-a", "zones/us-central1-c"] only allow VMs
     *           in zones us-central1-a and us-central1-c.
     *           All locations end up in different regions would cause errors.
     *           For example,
     *           ["regions/us-central1", "zones/us-central1-a", "zones/us-central1-b",
     *           "zones/us-west1-a"] contains 2 regions "us-central1" and
     *           "us-west1". An error is expected in this case.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Batch\V1\Job::initOnce();
        parent::__construct($data);
    }

    /**
     * A list of allowed location names represented by internal URLs.
     * Each location can be a region or a zone.
     * Only one region or multiple zones in one region is supported now.
     * For example,
     * ["regions/us-central1"] allow VMs in any zones in region us-central1.
     * ["zones/us-central1-a", "zones/us-central1-c"] only allow VMs
     * in zones us-central1-a and us-central1-c.
     * All locations end up in different regions would cause errors.
     * For example,
     * ["regions/us-central1", "zones/us-central1-a", "zones/us-central1-b",
     * "zones/us-west1-a"] contains 2 regions "us-central1" and
     * "us-west1". An error is expected in this case.
     *
     * Generated from protobuf field <code>repeated string allowed_locations = 1;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getAllowedLocations()
    {
        return $this->allowed_locations;
    }

    /**
     * A list of allowed location names represented by internal URLs.
     * Each location can be a region or a zone.
     * Only one region or multiple zones in one region is supported now.
     * For example,
     * ["regions/us-central1"] allow VMs in any zones in region us-central1.
     * ["zones/us-central1-a", "zones/us-central1-c"] only allow VMs
     * in zones us-central1-a and us-central1-c.
     * All locations end up in different regions would cause errors.
     * For example,
     * ["regions/us-central1", "zones/us-central1-a", "zones/us-central1-b",
     * "zones/us-west1-a"] contains 2 regions "us-central1" and
     * "us-west1". An error is expected in this case.
     *
     * Generated from protobuf field <code>repeated string allowed_locations = 1;</code>
     * @param array<string>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setAllowedLocations($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
        $this->allowed_locations = $arr;

        return $this;
    }

}


