Google Cloud Org Policy V2 Client - Class PolicyRule (0.5.3)

Reference documentation and code samples for the Google Cloud Org Policy V2 Client class PolicyRule.

A rule used to express this policy.

Generated from protobuf message google.cloud.orgpolicy.v2.PolicySpec.PolicyRule

Namespace

Google \ Cloud \ OrgPolicy \ V2 \ PolicySpec

Methods

__construct

Constructor.

Parameters
NameDescription
data array

Optional. Data for populating the Message object.

↳ values Google\Cloud\OrgPolicy\V2\PolicySpec\PolicyRule\StringValues

List of values to be used for this PolicyRule. This field can be set only in Policies for list constraints.

↳ allow_all bool

Setting this to true means that all values are allowed. This field can be set only in Policies for list constraints.

↳ deny_all bool

Setting this to true means that all values are denied. This field can be set only in Policies for list constraints.

↳ enforce bool

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.

↳ condition Google\Type\Expr

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')".

getValues

List of values to be used for this PolicyRule. This field can be set only in Policies for list constraints.

Returns
TypeDescription
Google\Cloud\OrgPolicy\V2\PolicySpec\PolicyRule\StringValues|null

hasValues

setValues

List of values to be used for this PolicyRule. This field can be set only in Policies for list constraints.

Parameter
NameDescription
var Google\Cloud\OrgPolicy\V2\PolicySpec\PolicyRule\StringValues
Returns
TypeDescription
$this

getAllowAll

Setting this to true means that all values are allowed. This field can be set only in Policies for list constraints.

Returns
TypeDescription
bool

hasAllowAll

setAllowAll

Setting this to true means that all values are allowed. This field can be set only in Policies for list constraints.

Parameter
NameDescription
var bool
Returns
TypeDescription
$this

getDenyAll

Setting this to true means that all values are denied. This field can be set only in Policies for list constraints.

Returns
TypeDescription
bool

hasDenyAll

setDenyAll

Setting this to true means that all values are denied. This field can be set only in Policies for list constraints.

Parameter
NameDescription
var bool
Returns
TypeDescription
$this

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.

Returns
TypeDescription
bool

hasEnforce

setEnforce

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.

Parameter
NameDescription
var bool
Returns
TypeDescription
$this

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')".

Returns
TypeDescription
Google\Type\Expr|null

hasCondition

clearCondition

setCondition

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')".

Parameter
NameDescription
var Google\Type\Expr
Returns
TypeDescription
$this

getKind

Returns
TypeDescription
string