Class PolicySpec.PolicyRule.Builder (2.31.0)

public static final class PolicySpec.PolicyRule.Builder extends GeneratedMessageV3.Builder<PolicySpec.PolicyRule.Builder> implements PolicySpec.PolicyRuleOrBuilder

A rule used to express this policy.

Protobuf type google.cloud.orgpolicy.v2.PolicySpec.PolicyRule

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
TypeDescription
Descriptor

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public PolicySpec.PolicyRule.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
PolicySpec.PolicyRule.Builder
Overrides

build()

public PolicySpec.PolicyRule build()
Returns
TypeDescription
PolicySpec.PolicyRule

buildPartial()

public PolicySpec.PolicyRule buildPartial()
Returns
TypeDescription
PolicySpec.PolicyRule

clear()

public PolicySpec.PolicyRule.Builder clear()
Returns
TypeDescription
PolicySpec.PolicyRule.Builder
Overrides

clearAllowAll()

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

This builder for chaining.

clearCondition()

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

Returns
TypeDescription
PolicySpec.PolicyRule.Builder

clearDenyAll()

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

This builder for chaining.

clearEnforce()

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

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

public PolicySpec.PolicyRule.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
NameDescription
fieldFieldDescriptor
Returns
TypeDescription
PolicySpec.PolicyRule.Builder
Overrides

clearKind()

public PolicySpec.PolicyRule.Builder clearKind()
Returns
TypeDescription
PolicySpec.PolicyRule.Builder

clearOneof(Descriptors.OneofDescriptor oneof)

public PolicySpec.PolicyRule.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
NameDescription
oneofOneofDescriptor
Returns
TypeDescription
PolicySpec.PolicyRule.Builder
Overrides

clearValues()

public PolicySpec.PolicyRule.Builder clearValues()

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;

Returns
TypeDescription
PolicySpec.PolicyRule.Builder

clone()

public PolicySpec.PolicyRule.Builder clone()
Returns
TypeDescription
PolicySpec.PolicyRule.Builder
Overrides

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;

Returns
TypeDescription
boolean

The allowAll.

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;

Returns
TypeDescription
com.google.type.Expr

The condition.

getConditionBuilder()

public Expr.Builder 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;

Returns
TypeDescription
com.google.type.Expr.Builder

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;

Returns
TypeDescription
com.google.type.ExprOrBuilder

getDefaultInstanceForType()

public PolicySpec.PolicyRule getDefaultInstanceForType()
Returns
TypeDescription
PolicySpec.PolicyRule

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;

Returns
TypeDescription
boolean

The denyAll.

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
Descriptor
Overrides

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;

Returns
TypeDescription
boolean

The enforce.

getKindCase()

public PolicySpec.PolicyRule.KindCase getKindCase()
Returns
TypeDescription
PolicySpec.PolicyRule.KindCase

getValues()

public PolicySpec.PolicyRule.StringValues getValues()

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;

Returns
TypeDescription
PolicySpec.PolicyRule.StringValues

The values.

getValuesBuilder()

public PolicySpec.PolicyRule.StringValues.Builder getValuesBuilder()

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;

Returns
TypeDescription
PolicySpec.PolicyRule.StringValues.Builder

getValuesOrBuilder()

public PolicySpec.PolicyRule.StringValuesOrBuilder getValuesOrBuilder()

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;

Returns
TypeDescription
PolicySpec.PolicyRule.StringValuesOrBuilder

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;

Returns
TypeDescription
boolean

Whether the allowAll field is set.

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;

Returns
TypeDescription
boolean

Whether the condition field is set.

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;

Returns
TypeDescription
boolean

Whether the denyAll field is set.

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;

Returns
TypeDescription
boolean

Whether the enforce field is set.

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;

Returns
TypeDescription
boolean

Whether the values field is set.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

mergeCondition(Expr value)

public PolicySpec.PolicyRule.Builder mergeCondition(Expr value)

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;

