# Google Cloud BigQuery Data Policies V1 Client - Class CreateDataPolicyRequest (1.1.3)

1.1.3 (latest) 1.1.2 1.0.5 0.5.5 0.4.1 0.3.3 0.2.4 0.1.1 Reference documentation and code samples for the Google Cloud BigQuery Data Policies V1 Client class CreateDataPolicyRequest.

Request message for the CreateDataPolicy method.

Generated from protobuf message `google.cloud.bigquery.datapolicies.v1.CreateDataPolicyRequest`

## Namespace

Google \\ Cloud \\ BigQuery \\ DataPolicies \\ V1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ parent` | `string` Required. Resource name of the project that the data policy will belong to. The format is `projects/{project_number}/locations/{location_id}`. |
| `↳ data_policy` | `https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-datapolicies/latest/V1.DataPolicy` Required. The data policy to create. The `name` field does not need to be provided for the data policy creation. |

### getParent

Required. Resource name of the project that the data policy will belong to.

The format is `projects/{project_number}/locations/{location_id}`.

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

### setParent

Required. Resource name of the project that the data policy will belong to.

The format is `projects/{project_number}/locations/{location_id}`.

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

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

### getDataPolicy

Required. The data policy to create. The `name` field does not need to be
provided for the data policy creation.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-datapolicies/latest/V1.DataPolicy|null` |   |

### hasDataPolicy

### clearDataPolicy

### setDataPolicy

Required. The data policy to create. The `name` field does not need to be
provided for the data policy creation.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-datapolicies/latest/V1.DataPolicy` |

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

### static::build

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `parent` | `string` Required. Resource name of the project that the data policy will belong to. The format is `projects/{project_number}/locations/{location_id}`. Please see DataPolicyServiceClient::locationName() for help formatting this field. |
| `dataPolicy` | `https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-datapolicies/latest/V1.DataPolicy` Required. The data policy to create. The `name` field does not need to be provided for the data policy creation. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-datapolicies/latest/V1.CreateDataPolicyRequest` |   |