Package com.google.cloud.orgpolicy.v2
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:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classA rule used to express this policy.static enumstatic final classA message that holds specific allowed and denied values.static interfaceNested classes/interfaces inherited from class com.google.protobuf.GeneratedMessage
com.google.protobuf.GeneratedMessage.ExtendableBuilder<MessageT extends com.google.protobuf.GeneratedMessage.ExtendableMessage<MessageT>,BuilderT extends com.google.protobuf.GeneratedMessage.ExtendableBuilder<MessageT, BuilderT>>, com.google.protobuf.GeneratedMessage.ExtendableMessage<MessageT extends com.google.protobuf.GeneratedMessage.ExtendableMessage<MessageT>>, com.google.protobuf.GeneratedMessage.ExtendableMessageOrBuilder<MessageT extends com.google.protobuf.GeneratedMessage.ExtendableMessage<MessageT>>, com.google.protobuf.GeneratedMessage.FieldAccessorTable, com.google.protobuf.GeneratedMessage.GeneratedExtension<ContainingT extends com.google.protobuf.Message, T extends Object>, com.google.protobuf.GeneratedMessage.UnusedPrivateParameter Nested classes/interfaces inherited from class com.google.protobuf.AbstractMessage
com.google.protobuf.AbstractMessage.BuilderParentNested classes/interfaces inherited from class com.google.protobuf.AbstractMessageLite
com.google.protobuf.AbstractMessageLite.InternalOneOfEnum -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intFields inherited from class com.google.protobuf.GeneratedMessage
alwaysUseFieldBuilders, loggedPre22TypeNames, unknownFieldsFields inherited from class com.google.protobuf.AbstractMessage
memoizedSizeFields inherited from class com.google.protobuf.AbstractMessageLite
memoizedHashCode -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleanSetting this to true means that all values are allowed.A condition which determines whether this rule is used in the evaluation of the policy.A condition which determines whether this rule is used in the evaluation of the policy.static PolicySpec.PolicyRulebooleanSetting this to true means that all values are denied.static final com.google.protobuf.Descriptors.DescriptorbooleanIf `true`, then the policy is enforced.com.google.protobuf.StructOptional.com.google.protobuf.StructOrBuilderOptional.com.google.protobuf.Parser<PolicySpec.PolicyRule>intList of values to be used for this policy rule.List of values to be used for this policy rule.booleanSetting this to true means that all values are allowed.booleanA condition which determines whether this rule is used in the evaluation of the policy.booleanSetting this to true means that all values are denied.booleanIf `true`, then the policy is enforced.inthashCode()booleanOptional.booleanList of values to be used for this policy rule.protected com.google.protobuf.GeneratedMessage.FieldAccessorTablefinal booleannewBuilder(PolicySpec.PolicyRule prototype) protected PolicySpec.PolicyRule.BuildernewBuilderForType(com.google.protobuf.AbstractMessage.BuilderParent parent) static PolicySpec.PolicyRuleparseDelimitedFrom(InputStream input) static PolicySpec.PolicyRuleparseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static PolicySpec.PolicyRuleparseFrom(byte[] data) static PolicySpec.PolicyRuleparseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static PolicySpec.PolicyRuleparseFrom(com.google.protobuf.ByteString data) static PolicySpec.PolicyRuleparseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static PolicySpec.PolicyRuleparseFrom(com.google.protobuf.CodedInputStream input) static PolicySpec.PolicyRuleparseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static PolicySpec.PolicyRuleparseFrom(InputStream input) static PolicySpec.PolicyRuleparseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static PolicySpec.PolicyRuleparseFrom(ByteBuffer data) static PolicySpec.PolicyRuleparseFrom(ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static com.google.protobuf.Parser<PolicySpec.PolicyRule>parser()voidwriteTo(com.google.protobuf.CodedOutputStream output) Methods inherited from class com.google.protobuf.GeneratedMessage
canUseUnsafe, computeStringSize, computeStringSizeNoTag, emptyBooleanList, emptyDoubleList, emptyFloatList, emptyIntList, emptyList, emptyLongList, getAllFields, getDescriptorForType, getField, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof, internalGetMapField, internalGetMapFieldReflection, isStringEmpty, makeExtensionsImmutable, makeMutableCopy, makeMutableCopy, mergeFromAndMakeImmutableInternal, newFileScopedGeneratedExtension, newInstance, newMessageScopedGeneratedExtension, parseDelimitedWithIOException, parseDelimitedWithIOException, parseUnknownField, parseUnknownFieldProto3, parseWithIOException, parseWithIOException, parseWithIOException, parseWithIOException, serializeBooleanMapTo, serializeIntegerMapTo, serializeLongMapTo, serializeStringMapTo, writeReplace, writeString, writeStringNoTagMethods inherited from class com.google.protobuf.AbstractMessage
findInitializationErrors, getInitializationErrorString, hashFields, toStringMethods inherited from class com.google.protobuf.AbstractMessageLite
addAll, checkByteStringIsUtf8, toByteArray, toByteString, writeDelimitedTo, writeToMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.google.protobuf.MessageLite
toByteArray, toByteString, writeDelimitedTo, writeToMethods inherited from interface com.google.protobuf.MessageOrBuilder
findInitializationErrors, getAllFields, getDescriptorForType, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof
-
Field Details
-
VALUES_FIELD_NUMBER
public static final int VALUES_FIELD_NUMBER- See Also:
-
ALLOW_ALL_FIELD_NUMBER
public static final int ALLOW_ALL_FIELD_NUMBER- See Also:
-
DENY_ALL_FIELD_NUMBER
public static final int DENY_ALL_FIELD_NUMBER- See Also:
-
ENFORCE_FIELD_NUMBER
public static final int ENFORCE_FIELD_NUMBER- See Also:
-
CONDITION_FIELD_NUMBER
public static final int CONDITION_FIELD_NUMBER- See Also:
-
PARAMETERS_FIELD_NUMBER
public static final int PARAMETERS_FIELD_NUMBER- See Also:
-
-
Method Details
-
getDescriptor
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() -
internalGetFieldAccessorTable
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()- Specified by:
internalGetFieldAccessorTablein classcom.google.protobuf.GeneratedMessage
-
getKindCase
- Specified by:
getKindCasein interfacePolicySpec.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:
hasValuesin interfacePolicySpec.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:
getValuesin interfacePolicySpec.PolicyRuleOrBuilder- Returns:
- The values.
-
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:
getValuesOrBuilderin interfacePolicySpec.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:
hasAllowAllin interfacePolicySpec.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:
getAllowAllin interfacePolicySpec.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:
hasDenyAllin interfacePolicySpec.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:
getDenyAllin interfacePolicySpec.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:
hasEnforcein interfacePolicySpec.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:
getEnforcein interfacePolicySpec.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:
hasConditionin interfacePolicySpec.PolicyRuleOrBuilder- Returns:
- Whether the condition field is set.
-
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:
getConditionin interfacePolicySpec.PolicyRuleOrBuilder- Returns:
- The condition.
-
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:
getConditionOrBuilderin interfacePolicySpec.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:
hasParametersin interfacePolicySpec.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:
getParametersin interfacePolicySpec.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:
getParametersOrBuilderin interfacePolicySpec.PolicyRuleOrBuilder
-
isInitialized
public final boolean isInitialized()- Specified by:
isInitializedin interfacecom.google.protobuf.MessageLiteOrBuilder- Overrides:
isInitializedin classcom.google.protobuf.GeneratedMessage
-
writeTo
- Specified by:
writeToin interfacecom.google.protobuf.MessageLite- Overrides:
writeToin classcom.google.protobuf.GeneratedMessage- Throws:
IOException
-
getSerializedSize
public int getSerializedSize()- Specified by:
getSerializedSizein interfacecom.google.protobuf.MessageLite- Overrides:
getSerializedSizein classcom.google.protobuf.GeneratedMessage
-
equals
- Specified by:
equalsin interfacecom.google.protobuf.Message- Overrides:
equalsin classcom.google.protobuf.AbstractMessage
-
hashCode
public int hashCode()- Specified by:
hashCodein interfacecom.google.protobuf.Message- Overrides:
hashCodein classcom.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
- Throws:
IOException
-
parseFrom
public static PolicySpec.PolicyRule parseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException - Throws:
IOException
-
parseDelimitedFrom
- 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
- Specified by:
newBuilderForTypein interfacecom.google.protobuf.Message- Specified by:
newBuilderForTypein interfacecom.google.protobuf.MessageLite
-
newBuilder
-
newBuilder
-
toBuilder
- Specified by:
toBuilderin interfacecom.google.protobuf.Message- Specified by:
toBuilderin interfacecom.google.protobuf.MessageLite
-
newBuilderForType
protected PolicySpec.PolicyRule.Builder newBuilderForType(com.google.protobuf.AbstractMessage.BuilderParent parent) - Overrides:
newBuilderForTypein classcom.google.protobuf.AbstractMessage
-
getDefaultInstance
-
parser
-
getParserForType
- Specified by:
getParserForTypein interfacecom.google.protobuf.Message- Specified by:
getParserForTypein interfacecom.google.protobuf.MessageLite- Overrides:
getParserForTypein classcom.google.protobuf.GeneratedMessage
-
getDefaultInstanceForType
- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageLiteOrBuilder- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageOrBuilder
-