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

Custom information type provided by the user. Used to find domain-specific
sensitive information configurable to the data in question.

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

## Namespace

Google \\ Cloud \\ Dlp \\ V2

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ info_type` | `https://docs.cloud.google.com/php/docs/reference/cloud-dlp/latest/V2.InfoType` CustomInfoType can either be a new infoType, or an extension of built-in infoType, when the name matches one of existing infoTypes and that infoType is specified in `InspectContent.info_types` field. Specifying the latter adds findings to the one detected by the system. If built-in info type is not specified in `InspectContent.info_types` list then the name is treated as a custom info type. |
| `↳ likelihood` | `int` Likelihood to return for this CustomInfoType. This base value can be altered by a detection rule if the finding meets the criteria specified by the rule. Defaults to `VERY_LIKELY` if not specified. |
| `↳ dictionary` | `https://docs.cloud.google.com/php/docs/reference/cloud-dlp/latest/V2.CustomInfoType.Dictionary` A list of phrases to detect as a CustomInfoType. |
| `↳ regex` | `https://docs.cloud.google.com/php/docs/reference/cloud-dlp/latest/V2.CustomInfoType.Regex` Regular expression based CustomInfoType. |
| `↳ surrogate_type` | `https://docs.cloud.google.com/php/docs/reference/cloud-dlp/latest/V2.CustomInfoType.SurrogateType` Message for detecting output from deidentification transformations that support reversing. |
| `↳ stored_type` | `https://docs.cloud.google.com/php/docs/reference/cloud-dlp/latest/V2.StoredType` Loads an existing `StoredInfoType` resource. |
| `↳ metadata_key_value_expression` | `https://docs.cloud.google.com/php/docs/reference/cloud-dlp/latest/V2.CustomInfoType.MetadataKeyValueExpression` Key-value pair to detect in the metadata. |
| `↳ detection_rules` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-dlp/latest/V2.CustomInfoType.DetectionRule>` Set of detection rules to apply to all findings of this CustomInfoType. Rules are applied in the order that they are specified. Only supported for the `dictionary`, `regex`, and `stored_type` CustomInfoTypes. |
| `↳ exclusion_type` | `int` If set to EXCLUSION_TYPE_EXCLUDE this infoType will not cause a finding to be returned. It still can be used for rules matching. Only supported for the `dictionary`, `regex`, and `stored_type` CustomInfoTypes. |
| `↳ sensitivity_score` | `https://docs.cloud.google.com/php/docs/reference/cloud-dlp/latest/V2.SensitivityScore` Sensitivity for this CustomInfoType. If this CustomInfoType extends an existing InfoType, the sensitivity here will take precedence over that of the original InfoType. If unset for a CustomInfoType, it will default to HIGH. This only applies to data profiling. |

### getInfoType

CustomInfoType can either be a new infoType, or an extension of built-in
infoType, when the name matches one of existing infoTypes and that infoType
is specified in `InspectContent.info_types` field. Specifying the latter
adds findings to the one detected by the system. If built-in info type is
not specified in `InspectContent.info_types` list then the name is treated
as a custom info type.

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

### hasInfoType

### clearInfoType

### setInfoType

CustomInfoType can either be a new infoType, or an extension of built-in
infoType, when the name matches one of existing infoTypes and that infoType
is specified in `InspectContent.info_types` field. Specifying the latter
adds findings to the one detected by the system. If built-in info type is
not specified in `InspectContent.info_types` list then the name is treated
as a custom info type.

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

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

### getLikelihood

Likelihood to return for this CustomInfoType. This base value can be
altered by a detection rule if the finding meets the criteria specified by
the rule. Defaults to `VERY_LIKELY` if not specified.

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

### setLikelihood

Likelihood to return for this CustomInfoType. This base value can be
altered by a detection rule if the finding meets the criteria specified by
the rule. Defaults to `VERY_LIKELY` if not specified.

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

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

### getDictionary

A list of phrases to detect as a CustomInfoType.

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

### hasDictionary

### setDictionary

A list of phrases to detect as a CustomInfoType.

| **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 based CustomInfoType.

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

### hasRegex

### setRegex

Regular expression based CustomInfoType.

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

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

### getSurrogateType

Message for detecting output from deidentification transformations that
support reversing.

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

### hasSurrogateType

### setSurrogateType

Message for detecting output from deidentification transformations that
support reversing.

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

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

### getStoredType

Loads an existing `StoredInfoType` resource.

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

### hasStoredType

### setStoredType

Loads an existing `StoredInfoType` resource.

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

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

### getMetadataKeyValueExpression

Key-value pair to detect in the metadata.

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

### hasMetadataKeyValueExpression

### setMetadataKeyValueExpression

Key-value pair to detect in the metadata.

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

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

### getDetectionRules

Set of detection rules to apply to all findings of this CustomInfoType.

Rules are applied in the order that they are specified. Only supported
for the `dictionary`, `regex`, and `stored_type` CustomInfoTypes.

| **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.CustomInfoType.DetectionRule>` |   |

### setDetectionRules

Set of detection rules to apply to all findings of this CustomInfoType.

Rules are applied in the order that they are specified. Only supported
for the `dictionary`, `regex`, and `stored_type` CustomInfoTypes.

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

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

### getExclusionType

If set to EXCLUSION_TYPE_EXCLUDE this infoType will not cause a finding
to be returned. It still can be used for rules matching. Only supported
for the `dictionary`, `regex`, and `stored_type` CustomInfoTypes.

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

### setExclusionType

If set to EXCLUSION_TYPE_EXCLUDE this infoType will not cause a finding
to be returned. It still can be used for rules matching. Only supported
for the `dictionary`, `regex`, and `stored_type` CustomInfoTypes.

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

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

### getSensitivityScore

Sensitivity for this CustomInfoType. If this CustomInfoType extends an
existing InfoType, the sensitivity here will take precedence over that of
the original InfoType. If unset for a CustomInfoType, it will default to
HIGH.

This only applies to data profiling.

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

### hasSensitivityScore

### clearSensitivityScore

### setSensitivityScore

Sensitivity for this CustomInfoType. If this CustomInfoType extends an
existing InfoType, the sensitivity here will take precedence over that of
the original InfoType. If unset for a CustomInfoType, it will default to
HIGH.

This only applies to data profiling.

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

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

### getType

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