# Policy Simulator V1 API - Class Google::Cloud::OrgPolicy::V2::Constraint::CustomConstraintDefinition (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::Constraint::CustomConstraintDefinition.

Custom constraint definition. Defines this as a managed constraint.

## Inherits

- Object

## Extended By

- Google::Protobuf::MessageExts::ClassMethods

## Includes

- Google::Protobuf::MessageExts

## Methods

### #action_type

    def action_type() -> ::Google::Cloud::OrgPolicy::V2::Constraint::CustomConstraintDefinition::ActionType

**Returns**

- ([::Google::Cloud::OrgPolicy::V2::Constraint::CustomConstraintDefinition::ActionType](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-policy_simulator-v1/latest/Google-Cloud-OrgPolicy-V2-Constraint-CustomConstraintDefinition-ActionType)) --- Allow or deny type.

### #action_type=

    def action_type=(value) -> ::Google::Cloud::OrgPolicy::V2::Constraint::CustomConstraintDefinition::ActionType

**Parameter**

- **value** ([::Google::Cloud::OrgPolicy::V2::Constraint::CustomConstraintDefinition::ActionType](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-policy_simulator-v1/latest/Google-Cloud-OrgPolicy-V2-Constraint-CustomConstraintDefinition-ActionType)) --- Allow or deny type.
**Returns**

- ([::Google::Cloud::OrgPolicy::V2::Constraint::CustomConstraintDefinition::ActionType](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-policy_simulator-v1/latest/Google-Cloud-OrgPolicy-V2-Constraint-CustomConstraintDefinition-ActionType)) --- Allow or deny type.

### #condition

    def condition() -> ::String

**Returns**

- (::String) --- Org policy condition/expression. For example: `resource.instanceName.matches("[production|test]_.*_(\d)+")` or, `resource.management.auto_upgrade == true`


  The max length of the condition is 1000 characters.

### #condition=

    def condition=(value) -> ::String

**Parameter**

- **value** (::String) --- Org policy condition/expression. For example: `resource.instanceName.matches("[production|test]_.*_(\d)+")` or, `resource.management.auto_upgrade == true`


  The max length of the condition is 1000 characters.
**Returns**

- (::String) --- Org policy condition/expression. For example: `resource.instanceName.matches("[production|test]_.*_(\d)+")` or, `resource.management.auto_upgrade == true`


  The max length of the condition is 1000 characters.

### #method_types

    def method_types() -> ::Array<::Google::Cloud::OrgPolicy::V2::Constraint::CustomConstraintDefinition::MethodType>

**Returns**

- (::Array\<[::Google::Cloud::OrgPolicy::V2::Constraint::CustomConstraintDefinition::MethodType](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-policy_simulator-v1/latest/Google-Cloud-OrgPolicy-V2-Constraint-CustomConstraintDefinition-MethodType)\>) --- All the operations being applied for this constraint.

### #method_types=

    def method_types=(value) -> ::Array<::Google::Cloud::OrgPolicy::V2::Constraint::CustomConstraintDefinition::MethodType>

**Parameter**

- **value** (::Array\<[::Google::Cloud::OrgPolicy::V2::Constraint::CustomConstraintDefinition::MethodType](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-policy_simulator-v1/latest/Google-Cloud-OrgPolicy-V2-Constraint-CustomConstraintDefinition-MethodType)\>) --- All the operations being applied for this constraint.
**Returns**

- (::Array\<[::Google::Cloud::OrgPolicy::V2::Constraint::CustomConstraintDefinition::MethodType](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-policy_simulator-v1/latest/Google-Cloud-OrgPolicy-V2-Constraint-CustomConstraintDefinition-MethodType)\>) --- All the operations being applied for this constraint.

### #parameters

    def parameters() -> ::Google::Protobuf::Map{::String => ::Google::Cloud::OrgPolicy::V2::Constraint::CustomConstraintDefinition::Parameter}

**Returns**

- (::Google::Protobuf::Map{::String =\> ::Google::Cloud::OrgPolicy::V2::Constraint::CustomConstraintDefinition::Parameter}) --- Stores the structure of [`Parameters`](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-policy_simulator-v1/latest/Google-Cloud-OrgPolicy-V2-Constraint-CustomConstraintDefinition-Parameter "Google::Cloud::OrgPolicy::V2::Constraint::CustomConstraintDefinition::Parameter (class)") used by the constraint condition. The key of `map` represents the name of the parameter.

### #parameters=

    def parameters=(value) -> ::Google::Protobuf::Map{::String => ::Google::Cloud::OrgPolicy::V2::Constraint::CustomConstraintDefinition::Parameter}

**Parameter**

- **value** (::Google::Protobuf::Map{::String =\> ::Google::Cloud::OrgPolicy::V2::Constraint::CustomConstraintDefinition::Parameter}) --- Stores the structure of [`Parameters`](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-policy_simulator-v1/latest/Google-Cloud-OrgPolicy-V2-Constraint-CustomConstraintDefinition-Parameter "Google::Cloud::OrgPolicy::V2::Constraint::CustomConstraintDefinition::Parameter (class)") used by the constraint condition. The key of `map` represents the name of the parameter.
**Returns**

- (::Google::Protobuf::Map{::String =\> ::Google::Cloud::OrgPolicy::V2::Constraint::CustomConstraintDefinition::Parameter}) --- Stores the structure of [`Parameters`](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-policy_simulator-v1/latest/Google-Cloud-OrgPolicy-V2-Constraint-CustomConstraintDefinition-Parameter "Google::Cloud::OrgPolicy::V2::Constraint::CustomConstraintDefinition::Parameter (class)") used by the constraint condition. The key of `map` represents the name of the parameter.

### #resource_types

    def resource_types() -> ::Array<::String>

**Returns**

- (::Array\<::String\>) --- The resource instance type on which this policy applies. Format will be
  of the form : `<service name>/<type>` Example:

  - `compute.googleapis.com/Instance`.

### #resource_types=

    def resource_types=(value) -> ::Array<::String>

**Parameter**

- **value** (::Array\<::String\>) ---

  The resource instance type on which this policy applies. Format will be
  of the form : `<service name>/<type>` Example:
  - `compute.googleapis.com/Instance`.
**Returns**

- (::Array\<::String\>) --- The resource instance type on which this policy applies. Format will be
  of the form : `<service name>/<type>` Example:

  - `compute.googleapis.com/Instance`.