Organization Policy v2 API - Class PolicySpec.Types.PolicyRule (2.3.0)

public sealed class PolicySpec.Types.PolicyRule : IMessage<PolicySpec.Types.PolicyRule>, IEquatable<PolicySpec.Types.PolicyRule>, IDeepCloneable<PolicySpec.Types.PolicyRule>, IBufferMessage, IMessage

Reference documentation and code samples for the Organization Policy v2 API class PolicySpec.Types.PolicyRule.

A rule used to express this policy.

Inheritance

object > PolicySpec.Types.PolicyRule

Namespace

Google.Cloud.OrgPolicy.V2

Assembly

Google.Cloud.OrgPolicy.V2.dll

Constructors

PolicyRule()

public PolicyRule()

PolicyRule(PolicyRule)

public PolicyRule(PolicySpec.Types.PolicyRule other)
Parameter
NameDescription
otherPolicySpecTypesPolicyRule

Properties

AllowAll

public bool AllowAll { get; set; }

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

Property Value
TypeDescription
bool

Condition

public Expr Condition { get; set; }

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

Property Value
TypeDescription
Expr

DenyAll

public bool DenyAll { get; set; }

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

Property Value
TypeDescription
bool

Enforce

public bool Enforce { get; set; }

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.

Property Value
TypeDescription
bool

HasAllowAll

public bool HasAllowAll { get; }

Gets whether the "allow_all" field is set

Property Value
TypeDescription
bool

HasDenyAll

public bool HasDenyAll { get; }

Gets whether the "deny_all" field is set

Property Value
TypeDescription
bool

HasEnforce

public bool HasEnforce { get; }

Gets whether the "enforce" field is set

Property Value
TypeDescription
bool

KindCase

public PolicySpec.Types.PolicyRule.KindOneofCase KindCase { get; }
Property Value
TypeDescription
PolicySpecTypesPolicyRuleKindOneofCase

Values

public PolicySpec.Types.PolicyRule.Types.StringValues Values { get; set; }

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

Property Value
TypeDescription
PolicySpecTypesPolicyRuleTypesStringValues