Class PolicySpec.PolicyRule (2.0.10)

public static final class PolicySpec.PolicyRule extends GeneratedMessageV3 implements PolicySpec.PolicyRuleOrBuilder

A rule used to express this policy.

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

Static Fields

ALLOW_ALL_FIELD_NUMBER

public static final int ALLOW_ALL_FIELD_NUMBER
Field Value
TypeDescription
int

CONDITION_FIELD_NUMBER

public static final int CONDITION_FIELD_NUMBER
Field Value
TypeDescription
int

DENY_ALL_FIELD_NUMBER

public static final int DENY_ALL_FIELD_NUMBER
Field Value
TypeDescription
int

ENFORCE_FIELD_NUMBER

public static final int ENFORCE_FIELD_NUMBER
Field Value
TypeDescription
int

VALUES_FIELD_NUMBER

public static final int VALUES_FIELD_NUMBER
Field Value
TypeDescription
int

Static Methods

getDefaultInstance()

public static PolicySpec.PolicyRule getDefaultInstance()
Returns
TypeDescription
PolicySpec.PolicyRule

getDescriptor()

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

newBuilder()

public static PolicySpec.PolicyRule.Builder newBuilder()
Returns
TypeDescription
PolicySpec.PolicyRule.Builder

newBuilder(PolicySpec.PolicyRule prototype)

public static PolicySpec.PolicyRule.Builder newBuilder(PolicySpec.PolicyRule prototype)
Parameter
NameDescription
prototypePolicySpec.PolicyRule
Returns
TypeDescription
PolicySpec.PolicyRule.Builder

parseDelimitedFrom(InputStream input)

public static PolicySpec.PolicyRule parseDelimitedFrom(InputStream input)
Parameter
NameDescription
inputInputStream
Returns
TypeDescription
PolicySpec.PolicyRule
Exceptions
TypeDescription
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static PolicySpec.PolicyRule parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
PolicySpec.PolicyRule
Exceptions
TypeDescription
IOException

parseFrom(byte[] data)

public static PolicySpec.PolicyRule parseFrom(byte[] data)
Parameter
NameDescription
databyte[]
Returns
TypeDescription
PolicySpec.PolicyRule
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static PolicySpec.PolicyRule parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
databyte[]
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
PolicySpec.PolicyRule
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteString data)

public static PolicySpec.PolicyRule parseFrom(ByteString data)
Parameter
NameDescription
dataByteString
Returns
TypeDescription
PolicySpec.PolicyRule
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static PolicySpec.PolicyRule parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
dataByteString
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
PolicySpec.PolicyRule
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static PolicySpec.PolicyRule parseFrom(CodedInputStream input)
Parameter
NameDescription
inputCodedInputStream
Returns
TypeDescription
PolicySpec.PolicyRule
Exceptions
TypeDescription
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static PolicySpec.PolicyRule parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
PolicySpec.PolicyRule
Exceptions
TypeDescription
IOException

parseFrom(InputStream input)

public static PolicySpec.PolicyRule parseFrom(InputStream input)
Parameter
NameDescription
inputInputStream
Returns
TypeDescription
PolicySpec.PolicyRule
Exceptions
TypeDescription
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static PolicySpec.PolicyRule parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
PolicySpec.PolicyRule
Exceptions
TypeDescription
IOException

parseFrom(ByteBuffer data)

public static PolicySpec.PolicyRule parseFrom(ByteBuffer data)
Parameter
NameDescription
dataByteBuffer
Returns
TypeDescription
PolicySpec.PolicyRule
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static PolicySpec.PolicyRule parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
dataByteBuffer
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
PolicySpec.PolicyRule
Exceptions
TypeDescription
InvalidProtocolBufferException

parser()

public static Parser<PolicySpec.PolicyRule> parser()
Returns
TypeDescription
Parser<PolicyRule>

Methods

equals(Object obj)

public boolean equals(Object obj)
Parameter
NameDescription
objObject
Returns
TypeDescription
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
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.matchLabels(key_name, value_name)", where key_name and value_name are the resource names for Label Keys and Values. These names are available from the Label Manager Service. An example expression is: "resource.matchLabels('labelKeys/123, 'labelValues/456')".

.google.type.Expr condition = 5;

Returns
TypeDescription
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.matchLabels(key_name, value_name)", where key_name and value_name are the resource names for Label Keys and Values. These names are available from the Label Manager Service. An example expression is: "resource.matchLabels('labelKeys/123, 'labelValues/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.

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

getParserForType()

public Parser<PolicySpec.PolicyRule> getParserForType()
Returns
TypeDescription
Parser<PolicyRule>
Overrides

getSerializedSize()

public int getSerializedSize()
Returns
TypeDescription
int
Overrides

getUnknownFields()

public final UnknownFieldSet getUnknownFields()
Returns
TypeDescription
UnknownFieldSet
Overrides

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.

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.matchLabels(key_name, value_name)", where key_name and value_name are the resource names for Label Keys and Values. These names are available from the Label Manager Service. An example expression is: "resource.matchLabels('labelKeys/123, 'labelValues/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.

hashCode()

public int hashCode()
Returns
TypeDescription
int
Overrides

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

newBuilderForType()

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

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protected PolicySpec.PolicyRule.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
NameDescription
parentBuilderParent
Returns
TypeDescription
PolicySpec.PolicyRule.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
NameDescription
unusedUnusedPrivateParameter
Returns
TypeDescription
Object
Overrides

toBuilder()

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

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
NameDescription
outputCodedOutputStream
Overrides Exceptions
TypeDescription
IOException