Parameter
NameDescription
valuecom.google.type.Expr
Returns
TypeDescription
PolicySpec.PolicyRule.Builder

mergeFrom(PolicySpec.PolicyRule other)

public PolicySpec.PolicyRule.Builder mergeFrom(PolicySpec.PolicyRule other)
Parameter
NameDescription
otherPolicySpec.PolicyRule
Returns
TypeDescription
PolicySpec.PolicyRule.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public PolicySpec.PolicyRule.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
PolicySpec.PolicyRule.Builder
Overrides
Exceptions
TypeDescription
IOException

mergeFrom(Message other)

public PolicySpec.PolicyRule.Builder mergeFrom(Message other)
Parameter
NameDescription
otherMessage
Returns
TypeDescription
PolicySpec.PolicyRule.Builder
Overrides

mergeUnknownFields(UnknownFieldSet unknownFields)

public final PolicySpec.PolicyRule.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
PolicySpec.PolicyRule.Builder
Overrides

mergeValues(PolicySpec.PolicyRule.StringValues value)

public PolicySpec.PolicyRule.Builder mergeValues(PolicySpec.PolicyRule.StringValues value)

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;

Parameter
NameDescription
valuePolicySpec.PolicyRule.StringValues
Returns
TypeDescription
PolicySpec.PolicyRule.Builder

setAllowAll(boolean value)

public PolicySpec.PolicyRule.Builder setAllowAll(boolean value)

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;

Parameter
NameDescription
valueboolean

The allowAll to set.

Returns
TypeDescription
PolicySpec.PolicyRule.Builder

This builder for chaining.

setCondition(Expr value)

public PolicySpec.PolicyRule.Builder setCondition(Expr value)

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;

Parameter
NameDescription
valuecom.google.type.Expr
Returns
TypeDescription
PolicySpec.PolicyRule.Builder

setCondition(Expr.Builder builderForValue)

public PolicySpec.PolicyRule.Builder setCondition(Expr.Builder builderForValue)

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;

Parameter
NameDescription
builderForValuecom.google.type.Expr.Builder
Returns
TypeDescription
PolicySpec.PolicyRule.Builder

setDenyAll(boolean value)

public PolicySpec.PolicyRule.Builder setDenyAll(boolean value)

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;

Parameter
NameDescription
valueboolean

The denyAll to set.

Returns
TypeDescription
PolicySpec.PolicyRule.Builder

This builder for chaining.

setEnforce(boolean value)

public PolicySpec.PolicyRule.Builder setEnforce(boolean value)

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;

Parameter
NameDescription
valueboolean

The enforce to set.

Returns
TypeDescription
PolicySpec.PolicyRule.Builder

This builder for chaining.

setField(Descriptors.FieldDescriptor field, Object value)

public PolicySpec.PolicyRule.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
PolicySpec.PolicyRule.Builder
Overrides

setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)

public PolicySpec.PolicyRule.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
NameDescription
fieldFieldDescriptor
indexint
valueObject
Returns
TypeDescription
PolicySpec.PolicyRule.Builder
Overrides

setUnknownFields(UnknownFieldSet unknownFields)

public final PolicySpec.PolicyRule.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
PolicySpec.PolicyRule.Builder
Overrides

setValues(PolicySpec.PolicyRule.StringValues value)

public PolicySpec.PolicyRule.Builder setValues(PolicySpec.PolicyRule.StringValues value)

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;

Parameter
NameDescription
valuePolicySpec.PolicyRule.StringValues
Returns
TypeDescription
PolicySpec.PolicyRule.Builder

setValues(PolicySpec.PolicyRule.StringValues.Builder builderForValue)

public PolicySpec.PolicyRule.Builder setValues(PolicySpec.PolicyRule.StringValues.Builder builderForValue)

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;

Parameter
NameDescription
builderForValuePolicySpec.PolicyRule.StringValues.Builder
Returns
TypeDescription
PolicySpec.PolicyRule.Builder