Class LocationPolicy.Builder

java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder
com.google.protobuf.AbstractMessage.Builder<BuilderT>
com.google.protobuf.GeneratedMessage.Builder<LocationPolicy.Builder>
com.google.cloud.compute.v1.LocationPolicy.Builder
All Implemented Interfaces:
LocationPolicyOrBuilder, com.google.protobuf.Message.Builder, com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Cloneable
Enclosing class:
LocationPolicy

public static final class LocationPolicy.Builder extends com.google.protobuf.GeneratedMessage.Builder<LocationPolicy.Builder> implements LocationPolicyOrBuilder
 Configuration for location policy among multiple possible locations
 (e.g. preferences for zone selection among zones in a single region).
 
Protobuf type google.cloud.compute.v1.LocationPolicy
  • Method Details

    • getDescriptor

      public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
    • internalGetMapFieldReflection

      protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection(int number)
      Overrides:
      internalGetMapFieldReflection in class com.google.protobuf.GeneratedMessage.Builder<LocationPolicy.Builder>
    • internalGetMutableMapFieldReflection

      protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection(int number)
      Overrides:
      internalGetMutableMapFieldReflection in class com.google.protobuf.GeneratedMessage.Builder<LocationPolicy.Builder>
    • internalGetFieldAccessorTable

      protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()
      Specified by:
      internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessage.Builder<LocationPolicy.Builder>
    • clear

      public LocationPolicy.Builder clear()
      Specified by:
      clear in interface com.google.protobuf.Message.Builder
      Specified by:
      clear in interface com.google.protobuf.MessageLite.Builder
      Overrides:
      clear in class com.google.protobuf.GeneratedMessage.Builder<LocationPolicy.Builder>
    • getDescriptorForType

      public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
      Specified by:
      getDescriptorForType in interface com.google.protobuf.Message.Builder
      Specified by:
      getDescriptorForType in interface com.google.protobuf.MessageOrBuilder
      Overrides:
      getDescriptorForType in class com.google.protobuf.GeneratedMessage.Builder<LocationPolicy.Builder>
    • getDefaultInstanceForType

      public LocationPolicy getDefaultInstanceForType()
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder
    • build

      public LocationPolicy build()
      Specified by:
      build in interface com.google.protobuf.Message.Builder
      Specified by:
      build in interface com.google.protobuf.MessageLite.Builder
    • buildPartial

      public LocationPolicy buildPartial()
      Specified by:
      buildPartial in interface com.google.protobuf.Message.Builder
      Specified by:
      buildPartial in interface com.google.protobuf.MessageLite.Builder
    • mergeFrom

      public LocationPolicy.Builder mergeFrom(com.google.protobuf.Message other)
      Specified by:
      mergeFrom in interface com.google.protobuf.Message.Builder
      Overrides:
      mergeFrom in class com.google.protobuf.AbstractMessage.Builder<LocationPolicy.Builder>
    • mergeFrom

      public LocationPolicy.Builder mergeFrom(LocationPolicy other)
    • isInitialized

      public final boolean isInitialized()
      Specified by:
      isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
      Overrides:
      isInitialized in class com.google.protobuf.GeneratedMessage.Builder<LocationPolicy.Builder>
    • mergeFrom

      public LocationPolicy.Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
      Specified by:
      mergeFrom in interface com.google.protobuf.Message.Builder
      Specified by:
      mergeFrom in interface com.google.protobuf.MessageLite.Builder
      Overrides:
      mergeFrom in class com.google.protobuf.AbstractMessage.Builder<LocationPolicy.Builder>
      Throws:
      IOException
    • getLocationsCount

      public int getLocationsCount()
      Description copied from interface: LocationPolicyOrBuilder
       Location configurations mapped by location name.
       Currently only zone names are supported and must be represented as valid
       internal URLs, such as zones/us-central1-a.
       The bulkInsert operation doesn't create instances in an AI zone, even if
       an AI zone is available in the specified region. For example, if you set a
       DENY preference for us-central1-a, Compute Engine will consider
       us-central1-b and us-central1-c for instance creation, but not
       us-central1-ai1a. Also, you can't use the locations[] configuration to
       allow instance creation in an AI zone. To include an AI zone in bulkInsert
       operations, use the locationPolicy.zones[] field.
       
      map<string, .google.cloud.compute.v1.LocationPolicyLocation> locations = 413423454;
      Specified by:
      getLocationsCount in interface LocationPolicyOrBuilder
    • containsLocations

      public boolean containsLocations(String key)
       Location configurations mapped by location name.
       Currently only zone names are supported and must be represented as valid
       internal URLs, such as zones/us-central1-a.
       The bulkInsert operation doesn't create instances in an AI zone, even if
       an AI zone is available in the specified region. For example, if you set a
       DENY preference for us-central1-a, Compute Engine will consider
       us-central1-b and us-central1-c for instance creation, but not
       us-central1-ai1a. Also, you can't use the locations[] configuration to
       allow instance creation in an AI zone. To include an AI zone in bulkInsert
       operations, use the locationPolicy.zones[] field.
       
      map<string, .google.cloud.compute.v1.LocationPolicyLocation> locations = 413423454;
      Specified by:
      containsLocations in interface LocationPolicyOrBuilder
    • getLocations

      @Deprecated public Map<String,LocationPolicyLocation> getLocations()
      Deprecated.
      Use getLocationsMap() instead.
      Specified by:
      getLocations in interface LocationPolicyOrBuilder
    • getLocationsMap

      public Map<String,LocationPolicyLocation> getLocationsMap()
       Location configurations mapped by location name.
       Currently only zone names are supported and must be represented as valid
       internal URLs, such as zones/us-central1-a.
       The bulkInsert operation doesn't create instances in an AI zone, even if
       an AI zone is available in the specified region. For example, if you set a
       DENY preference for us-central1-a, Compute Engine will consider
       us-central1-b and us-central1-c for instance creation, but not
       us-central1-ai1a. Also, you can't use the locations[] configuration to
       allow instance creation in an AI zone. To include an AI zone in bulkInsert
       operations, use the locationPolicy.zones[] field.
       
      map<string, .google.cloud.compute.v1.LocationPolicyLocation> locations = 413423454;
      Specified by:
      getLocationsMap in interface LocationPolicyOrBuilder
    • getLocationsOrDefault

      public LocationPolicyLocation getLocationsOrDefault(String key, LocationPolicyLocation defaultValue)
       Location configurations mapped by location name.
       Currently only zone names are supported and must be represented as valid
       internal URLs, such as zones/us-central1-a.
       The bulkInsert operation doesn't create instances in an AI zone, even if
       an AI zone is available in the specified region. For example, if you set a
       DENY preference for us-central1-a, Compute Engine will consider
       us-central1-b and us-central1-c for instance creation, but not
       us-central1-ai1a. Also, you can't use the locations[] configuration to
       allow instance creation in an AI zone. To include an AI zone in bulkInsert
       operations, use the locationPolicy.zones[] field.
       
      map<string, .google.cloud.compute.v1.LocationPolicyLocation> locations = 413423454;
      Specified by:
      getLocationsOrDefault in interface LocationPolicyOrBuilder
    • getLocationsOrThrow

      public LocationPolicyLocation getLocationsOrThrow(String key)
       Location configurations mapped by location name.
       Currently only zone names are supported and must be represented as valid
       internal URLs, such as zones/us-central1-a.
       The bulkInsert operation doesn't create instances in an AI zone, even if
       an AI zone is available in the specified region. For example, if you set a
       DENY preference for us-central1-a, Compute Engine will consider
       us-central1-b and us-central1-c for instance creation, but not
       us-central1-ai1a. Also, you can't use the locations[] configuration to
       allow instance creation in an AI zone. To include an AI zone in bulkInsert
       operations, use the locationPolicy.zones[] field.
       
      map<string, .google.cloud.compute.v1.LocationPolicyLocation> locations = 413423454;
      Specified by:
      getLocationsOrThrow in interface LocationPolicyOrBuilder
    • clearLocations

      public LocationPolicy.Builder clearLocations()
    • removeLocations

      public LocationPolicy.Builder removeLocations(String key)
       Location configurations mapped by location name.
       Currently only zone names are supported and must be represented as valid
       internal URLs, such as zones/us-central1-a.
       The bulkInsert operation doesn't create instances in an AI zone, even if
       an AI zone is available in the specified region. For example, if you set a
       DENY preference for us-central1-a, Compute Engine will consider
       us-central1-b and us-central1-c for instance creation, but not
       us-central1-ai1a. Also, you can't use the locations[] configuration to
       allow instance creation in an AI zone. To include an AI zone in bulkInsert
       operations, use the locationPolicy.zones[] field.
       
      map<string, .google.cloud.compute.v1.LocationPolicyLocation> locations = 413423454;
    • getMutableLocations

      @Deprecated public Map<String,LocationPolicyLocation> getMutableLocations()
      Deprecated.
      Use alternate mutation accessors instead.
    • putLocations

      public LocationPolicy.Builder putLocations(String key, LocationPolicyLocation value)
       Location configurations mapped by location name.
       Currently only zone names are supported and must be represented as valid
       internal URLs, such as zones/us-central1-a.
       The bulkInsert operation doesn't create instances in an AI zone, even if
       an AI zone is available in the specified region. For example, if you set a
       DENY preference for us-central1-a, Compute Engine will consider
       us-central1-b and us-central1-c for instance creation, but not
       us-central1-ai1a. Also, you can't use the locations[] configuration to
       allow instance creation in an AI zone. To include an AI zone in bulkInsert
       operations, use the locationPolicy.zones[] field.
       
      map<string, .google.cloud.compute.v1.LocationPolicyLocation> locations = 413423454;
    • putAllLocations

      public LocationPolicy.Builder putAllLocations(Map<String,LocationPolicyLocation> values)
       Location configurations mapped by location name.
       Currently only zone names are supported and must be represented as valid
       internal URLs, such as zones/us-central1-a.
       The bulkInsert operation doesn't create instances in an AI zone, even if
       an AI zone is available in the specified region. For example, if you set a
       DENY preference for us-central1-a, Compute Engine will consider
       us-central1-b and us-central1-c for instance creation, but not
       us-central1-ai1a. Also, you can't use the locations[] configuration to
       allow instance creation in an AI zone. To include an AI zone in bulkInsert
       operations, use the locationPolicy.zones[] field.
       
      map<string, .google.cloud.compute.v1.LocationPolicyLocation> locations = 413423454;
    • putLocationsBuilderIfAbsent

      public LocationPolicyLocation.Builder putLocationsBuilderIfAbsent(String key)
       Location configurations mapped by location name.
       Currently only zone names are supported and must be represented as valid
       internal URLs, such as zones/us-central1-a.
       The bulkInsert operation doesn't create instances in an AI zone, even if
       an AI zone is available in the specified region. For example, if you set a
       DENY preference for us-central1-a, Compute Engine will consider
       us-central1-b and us-central1-c for instance creation, but not
       us-central1-ai1a. Also, you can't use the locations[] configuration to
       allow instance creation in an AI zone. To include an AI zone in bulkInsert
       operations, use the locationPolicy.zones[] field.
       
      map<string, .google.cloud.compute.v1.LocationPolicyLocation> locations = 413423454;
    • hasTargetShape

      public boolean hasTargetShape()
       Strategy for distributing VMs across zones in a region.
       Check the TargetShape enum for the list of possible values.
       
      optional string target_shape = 338621299;
      Specified by:
      hasTargetShape in interface LocationPolicyOrBuilder
      Returns:
      Whether the targetShape field is set.
    • getTargetShape

      public String getTargetShape()
       Strategy for distributing VMs across zones in a region.
       Check the TargetShape enum for the list of possible values.
       
      optional string target_shape = 338621299;
      Specified by:
      getTargetShape in interface LocationPolicyOrBuilder
      Returns:
      The targetShape.
    • getTargetShapeBytes

      public com.google.protobuf.ByteString getTargetShapeBytes()
       Strategy for distributing VMs across zones in a region.
       Check the TargetShape enum for the list of possible values.
       
      optional string target_shape = 338621299;
      Specified by:
      getTargetShapeBytes in interface LocationPolicyOrBuilder
      Returns:
      The bytes for targetShape.
    • setTargetShape

      public LocationPolicy.Builder setTargetShape(String value)
       Strategy for distributing VMs across zones in a region.
       Check the TargetShape enum for the list of possible values.
       
      optional string target_shape = 338621299;
      Parameters:
      value - The targetShape to set.
      Returns:
      This builder for chaining.
    • clearTargetShape

      public LocationPolicy.Builder clearTargetShape()
       Strategy for distributing VMs across zones in a region.
       Check the TargetShape enum for the list of possible values.
       
      optional string target_shape = 338621299;
      Returns:
      This builder for chaining.
    • setTargetShapeBytes

      public LocationPolicy.Builder setTargetShapeBytes(com.google.protobuf.ByteString value)
       Strategy for distributing VMs across zones in a region.
       Check the TargetShape enum for the list of possible values.
       
      optional string target_shape = 338621299;
      Parameters:
      value - The bytes for targetShape to set.
      Returns:
      This builder for chaining.
    • getZonesList

      public List<LocationPolicyZoneConfiguration> getZonesList()
       The bulkInsert operation applies any preferences set in the locations
       field to the specific zones listed in the zones field if the same zones
       are specified in both fields.
       
      repeated .google.cloud.compute.v1.LocationPolicyZoneConfiguration zones = 116085319;
      Specified by:
      getZonesList in interface LocationPolicyOrBuilder
    • getZonesCount

      public int getZonesCount()
       The bulkInsert operation applies any preferences set in the locations
       field to the specific zones listed in the zones field if the same zones
       are specified in both fields.
       
      repeated .google.cloud.compute.v1.LocationPolicyZoneConfiguration zones = 116085319;
      Specified by:
      getZonesCount in interface LocationPolicyOrBuilder
    • getZones

      public LocationPolicyZoneConfiguration getZones(int index)
       The bulkInsert operation applies any preferences set in the locations
       field to the specific zones listed in the zones field if the same zones
       are specified in both fields.
       
      repeated .google.cloud.compute.v1.LocationPolicyZoneConfiguration zones = 116085319;
      Specified by:
      getZones in interface LocationPolicyOrBuilder
    • setZones

      public LocationPolicy.Builder setZones(int index, LocationPolicyZoneConfiguration value)
       The bulkInsert operation applies any preferences set in the locations
       field to the specific zones listed in the zones field if the same zones
       are specified in both fields.
       
      repeated .google.cloud.compute.v1.LocationPolicyZoneConfiguration zones = 116085319;
    • setZones

      public LocationPolicy.Builder setZones(int index, LocationPolicyZoneConfiguration.Builder builderForValue)
       The bulkInsert operation applies any preferences set in the locations
       field to the specific zones listed in the zones field if the same zones
       are specified in both fields.
       
      repeated .google.cloud.compute.v1.LocationPolicyZoneConfiguration zones = 116085319;
    • addZones

       The bulkInsert operation applies any preferences set in the locations
       field to the specific zones listed in the zones field if the same zones
       are specified in both fields.
       
      repeated .google.cloud.compute.v1.LocationPolicyZoneConfiguration zones = 116085319;
    • addZones

      public LocationPolicy.Builder addZones(int index, LocationPolicyZoneConfiguration value)
       The bulkInsert operation applies any preferences set in the locations
       field to the specific zones listed in the zones field if the same zones
       are specified in both fields.
       
      repeated .google.cloud.compute.v1.LocationPolicyZoneConfiguration zones = 116085319;
    • addZones

       The bulkInsert operation applies any preferences set in the locations
       field to the specific zones listed in the zones field if the same zones
       are specified in both fields.
       
      repeated .google.cloud.compute.v1.LocationPolicyZoneConfiguration zones = 116085319;
    • addZones

      public LocationPolicy.Builder addZones(int index, LocationPolicyZoneConfiguration.Builder builderForValue)
       The bulkInsert operation applies any preferences set in the locations
       field to the specific zones listed in the zones field if the same zones
       are specified in both fields.
       
      repeated .google.cloud.compute.v1.LocationPolicyZoneConfiguration zones = 116085319;
    • addAllZones

      public LocationPolicy.Builder addAllZones(Iterable<? extends LocationPolicyZoneConfiguration> values)
       The bulkInsert operation applies any preferences set in the locations
       field to the specific zones listed in the zones field if the same zones
       are specified in both fields.
       
      repeated .google.cloud.compute.v1.LocationPolicyZoneConfiguration zones = 116085319;
    • clearZones

      public LocationPolicy.Builder clearZones()
       The bulkInsert operation applies any preferences set in the locations
       field to the specific zones listed in the zones field if the same zones
       are specified in both fields.
       
      repeated .google.cloud.compute.v1.LocationPolicyZoneConfiguration zones = 116085319;
    • removeZones

      public LocationPolicy.Builder removeZones(int index)
       The bulkInsert operation applies any preferences set in the locations
       field to the specific zones listed in the zones field if the same zones
       are specified in both fields.
       
      repeated .google.cloud.compute.v1.LocationPolicyZoneConfiguration zones = 116085319;
    • getZonesBuilder

      public LocationPolicyZoneConfiguration.Builder getZonesBuilder(int index)
       The bulkInsert operation applies any preferences set in the locations
       field to the specific zones listed in the zones field if the same zones
       are specified in both fields.
       
      repeated .google.cloud.compute.v1.LocationPolicyZoneConfiguration zones = 116085319;
    • getZonesOrBuilder

      public LocationPolicyZoneConfigurationOrBuilder getZonesOrBuilder(int index)
       The bulkInsert operation applies any preferences set in the locations
       field to the specific zones listed in the zones field if the same zones
       are specified in both fields.
       
      repeated .google.cloud.compute.v1.LocationPolicyZoneConfiguration zones = 116085319;
      Specified by:
      getZonesOrBuilder in interface LocationPolicyOrBuilder
    • getZonesOrBuilderList

      public List<? extends LocationPolicyZoneConfigurationOrBuilder> getZonesOrBuilderList()
       The bulkInsert operation applies any preferences set in the locations
       field to the specific zones listed in the zones field if the same zones
       are specified in both fields.
       
      repeated .google.cloud.compute.v1.LocationPolicyZoneConfiguration zones = 116085319;
      Specified by:
      getZonesOrBuilderList in interface LocationPolicyOrBuilder
    • addZonesBuilder

      public LocationPolicyZoneConfiguration.Builder addZonesBuilder()
       The bulkInsert operation applies any preferences set in the locations
       field to the specific zones listed in the zones field if the same zones
       are specified in both fields.
       
      repeated .google.cloud.compute.v1.LocationPolicyZoneConfiguration zones = 116085319;
    • addZonesBuilder

      public LocationPolicyZoneConfiguration.Builder addZonesBuilder(int index)
       The bulkInsert operation applies any preferences set in the locations
       field to the specific zones listed in the zones field if the same zones
       are specified in both fields.
       
      repeated .google.cloud.compute.v1.LocationPolicyZoneConfiguration zones = 116085319;
    • getZonesBuilderList

      public List<LocationPolicyZoneConfiguration.Builder> getZonesBuilderList()
       The bulkInsert operation applies any preferences set in the locations
       field to the specific zones listed in the zones field if the same zones
       are specified in both fields.
       
      repeated .google.cloud.compute.v1.LocationPolicyZoneConfiguration zones = 116085319;