# Google Cloud Org Policy V2 Client - Class CreateCustomConstraintRequest (1.3.3)

1.3.3 (latest) 1.3.2 1.2.2 1.1.3 1.0.0 0.7.0 0.6.5 0.5.3 0.4.2 0.3.7 Reference documentation and code samples for the Google Cloud Org Policy V2 Client class CreateCustomConstraintRequest.

The request sent to the [CreateCustomConstraintRequest](https://docs.cloud.google.com/php/docs/reference/cloud-org-policy/latest/V2.Client.OrgPolicyClient#_Google_Cloud_OrgPolicy_V2_Client_OrgPolicyClient__createCustomConstraint__) method.

Generated from protobuf message `google.cloud.orgpolicy.v2.CreateCustomConstraintRequest`

## Namespace

Google \\ Cloud \\ OrgPolicy \\ V2

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ parent` | `string` Required. Must be in the following form: \* \* `organizations/{organization_id}` |
| `↳ custom_constraint` | `https://docs.cloud.google.com/php/docs/reference/cloud-org-policy/latest/V2.CustomConstraint` Required. Custom constraint to create. |

### getParent

Required. Must be in the following form:

- `organizations/{organization_id}`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setParent

Required. Must be in the following form:

- `organizations/{organization_id}`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getCustomConstraint

Required. Custom constraint to create.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-org-policy/latest/V2.CustomConstraint|null` |   |

### hasCustomConstraint

### clearCustomConstraint

### setCustomConstraint

Required. Custom constraint to create.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-org-policy/latest/V2.CustomConstraint` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### static::build

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `parent` | `string` Required. Must be in the following form: - - `organizations/{organization_id}` Please see OrgPolicyClient::organizationName() for help formatting this field. |
| `customConstraint` | `https://docs.cloud.google.com/php/docs/reference/cloud-org-policy/latest/V2.CustomConstraint` Required. Custom constraint to create. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-org-policy/latest/V2.CreateCustomConstraintRequest` |   |