Package com.google.cloud.orgpolicy.v2
Class PolicySpec.PolicyRule.Builder
java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder
com.google.protobuf.AbstractMessage.Builder<BuilderT>
com.google.protobuf.GeneratedMessage.Builder<PolicySpec.PolicyRule.Builder>
com.google.cloud.orgpolicy.v2.PolicySpec.PolicyRule.Builder
- All Implemented Interfaces:
PolicySpec.PolicyRuleOrBuilder,com.google.protobuf.Message.Builder,com.google.protobuf.MessageLite.Builder,com.google.protobuf.MessageLiteOrBuilder,com.google.protobuf.MessageOrBuilder,Cloneable
- Enclosing class:
- PolicySpec.PolicyRule
public static final class PolicySpec.PolicyRule.Builder
extends com.google.protobuf.GeneratedMessage.Builder<PolicySpec.PolicyRule.Builder>
implements PolicySpec.PolicyRuleOrBuilder
A rule used to express this policy.Protobuf type
google.cloud.orgpolicy.v2.PolicySpec.PolicyRule-
Method Summary
Modifier and TypeMethodDescriptionbuild()clear()Setting this to true means that all values are allowed.A condition which determines whether this rule is used in the evaluation of the policy.Setting this to true means that all values are denied.If `true`, then the policy is enforced.Optional.List of values to be used for this policy rule.booleanSetting 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.A condition which determines whether this rule is used in the evaluation of the policy.booleanSetting this to true means that all values are denied.static final com.google.protobuf.Descriptors.Descriptorcom.google.protobuf.Descriptors.DescriptorbooleanIf `true`, then the policy is enforced.com.google.protobuf.StructOptional.com.google.protobuf.Struct.BuilderOptional.com.google.protobuf.StructOrBuilderOptional.List of values to be used for this policy rule.List 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.booleanOptional.booleanList of values to be used for this policy rule.protected com.google.protobuf.GeneratedMessage.FieldAccessorTablefinal booleanmergeCondition(Expr value) A condition which determines whether this rule is used in the evaluation of the policy.mergeFrom(PolicySpec.PolicyRule other) mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) mergeFrom(com.google.protobuf.Message other) mergeParameters(com.google.protobuf.Struct value) Optional.List of values to be used for this policy rule.setAllowAll(boolean value) Setting this to true means that all values are allowed.setCondition(Expr value) A condition which determines whether this rule is used in the evaluation of the policy.setCondition(Expr.Builder builderForValue) A condition which determines whether this rule is used in the evaluation of the policy.setDenyAll(boolean value) Setting this to true means that all values are denied.setEnforce(boolean value) If `true`, then the policy is enforced.setParameters(com.google.protobuf.Struct value) Optional.setParameters(com.google.protobuf.Struct.Builder builderForValue) Optional.List of values to be used for this policy rule.setValues(PolicySpec.PolicyRule.StringValues.Builder builderForValue) List of values to be used for this policy rule.Methods inherited from class com.google.protobuf.GeneratedMessage.Builder
addRepeatedField, clearField, clearOneof, clone, getAllFields, getField, getFieldBuilder, getOneofFieldDescriptor, getParentForChildren, getRepeatedField, getRepeatedFieldBuilder, getRepeatedFieldCount, getUnknownFields, getUnknownFieldSetBuilder, hasField, hasOneof, internalGetMapField, internalGetMapFieldReflection, internalGetMutableMapField, internalGetMutableMapFieldReflection, isClean, markClean, mergeUnknownFields, mergeUnknownLengthDelimitedField, mergeUnknownVarintField, newBuilderForField, onBuilt, onChanged, parseUnknownField, setField, setRepeatedField, setUnknownFields, setUnknownFieldSetBuilder, setUnknownFieldsProto3Methods inherited from class com.google.protobuf.AbstractMessage.Builder
findInitializationErrors, getInitializationErrorString, internalMergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, newUninitializedMessageException, toStringMethods inherited from class com.google.protobuf.AbstractMessageLite.Builder
addAll, addAll, mergeDelimitedFrom, mergeDelimitedFrom, mergeFrom, newUninitializedMessageExceptionMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.google.protobuf.Message.Builder
mergeDelimitedFrom, mergeDelimitedFromMethods inherited from interface com.google.protobuf.MessageLite.Builder
mergeFromMethods inherited from interface com.google.protobuf.MessageOrBuilder
findInitializationErrors, getAllFields, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof
-
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.Builder<PolicySpec.PolicyRule.Builder>
-
clear
- Specified by:
clearin interfacecom.google.protobuf.Message.Builder- Specified by:
clearin interfacecom.google.protobuf.MessageLite.Builder- Overrides:
clearin classcom.google.protobuf.GeneratedMessage.Builder<PolicySpec.PolicyRule.Builder>
-
getDescriptorForType
public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()- Specified by:
getDescriptorForTypein interfacecom.google.protobuf.Message.Builder- Specified by:
getDescriptorForTypein interfacecom.google.protobuf.MessageOrBuilder- Overrides:
getDescriptorForTypein classcom.google.protobuf.GeneratedMessage.Builder<PolicySpec.PolicyRule.Builder>
-
getDefaultInstanceForType
- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageLiteOrBuilder- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageOrBuilder
-
build
- Specified by:
buildin interfacecom.google.protobuf.Message.Builder- Specified by:
buildin interfacecom.google.protobuf.MessageLite.Builder
-
buildPartial
- Specified by:
buildPartialin interfacecom.google.protobuf.Message.Builder- Specified by:
buildPartialin interfacecom.google.protobuf.MessageLite.Builder
-
mergeFrom
- Specified by:
mergeFromin interfacecom.google.protobuf.Message.Builder- Overrides:
mergeFromin classcom.google.protobuf.AbstractMessage.Builder<PolicySpec.PolicyRule.Builder>
-
mergeFrom
-
isInitialized
public final boolean isInitialized()- Specified by:
isInitializedin interfacecom.google.protobuf.MessageLiteOrBuilder- Overrides:
isInitializedin classcom.google.protobuf.GeneratedMessage.Builder<PolicySpec.PolicyRule.Builder>
-
mergeFrom
public PolicySpec.PolicyRule.Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException - Specified by:
mergeFromin interfacecom.google.protobuf.Message.Builder- Specified by:
mergeFromin interfacecom.google.protobuf.MessageLite.Builder- Overrides:
mergeFromin classcom.google.protobuf.AbstractMessage.Builder<PolicySpec.PolicyRule.Builder>- Throws:
IOException
-
getKindCase
- Specified by:
getKindCasein interfacePolicySpec.PolicyRuleOrBuilder
-
clearKind
-
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.
-
setValues
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; -
setValues
public PolicySpec.PolicyRule.Builder setValues(PolicySpec.PolicyRule.StringValues.Builder builderForValue) 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; -
mergeValues
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; -
clearValues
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; -
getValuesBuilder
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; -
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.
-
setAllowAll
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;- Parameters:
value- The allowAll to set.- Returns:
- This builder for chaining.
-
clearAllowAll
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;- Returns:
- This builder for chaining.
-
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.
-
setDenyAll
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;- Parameters:
value- The denyAll to set.- Returns:
- This builder for chaining.
-
clearDenyAll
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;- Returns:
- This builder for chaining.
-
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.
-
setEnforce
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;- Parameters:
value- The enforce to set.- Returns:
- This builder for chaining.
-
clearEnforce
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;- Returns:
- This builder for chaining.
-
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.
-
setCondition
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; -
setCondition
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; -
mergeCondition
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; -
clearCondition
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; -
getConditionBuilder
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; -
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.
-
setParameters
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]; -
setParameters
public PolicySpec.PolicyRule.Builder setParameters(com.google.protobuf.Struct.Builder builderForValue) 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]; -
mergeParameters
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]; -
clearParameters
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]; -
getParametersBuilder
public com.google.protobuf.Struct.Builder getParametersBuilder()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]; -
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
-