# Data Loss Prevention V2 Client - Class ExclusionRule (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 ExclusionRule.

The rule that specifies conditions when findings of infoTypes specified in
`InspectionRuleSet` are removed from results.

Generated from protobuf message `google.privacy.dlp.v2.ExclusionRule`

## Namespace

Google \\ Cloud \\ Dlp \\ V2

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ dictionary` | `https://docs.cloud.google.com/php/docs/reference/cloud-dlp/latest/V2.CustomInfoType.Dictionary` Dictionary which defines the rule. |
| `↳ regex` | `https://docs.cloud.google.com/php/docs/reference/cloud-dlp/latest/V2.CustomInfoType.Regex` Regular expression which defines the rule. |
| `↳ exclude_info_types` | `https://docs.cloud.google.com/php/docs/reference/cloud-dlp/latest/V2.ExcludeInfoTypes` Set of infoTypes for which findings would affect this rule. |
| `↳ exclude_by_hotword` | `https://docs.cloud.google.com/php/docs/reference/cloud-dlp/latest/V2.ExcludeByHotword` Drop if the hotword rule is contained in the proximate context. For tabular data, the context includes the column name. |
| `↳ exclude_by_image_findings` | `https://docs.cloud.google.com/php/docs/reference/cloud-dlp/latest/V2.ExcludeByImageFindings` Exclude findings based on image containment rules. For example, exclude an image finding if it overlaps with another image finding. |
| `↳ matching_type` | `int` How the rule is applied, see MatchingType documentation for details. |

### getDictionary

Dictionary which defines the rule.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-dlp/latest/V2.CustomInfoType.Dictionary|null` |   |

### hasDictionary

### setDictionary

Dictionary which defines the rule.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-dlp/latest/V2.CustomInfoType.Dictionary` |

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

### getRegex

Regular expression which defines the rule.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-dlp/latest/V2.CustomInfoType.Regex|null` |   |

### hasRegex

### setRegex

Regular expression which defines the rule.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-dlp/latest/V2.CustomInfoType.Regex` |

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

### getExcludeInfoTypes

Set of infoTypes for which findings would affect this rule.

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

### hasExcludeInfoTypes

### setExcludeInfoTypes

Set of infoTypes for which findings would affect this rule.

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

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

### getExcludeByHotword

Drop if the hotword rule is contained in the proximate context. For
tabular data, the context includes the column name.

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

### hasExcludeByHotword

### setExcludeByHotword

Drop if the hotword rule is contained in the proximate context. For
tabular data, the context includes the column name.

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

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

### getExcludeByImageFindings

Exclude findings based on image containment rules. For example, exclude
an image finding if it overlaps with another image finding.

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

### hasExcludeByImageFindings

### setExcludeByImageFindings

Exclude findings based on image containment rules. For example, exclude
an image finding if it overlaps with another image finding.

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

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

### getMatchingType

How the rule is applied, see MatchingType documentation for details.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` | Enum of type [MatchingType](https://docs.cloud.google.com/php/docs/reference/cloud-dlp/latest/V2.MatchingType). |

### setMatchingType

How the rule is applied, see MatchingType documentation for details.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` Enum of type [MatchingType](https://docs.cloud.google.com/php/docs/reference/cloud-dlp/latest/V2.MatchingType). |

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

### getType

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