2.16.0 (latest) 2.15.0 2.14.0 2.13.0 2.12.0 2.11.0 2.10.0 2.9.0 2.8.0 2.7.0 2.6.0 2.5.0 2.4.0 2.3.0 2.2.0 2.1.0 2.0.0 1.3.0 1.2.0 1.1.0 1.0.0

    public sealed class AllocationPolicy.Types.LocationPolicy : IMessage<AllocationPolicy.Types.LocationPolicy>, IEquatable<AllocationPolicy.Types.LocationPolicy>, IDeepCloneable<AllocationPolicy.Types.LocationPolicy>, IBufferMessage, IMessage

## Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) \> AllocationPolicy.Types.LocationPolicy

## Implements

[IMessage](https://docs.cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.md.txt)[AllocationPolicy](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Batch.V1/latest/Google.Cloud.Batch.V1.AllocationPolicy.md.txt)[Types](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Batch.V1/latest/Google.Cloud.Batch.V1.AllocationPolicy.Types.md.txt)[LocationPolicy](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Batch.V1/latest/Google.Cloud.Batch.V1.AllocationPolicy.Types.LocationPolicy.md.txt), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[AllocationPolicy](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Batch.V1/latest/Google.Cloud.Batch.V1.AllocationPolicy.md.txt)[Types](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Batch.V1/latest/Google.Cloud.Batch.V1.AllocationPolicy.Types.md.txt)[LocationPolicy](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Batch.V1/latest/Google.Cloud.Batch.V1.AllocationPolicy.Types.LocationPolicy.md.txt), [IDeepCloneable](https://docs.cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.md.txt)[AllocationPolicy](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Batch.V1/latest/Google.Cloud.Batch.V1.AllocationPolicy.md.txt)[Types](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Batch.V1/latest/Google.Cloud.Batch.V1.AllocationPolicy.Types.md.txt)[LocationPolicy](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Batch.V1/latest/Google.Cloud.Batch.V1.AllocationPolicy.Types.LocationPolicy.md.txt), [IBufferMessage](https://docs.cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IBufferMessage.md.txt), [IMessage](https://docs.cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage.md.txt)

## Inherited Members

[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) [object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) [object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)

## Namespace

[Google.Cloud.Batch.V1](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Batch.V1/latest/Google.Cloud.Batch.V1.md.txt)

## Assembly

Google.Cloud.Batch.V1.dll

## Constructors

### LocationPolicy()

    public LocationPolicy()

### LocationPolicy(LocationPolicy)

    public LocationPolicy(AllocationPolicy.Types.LocationPolicy other)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `other` | `AllocationPolicyTypesLocationPolicy` |

## Properties

### AllowedLocations

    public RepeatedField<string> AllowedLocations { get; }

A list of location names that are allowed for the job's VMs formatted
as URLs. Each location can be a region or a zone, but you can only
specify one region or multiple zones in one region per job. For example,
`["regions/us-central1"]` allow VMs in any zones in region
`us-central1`, and `["zones/us-central1-a", "zones/us-central1-c"]`
only allow VMs in zones `us-central1-a` and `us-central1-c`. However,
`["regions/us-central1", "zones/us-central1-a", "zones/us-central1-b",
"zones/us-west1-a"]` causes an error because it contains multiple regions
(`us-central1` and `us-west1`).

The specified region or zones must be in the same region in
which the job is created starting on the following dates:

- For projects that have successfully submitted before
  July 31, 2026 at least one job that uses the
  `allowedLocations[]` field with any region or zones
  outside of the job's location, the changes are starting
  on *June 30, 2027*.

- For all other projects, the changes are starting on
  *July 31, 2026*.

For example, for job `projects/123/locations/us-central1/jobs/jobid`,
the specified region or zones must be in `us-central1`. Using a
different region (e.g. `regions/us-west1`) or a zone not in
`us-central1` (e.g. `zones/us-west1-a`) causes an error.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `RepeatedFieldstring` |   |