Class PolicySpec.PolicyRule

java.lang.Object
com.google.protobuf.AbstractMessageLite
com.google.protobuf.AbstractMessage
com.google.protobuf.GeneratedMessage
com.google.cloud.orgpolicy.v2.PolicySpec.PolicyRule
All Implemented Interfaces:
PolicySpec.PolicyRuleOrBuilder, com.google.protobuf.Message, com.google.protobuf.MessageLite, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Serializable
Enclosing class:
PolicySpec

public static final class PolicySpec.PolicyRule extends com.google.protobuf.GeneratedMessage implements PolicySpec.PolicyRuleOrBuilder
 A rule used to express this policy.
 
Protobuf type google.cloud.orgpolicy.v2.PolicySpec.PolicyRule
See Also:
  • Field Details

  • 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
    • getKindCase

      public PolicySpec.PolicyRule.KindCase getKindCase()
      Specified by:
      getKindCase in interface PolicySpec.PolicyRuleOrBuilder
    • hasValues

      public boolean hasValues()
       List of values to be used for this policy rule. This field can be set
       only in policies for list constraints.
       
      .google.cloud.orgpolicy.v2.PolicySpec.PolicyRule.StringValues values = 1;
      Specified by:
      hasValues in interface PolicySpec.PolicyRuleOrBuilder
      Returns:
      Whether the values field is set.
    • getValues

       List of values to be used for this policy rule. This field can be set
       only in policies for list constraints.
       
      .google.cloud.orgpolicy.v2.PolicySpec.PolicyRule.StringValues values = 1;
      Specified by:
      getValues in interface PolicySpec.PolicyRuleOrBuilder
      Returns:
      The values.
    • getValuesOrBuilder

      public PolicySpec.PolicyRule.StringValuesOrBuilder getValuesOrBuilder()
       List of values to be used for this policy rule. This field can be set
       only in policies for list constraints.
       
      .google.cloud.orgpolicy.v2.PolicySpec.PolicyRule.StringValues values = 1;
      Specified by:
      getValuesOrBuilder in interface PolicySpec.PolicyRuleOrBuilder
    • hasAllowAll

      public boolean hasAllowAll()
       Setting this to true means that all values are allowed. This field can
       be set only in policies for list constraints.
       
      bool allow_all = 2;
      Specified by:
      hasAllowAll in interface PolicySpec.PolicyRuleOrBuilder
      Returns:
      Whether the allowAll field is set.
    • getAllowAll

      public boolean getAllowAll()
       Setting this to true means that all values are allowed. This field can
       be set only in policies for list constraints.
       
      bool allow_all = 2;
      Specified by:
      getAllowAll in interface PolicySpec.PolicyRuleOrBuilder
      Returns:
      The allowAll.
    • hasDenyAll

      public boolean hasDenyAll()
       Setting this to true means that all values are denied. This field can
       be set only in policies for list constraints.
       
      bool deny_all = 3;
      Specified by:
      hasDenyAll in interface PolicySpec.PolicyRuleOrBuilder
      Returns:
      Whether the denyAll field is set.
    • getDenyAll

      public boolean getDenyAll()
       Setting this to true means that all values are denied. This field can
       be set only in policies for list constraints.
       
      bool deny_all = 3;
      Specified by:
      getDenyAll in interface PolicySpec.PolicyRuleOrBuilder
      Returns:
      The denyAll.
    • hasEnforce

      public boolean hasEnforce()
       If `true`, then the policy is enforced. If `false`, then any
       configuration is acceptable.
       This field can be set only in policies for boolean constraints.
       
      bool enforce = 4;
      Specified by:
      hasEnforce in interface PolicySpec.PolicyRuleOrBuilder
      Returns:
      Whether the enforce field is set.
    • getEnforce

      public boolean getEnforce()
       If `true`, then the policy is enforced. If `false`, then any
       configuration is acceptable.
       This field can be set only in policies for boolean constraints.
       
      bool enforce = 4;
      Specified by:
      getEnforce in interface PolicySpec.PolicyRuleOrBuilder
      Returns:
      The enforce.
    • hasCondition

      public boolean hasCondition()
       A condition which determines whether this rule is used
       in the evaluation of the policy. When set, the `expression` field in
       the `Expr' must include from 1 to 10 subexpressions, joined by the "||"
       or "&&" operators. Each subexpression must be of the form
       "resource.matchTag('<ORG_ID>/tag_key_short_name,
       'tag_value_short_name')". or "resource.matchTagId('tagKeys/key_id',
       'tagValues/value_id')". where key_name and value_name are the resource
       names for Label Keys and Values. These names are available from the Tag
       Manager Service. An example expression is:
       "resource.matchTag('123456789/environment,
       'prod')". or "resource.matchTagId('tagKeys/123',
       'tagValues/456')".
       
      .google.type.Expr condition = 5;
      Specified by:
      hasCondition in interface PolicySpec.PolicyRuleOrBuilder
      Returns:
      Whether the condition field is set.
    • getCondition

      public Expr getCondition()
       A condition which determines whether this rule is used
       in the evaluation of the policy. When set, the `expression` field in
       the `Expr' must include from 1 to 10 subexpressions, joined by the "||"
       or "&&" operators. Each subexpression must be of the form
       "resource.matchTag('<ORG_ID>/tag_key_short_name,
       'tag_value_short_name')". or "resource.matchTagId('tagKeys/key_id',
       'tagValues/value_id')". where key_name and value_name are the resource
       names for Label Keys and Values. These names are available from the Tag
       Manager Service. An example expression is:
       "resource.matchTag('123456789/environment,
       'prod')". or "resource.matchTagId('tagKeys/123',
       'tagValues/456')".
       
      .google.type.Expr condition = 5;
      Specified by:
      getCondition in interface PolicySpec.PolicyRuleOrBuilder
      Returns:
      The condition.
    • getConditionOrBuilder

      public ExprOrBuilder getConditionOrBuilder()
       A condition which determines whether this rule is used
       in the evaluation of the policy. When set, the `expression` field in
       the `Expr' must include from 1 to 10 subexpressions, joined by the "||"
       or "&&" operators. Each subexpression must be of the form
       "resource.matchTag('<ORG_ID>/tag_key_short_name,
       'tag_value_short_name')". or "resource.matchTagId('tagKeys/key_id',
       'tagValues/value_id')". where key_name and value_name are the resource
       names for Label Keys and Values. These names are available from the Tag
       Manager Service. An example expression is:
       "resource.matchTag('123456789/environment,
       'prod')". or "resource.matchTagId('tagKeys/123',
       'tagValues/456')".
       
      .google.type.Expr condition = 5;
      Specified by:
      getConditionOrBuilder in interface PolicySpec.PolicyRuleOrBuilder
    • hasParameters

      public boolean hasParameters()
       Optional. Required for managed constraints if parameters are defined.
       Passes parameter values when policy enforcement is enabled. Ensure that
       parameter value types match those defined in the constraint definition.
       For example:
       {
       "allowedLocations" : ["us-east1", "us-west1"],
       "allowAll" : true
       }
       
      .google.protobuf.Struct parameters = 6 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      hasParameters in interface PolicySpec.PolicyRuleOrBuilder
      Returns:
      Whether the parameters field is set.
    • getParameters

      public com.google.protobuf.Struct getParameters()
       Optional. Required for managed constraints if parameters are defined.
       Passes parameter values when policy enforcement is enabled. Ensure that
       parameter value types match those defined in the constraint definition.
       For example:
       {
       "allowedLocations" : ["us-east1", "us-west1"],
       "allowAll" : true
       }
       
      .google.protobuf.Struct parameters = 6 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      getParameters in interface PolicySpec.PolicyRuleOrBuilder
      Returns:
      The parameters.
    • getParametersOrBuilder

      public com.google.protobuf.StructOrBuilder getParametersOrBuilder()
       Optional. Required for managed constraints if parameters are defined.
       Passes parameter values when policy enforcement is enabled. Ensure that
       parameter value types match those defined in the constraint definition.
       For example:
       {
       "allowedLocations" : ["us-east1", "us-west1"],
       "allowAll" : true
       }
       
      .google.protobuf.Struct parameters = 6 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      getParametersOrBuilder in interface PolicySpec.PolicyRuleOrBuilder
    • isInitialized

      public final boolean isInitialized()
      Specified by:
      isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
      Overrides:
      isInitialized in class com.google.protobuf.GeneratedMessage
    • writeTo

      public void writeTo(com.google.protobuf.CodedOutputStream output) throws IOException
      Specified by:
      writeTo in interface com.google.protobuf.MessageLite
      Overrides:
      writeTo in class com.google.protobuf.GeneratedMessage
      Throws:
      IOException
    • getSerializedSize

      public int getSerializedSize()
      Specified by:
      getSerializedSize in interface com.google.protobuf.MessageLite
      Overrides:
      getSerializedSize in class com.google.protobuf.GeneratedMessage
    • equals

      public boolean equals(Object obj)
      Specified by:
      equals in interface com.google.protobuf.Message
      Overrides:
      equals in class com.google.protobuf.AbstractMessage
    • hashCode

      public int hashCode()
      Specified by:
      hashCode in interface com.google.protobuf.Message
      Overrides:
      hashCode in class com.google.protobuf.AbstractMessage
    • parseFrom

      public static PolicySpec.PolicyRule parseFrom(ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static PolicySpec.PolicyRule parseFrom(ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static PolicySpec.PolicyRule parseFrom(com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static PolicySpec.PolicyRule parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static PolicySpec.PolicyRule parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static PolicySpec.PolicyRule parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static PolicySpec.PolicyRule parseFrom(InputStream input) throws IOException
      Throws:
      IOException
    • parseFrom

      public static PolicySpec.PolicyRule parseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
      Throws:
      IOException
    • parseDelimitedFrom

      public static PolicySpec.PolicyRule parseDelimitedFrom(InputStream input) throws IOException
      Throws:
      IOException
    • parseDelimitedFrom

      public static PolicySpec.PolicyRule parseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
      Throws:
      IOException
    • parseFrom

      public static PolicySpec.PolicyRule parseFrom(com.google.protobuf.CodedInputStream input) throws IOException
      Throws:
      IOException
    • parseFrom

      public static PolicySpec.PolicyRule parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
      Throws:
      IOException
    • newBuilderForType

      public PolicySpec.PolicyRule.Builder newBuilderForType()
      Specified by:
      newBuilderForType in interface com.google.protobuf.Message
      Specified by:
      newBuilderForType in interface com.google.protobuf.MessageLite
    • newBuilder

      public static PolicySpec.PolicyRule.Builder newBuilder()
    • newBuilder

      public static PolicySpec.PolicyRule.Builder newBuilder(PolicySpec.PolicyRule prototype)
    • toBuilder

      public PolicySpec.PolicyRule.Builder toBuilder()
      Specified by:
      toBuilder in interface com.google.protobuf.Message
      Specified by:
      toBuilder in interface com.google.protobuf.MessageLite
    • newBuilderForType

      protected PolicySpec.PolicyRule.Builder newBuilderForType(com.google.protobuf.AbstractMessage.BuilderParent parent)
      Overrides:
      newBuilderForType in class com.google.protobuf.AbstractMessage
    • getDefaultInstance

      public static PolicySpec.PolicyRule getDefaultInstance()
    • parser

      public static com.google.protobuf.Parser<PolicySpec.PolicyRule> parser()
    • getParserForType

      public com.google.protobuf.Parser<PolicySpec.PolicyRule> getParserForType()
      Specified by:
      getParserForType in interface com.google.protobuf.Message
      Specified by:
      getParserForType in interface com.google.protobuf.MessageLite
      Overrides:
      getParserForType in class com.google.protobuf.GeneratedMessage
    • getDefaultInstanceForType

      public PolicySpec.PolicyRule getDefaultInstanceForType()
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder