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
Inheritance
Object > AbstractMessageLite.Builder<MessageType,BuilderType> > AbstractMessage.Builder<BuilderType> > GeneratedMessageV3.Builder > PolicyRule.BuilderImplements
PolicyRuleOrBuilderStatic Methods
getDescriptor()
public static final Descriptors.Descriptor getDescriptor()
Returns | |
---|---|
Type | Description |
Descriptor |
Methods
addRepeatedField(Descriptors.FieldDescriptor field, Object value)
public PolicyRule.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters | |
---|---|
Name | Description |
field | FieldDescriptor |
value | Object |
Returns | |
---|---|
Type | Description |
PolicyRule.Builder |
build()
public PolicyRule build()
Returns | |
---|---|
Type | Description |
PolicyRule |
buildPartial()
public PolicyRule buildPartial()
Returns | |
---|---|
Type | Description |
PolicyRule |
clear()
public PolicyRule.Builder clear()
Returns | |
---|---|
Type | Description |
PolicyRule.Builder |
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 | |
---|---|
Type | Description |
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 | |
---|---|
Type | Description |
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 | |
---|---|
Type | Description |
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 | |
---|---|
Type | Description |
PolicyRule.Builder | This builder for chaining. |
clearField(Descriptors.FieldDescriptor field)
public PolicyRule.Builder clearField(Descriptors.FieldDescriptor field)
Parameter | |
---|---|
Name | Description |
field | FieldDescriptor |
Returns | |
---|---|
Type | Description |
PolicyRule.Builder |
clearKind()
public PolicyRule.Builder clearKind()
Returns | |
---|---|
Type | Description |
PolicyRule.Builder |
clearOneof(Descriptors.OneofDescriptor oneof)
public PolicyRule.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter | |
---|---|
Name | Description |
oneof | OneofDescriptor |
Returns | |
---|---|
Type | Description |
PolicyRule.Builder |
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 | |
---|---|
Type | Description |
PolicyRule.Builder |
clone()
public PolicyRule.Builder clone()
Returns | |
---|---|
Type | Description |
PolicyRule.Builder |
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 | |
---|---|
Type | Description |
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 | |
---|---|
Type | Description |
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 | |
---|---|
Type | Description |
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 | |
---|---|
Type | Description |
com.google.type.ExprOrBuilder |
getDefaultInstanceForType()
public PolicyRule getDefaultInstanceForType()
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Type | Description |
boolean | The denyAll. |
getDescriptorForType()
public Descriptors.Descriptor getDescriptorForType()
Returns | |
---|---|
Type | Description |
Descriptor |
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 | |
---|---|
Type | Description |
boolean | The enforce. |
getKindCase()
public PolicyRule.KindCase getKindCase()
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Type | Description |
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 | |
---|---|
Type | Description |
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 | |
---|---|
Type | Description |
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 | |
---|---|
Type | Description |
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 | |
---|---|
Type | Description |
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 | |
---|---|
Type | Description |
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 | |
---|---|
Type | Description |
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 | |
---|---|
Type | Description |
boolean | Whether the values field is set. |
internalGetFieldAccessorTable()
protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns | |
---|---|
Type | Description |
FieldAccessorTable |
isInitialized()
public final boolean isInitialized()
Returns | |
---|---|
Type | Description |
boolean |
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 | |
---|---|
Name | Description |
value | com.google.type.Expr |
Returns | |
---|---|
Type | Description |
PolicyRule.Builder |
mergeFrom(PolicyRule other)
public PolicyRule.Builder mergeFrom(PolicyRule other)
Parameter | |
---|---|
Name | Description |
other | PolicyRule |
Returns | |
---|---|
Type | Description |
PolicyRule.Builder |
mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
public PolicyRule.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters | |
---|---|
Name | Description |
input | CodedInputStream |
extensionRegistry | ExtensionRegistryLite |
Returns | |
---|---|
Type | Description |
PolicyRule.Builder |
Exceptions | |
---|---|
Type | Description |
IOException |
mergeFrom(Message other)
public PolicyRule.Builder mergeFrom(Message other)
Parameter | |
---|---|
Name | Description |
other | Message |
Returns | |
---|---|
Type | Description |
PolicyRule.Builder |
mergeUnknownFields(UnknownFieldSet unknownFields)
public final PolicyRule.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter | |
---|---|
Name | Description |
unknownFields | UnknownFieldSet |
Returns | |
---|---|
Type | Description |
PolicyRule.Builder |
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 | |
---|---|
Name | Description |
value | PolicyRule.StringValues |
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
value | boolean The allowAll to set. |
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
value | com.google.type.Expr |
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
builderForValue | com.google.type.Expr.Builder |
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
value | boolean The denyAll to set. |
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
value | boolean The enforce to set. |
Returns | |
---|---|
Type | Description |
PolicyRule.Builder | This builder for chaining. |
setField(Descriptors.FieldDescriptor field, Object value)
public PolicyRule.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters | |
---|---|
Name | Description |
field | FieldDescriptor |
value | Object |
Returns | |
---|---|
Type | Description |
PolicyRule.Builder |
setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
public PolicyRule.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters | |
---|---|
Name | Description |
field | FieldDescriptor |
index | int |
value | Object |
Returns | |
---|---|
Type | Description |
PolicyRule.Builder |
setUnknownFields(UnknownFieldSet unknownFields)
public final PolicyRule.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter | |
---|---|
Name | Description |
unknownFields | UnknownFieldSet |
Returns | |
---|---|
Type | Description |
PolicyRule.Builder |
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 | |
---|---|
Name | Description |
value | PolicyRule.StringValues |
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
builderForValue | PolicyRule.StringValues.Builder |
Returns | |
---|---|
Type | Description |
PolicyRule.Builder |