Class PolicyRule (0.10.0)

public final class PolicyRule extends GeneratedMessageV3 implements PolicyRuleOrBuilder

A rule used to express this policy.

Protobuf type google.cloud.securityposture.v1.PolicyRule

Implements

PolicyRuleOrBuilder

Static Fields

ALLOW_ALL_FIELD_NUMBER

public static final int ALLOW_ALL_FIELD_NUMBER
Field Value
Type Description
int

CONDITION_FIELD_NUMBER

public static final int CONDITION_FIELD_NUMBER
Field Value
Type Description
int

DENY_ALL_FIELD_NUMBER

public static final int DENY_ALL_FIELD_NUMBER
Field Value
Type Description
int

ENFORCE_FIELD_NUMBER

public static final int ENFORCE_FIELD_NUMBER
Field Value
Type Description
int

VALUES_FIELD_NUMBER

public static final int VALUES_FIELD_NUMBER
Field Value
Type Description
int

Static Methods

getDefaultInstance()

public static PolicyRule getDefaultInstance()
Returns
Type Description
PolicyRule

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
Type Description
Descriptor

newBuilder()

public static PolicyRule.Builder newBuilder()
Returns
Type Description
PolicyRule.Builder

newBuilder(PolicyRule prototype)

public static PolicyRule.Builder newBuilder(PolicyRule prototype)
Parameter
Name Description
prototype PolicyRule
Returns
Type Description
PolicyRule.Builder

parseDelimitedFrom(InputStream input)

public static PolicyRule parseDelimitedFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
PolicyRule
Exceptions
Type Description
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static PolicyRule parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
PolicyRule
Exceptions
Type Description
IOException

parseFrom(byte[] data)

public static PolicyRule parseFrom(byte[] data)
Parameter
Name Description
data byte[]
Returns
Type Description
PolicyRule
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static PolicyRule parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data byte[]
extensionRegistry ExtensionRegistryLite
Returns
Type Description
PolicyRule
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data)

public static PolicyRule parseFrom(ByteString data)
Parameter
Name Description
data ByteString
Returns
Type Description
PolicyRule
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static PolicyRule parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteString
extensionRegistry ExtensionRegistryLite
Returns
Type Description
PolicyRule
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static PolicyRule parseFrom(CodedInputStream input)
Parameter
Name Description
input CodedInputStream
Returns
Type Description
PolicyRule
Exceptions
Type Description
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static PolicyRule parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
PolicyRule
Exceptions
Type Description
IOException

parseFrom(InputStream input)

public static PolicyRule parseFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
PolicyRule
Exceptions
Type Description
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static PolicyRule parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
PolicyRule
Exceptions
Type Description
IOException

parseFrom(ByteBuffer data)

public static PolicyRule parseFrom(ByteBuffer data)
Parameter
Name Description
data ByteBuffer
Returns
Type Description
PolicyRule
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static PolicyRule parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteBuffer
extensionRegistry ExtensionRegistryLite
Returns
Type Description
PolicyRule
Exceptions
Type Description
InvalidProtocolBufferException

parser()

public static Parser<PolicyRule> parser()
Returns
Type Description
Parser<PolicyRule>

Methods

equals(Object obj)

public boolean equals(Object obj)
Parameter
Name Description
obj Object
Returns
Type Description
boolean
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
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.

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.

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

getParserForType()

public Parser<PolicyRule> getParserForType()
Returns
Type Description
Parser<PolicyRule>
Overrides

getSerializedSize()

public int getSerializedSize()
Returns
Type Description
int
Overrides

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.

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.

hashCode()

public int hashCode()
Returns
Type Description
int
Overrides

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

newBuilderForType()

public PolicyRule.Builder newBuilderForType()
Returns
Type Description
PolicyRule.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protected PolicyRule.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
Name Description
parent BuilderParent
Returns
Type Description
PolicyRule.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
Name Description
unused UnusedPrivateParameter
Returns
Type Description
Object
Overrides

toBuilder()

public PolicyRule.Builder toBuilder()
Returns
Type Description
PolicyRule.Builder

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
Name Description
output CodedOutputStream
Overrides
Exceptions
Type Description
IOException