Class Constraint.CustomConstraintDefinition.Builder

java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder
com.google.protobuf.AbstractMessage.Builder<BuilderT>
com.google.protobuf.GeneratedMessage.Builder<Constraint.CustomConstraintDefinition.Builder>
com.google.cloud.orgpolicy.v2.Constraint.CustomConstraintDefinition.Builder
All Implemented Interfaces:
Constraint.CustomConstraintDefinitionOrBuilder, com.google.protobuf.Message.Builder, com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Cloneable
Enclosing class:
Constraint.CustomConstraintDefinition

public static final class Constraint.CustomConstraintDefinition.Builder extends com.google.protobuf.GeneratedMessage.Builder<Constraint.CustomConstraintDefinition.Builder> implements Constraint.CustomConstraintDefinitionOrBuilder
 Custom constraint definition. Defines this as a managed constraint.
 
Protobuf type google.cloud.orgpolicy.v2.Constraint.CustomConstraintDefinition
  • 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<Constraint.CustomConstraintDefinition.Builder>
    • internalGetMutableMapFieldReflection

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

      protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()
      Specified by:
      internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessage.Builder<Constraint.CustomConstraintDefinition.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<Constraint.CustomConstraintDefinition.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<Constraint.CustomConstraintDefinition.Builder>
    • getDefaultInstanceForType

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

      Specified by:
      build in interface com.google.protobuf.Message.Builder
      Specified by:
      build in interface com.google.protobuf.MessageLite.Builder
    • buildPartial

      Specified by:
      buildPartial in interface com.google.protobuf.Message.Builder
      Specified by:
      buildPartial in interface com.google.protobuf.MessageLite.Builder
    • mergeFrom

      public Constraint.CustomConstraintDefinition.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<Constraint.CustomConstraintDefinition.Builder>
    • mergeFrom

    • isInitialized

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

      public Constraint.CustomConstraintDefinition.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<Constraint.CustomConstraintDefinition.Builder>
      Throws:
      IOException
    • getResourceTypesList

      public com.google.protobuf.ProtocolStringList getResourceTypesList()
       The resource instance type on which this policy applies. Format will be
       of the form : `<service name>/<type>` Example:
      
       * `compute.googleapis.com/Instance`.
       
      repeated string resource_types = 1;
      Specified by:
      getResourceTypesList in interface Constraint.CustomConstraintDefinitionOrBuilder
      Returns:
      A list containing the resourceTypes.
    • getResourceTypesCount

      public int getResourceTypesCount()
       The resource instance type on which this policy applies. Format will be
       of the form : `<service name>/<type>` Example:
      
       * `compute.googleapis.com/Instance`.
       
      repeated string resource_types = 1;
      Specified by:
      getResourceTypesCount in interface Constraint.CustomConstraintDefinitionOrBuilder
      Returns:
      The count of resourceTypes.
    • getResourceTypes

      public String getResourceTypes(int index)
       The resource instance type on which this policy applies. Format will be
       of the form : `<service name>/<type>` Example:
      
       * `compute.googleapis.com/Instance`.
       
      repeated string resource_types = 1;
      Specified by:
      getResourceTypes in interface Constraint.CustomConstraintDefinitionOrBuilder
      Parameters:
      index - The index of the element to return.
      Returns:
      The resourceTypes at the given index.
    • getResourceTypesBytes

      public com.google.protobuf.ByteString getResourceTypesBytes(int index)
       The resource instance type on which this policy applies. Format will be
       of the form : `<service name>/<type>` Example:
      
       * `compute.googleapis.com/Instance`.
       
      repeated string resource_types = 1;
      Specified by:
      getResourceTypesBytes in interface Constraint.CustomConstraintDefinitionOrBuilder
      Parameters:
      index - The index of the value to return.
      Returns:
      The bytes of the resourceTypes at the given index.
    • setResourceTypes

      public Constraint.CustomConstraintDefinition.Builder setResourceTypes(int index, String value)
       The resource instance type on which this policy applies. Format will be
       of the form : `<service name>/<type>` Example:
      
       * `compute.googleapis.com/Instance`.
       
      repeated string resource_types = 1;
      Parameters:
      index - The index to set the value at.
      value - The resourceTypes to set.
      Returns:
      This builder for chaining.
    • addResourceTypes

      public Constraint.CustomConstraintDefinition.Builder addResourceTypes(String value)
       The resource instance type on which this policy applies. Format will be
       of the form : `<service name>/<type>` Example:
      
       * `compute.googleapis.com/Instance`.
       
      repeated string resource_types = 1;
      Parameters:
      value - The resourceTypes to add.
      Returns:
      This builder for chaining.
    • addAllResourceTypes

      public Constraint.CustomConstraintDefinition.Builder addAllResourceTypes(Iterable<String> values)
       The resource instance type on which this policy applies. Format will be
       of the form : `<service name>/<type>` Example:
      
       * `compute.googleapis.com/Instance`.
       
      repeated string resource_types = 1;
      Parameters:
      values - The resourceTypes to add.
      Returns:
      This builder for chaining.
    • clearResourceTypes

      public Constraint.CustomConstraintDefinition.Builder clearResourceTypes()
       The resource instance type on which this policy applies. Format will be
       of the form : `<service name>/<type>` Example:
      
       * `compute.googleapis.com/Instance`.
       
      repeated string resource_types = 1;
      Returns:
      This builder for chaining.
    • addResourceTypesBytes

      public Constraint.CustomConstraintDefinition.Builder addResourceTypesBytes(com.google.protobuf.ByteString value)
       The resource instance type on which this policy applies. Format will be
       of the form : `<service name>/<type>` Example:
      
       * `compute.googleapis.com/Instance`.
       
      repeated string resource_types = 1;
      Parameters:
      value - The bytes of the resourceTypes to add.
      Returns:
      This builder for chaining.
    • getMethodTypesList

       All the operations being applied for this constraint.
       
      repeated .google.cloud.orgpolicy.v2.Constraint.CustomConstraintDefinition.MethodType method_types = 2;
      Specified by:
      getMethodTypesList in interface Constraint.CustomConstraintDefinitionOrBuilder
      Returns:
      A list containing the methodTypes.
    • getMethodTypesCount

      public int getMethodTypesCount()
       All the operations being applied for this constraint.
       
      repeated .google.cloud.orgpolicy.v2.Constraint.CustomConstraintDefinition.MethodType method_types = 2;
      Specified by:
      getMethodTypesCount in interface Constraint.CustomConstraintDefinitionOrBuilder
      Returns:
      The count of methodTypes.
    • getMethodTypes

      public Constraint.CustomConstraintDefinition.MethodType getMethodTypes(int index)
       All the operations being applied for this constraint.
       
      repeated .google.cloud.orgpolicy.v2.Constraint.CustomConstraintDefinition.MethodType method_types = 2;
      Specified by:
      getMethodTypes in interface Constraint.CustomConstraintDefinitionOrBuilder
      Parameters:
      index - The index of the element to return.
      Returns:
      The methodTypes at the given index.
    • setMethodTypes

       All the operations being applied for this constraint.
       
      repeated .google.cloud.orgpolicy.v2.Constraint.CustomConstraintDefinition.MethodType method_types = 2;
      Parameters:
      index - The index to set the value at.
      value - The methodTypes to set.
      Returns:
      This builder for chaining.
    • addMethodTypes

       All the operations being applied for this constraint.
       
      repeated .google.cloud.orgpolicy.v2.Constraint.CustomConstraintDefinition.MethodType method_types = 2;
      Parameters:
      value - The methodTypes to add.
      Returns:
      This builder for chaining.
    • addAllMethodTypes

       All the operations being applied for this constraint.
       
      repeated .google.cloud.orgpolicy.v2.Constraint.CustomConstraintDefinition.MethodType method_types = 2;
      Parameters:
      values - The methodTypes to add.
      Returns:
      This builder for chaining.
    • clearMethodTypes

       All the operations being applied for this constraint.
       
      repeated .google.cloud.orgpolicy.v2.Constraint.CustomConstraintDefinition.MethodType method_types = 2;
      Returns:
      This builder for chaining.
    • getMethodTypesValueList

      public List<Integer> getMethodTypesValueList()
       All the operations being applied for this constraint.
       
      repeated .google.cloud.orgpolicy.v2.Constraint.CustomConstraintDefinition.MethodType method_types = 2;
      Specified by:
      getMethodTypesValueList in interface Constraint.CustomConstraintDefinitionOrBuilder
      Returns:
      A list containing the enum numeric values on the wire for methodTypes.
    • getMethodTypesValue

      public int getMethodTypesValue(int index)
       All the operations being applied for this constraint.
       
      repeated .google.cloud.orgpolicy.v2.Constraint.CustomConstraintDefinition.MethodType method_types = 2;
      Specified by:
      getMethodTypesValue in interface Constraint.CustomConstraintDefinitionOrBuilder
      Parameters:
      index - The index of the value to return.
      Returns:
      The enum numeric value on the wire of methodTypes at the given index.
    • setMethodTypesValue

      public Constraint.CustomConstraintDefinition.Builder setMethodTypesValue(int index, int value)
       All the operations being applied for this constraint.
       
      repeated .google.cloud.orgpolicy.v2.Constraint.CustomConstraintDefinition.MethodType method_types = 2;
      Parameters:
      index - The index to set the value at.
      value - The enum numeric value on the wire for methodTypes to set.
      Returns:
      This builder for chaining.
    • addMethodTypesValue

      public Constraint.CustomConstraintDefinition.Builder addMethodTypesValue(int value)
       All the operations being applied for this constraint.
       
      repeated .google.cloud.orgpolicy.v2.Constraint.CustomConstraintDefinition.MethodType method_types = 2;
      Parameters:
      value - The enum numeric value on the wire for methodTypes to add.
      Returns:
      This builder for chaining.
    • addAllMethodTypesValue

      public Constraint.CustomConstraintDefinition.Builder addAllMethodTypesValue(Iterable<Integer> values)
       All the operations being applied for this constraint.
       
      repeated .google.cloud.orgpolicy.v2.Constraint.CustomConstraintDefinition.MethodType method_types = 2;
      Parameters:
      values - The enum numeric values on the wire for methodTypes to add.
      Returns:
      This builder for chaining.
    • getCondition

      public String getCondition()
       Org policy condition/expression. For example:
       `resource.instanceName.matches("[production|test]_.*_(\d)+")` or,
       `resource.management.auto_upgrade == true`
      
       The max length of the condition is 1000 characters.
       
      string condition = 3;
      Specified by:
      getCondition in interface Constraint.CustomConstraintDefinitionOrBuilder
      Returns:
      The condition.
    • getConditionBytes

      public com.google.protobuf.ByteString getConditionBytes()
       Org policy condition/expression. For example:
       `resource.instanceName.matches("[production|test]_.*_(\d)+")` or,
       `resource.management.auto_upgrade == true`
      
       The max length of the condition is 1000 characters.
       
      string condition = 3;
      Specified by:
      getConditionBytes in interface Constraint.CustomConstraintDefinitionOrBuilder
      Returns:
      The bytes for condition.
    • setCondition

       Org policy condition/expression. For example:
       `resource.instanceName.matches("[production|test]_.*_(\d)+")` or,
       `resource.management.auto_upgrade == true`
      
       The max length of the condition is 1000 characters.
       
      string condition = 3;
      Parameters:
      value - The condition to set.
      Returns:
      This builder for chaining.
    • clearCondition

       Org policy condition/expression. For example:
       `resource.instanceName.matches("[production|test]_.*_(\d)+")` or,
       `resource.management.auto_upgrade == true`
      
       The max length of the condition is 1000 characters.
       
      string condition = 3;
      Returns:
      This builder for chaining.
    • setConditionBytes

      public Constraint.CustomConstraintDefinition.Builder setConditionBytes(com.google.protobuf.ByteString value)
       Org policy condition/expression. For example:
       `resource.instanceName.matches("[production|test]_.*_(\d)+")` or,
       `resource.management.auto_upgrade == true`
      
       The max length of the condition is 1000 characters.
       
      string condition = 3;
      Parameters:
      value - The bytes for condition to set.
      Returns:
      This builder for chaining.
    • getActionTypeValue

      public int getActionTypeValue()
       Allow or deny type.
       
      .google.cloud.orgpolicy.v2.Constraint.CustomConstraintDefinition.ActionType action_type = 4;
      Specified by:
      getActionTypeValue in interface Constraint.CustomConstraintDefinitionOrBuilder
      Returns:
      The enum numeric value on the wire for actionType.
    • setActionTypeValue

      public Constraint.CustomConstraintDefinition.Builder setActionTypeValue(int value)
       Allow or deny type.
       
      .google.cloud.orgpolicy.v2.Constraint.CustomConstraintDefinition.ActionType action_type = 4;
      Parameters:
      value - The enum numeric value on the wire for actionType to set.
      Returns:
      This builder for chaining.
    • getActionType

       Allow or deny type.
       
      .google.cloud.orgpolicy.v2.Constraint.CustomConstraintDefinition.ActionType action_type = 4;
      Specified by:
      getActionType in interface Constraint.CustomConstraintDefinitionOrBuilder
      Returns:
      The actionType.
    • setActionType

       Allow or deny type.
       
      .google.cloud.orgpolicy.v2.Constraint.CustomConstraintDefinition.ActionType action_type = 4;
      Parameters:
      value - The actionType to set.
      Returns:
      This builder for chaining.
    • clearActionType

       Allow or deny type.
       
      .google.cloud.orgpolicy.v2.Constraint.CustomConstraintDefinition.ActionType action_type = 4;
      Returns:
      This builder for chaining.
    • getParametersCount

      public int getParametersCount()
      Description copied from interface: Constraint.CustomConstraintDefinitionOrBuilder
       Stores the structure of
       [`Parameters`][google.cloud.orgpolicy.v2.Constraint.CustomConstraintDefinition.Parameter]
       used by the constraint condition. The key of `map` represents the name of
       the parameter.
       
      map<string, .google.cloud.orgpolicy.v2.Constraint.CustomConstraintDefinition.Parameter> parameters = 5;
      Specified by:
      getParametersCount in interface Constraint.CustomConstraintDefinitionOrBuilder
    • containsParameters

      public boolean containsParameters(String key)
       Stores the structure of
       [`Parameters`][google.cloud.orgpolicy.v2.Constraint.CustomConstraintDefinition.Parameter]
       used by the constraint condition. The key of `map` represents the name of
       the parameter.
       
      map<string, .google.cloud.orgpolicy.v2.Constraint.CustomConstraintDefinition.Parameter> parameters = 5;
      Specified by:
      containsParameters in interface Constraint.CustomConstraintDefinitionOrBuilder
    • getParameters

      Deprecated.
      Use getParametersMap() instead.
      Specified by:
      getParameters in interface Constraint.CustomConstraintDefinitionOrBuilder
    • getParametersMap

       Stores the structure of
       [`Parameters`][google.cloud.orgpolicy.v2.Constraint.CustomConstraintDefinition.Parameter]
       used by the constraint condition. The key of `map` represents the name of
       the parameter.
       
      map<string, .google.cloud.orgpolicy.v2.Constraint.CustomConstraintDefinition.Parameter> parameters = 5;
      Specified by:
      getParametersMap in interface Constraint.CustomConstraintDefinitionOrBuilder
    • getParametersOrDefault

       Stores the structure of
       [`Parameters`][google.cloud.orgpolicy.v2.Constraint.CustomConstraintDefinition.Parameter]
       used by the constraint condition. The key of `map` represents the name of
       the parameter.
       
      map<string, .google.cloud.orgpolicy.v2.Constraint.CustomConstraintDefinition.Parameter> parameters = 5;
      Specified by:
      getParametersOrDefault in interface Constraint.CustomConstraintDefinitionOrBuilder
    • getParametersOrThrow

      public Constraint.CustomConstraintDefinition.Parameter getParametersOrThrow(String key)
       Stores the structure of
       [`Parameters`][google.cloud.orgpolicy.v2.Constraint.CustomConstraintDefinition.Parameter]
       used by the constraint condition. The key of `map` represents the name of
       the parameter.
       
      map<string, .google.cloud.orgpolicy.v2.Constraint.CustomConstraintDefinition.Parameter> parameters = 5;
      Specified by:
      getParametersOrThrow in interface Constraint.CustomConstraintDefinitionOrBuilder
    • clearParameters

    • removeParameters

       Stores the structure of
       [`Parameters`][google.cloud.orgpolicy.v2.Constraint.CustomConstraintDefinition.Parameter]
       used by the constraint condition. The key of `map` represents the name of
       the parameter.
       
      map<string, .google.cloud.orgpolicy.v2.Constraint.CustomConstraintDefinition.Parameter> parameters = 5;
    • getMutableParameters

      Deprecated.
      Use alternate mutation accessors instead.
    • putParameters

       Stores the structure of
       [`Parameters`][google.cloud.orgpolicy.v2.Constraint.CustomConstraintDefinition.Parameter]
       used by the constraint condition. The key of `map` represents the name of
       the parameter.
       
      map<string, .google.cloud.orgpolicy.v2.Constraint.CustomConstraintDefinition.Parameter> parameters = 5;
    • putAllParameters

       Stores the structure of
       [`Parameters`][google.cloud.orgpolicy.v2.Constraint.CustomConstraintDefinition.Parameter]
       used by the constraint condition. The key of `map` represents the name of
       the parameter.
       
      map<string, .google.cloud.orgpolicy.v2.Constraint.CustomConstraintDefinition.Parameter> parameters = 5;
    • putParametersBuilderIfAbsent

      public Constraint.CustomConstraintDefinition.Parameter.Builder putParametersBuilderIfAbsent(String key)
       Stores the structure of
       [`Parameters`][google.cloud.orgpolicy.v2.Constraint.CustomConstraintDefinition.Parameter]
       used by the constraint condition. The key of `map` represents the name of
       the parameter.
       
      map<string, .google.cloud.orgpolicy.v2.Constraint.CustomConstraintDefinition.Parameter> parameters = 5;