public sealed class PolicySpec.Types.PolicyRule : IMessage<PolicySpec.Types.PolicyRule>, IEquatable<PolicySpec.Types.PolicyRule>, IDeepCloneable<PolicySpec.Types.PolicyRule>, IBufferMessage, IMessageReference documentation and code samples for the Organization Policy v2 API class PolicySpec.Types.PolicyRule.
A rule used to express this policy.
Implements
IMessagePolicySpecTypesPolicyRule, IEquatablePolicySpecTypesPolicyRule, IDeepCloneablePolicySpecTypesPolicyRule, IBufferMessage, IMessageNamespace
Google.Cloud.OrgPolicy.V2Assembly
Google.Cloud.OrgPolicy.V2.dll
Constructors
PolicyRule()
public PolicyRule()PolicyRule(PolicyRule)
public PolicyRule(PolicySpec.Types.PolicyRule other)| Parameter | |
|---|---|
| Name | Description | 
other | 
        PolicySpecTypesPolicyRule | 
      
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 | |
|---|---|
| Type | Description | 
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 | |
|---|---|
| Type | Description | 
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 | |
|---|---|
| Type | Description | 
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 | |
|---|---|
| Type | Description | 
bool | 
        |
HasAllowAll
public bool HasAllowAll { get; }Gets whether the "allow_all" field is set
| Property Value | |
|---|---|
| Type | Description | 
bool | 
        |
HasDenyAll
public bool HasDenyAll { get; }Gets whether the "deny_all" field is set
| Property Value | |
|---|---|
| Type | Description | 
bool | 
        |
HasEnforce
public bool HasEnforce { get; }Gets whether the "enforce" field is set
| Property Value | |
|---|---|
| Type | Description | 
bool | 
        |
KindCase
public PolicySpec.Types.PolicyRule.KindOneofCase KindCase { get; }| Property Value | |
|---|---|
| Type | Description | 
PolicySpecTypesPolicyRuleKindOneofCase | 
        |
Parameters
public Struct Parameters { get; set; }Optional. Required for managed constraints if parameters are defined. Passes parameter values when policy enforcement is enabled. Ensure that parameter value types match those defined in the constraint definition. For example: { "allowedLocations" : ["us-east1", "us-west1"], "allowAll" : true }
| Property Value | |
|---|---|
| Type | Description | 
Struct | 
        |
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 | |
|---|---|
| Type | Description | 
PolicySpecTypesPolicyRuleTypesStringValues | 
        |