Class PolicyRule.Builder (0.6.0)

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

A rule used to express this policy.

Protobuf type google.cloud.securityposture.v1.PolicyRule

Implements

PolicyRuleOrBuilder

Static Methods

getDescriptor()

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

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

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

build()

public PolicyRule build()
Returns
TypeDescription
PolicyRule

buildPartial()

public PolicyRule buildPartial()
Returns
TypeDescription
PolicyRule

clear()

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

clearAllowAll()

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

This builder for chaining.

clearCondition()

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

clearDenyAll()

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

This builder for chaining.

clearEnforce()

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

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

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

clearKind()

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

clearOneof(Descriptors.OneofDescriptor oneof)

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

clearValues()

public PolicyRule.Builder clearValues()

List of values to be used for this policy rule. This field can be set only in policies for list constraints.

.google.cloud.securityposture.v1.PolicyRule.StringValues values = 1;

Returns
TypeDescription
PolicyRule.Builder

clone()

public PolicyRule.Builder clone()
Returns
TypeDescription
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 PolicyRule getDefaultInstanceForType()
Returns
TypeDescription
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 PolicyRule.KindCase getKindCase()
Returns
TypeDescription
PolicyRule.KindCase

getValues()

public PolicyRule.StringValues getValues()

List of values to be used for this policy rule. This field can be set only in policies for list constraints.

.google.cloud.securityposture.v1.PolicyRule.StringValues values = 1;

Returns
TypeDescription
PolicyRule.StringValues

The values.

getValuesBuilder()

public PolicyRule.StringValues.Builder getValuesBuilder()

List of values to be used for this policy rule. This field can be set only in policies for list constraints.

.google.cloud.securityposture.v1.PolicyRule.StringValues values = 1;

Returns
TypeDescription
PolicyRule.StringValues.Builder

getValuesOrBuilder()

public 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.securityposture.v1.PolicyRule.StringValues values = 1;

Returns
TypeDescription
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 policy rule. This field can be set only in policies for list constraints.

.google.cloud.securityposture.v1.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 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
PolicyRule.Builder

mergeFrom(PolicyRule other)

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

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

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

mergeFrom(Message other)

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

mergeUnknownFields(UnknownFieldSet unknownFields)

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

mergeValues(PolicyRule.StringValues value)

public PolicyRule.Builder mergeValues(PolicyRule.StringValues value)

List of values to be used for this policy rule. This field can be set only in policies for list constraints.

.google.cloud.securityposture.v1.PolicyRule.StringValues values = 1;

Parameter
NameDescription
valuePolicyRule.StringValues
Returns
TypeDescription
PolicyRule.Builder

setAllowAll(boolean value)

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

This builder for chaining.

setCondition(Expr value)

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

setCondition(Expr.Builder builderForValue)

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

setDenyAll(boolean value)

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

This builder for chaining.

setEnforce(boolean value)

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

This builder for chaining.

setField(Descriptors.FieldDescriptor field, Object value)

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

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

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

setUnknownFields(UnknownFieldSet unknownFields)

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

setValues(PolicyRule.StringValues value)

public PolicyRule.Builder setValues(PolicyRule.StringValues value)

List of values to be used for this policy rule. This field can be set only in policies for list constraints.

.google.cloud.securityposture.v1.PolicyRule.StringValues values = 1;

Parameter
NameDescription
valuePolicyRule.StringValues
Returns
TypeDescription
PolicyRule.Builder

setValues(PolicyRule.StringValues.Builder builderForValue)

public PolicyRule.Builder setValues(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.securityposture.v1.PolicyRule.StringValues values = 1;

Parameter
NameDescription
builderForValuePolicyRule.StringValues.Builder
Returns
TypeDescription
PolicyRule.Builder