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

Configuration for discovery to scan resources for profile generation.

Only one discovery configuration may exist per organization, folder,
or project.
The generated data profiles are retained according to the
[data retention policy](https://cloud.google.com/sensitive-data-protection/docs/data-profiles#retention).

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

## Namespace

Google \\ Cloud \\ Dlp \\ V2

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ name` | `string` Unique resource name for the DiscoveryConfig, assigned by the service when the DiscoveryConfig is created, for example `projects/dlp-test-project/locations/global/discoveryConfigs/53234423`. |
| `↳ display_name` | `string` Display name (max 100 chars) |
| `↳ org_config` | `https://docs.cloud.google.com/php/docs/reference/cloud-dlp/latest/V2.DiscoveryConfig.OrgConfig` Only set when the parent is an org. |
| `↳ other_cloud_starting_location` | `https://docs.cloud.google.com/php/docs/reference/cloud-dlp/latest/V2.OtherCloudDiscoveryStartingLocation` Must be set only when scanning other clouds. |
| `↳ inspect_templates` | `string[]` Detection logic for profile generation. Not all template features are used by Discovery. FindingLimits, include_quote and exclude_info_types have no impact on Discovery. Multiple templates may be provided if there is data in multiple regions. At most one template must be specified per-region (including "global"). Each region is scanned using the applicable template. If no region-specific template is specified, but a "global" template is specified, it will be copied to that region and used instead. If no global or region-specific template is provided for a region with data, that region's data will not be scanned. For more information, see <https://cloud.google.com/sensitive-data-protection/docs/data-profiles#data-residency>. |
| `↳ actions` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-dlp/latest/V2.DataProfileAction>` Actions to execute at the completion of scanning. |
| `↳ targets` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-dlp/latest/V2.DiscoveryTarget>` Target to match against for determining what to scan and how frequently. |
| `↳ errors` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-dlp/latest/V2.Error>` Output only. A stream of errors encountered when the config was activated. Repeated errors may result in the config automatically being paused. Output only field. Will return the last 100 errors. Whenever the config is modified this list will be cleared. |
| `↳ create_time` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` Output only. The creation timestamp of a DiscoveryConfig. |
| `↳ update_time` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` Output only. The last update timestamp of a DiscoveryConfig. |
| `↳ last_run_time` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` Output only. The timestamp of the last time this config was executed. |
| `↳ status` | `int` Required. A status for this configuration. |
| `↳ processing_location` | `https://docs.cloud.google.com/php/docs/reference/cloud-dlp/latest/V2.ProcessingLocation` Optional. Processing location configuration. Vertex AI dataset scanning will set processing_location.image_fallback_type to MultiRegionProcessing by default. |

### getName

Unique resource name for the DiscoveryConfig, assigned by the service when
the DiscoveryConfig is created, for example
`projects/dlp-test-project/locations/global/discoveryConfigs/53234423`.

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

### setName

Unique resource name for the DiscoveryConfig, assigned by the service when
the DiscoveryConfig is created, for example
`projects/dlp-test-project/locations/global/discoveryConfigs/53234423`.

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

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

### getDisplayName

Display name (max 100 chars)

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

### setDisplayName

Display name (max 100 chars)

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

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

### getOrgConfig

Only set when the parent is an org.

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

### hasOrgConfig

### clearOrgConfig

### setOrgConfig

Only set when the parent is an org.

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

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

### getOtherCloudStartingLocation

Must be set only when scanning other clouds.

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

### hasOtherCloudStartingLocation

### clearOtherCloudStartingLocation

### setOtherCloudStartingLocation

Must be set only when scanning other clouds.

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

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

### getInspectTemplates

Detection logic for profile generation.

Not all template features are used by Discovery. FindingLimits,
include_quote and exclude_info_types have no impact on
Discovery.
Multiple templates may be provided if there is data in multiple regions.
At most one template must be specified per-region (including "global").
Each region is scanned using the applicable template. If no region-specific
template is specified, but a "global" template is specified, it will be
copied to that region and used instead. If no global or region-specific
template is provided for a region with data, that region's data will not be
scanned.
For more information, see
<https://cloud.google.com/sensitive-data-protection/docs/data-profiles#data-residency>.

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

### setInspectTemplates

Detection logic for profile generation.

Not all template features are used by Discovery. FindingLimits,
include_quote and exclude_info_types have no impact on
Discovery.
Multiple templates may be provided if there is data in multiple regions.
At most one template must be specified per-region (including "global").
Each region is scanned using the applicable template. If no region-specific
template is specified, but a "global" template is specified, it will be
copied to that region and used instead. If no global or region-specific
template is provided for a region with data, that region's data will not be
scanned.
For more information, see
<https://cloud.google.com/sensitive-data-protection/docs/data-profiles#data-residency>.

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

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

### getActions

Actions to execute at the completion of scanning.

| **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>` |   |

### setActions

Actions to execute at the completion of scanning.

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

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

### getTargets

Target to match against for determining what to scan and how frequently.

| **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.DiscoveryTarget>` |   |

### setTargets

Target to match against for determining what to scan and how frequently.

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

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

### getErrors

Output only. A stream of errors encountered when the config was activated.

Repeated errors may result in the config automatically being paused. Output
only field. Will return the last 100 errors. Whenever the config is
modified this list will be cleared.

| **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.Error>` |   |

### setErrors

Output only. A stream of errors encountered when the config was activated.

Repeated errors may result in the config automatically being paused. Output
only field. Will return the last 100 errors. Whenever the config is
modified this list will be cleared.

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

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

### getCreateTime

Output only. The creation timestamp of a DiscoveryConfig.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp|null` |   |

### hasCreateTime

### clearCreateTime

### setCreateTime

Output only. The creation timestamp of a DiscoveryConfig.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` |

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

### getUpdateTime

Output only. The last update timestamp of a DiscoveryConfig.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp|null` |   |

### hasUpdateTime

### clearUpdateTime

### setUpdateTime

Output only. The last update timestamp of a DiscoveryConfig.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` |

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

### getLastRunTime

Output only. The timestamp of the last time this config was executed.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp|null` |   |

### hasLastRunTime

### clearLastRunTime

### setLastRunTime

Output only. The timestamp of the last time this config was executed.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` |

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

### getStatus

Required. A status for this configuration.

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

### setStatus

Required. A status for this configuration.

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

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

### getProcessingLocation

Optional. Processing location configuration. Vertex AI dataset scanning
will set processing_location.image_fallback_type to MultiRegionProcessing
by default.

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

### hasProcessingLocation

### clearProcessingLocation

### setProcessingLocation

Optional. Processing location configuration. Vertex AI dataset scanning
will set processing_location.image_fallback_type to MultiRegionProcessing
by default.

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

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