Class 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.GeneratedMessageV3
    implements PolicySpec.PolicyRuleOrBuilder
     A rule used to express this policy.
     
    Protobuf type google.cloud.orgpolicy.v2.PolicySpec.PolicyRule
    See Also:
    Serialized Form
    • Method Detail

      • newInstance

        protected Object newInstance​(com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused)
        Overrides:
        newInstance in class com.google.protobuf.GeneratedMessageV3
      • getDescriptor

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

        protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
        Specified by:
        internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessageV3
      • hasValues

        public boolean hasValues()
         List of values to be used for this PolicyRule. 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.
      • 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 com.google.type.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 com.google.type.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
      • isInitialized

        public final boolean isInitialized()
        Specified by:
        isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
        Overrides:
        isInitialized in class com.google.protobuf.GeneratedMessageV3
      • 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.GeneratedMessageV3
        Throws:
        IOException
      • getSerializedSize

        public int getSerializedSize()
        Specified by:
        getSerializedSize in interface com.google.protobuf.MessageLite
        Overrides:
        getSerializedSize in class com.google.protobuf.GeneratedMessageV3
      • 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
      • newBuilderForType

        public PolicySpec.PolicyRule.Builder newBuilderForType()
        Specified by:
        newBuilderForType in interface com.google.protobuf.Message
        Specified by:
        newBuilderForType in interface com.google.protobuf.MessageLite
      • 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.GeneratedMessageV3.BuilderParent parent)
        Specified by:
        newBuilderForType in class com.google.protobuf.GeneratedMessageV3
      • 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.GeneratedMessageV3
      • getDefaultInstanceForType

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