# Policy Simulator V1 API - Class Google::Cloud::OrgPolicy::V2::PolicySpec::PolicyRule (v1.9.0)

1.9.0 (latest) 1.8.1 1.7.0 1.6.1 1.5.0 1.4.0 1.3.0 1.2.1 1.1.0 1.0.1 0.4.0 0.3.2 0.2.0 0.1.1 Reference documentation and code samples for the Policy Simulator V1 API class Google::Cloud::OrgPolicy::V2::PolicySpec::PolicyRule.

A rule used to express this policy.

## Inherits

- Object

## Extended By

- Google::Protobuf::MessageExts::ClassMethods

## Includes

- Google::Protobuf::MessageExts

## Methods

### #allow_all

    def allow_all() -> ::Boolean

**Returns**

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

  Note: The following fields are mutually exclusive: `allow_all`, `values`, `deny_all`, `enforce`. If a field in that set is populated, all other fields in the set will automatically be cleared.

### #allow_all=

    def allow_all=(value) -> ::Boolean

**Parameter**

- **value** (::Boolean) --- Setting this to true means that all values are allowed. This field can be set only in policies for list constraints.


  Note: The following fields are mutually exclusive: `allow_all`, `values`, `deny_all`, `enforce`. If a field in that set is populated, all other fields in the set will automatically be cleared.
**Returns**

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

  Note: The following fields are mutually exclusive: `allow_all`, `values`, `deny_all`, `enforce`. If a field in that set is populated, all other fields in the set will automatically be cleared.

### #condition

    def condition() -> ::Google::Type::Expr

**Returns**

- ([::Google::Type::Expr](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-policy_simulator-v1/latest/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('

### #condition=

    def condition=(value) -> ::Google::Type::Expr

**Parameter**

- **value** ([::Google::Type::Expr](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-policy_simulator-v1/latest/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('
**Returns**

- ([::Google::Type::Expr](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-policy_simulator-v1/latest/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('

### #deny_all

    def deny_all() -> ::Boolean

**Returns**

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

  Note: The following fields are mutually exclusive: `deny_all`, `values`, `allow_all`, `enforce`. If a field in that set is populated, all other fields in the set will automatically be cleared.

### #deny_all=

    def deny_all=(value) -> ::Boolean

**Parameter**

- **value** (::Boolean) --- Setting this to true means that all values are denied. This field can be set only in policies for list constraints.


  Note: The following fields are mutually exclusive: `deny_all`, `values`, `allow_all`, `enforce`. If a field in that set is populated, all other fields in the set will automatically be cleared.
**Returns**

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

  Note: The following fields are mutually exclusive: `deny_all`, `values`, `allow_all`, `enforce`. If a field in that set is populated, all other fields in the set will automatically be cleared.

### #enforce

    def enforce() -> ::Boolean

**Returns**

- (::Boolean) --- 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.


  Note: The following fields are mutually exclusive: `enforce`, `values`, `allow_all`, `deny_all`. If a field in that set is populated, all other fields in the set will automatically be cleared.

### #enforce=

    def enforce=(value) -> ::Boolean

**Parameter**

- **value** (::Boolean) --- 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.


  Note: The following fields are mutually exclusive: `enforce`, `values`, `allow_all`, `deny_all`. If a field in that set is populated, all other fields in the set will automatically be cleared.
**Returns**

- (::Boolean) --- 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.


  Note: The following fields are mutually exclusive: `enforce`, `values`, `allow_all`, `deny_all`. If a field in that set is populated, all other fields in the set will automatically be cleared.

### #parameters

    def parameters() -> ::Google::Protobuf::Struct

**Returns**

- ([::Google::Protobuf::Struct](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-policy_simulator-v1/latest/Google-Protobuf-Struct)) --- 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 }

### #parameters=

    def parameters=(value) -> ::Google::Protobuf::Struct

**Parameter**

- **value** ([::Google::Protobuf::Struct](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-policy_simulator-v1/latest/Google-Protobuf-Struct)) --- 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 }
**Returns**

- ([::Google::Protobuf::Struct](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-policy_simulator-v1/latest/Google-Protobuf-Struct)) --- 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 }

### #values

    def values() -> ::Google::Cloud::OrgPolicy::V2::PolicySpec::PolicyRule::StringValues

**Returns**

- ([::Google::Cloud::OrgPolicy::V2::PolicySpec::PolicyRule::StringValues](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-policy_simulator-v1/latest/Google-Cloud-OrgPolicy-V2-PolicySpec-PolicyRule-StringValues)) --- List of values to be used for this policy rule. This field can be set only in policies for list constraints.


  Note: The following fields are mutually exclusive: `values`, `allow_all`, `deny_all`, `enforce`. If a field in that set is populated, all other fields in the set will automatically be cleared.

### #values=

    def values=(value) -> ::Google::Cloud::OrgPolicy::V2::PolicySpec::PolicyRule::StringValues

**Parameter**

- **value** ([::Google::Cloud::OrgPolicy::V2::PolicySpec::PolicyRule::StringValues](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-policy_simulator-v1/latest/Google-Cloud-OrgPolicy-V2-PolicySpec-PolicyRule-StringValues)) --- List of values to be used for this policy rule. This field can be set only in policies for list constraints.


  Note: The following fields are mutually exclusive: `values`, `allow_all`, `deny_all`, `enforce`. If a field in that set is populated, all other fields in the set will automatically be cleared.
**Returns**

- ([::Google::Cloud::OrgPolicy::V2::PolicySpec::PolicyRule::StringValues](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-policy_simulator-v1/latest/Google-Cloud-OrgPolicy-V2-PolicySpec-PolicyRule-StringValues)) --- List of values to be used for this policy rule. This field can be set only in policies for list constraints.


  Note: The following fields are mutually exclusive: `values`, `allow_all`, `deny_all`, `enforce`. If a field in that set is populated, all other fields in the set will automatically be cleared.