# Google Cloud BigQuery Data Policies V1 Client - Class DataPolicy (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 DataPolicy.

Represents the label-policy binding.

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

## Namespace

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

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ policy_tag` | `string` Policy tag resource name, in the format of `projects/{project_number}/locations/{location_id}/taxonomies/{taxonomy_id}/policyTags/{policyTag_id}`. |
| `↳ data_masking_policy` | `https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-datapolicies/latest/V1.DataMaskingPolicy` The data masking policy that specifies the data masking rule to use. |
| `↳ name` | `string` Output only. Resource name of this data policy, in the format of `projects/{project_number}/locations/{location_id}/dataPolicies/{data_policy_id}`. |
| `↳ data_policy_type` | `int` Type of data policy. |
| `↳ data_policy_id` | `string` User-assigned (human readable) ID of the data policy that needs to be unique within a project. Used as {data_policy_id} in part of the resource name. |

### getPolicyTag

Policy tag resource name, in the format of
`projects/{project_number}/locations/{location_id}/taxonomies/{taxonomy_id}/policyTags/{policyTag_id}`.

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

### hasPolicyTag

### setPolicyTag

Policy tag resource name, in the format of
`projects/{project_number}/locations/{location_id}/taxonomies/{taxonomy_id}/policyTags/{policyTag_id}`.

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

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

### getDataMaskingPolicy

The data masking policy that specifies the data masking rule to use.

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

### hasDataMaskingPolicy

### setDataMaskingPolicy

The data masking policy that specifies the data masking rule to use.

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

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

### getName

Output only. Resource name of this data policy, in the format of
`projects/{project_number}/locations/{location_id}/dataPolicies/{data_policy_id}`.

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

### setName

Output only. Resource name of this data policy, in the format of
`projects/{project_number}/locations/{location_id}/dataPolicies/{data_policy_id}`.

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

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

### getDataPolicyType

Type of data policy.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` | Enum of type [DataPolicyType](https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-datapolicies/latest/V1.DataPolicy.DataPolicyType). |

### setDataPolicyType

Type of data policy.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` Enum of type [DataPolicyType](https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-datapolicies/latest/V1.DataPolicy.DataPolicyType). |

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

### getDataPolicyId

User-assigned (human readable) ID of the data policy that needs to be
unique within a project. Used as {data_policy_id} in part of the resource
name.

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

### setDataPolicyId

User-assigned (human readable) ID of the data policy that needs to be
unique within a project. Used as {data_policy_id} in part of the resource
name.

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

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

### getMatchingLabel

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

### getPolicy

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