# Data Loss Prevention V2 Client - Class TagResources (2.13.0)

2.13.0 (latest) 2.12.0 2.11.0 2.10.0 2.9.2 2.8.1 2.7.0 2.6.1 2.4.1 2.3.0 2.2.3 2.1.0 2.0.0 1.19.0 1.18.0 1.17.0 1.16.0 1.15.1 1.14.0 1.13.2 1.12.0 1.11.0 1.10.2 1.9.0 1.8.6 Reference documentation and code samples for the Data Loss Prevention V2 Client class TagResources.

If set, attaches the [tags](https://cloud.google.com/resource-manager/docs/tags/tags-overview)
provided to profiled resources. Tags support [access
control](https://cloud.google.com/iam/docs/tags-access-control). You can
conditionally grant or deny access to a resource based on whether the
resource has a specific tag.

Generated from protobuf message `google.privacy.dlp.v2.DataProfileAction.TagResources`

## Namespace

Google \\ Cloud \\ Dlp \\ V2 \\ DataProfileAction

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ tag_conditions` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-dlp/latest/V2.DataProfileAction.TagResources.TagCondition>` The tags to associate with different conditions. |
| `↳ profile_generations_to_tag` | `int[]` The profile generations for which the tag should be attached to resources. If you attach a tag to only new profiles, then if the sensitivity score of a profile subsequently changes, its tag doesn't change. By default, this field includes only new profiles. To include both new and updated profiles for tagging, this field should explicitly include both `PROFILE_GENERATION_NEW` and `PROFILE_GENERATION_UPDATE`. |
| `↳ lower_data_risk_to_low` | `bool` Whether applying a tag to a resource should lower the risk of the profile for that resource. For example, in conjunction with an [IAM deny policy](https://cloud.google.com/iam/docs/deny-overview), you can deny all principals a permission if a tag value is present, mitigating the risk of the resource. This also lowers the data risk of resources at the lower levels of the resource hierarchy. For example, reducing the data risk of a table data profile also reduces the data risk of the constituent column data profiles. |

### getTagConditions

The tags to associate with different conditions.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<https://docs.cloud.google.com/php/docs/reference/cloud-dlp/latest/V2.DataProfileAction.TagResources.TagCondition>` |   |

### setTagConditions

The tags to associate with different conditions.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-dlp/latest/V2.DataProfileAction.TagResources.TagCondition>` |

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

### getProfileGenerationsToTag

The profile generations for which the tag should be attached to
resources. If you attach a tag to only new profiles, then if the
sensitivity score of a profile subsequently changes, its tag doesn't
change. By default, this field includes only new profiles. To include
both new and updated profiles for tagging, this field should explicitly
include both `PROFILE_GENERATION_NEW` and `PROFILE_GENERATION_UPDATE`.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<int>` |   |

### setProfileGenerationsToTag

The profile generations for which the tag should be attached to
resources. If you attach a tag to only new profiles, then if the
sensitivity score of a profile subsequently changes, its tag doesn't
change. By default, this field includes only new profiles. To include
both new and updated profiles for tagging, this field should explicitly
include both `PROFILE_GENERATION_NEW` and `PROFILE_GENERATION_UPDATE`.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int[]` |

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

### getLowerDataRiskToLow

Whether applying a tag to a resource should lower the risk of the profile
for that resource. For example, in conjunction with an [IAM deny
policy](https://cloud.google.com/iam/docs/deny-overview), you can deny
all principals a permission if a tag value is present, mitigating the
risk of the resource. This also lowers the data risk of resources at the
lower levels of the resource hierarchy. For example, reducing the data
risk of a table data profile also reduces the data risk of the
constituent column data profiles.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `bool` |   |

### setLowerDataRiskToLow

Whether applying a tag to a resource should lower the risk of the profile
for that resource. For example, in conjunction with an [IAM deny
policy](https://cloud.google.com/iam/docs/deny-overview), you can deny
all principals a permission if a tag value is present, mitigating the
risk of the resource. This also lowers the data risk of resources at the
lower levels of the resource hierarchy. For example, reducing the data
risk of a table data profile also reduces the data risk of the
constituent column data profiles.

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

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