Class PolicySpec.PolicyRule.StringValues.Builder

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

public static final class PolicySpec.PolicyRule.StringValues.Builder extends com.google.protobuf.GeneratedMessage.Builder<PolicySpec.PolicyRule.StringValues.Builder> implements PolicySpec.PolicyRule.StringValuesOrBuilder
 A message that holds specific allowed and denied values.
 This message can define specific values and subtrees of the Resource
 Manager resource hierarchy (`Organizations`, `Folders`, `Projects`) that
 are allowed or denied. This is achieved by using the `under:` and
 optional `is:` prefixes.
 The `under:` prefix is used to denote resource subtree values.
 The `is:` prefix is used to denote specific values, and is required only
 if the value contains a ":". Values prefixed with "is:" are treated the
 same as values with no prefix.
 Ancestry subtrees must be in one of the following formats:

 - `projects/<project-id>` (for example, `projects/tokyo-rain-123`)
 - `folders/<folder-id>` (for example, `folders/1234`)
 - `organizations/<organization-id>` (for example, `organizations/1234`)

 The `supports_under` field of the associated `Constraint`  defines
 whether ancestry prefixes can be used.
 
Protobuf type google.cloud.orgpolicy.v2.PolicySpec.PolicyRule.StringValues
  • Method Details

    • getDescriptor

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

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

      public PolicySpec.PolicyRule.StringValues 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

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

      public PolicySpec.PolicyRule.StringValues.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<PolicySpec.PolicyRule.StringValues.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<PolicySpec.PolicyRule.StringValues.Builder>
    • mergeFrom

      public PolicySpec.PolicyRule.StringValues.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<PolicySpec.PolicyRule.StringValues.Builder>
      Throws:
      IOException
    • getAllowedValuesList

      public com.google.protobuf.ProtocolStringList getAllowedValuesList()
       List of values allowed at this resource.
       
      repeated string allowed_values = 1;
      Specified by:
      getAllowedValuesList in interface PolicySpec.PolicyRule.StringValuesOrBuilder
      Returns:
      A list containing the allowedValues.
    • getAllowedValuesCount

      public int getAllowedValuesCount()
       List of values allowed at this resource.
       
      repeated string allowed_values = 1;
      Specified by:
      getAllowedValuesCount in interface PolicySpec.PolicyRule.StringValuesOrBuilder
      Returns:
      The count of allowedValues.
    • getAllowedValues

      public String getAllowedValues(int index)
       List of values allowed at this resource.
       
      repeated string allowed_values = 1;
      Specified by:
      getAllowedValues in interface PolicySpec.PolicyRule.StringValuesOrBuilder
      Parameters:
      index - The index of the element to return.
      Returns:
      The allowedValues at the given index.
    • getAllowedValuesBytes

      public com.google.protobuf.ByteString getAllowedValuesBytes(int index)
       List of values allowed at this resource.
       
      repeated string allowed_values = 1;
      Specified by:
      getAllowedValuesBytes in interface PolicySpec.PolicyRule.StringValuesOrBuilder
      Parameters:
      index - The index of the value to return.
      Returns:
      The bytes of the allowedValues at the given index.
    • setAllowedValues

      public PolicySpec.PolicyRule.StringValues.Builder setAllowedValues(int index, String value)
       List of values allowed at this resource.
       
      repeated string allowed_values = 1;
      Parameters:
      index - The index to set the value at.
      value - The allowedValues to set.
      Returns:
      This builder for chaining.
    • addAllowedValues

      public PolicySpec.PolicyRule.StringValues.Builder addAllowedValues(String value)
       List of values allowed at this resource.
       
      repeated string allowed_values = 1;
      Parameters:
      value - The allowedValues to add.
      Returns:
      This builder for chaining.
    • addAllAllowedValues

      public PolicySpec.PolicyRule.StringValues.Builder addAllAllowedValues(Iterable<String> values)
       List of values allowed at this resource.
       
      repeated string allowed_values = 1;
      Parameters:
      values - The allowedValues to add.
      Returns:
      This builder for chaining.
    • clearAllowedValues

      public PolicySpec.PolicyRule.StringValues.Builder clearAllowedValues()
       List of values allowed at this resource.
       
      repeated string allowed_values = 1;
      Returns:
      This builder for chaining.
    • addAllowedValuesBytes

      public PolicySpec.PolicyRule.StringValues.Builder addAllowedValuesBytes(com.google.protobuf.ByteString value)
       List of values allowed at this resource.
       
      repeated string allowed_values = 1;
      Parameters:
      value - The bytes of the allowedValues to add.
      Returns:
      This builder for chaining.
    • getDeniedValuesList

      public com.google.protobuf.ProtocolStringList getDeniedValuesList()
       List of values denied at this resource.
       
      repeated string denied_values = 2;
      Specified by:
      getDeniedValuesList in interface PolicySpec.PolicyRule.StringValuesOrBuilder
      Returns:
      A list containing the deniedValues.
    • getDeniedValuesCount

      public int getDeniedValuesCount()
       List of values denied at this resource.
       
      repeated string denied_values = 2;
      Specified by:
      getDeniedValuesCount in interface PolicySpec.PolicyRule.StringValuesOrBuilder
      Returns:
      The count of deniedValues.
    • getDeniedValues

      public String getDeniedValues(int index)
       List of values denied at this resource.
       
      repeated string denied_values = 2;
      Specified by:
      getDeniedValues in interface PolicySpec.PolicyRule.StringValuesOrBuilder
      Parameters:
      index - The index of the element to return.
      Returns:
      The deniedValues at the given index.
    • getDeniedValuesBytes

      public com.google.protobuf.ByteString getDeniedValuesBytes(int index)
       List of values denied at this resource.
       
      repeated string denied_values = 2;
      Specified by:
      getDeniedValuesBytes in interface PolicySpec.PolicyRule.StringValuesOrBuilder
      Parameters:
      index - The index of the value to return.
      Returns:
      The bytes of the deniedValues at the given index.
    • setDeniedValues

      public PolicySpec.PolicyRule.StringValues.Builder setDeniedValues(int index, String value)
       List of values denied at this resource.
       
      repeated string denied_values = 2;
      Parameters:
      index - The index to set the value at.
      value - The deniedValues to set.
      Returns:
      This builder for chaining.
    • addDeniedValues

      public PolicySpec.PolicyRule.StringValues.Builder addDeniedValues(String value)
       List of values denied at this resource.
       
      repeated string denied_values = 2;
      Parameters:
      value - The deniedValues to add.
      Returns:
      This builder for chaining.
    • addAllDeniedValues

      public PolicySpec.PolicyRule.StringValues.Builder addAllDeniedValues(Iterable<String> values)
       List of values denied at this resource.
       
      repeated string denied_values = 2;
      Parameters:
      values - The deniedValues to add.
      Returns:
      This builder for chaining.
    • clearDeniedValues

      public PolicySpec.PolicyRule.StringValues.Builder clearDeniedValues()
       List of values denied at this resource.
       
      repeated string denied_values = 2;
      Returns:
      This builder for chaining.
    • addDeniedValuesBytes

      public PolicySpec.PolicyRule.StringValues.Builder addDeniedValuesBytes(com.google.protobuf.ByteString value)
       List of values denied at this resource.
       
      repeated string denied_values = 2;
      Parameters:
      value - The bytes of the deniedValues to add.
      Returns:
      This builder for chaining.