Data Loss Prevention V2 Client - Class DlpServiceClient (1.13.2)

Reference documentation and code samples for the Data Loss Prevention V2 Client class DlpServiceClient.

Service Description: The Cloud Data Loss Prevention (DLP) API is a service that allows clients to detect the presence of Personally Identifiable Information (PII) and other privacy-sensitive data in user-supplied, unstructured data streams, like text blocks or images.

The service also includes methods for sensitive data redaction and scheduling of data scans on Google Cloud Platform based data sets.

To learn more about concepts and find how-to guides see https://cloud.google.com/sensitive-data-protection/docs/.

This class provides the ability to make remote calls to the backing service through method calls that map to API methods.

Many parameters require resource names to be formatted in a particular way. To assist with these names, this class includes a format method for each type of name, and additionally a parseName method to extract the individual identifiers contained within formatted names that are returned by the API.

Namespace

Google \ Cloud \ Dlp \ V2 \ Client

Methods

__construct

Constructor.

Parameters
Name Description
options array

Optional. Options for configuring the service API wrapper.

↳ apiEndpoint string

The address of the API remote host. May optionally include the port, formatted as "

↳ credentials string|array|FetchAuthTokenInterface|CredentialsWrapper

The credentials to be used by the client to authorize API calls. This option accepts either a path to a credentials file, or a decoded credentials file as a PHP array. Advanced usage: In addition, this option can also accept a pre-constructed Google\Auth\FetchAuthTokenInterface object or Google\ApiCore\CredentialsWrapper object. Note that when one of these objects are provided, any settings in $credentialsConfig will be ignored.

↳ credentialsConfig array

Options used to configure credentials, including auth token caching, for the client. For a full list of supporting configuration options, see Google\ApiCore\CredentialsWrapper::build() .

↳ disableRetries bool

Determines whether or not retries defined by the client configuration should be disabled. Defaults to false.

↳ clientConfig string|array

Client method configuration, including retry settings. This option can be either a path to a JSON file, or a PHP array containing the decoded JSON data. By default this settings points to the default client config file, which is provided in the resources folder.

↳ transport string|TransportInterface

The transport used for executing network requests. May be either the string rest or grpc. Defaults to grpc if gRPC support is detected on the system. Advanced usage: Additionally, it is possible to pass in an already instantiated Google\ApiCore\Transport\TransportInterface object. Note that when this object is provided, any settings in $transportConfig, and any $apiEndpoint setting, will be ignored.

↳ transportConfig array

Configuration options that will be used to construct the transport. Options for each supported transport type should be passed in a key for that transport. For example: $transportConfig = [ 'grpc' => [...], 'rest' => [...], ]; See the Google\ApiCore\Transport\GrpcTransport::build() and Google\ApiCore\Transport\RestTransport::build() methods for the supported options.

↳ clientCertSource callable

A callable which returns the client cert as a string. This can be used to provide a certificate and private key to the transport layer for mTLS.

activateJobTrigger

Activate a job trigger. Causes the immediate execute of a trigger instead of waiting on the trigger event to occur.

The async variant is Google\Cloud\Dlp\V2\Client\DlpServiceClient::activateJobTriggerAsync() .

Parameters
Name Description
request Google\Cloud\Dlp\V2\ActivateJobTriggerRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
Type Description
Google\Cloud\Dlp\V2\DlpJob
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Dlp\V2\ActivateJobTriggerRequest;
use Google\Cloud\Dlp\V2\Client\DlpServiceClient;
use Google\Cloud\Dlp\V2\DlpJob;

/**
 * @param string $formattedName Resource name of the trigger to activate, for example
 *                              `projects/dlp-test-project/jobTriggers/53234423`. Please see
 *                              {@see DlpServiceClient::jobTriggerName()} for help formatting this field.
 */
function activate_job_trigger_sample(string $formattedName): void
{
    // Create a client.
    $dlpServiceClient = new DlpServiceClient();

    // Prepare the request message.
    $request = (new ActivateJobTriggerRequest())
        ->setName($formattedName);

    // Call the API and handle any network failures.
    try {
        /** @var DlpJob $response */
        $response = $dlpServiceClient->activateJobTrigger($request);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedName = DlpServiceClient::jobTriggerName('[PROJECT]', '[JOB_TRIGGER]');

    activate_job_trigger_sample($formattedName);
}

cancelDlpJob

Starts asynchronous cancellation on a long-running DlpJob. The server makes a best effort to cancel the DlpJob, but success is not guaranteed.

See https://cloud.google.com/sensitive-data-protection/docs/inspecting-storage and https://cloud.google.com/sensitive-data-protection/docs/compute-risk-analysis to learn more.

The async variant is Google\Cloud\Dlp\V2\Client\DlpServiceClient::cancelDlpJobAsync() .

Parameters
Name Description
request Google\Cloud\Dlp\V2\CancelDlpJobRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Example
use Google\ApiCore\ApiException;
use Google\Cloud\Dlp\V2\CancelDlpJobRequest;
use Google\Cloud\Dlp\V2\Client\DlpServiceClient;

/**
 * @param string $formattedName The name of the DlpJob resource to be cancelled. Please see
 *                              {@see DlpServiceClient::dlpJobName()} for help formatting this field.
 */
function cancel_dlp_job_sample(string $formattedName): void
{
    // Create a client.
    $dlpServiceClient = new DlpServiceClient();

    // Prepare the request message.
    $request = (new CancelDlpJobRequest())
        ->setName($formattedName);

    // Call the API and handle any network failures.
    try {
        $dlpServiceClient->cancelDlpJob($request);
        printf('Call completed successfully.' . PHP_EOL);
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedName = DlpServiceClient::dlpJobName('[PROJECT]', '[DLP_JOB]');

    cancel_dlp_job_sample($formattedName);
}

createDeidentifyTemplate

Creates a DeidentifyTemplate for reusing frequently used configuration for de-identifying content, images, and storage.

See https://cloud.google.com/sensitive-data-protection/docs/creating-templates-deid to learn more.

The async variant is Google\Cloud\Dlp\V2\Client\DlpServiceClient::createDeidentifyTemplateAsync() .

Parameters
Name Description
request Google\Cloud\Dlp\V2\CreateDeidentifyTemplateRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
Type Description
Google\Cloud\Dlp\V2\DeidentifyTemplate
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Dlp\V2\Client\DlpServiceClient;
use Google\Cloud\Dlp\V2\CreateDeidentifyTemplateRequest;
use Google\Cloud\Dlp\V2\DeidentifyTemplate;

/**
 * @param string $formattedParent Parent resource name.
 *
 *                                The format of this value varies depending on the scope of the request
 *                                (project or organization) and whether you have [specified a processing
 *                                location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location):
 *
 *                                + Projects scope, location specified:<br/>
 *                                `projects/`<var>PROJECT_ID</var>`/locations/`<var>LOCATION_ID</var>
 *                                + Projects scope, no location specified (defaults to global):<br/>
 *                                `projects/`<var>PROJECT_ID</var>
 *                                + Organizations scope, location specified:<br/>
 *                                `organizations/`<var>ORG_ID</var>`/locations/`<var>LOCATION_ID</var>
 *                                + Organizations scope, no location specified (defaults to global):<br/>
 *                                `organizations/`<var>ORG_ID</var>
 *
 *                                The following example `parent` string specifies a parent project with the
 *                                identifier `example-project`, and specifies the `europe-west3` location
 *                                for processing data:
 *
 *                                parent=projects/example-project/locations/europe-west3
 *                                Please see {@see DlpServiceClient::organizationLocationName()} for help formatting this field.
 */
function create_deidentify_template_sample(string $formattedParent): void
{
    // Create a client.
    $dlpServiceClient = new DlpServiceClient();

    // Prepare the request message.
    $deidentifyTemplate = new DeidentifyTemplate();
    $request = (new CreateDeidentifyTemplateRequest())
        ->setParent($formattedParent)
        ->setDeidentifyTemplate($deidentifyTemplate);

    // Call the API and handle any network failures.
    try {
        /** @var DeidentifyTemplate $response */
        $response = $dlpServiceClient->createDeidentifyTemplate($request);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedParent = DlpServiceClient::organizationLocationName('[ORGANIZATION]', '[LOCATION]');

    create_deidentify_template_sample($formattedParent);
}

createDiscoveryConfig

Creates a config for discovery to scan and profile storage.

The async variant is Google\Cloud\Dlp\V2\Client\DlpServiceClient::createDiscoveryConfigAsync() .

Parameters
Name Description
request Google\Cloud\Dlp\V2\CreateDiscoveryConfigRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
Type Description
Google\Cloud\Dlp\V2\DiscoveryConfig
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Dlp\V2\Client\DlpServiceClient;
use Google\Cloud\Dlp\V2\CreateDiscoveryConfigRequest;
use Google\Cloud\Dlp\V2\DiscoveryConfig;
use Google\Cloud\Dlp\V2\DiscoveryConfig\Status;

/**
 * @param string $formattedParent       Parent resource name.
 *
 *                                      The format of this value is as follows:
 *                                      `projects/`<var>PROJECT_ID</var>`/locations/`<var>LOCATION_ID</var>
 *
 *                                      The following example `parent` string specifies a parent project with the
 *                                      identifier `example-project`, and specifies the `europe-west3` location
 *                                      for processing data:
 *
 *                                      parent=projects/example-project/locations/europe-west3
 *                                      Please see {@see DlpServiceClient::locationName()} for help formatting this field.
 * @param int    $discoveryConfigStatus A status for this configuration.
 */
function create_discovery_config_sample(string $formattedParent, int $discoveryConfigStatus): void
{
    // Create a client.
    $dlpServiceClient = new DlpServiceClient();

    // Prepare the request message.
    $discoveryConfig = (new DiscoveryConfig())
        ->setStatus($discoveryConfigStatus);
    $request = (new CreateDiscoveryConfigRequest())
        ->setParent($formattedParent)
        ->setDiscoveryConfig($discoveryConfig);

    // Call the API and handle any network failures.
    try {
        /** @var DiscoveryConfig $response */
        $response = $dlpServiceClient->createDiscoveryConfig($request);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedParent = DlpServiceClient::locationName('[PROJECT]', '[LOCATION]');
    $discoveryConfigStatus = Status::STATUS_UNSPECIFIED;

    create_discovery_config_sample($formattedParent, $discoveryConfigStatus);
}

createDlpJob

Creates a new job to inspect storage or calculate risk metrics.

See https://cloud.google.com/sensitive-data-protection/docs/inspecting-storage and https://cloud.google.com/sensitive-data-protection/docs/compute-risk-analysis to learn more.

When no InfoTypes or CustomInfoTypes are specified in inspect jobs, the system will automatically choose what detectors to run. By default this may be all types, but may change over time as detectors are updated.

The async variant is Google\Cloud\Dlp\V2\Client\DlpServiceClient::createDlpJobAsync() .

Parameters
Name Description
request Google\Cloud\Dlp\V2\CreateDlpJobRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
Type Description
Google\Cloud\Dlp\V2\DlpJob
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Dlp\V2\Client\DlpServiceClient;
use Google\Cloud\Dlp\V2\CreateDlpJobRequest;
use Google\Cloud\Dlp\V2\DlpJob;

/**
 * @param string $formattedParent Parent resource name.
 *
 *                                The format of this value varies depending on whether you have [specified a
 *                                processing
 *                                location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location):
 *
 *                                + Projects scope, location specified:<br/>
 *                                `projects/`<var>PROJECT_ID</var>`/locations/`<var>LOCATION_ID</var>
 *                                + Projects scope, no location specified (defaults to global):<br/>
 *                                `projects/`<var>PROJECT_ID</var>
 *
 *                                The following example `parent` string specifies a parent project with the
 *                                identifier `example-project`, and specifies the `europe-west3` location
 *                                for processing data:
 *
 *                                parent=projects/example-project/locations/europe-west3
 *                                Please see {@see DlpServiceClient::projectName()} for help formatting this field.
 */
function create_dlp_job_sample(string $formattedParent): void
{
    // Create a client.
    $dlpServiceClient = new DlpServiceClient();

    // Prepare the request message.
    $request = (new CreateDlpJobRequest())
        ->setParent($formattedParent);

    // Call the API and handle any network failures.
    try {
        /** @var DlpJob $response */
        $response = $dlpServiceClient->createDlpJob($request);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedParent = DlpServiceClient::projectName('[PROJECT]');

    create_dlp_job_sample($formattedParent);
}

createInspectTemplate

Creates an InspectTemplate for reusing frequently used configuration for inspecting content, images, and storage.

See https://cloud.google.com/sensitive-data-protection/docs/creating-templates to learn more.

The async variant is Google\Cloud\Dlp\V2\Client\DlpServiceClient::createInspectTemplateAsync() .

Parameters
Name Description
request Google\Cloud\Dlp\V2\CreateInspectTemplateRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
Type Description
Google\Cloud\Dlp\V2\InspectTemplate
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Dlp\V2\Client\DlpServiceClient;
use Google\Cloud\Dlp\V2\CreateInspectTemplateRequest;
use Google\Cloud\Dlp\V2\InspectTemplate;

/**
 * @param string $formattedParent Parent resource name.
 *
 *                                The format of this value varies depending on the scope of the request
 *                                (project or organization) and whether you have [specified a processing
 *                                location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location):
 *
 *                                + Projects scope, location specified:<br/>
 *                                `projects/`<var>PROJECT_ID</var>`/locations/`<var>LOCATION_ID</var>
 *                                + Projects scope, no location specified (defaults to global):<br/>
 *                                `projects/`<var>PROJECT_ID</var>
 *                                + Organizations scope, location specified:<br/>
 *                                `organizations/`<var>ORG_ID</var>`/locations/`<var>LOCATION_ID</var>
 *                                + Organizations scope, no location specified (defaults to global):<br/>
 *                                `organizations/`<var>ORG_ID</var>
 *
 *                                The following example `parent` string specifies a parent project with the
 *                                identifier `example-project`, and specifies the `europe-west3` location
 *                                for processing data:
 *
 *                                parent=projects/example-project/locations/europe-west3
 *                                Please see {@see DlpServiceClient::organizationLocationName()} for help formatting this field.
 */
function create_inspect_template_sample(string $formattedParent): void
{
    // Create a client.
    $dlpServiceClient = new DlpServiceClient();

    // Prepare the request message.
    $inspectTemplate = new InspectTemplate();
    $request = (new CreateInspectTemplateRequest())
        ->setParent($formattedParent)
        ->setInspectTemplate($inspectTemplate);

    // Call the API and handle any network failures.
    try {
        /** @var InspectTemplate $response */
        $response = $dlpServiceClient->createInspectTemplate($request);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedParent = DlpServiceClient::organizationLocationName('[ORGANIZATION]', '[LOCATION]');

    create_inspect_template_sample($formattedParent);
}

createJobTrigger

Creates a job trigger to run DLP actions such as scanning storage for sensitive information on a set schedule.

See https://cloud.google.com/sensitive-data-protection/docs/creating-job-triggers to learn more.

The async variant is Google\Cloud\Dlp\V2\Client\DlpServiceClient::createJobTriggerAsync() .

Parameters
Name Description
request Google\Cloud\Dlp\V2\CreateJobTriggerRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
Type Description
Google\Cloud\Dlp\V2\JobTrigger
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Dlp\V2\Client\DlpServiceClient;
use Google\Cloud\Dlp\V2\CreateJobTriggerRequest;
use Google\Cloud\Dlp\V2\JobTrigger;
use Google\Cloud\Dlp\V2\JobTrigger\Status;

/**
 * @param string $formattedParent  Parent resource name.
 *
 *                                 The format of this value varies depending on whether you have [specified a
 *                                 processing
 *                                 location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location):
 *
 *                                 + Projects scope, location specified:<br/>
 *                                 `projects/`<var>PROJECT_ID</var>`/locations/`<var>LOCATION_ID</var>
 *                                 + Projects scope, no location specified (defaults to global):<br/>
 *                                 `projects/`<var>PROJECT_ID</var>
 *
 *                                 The following example `parent` string specifies a parent project with the
 *                                 identifier `example-project`, and specifies the `europe-west3` location
 *                                 for processing data:
 *
 *                                 parent=projects/example-project/locations/europe-west3
 *                                 Please see {@see DlpServiceClient::projectName()} for help formatting this field.
 * @param int    $jobTriggerStatus A status for this trigger.
 */
function create_job_trigger_sample(string $formattedParent, int $jobTriggerStatus): void
{
    // Create a client.
    $dlpServiceClient = new DlpServiceClient();

    // Prepare the request message.
    $jobTrigger = (new JobTrigger())
        ->setStatus($jobTriggerStatus);
    $request = (new CreateJobTriggerRequest())
        ->setParent($formattedParent)
        ->setJobTrigger($jobTrigger);

    // Call the API and handle any network failures.
    try {
        /** @var JobTrigger $response */
        $response = $dlpServiceClient->createJobTrigger($request);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedParent = DlpServiceClient::projectName('[PROJECT]');
    $jobTriggerStatus = Status::STATUS_UNSPECIFIED;

    create_job_trigger_sample($formattedParent, $jobTriggerStatus);
}

createStoredInfoType

Creates a pre-built stored infoType to be used for inspection.

See https://cloud.google.com/sensitive-data-protection/docs/creating-stored-infotypes to learn more.

The async variant is Google\Cloud\Dlp\V2\Client\DlpServiceClient::createStoredInfoTypeAsync() .

Parameters
Name Description
request Google\Cloud\Dlp\V2\CreateStoredInfoTypeRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
Type Description
Google\Cloud\Dlp\V2\StoredInfoType
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Dlp\V2\Client\DlpServiceClient;
use Google\Cloud\Dlp\V2\CreateStoredInfoTypeRequest;
use Google\Cloud\Dlp\V2\StoredInfoType;
use Google\Cloud\Dlp\V2\StoredInfoTypeConfig;

/**
 * @param string $formattedParent Parent resource name.
 *
 *                                The format of this value varies depending on the scope of the request
 *                                (project or organization) and whether you have [specified a processing
 *                                location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location):
 *
 *                                + Projects scope, location specified:<br/>
 *                                `projects/`<var>PROJECT_ID</var>`/locations/`<var>LOCATION_ID</var>
 *                                + Projects scope, no location specified (defaults to global):<br/>
 *                                `projects/`<var>PROJECT_ID</var>
 *                                + Organizations scope, location specified:<br/>
 *                                `organizations/`<var>ORG_ID</var>`/locations/`<var>LOCATION_ID</var>
 *                                + Organizations scope, no location specified (defaults to global):<br/>
 *                                `organizations/`<var>ORG_ID</var>
 *
 *                                The following example `parent` string specifies a parent project with the
 *                                identifier `example-project`, and specifies the `europe-west3` location
 *                                for processing data:
 *
 *                                parent=projects/example-project/locations/europe-west3
 *                                Please see {@see DlpServiceClient::organizationLocationName()} for help formatting this field.
 */
function create_stored_info_type_sample(string $formattedParent): void
{
    // Create a client.
    $dlpServiceClient = new DlpServiceClient();

    // Prepare the request message.
    $config = new StoredInfoTypeConfig();
    $request = (new CreateStoredInfoTypeRequest())
        ->setParent($formattedParent)
        ->setConfig($config);

    // Call the API and handle any network failures.
    try {
        /** @var StoredInfoType $response */
        $response = $dlpServiceClient->createStoredInfoType($request);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedParent = DlpServiceClient::organizationLocationName('[ORGANIZATION]', '[LOCATION]');

    create_stored_info_type_sample($formattedParent);
}

deidentifyContent

De-identifies potentially sensitive info from a ContentItem.

This method has limits on input size and output size. See https://cloud.google.com/sensitive-data-protection/docs/deidentify-sensitive-data to learn more.

When no InfoTypes or CustomInfoTypes are specified in this request, the system will automatically choose what detectors to run. By default this may be all types, but may change over time as detectors are updated.

The async variant is Google\Cloud\Dlp\V2\Client\DlpServiceClient::deidentifyContentAsync() .

Parameters
Name Description
request Google\Cloud\Dlp\V2\DeidentifyContentRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
Type Description
Google\Cloud\Dlp\V2\DeidentifyContentResponse
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Dlp\V2\Client\DlpServiceClient;
use Google\Cloud\Dlp\V2\DeidentifyContentRequest;
use Google\Cloud\Dlp\V2\DeidentifyContentResponse;

/**
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function deidentify_content_sample(): void
{
    // Create a client.
    $dlpServiceClient = new DlpServiceClient();

    // Prepare the request message.
    $request = new DeidentifyContentRequest();

    // Call the API and handle any network failures.
    try {
        /** @var DeidentifyContentResponse $response */
        $response = $dlpServiceClient->deidentifyContent($request);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

deleteDeidentifyTemplate

Parameters
Name Description
request Google\Cloud\Dlp\V2\DeleteDeidentifyTemplateRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Example
use Google\ApiCore\ApiException;
use Google\Cloud\Dlp\V2\Client\DlpServiceClient;
use Google\Cloud\Dlp\V2\DeleteDeidentifyTemplateRequest;

/**
 * @param string $formattedName Resource name of the organization and deidentify template to be
 *                              deleted, for example
 *                              `organizations/433245324/deidentifyTemplates/432452342` or
 *                              projects/project-id/deidentifyTemplates/432452342. Please see
 *                              {@see DlpServiceClient::deidentifyTemplateName()} for help formatting this field.
 */
function delete_deidentify_template_sample(string $formattedName): void
{
    // Create a client.
    $dlpServiceClient = new DlpServiceClient();

    // Prepare the request message.
    $request = (new DeleteDeidentifyTemplateRequest())
        ->setName($formattedName);

    // Call the API and handle any network failures.
    try {
        $dlpServiceClient->deleteDeidentifyTemplate($request);
        printf('Call completed successfully.' . PHP_EOL);
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedName = DlpServiceClient::deidentifyTemplateName(
        '[ORGANIZATION]',
        '[DEIDENTIFY_TEMPLATE]'
    );

    delete_deidentify_template_sample($formattedName);
}

deleteDiscoveryConfig

Deletes a discovery configuration.

The async variant is Google\Cloud\Dlp\V2\Client\DlpServiceClient::deleteDiscoveryConfigAsync() .

Parameters
Name Description
request Google\Cloud\Dlp\V2\DeleteDiscoveryConfigRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Example
use Google\ApiCore\ApiException;
use Google\Cloud\Dlp\V2\Client\DlpServiceClient;
use Google\Cloud\Dlp\V2\DeleteDiscoveryConfigRequest;

/**
 * @param string $formattedName Resource name of the project and the config, for example
 *                              `projects/dlp-test-project/discoveryConfigs/53234423`. Please see
 *                              {@see DlpServiceClient::discoveryConfigName()} for help formatting this field.
 */
function delete_discovery_config_sample(string $formattedName): void
{
    // Create a client.
    $dlpServiceClient = new DlpServiceClient();

    // Prepare the request message.
    $request = (new DeleteDiscoveryConfigRequest())
        ->setName($formattedName);

    // Call the API and handle any network failures.
    try {
        $dlpServiceClient->deleteDiscoveryConfig($request);
        printf('Call completed successfully.' . PHP_EOL);
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedName = DlpServiceClient::discoveryConfigName(
        '[PROJECT]',
        '[LOCATION]',
        '[DISCOVERY_CONFIG]'
    );

    delete_discovery_config_sample($formattedName);
}

deleteDlpJob

Deletes a long-running DlpJob. This method indicates that the client is no longer interested in the DlpJob result. The job will be canceled if possible.

See https://cloud.google.com/sensitive-data-protection/docs/inspecting-storage and https://cloud.google.com/sensitive-data-protection/docs/compute-risk-analysis to learn more.

The async variant is Google\Cloud\Dlp\V2\Client\DlpServiceClient::deleteDlpJobAsync() .

Parameters
Name Description
request Google\Cloud\Dlp\V2\DeleteDlpJobRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Example
use Google\ApiCore\ApiException;
use Google\Cloud\Dlp\V2\Client\DlpServiceClient;
use Google\Cloud\Dlp\V2\DeleteDlpJobRequest;

/**
 * @param string $formattedName The name of the DlpJob resource to be deleted. Please see
 *                              {@see DlpServiceClient::dlpJobName()} for help formatting this field.
 */
function delete_dlp_job_sample(string $formattedName): void
{
    // Create a client.
    $dlpServiceClient = new DlpServiceClient();

    // Prepare the request message.
    $request = (new DeleteDlpJobRequest())
        ->setName($formattedName);

    // Call the API and handle any network failures.
    try {
        $dlpServiceClient->deleteDlpJob($request);
        printf('Call completed successfully.' . PHP_EOL);
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedName = DlpServiceClient::dlpJobName('[PROJECT]', '[DLP_JOB]');

    delete_dlp_job_sample($formattedName);
}

deleteInspectTemplate

Parameters
Name Description
request Google\Cloud\Dlp\V2\DeleteInspectTemplateRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Example
use Google\ApiCore\ApiException;
use Google\Cloud\Dlp\V2\Client\DlpServiceClient;
use Google\Cloud\Dlp\V2\DeleteInspectTemplateRequest;

/**
 * @param string $formattedName Resource name of the organization and inspectTemplate to be
 *                              deleted, for example `organizations/433245324/inspectTemplates/432452342`
 *                              or projects/project-id/inspectTemplates/432452342. Please see
 *                              {@see DlpServiceClient::inspectTemplateName()} for help formatting this field.
 */
function delete_inspect_template_sample(string $formattedName): void
{
    // Create a client.
    $dlpServiceClient = new DlpServiceClient();

    // Prepare the request message.
    $request = (new DeleteInspectTemplateRequest())
        ->setName($formattedName);

    // Call the API and handle any network failures.
    try {
        $dlpServiceClient->deleteInspectTemplate($request);
        printf('Call completed successfully.' . PHP_EOL);
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedName = DlpServiceClient::inspectTemplateName('[ORGANIZATION]', '[INSPECT_TEMPLATE]');

    delete_inspect_template_sample($formattedName);
}

deleteJobTrigger

Parameters
Name Description
request Google\Cloud\Dlp\V2\DeleteJobTriggerRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Example
use Google\ApiCore\ApiException;
use Google\Cloud\Dlp\V2\Client\DlpServiceClient;
use Google\Cloud\Dlp\V2\DeleteJobTriggerRequest;

/**
 * @param string $formattedName Resource name of the project and the triggeredJob, for example
 *                              `projects/dlp-test-project/jobTriggers/53234423`. Please see
 *                              {@see DlpServiceClient::jobTriggerName()} for help formatting this field.
 */
function delete_job_trigger_sample(string $formattedName): void
{
    // Create a client.
    $dlpServiceClient = new DlpServiceClient();

    // Prepare the request message.
    $request = (new DeleteJobTriggerRequest())
        ->setName($formattedName);

    // Call the API and handle any network failures.
    try {
        $dlpServiceClient->deleteJobTrigger($request);
        printf('Call completed successfully.' . PHP_EOL);
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedName = DlpServiceClient::jobTriggerName('[PROJECT]', '[JOB_TRIGGER]');

    delete_job_trigger_sample($formattedName);
}

deleteStoredInfoType

Parameters
Name Description
request Google\Cloud\Dlp\V2\DeleteStoredInfoTypeRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Example
use Google\ApiCore\ApiException;
use Google\Cloud\Dlp\V2\Client\DlpServiceClient;
use Google\Cloud\Dlp\V2\DeleteStoredInfoTypeRequest;

/**
 * @param string $formattedName Resource name of the organization and storedInfoType to be
 *                              deleted, for example `organizations/433245324/storedInfoTypes/432452342` or
 *                              projects/project-id/storedInfoTypes/432452342. Please see
 *                              {@see DlpServiceClient::storedInfoTypeName()} for help formatting this field.
 */
function delete_stored_info_type_sample(string $formattedName): void
{
    // Create a client.
    $dlpServiceClient = new DlpServiceClient();

    // Prepare the request message.
    $request = (new DeleteStoredInfoTypeRequest())
        ->setName($formattedName);

    // Call the API and handle any network failures.
    try {
        $dlpServiceClient->deleteStoredInfoType($request);
        printf('Call completed successfully.' . PHP_EOL);
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedName = DlpServiceClient::storedInfoTypeName('[ORGANIZATION]', '[STORED_INFO_TYPE]');

    delete_stored_info_type_sample($formattedName);
}

finishDlpJob

Finish a running hybrid DlpJob. Triggers the finalization steps and running of any enabled actions that have not yet run.

The async variant is Google\Cloud\Dlp\V2\Client\DlpServiceClient::finishDlpJobAsync() .

Parameters
Name Description
request Google\Cloud\Dlp\V2\FinishDlpJobRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Example
use Google\ApiCore\ApiException;
use Google\Cloud\Dlp\V2\Client\DlpServiceClient;
use Google\Cloud\Dlp\V2\FinishDlpJobRequest;

/**
 * @param string $formattedName The name of the DlpJob resource to be finished. Please see
 *                              {@see DlpServiceClient::dlpJobName()} for help formatting this field.
 */
function finish_dlp_job_sample(string $formattedName): void
{
    // Create a client.
    $dlpServiceClient = new DlpServiceClient();

    // Prepare the request message.
    $request = (new FinishDlpJobRequest())
        ->setName($formattedName);

    // Call the API and handle any network failures.
    try {
        $dlpServiceClient->finishDlpJob($request);
        printf('Call completed successfully.' . PHP_EOL);
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedName = DlpServiceClient::dlpJobName('[PROJECT]', '[DLP_JOB]');

    finish_dlp_job_sample($formattedName);
}

getColumnDataProfile

Gets a column data profile.

The async variant is Google\Cloud\Dlp\V2\Client\DlpServiceClient::getColumnDataProfileAsync() .

Parameters
Name Description
request Google\Cloud\Dlp\V2\GetColumnDataProfileRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
Type Description
Google\Cloud\Dlp\V2\ColumnDataProfile
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Dlp\V2\Client\DlpServiceClient;
use Google\Cloud\Dlp\V2\ColumnDataProfile;
use Google\Cloud\Dlp\V2\GetColumnDataProfileRequest;

/**
 * @param string $formattedName Resource name, for example
 *                              `organizations/12345/locations/us/columnDataProfiles/53234423`. Please see
 *                              {@see DlpServiceClient::columnDataProfileName()} for help formatting this field.
 */
function get_column_data_profile_sample(string $formattedName): void
{
    // Create a client.
    $dlpServiceClient = new DlpServiceClient();

    // Prepare the request message.
    $request = (new GetColumnDataProfileRequest())
        ->setName($formattedName);

    // Call the API and handle any network failures.
    try {
        /** @var ColumnDataProfile $response */
        $response = $dlpServiceClient->getColumnDataProfile($request);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedName = DlpServiceClient::columnDataProfileName(
        '[ORGANIZATION]',
        '[LOCATION]',
        '[COLUMN_DATA_PROFILE]'
    );

    get_column_data_profile_sample($formattedName);
}

getDeidentifyTemplate

Parameters
Name Description
request Google\Cloud\Dlp\V2\GetDeidentifyTemplateRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
Type Description
Google\Cloud\Dlp\V2\DeidentifyTemplate
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Dlp\V2\Client\DlpServiceClient;
use Google\Cloud\Dlp\V2\DeidentifyTemplate;
use Google\Cloud\Dlp\V2\GetDeidentifyTemplateRequest;

/**
 * @param string $formattedName Resource name of the organization and deidentify template to be
 *                              read, for example `organizations/433245324/deidentifyTemplates/432452342`
 *                              or projects/project-id/deidentifyTemplates/432452342. Please see
 *                              {@see DlpServiceClient::deidentifyTemplateName()} for help formatting this field.
 */
function get_deidentify_template_sample(string $formattedName): void
{
    // Create a client.
    $dlpServiceClient = new DlpServiceClient();

    // Prepare the request message.
    $request = (new GetDeidentifyTemplateRequest())
        ->setName($formattedName);

    // Call the API and handle any network failures.
    try {
        /** @var DeidentifyTemplate $response */
        $response = $dlpServiceClient->getDeidentifyTemplate($request);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedName = DlpServiceClient::deidentifyTemplateName(
        '[ORGANIZATION]',
        '[DEIDENTIFY_TEMPLATE]'
    );

    get_deidentify_template_sample($formattedName);
}

getDiscoveryConfig

Gets a discovery configuration.

The async variant is Google\Cloud\Dlp\V2\Client\DlpServiceClient::getDiscoveryConfigAsync() .

Parameters
Name Description
request Google\Cloud\Dlp\V2\GetDiscoveryConfigRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
Type Description
Google\Cloud\Dlp\V2\DiscoveryConfig
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Dlp\V2\Client\DlpServiceClient;
use Google\Cloud\Dlp\V2\DiscoveryConfig;
use Google\Cloud\Dlp\V2\GetDiscoveryConfigRequest;

/**
 * @param string $formattedName Resource name of the project and the configuration, for example
 *                              `projects/dlp-test-project/discoveryConfigs/53234423`. Please see
 *                              {@see DlpServiceClient::discoveryConfigName()} for help formatting this field.
 */
function get_discovery_config_sample(string $formattedName): void
{
    // Create a client.
    $dlpServiceClient = new DlpServiceClient();

    // Prepare the request message.
    $request = (new GetDiscoveryConfigRequest())
        ->setName($formattedName);

    // Call the API and handle any network failures.
    try {
        /** @var DiscoveryConfig $response */
        $response = $dlpServiceClient->getDiscoveryConfig($request);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedName = DlpServiceClient::discoveryConfigName(
        '[PROJECT]',
        '[LOCATION]',
        '[DISCOVERY_CONFIG]'
    );

    get_discovery_config_sample($formattedName);
}

getDlpJob

Parameters
Name Description
request Google\Cloud\Dlp\V2\GetDlpJobRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
Type Description
Google\Cloud\Dlp\V2\DlpJob
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Dlp\V2\Client\DlpServiceClient;
use Google\Cloud\Dlp\V2\DlpJob;
use Google\Cloud\Dlp\V2\GetDlpJobRequest;

/**
 * @param string $formattedName The name of the DlpJob resource. Please see
 *                              {@see DlpServiceClient::dlpJobName()} for help formatting this field.
 */
function get_dlp_job_sample(string $formattedName): void
{
    // Create a client.
    $dlpServiceClient = new DlpServiceClient();

    // Prepare the request message.
    $request = (new GetDlpJobRequest())
        ->setName($formattedName);

    // Call the API and handle any network failures.
    try {
        /** @var DlpJob $response */
        $response = $dlpServiceClient->getDlpJob($request);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedName = DlpServiceClient::dlpJobName('[PROJECT]', '[DLP_JOB]');

    get_dlp_job_sample($formattedName);
}

getInspectTemplate

Parameters
Name Description
request Google\Cloud\Dlp\V2\GetInspectTemplateRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
Type Description
Google\Cloud\Dlp\V2\InspectTemplate
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Dlp\V2\Client\DlpServiceClient;
use Google\Cloud\Dlp\V2\GetInspectTemplateRequest;
use Google\Cloud\Dlp\V2\InspectTemplate;

/**
 * @param string $formattedName Resource name of the organization and inspectTemplate to be read,
 *                              for example `organizations/433245324/inspectTemplates/432452342` or
 *                              projects/project-id/inspectTemplates/432452342. Please see
 *                              {@see DlpServiceClient::inspectTemplateName()} for help formatting this field.
 */
function get_inspect_template_sample(string $formattedName): void
{
    // Create a client.
    $dlpServiceClient = new DlpServiceClient();

    // Prepare the request message.
    $request = (new GetInspectTemplateRequest())
        ->setName($formattedName);

    // Call the API and handle any network failures.
    try {
        /** @var InspectTemplate $response */
        $response = $dlpServiceClient->getInspectTemplate($request);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedName = DlpServiceClient::inspectTemplateName('[ORGANIZATION]', '[INSPECT_TEMPLATE]');

    get_inspect_template_sample($formattedName);
}

getJobTrigger

Parameters
Name Description
request Google\Cloud\Dlp\V2\GetJobTriggerRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
Type Description
Google\Cloud\Dlp\V2\JobTrigger
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Dlp\V2\Client\DlpServiceClient;
use Google\Cloud\Dlp\V2\GetJobTriggerRequest;
use Google\Cloud\Dlp\V2\JobTrigger;

/**
 * @param string $formattedName Resource name of the project and the triggeredJob, for example
 *                              `projects/dlp-test-project/jobTriggers/53234423`. Please see
 *                              {@see DlpServiceClient::jobTriggerName()} for help formatting this field.
 */
function get_job_trigger_sample(string $formattedName): void
{
    // Create a client.
    $dlpServiceClient = new DlpServiceClient();

    // Prepare the request message.
    $request = (new GetJobTriggerRequest())
        ->setName($formattedName);

    // Call the API and handle any network failures.
    try {
        /** @var JobTrigger $response */
        $response = $dlpServiceClient->getJobTrigger($request);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedName = DlpServiceClient::jobTriggerName('[PROJECT]', '[JOB_TRIGGER]');

    get_job_trigger_sample($formattedName);
}

getProjectDataProfile

Gets a project data profile.

The async variant is Google\Cloud\Dlp\V2\Client\DlpServiceClient::getProjectDataProfileAsync() .

Parameters
Name Description
request Google\Cloud\Dlp\V2\GetProjectDataProfileRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
Type Description
Google\Cloud\Dlp\V2\ProjectDataProfile
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Dlp\V2\Client\DlpServiceClient;
use Google\Cloud\Dlp\V2\GetProjectDataProfileRequest;
use Google\Cloud\Dlp\V2\ProjectDataProfile;

/**
 * @param string $formattedName Resource name, for example
 *                              `organizations/12345/locations/us/projectDataProfiles/53234423`. Please see
 *                              {@see DlpServiceClient::projectDataProfileName()} for help formatting this field.
 */
function get_project_data_profile_sample(string $formattedName): void
{
    // Create a client.
    $dlpServiceClient = new DlpServiceClient();

    // Prepare the request message.
    $request = (new GetProjectDataProfileRequest())
        ->setName($formattedName);

    // Call the API and handle any network failures.
    try {
        /** @var ProjectDataProfile $response */
        $response = $dlpServiceClient->getProjectDataProfile($request);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedName = DlpServiceClient::projectDataProfileName(
        '[ORGANIZATION]',
        '[LOCATION]',
        '[PROJECT_DATA_PROFILE]'
    );

    get_project_data_profile_sample($formattedName);
}

getStoredInfoType

Parameters
Name Description
request Google\Cloud\Dlp\V2\GetStoredInfoTypeRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
Type Description
Google\Cloud\Dlp\V2\StoredInfoType
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Dlp\V2\Client\DlpServiceClient;
use Google\Cloud\Dlp\V2\GetStoredInfoTypeRequest;
use Google\Cloud\Dlp\V2\StoredInfoType;

/**
 * @param string $formattedName Resource name of the organization and storedInfoType to be read,
 *                              for example `organizations/433245324/storedInfoTypes/432452342` or
 *                              projects/project-id/storedInfoTypes/432452342. Please see
 *                              {@see DlpServiceClient::storedInfoTypeName()} for help formatting this field.
 */
function get_stored_info_type_sample(string $formattedName): void
{
    // Create a client.
    $dlpServiceClient = new DlpServiceClient();

    // Prepare the request message.
    $request = (new GetStoredInfoTypeRequest())
        ->setName($formattedName);

    // Call the API and handle any network failures.
    try {
        /** @var StoredInfoType $response */
        $response = $dlpServiceClient->getStoredInfoType($request);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedName = DlpServiceClient::storedInfoTypeName('[ORGANIZATION]', '[STORED_INFO_TYPE]');

    get_stored_info_type_sample($formattedName);
}

getTableDataProfile

Gets a table data profile.

The async variant is Google\Cloud\Dlp\V2\Client\DlpServiceClient::getTableDataProfileAsync() .

Parameters
Name Description
request Google\Cloud\Dlp\V2\GetTableDataProfileRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
Type Description
Google\Cloud\Dlp\V2\TableDataProfile
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Dlp\V2\Client\DlpServiceClient;
use Google\Cloud\Dlp\V2\GetTableDataProfileRequest;
use Google\Cloud\Dlp\V2\TableDataProfile;

/**
 * @param string $formattedName Resource name, for example
 *                              `organizations/12345/locations/us/tableDataProfiles/53234423`. Please see
 *                              {@see DlpServiceClient::tableDataProfileName()} for help formatting this field.
 */
function get_table_data_profile_sample(string $formattedName): void
{
    // Create a client.
    $dlpServiceClient = new DlpServiceClient();

    // Prepare the request message.
    $request = (new GetTableDataProfileRequest())
        ->setName($formattedName);

    // Call the API and handle any network failures.
    try {
        /** @var TableDataProfile $response */
        $response = $dlpServiceClient->getTableDataProfile($request);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedName = DlpServiceClient::tableDataProfileName(
        '[ORGANIZATION]',
        '[LOCATION]',
        '[TABLE_DATA_PROFILE]'
    );

    get_table_data_profile_sample($formattedName);
}

hybridInspectDlpJob

Inspect hybrid content and store findings to a job.

To review the findings, inspect the job. Inspection will occur asynchronously.

The async variant is Google\Cloud\Dlp\V2\Client\DlpServiceClient::hybridInspectDlpJobAsync() .

Parameters
Name Description
request Google\Cloud\Dlp\V2\HybridInspectDlpJobRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
Type Description
Google\Cloud\Dlp\V2\HybridInspectResponse
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Dlp\V2\Client\DlpServiceClient;
use Google\Cloud\Dlp\V2\HybridInspectDlpJobRequest;
use Google\Cloud\Dlp\V2\HybridInspectResponse;

/**
 * @param string $formattedName Resource name of the job to execute a hybrid inspect on, for
 *                              example `projects/dlp-test-project/dlpJob/53234423`. Please see
 *                              {@see DlpServiceClient::dlpJobName()} for help formatting this field.
 */
function hybrid_inspect_dlp_job_sample(string $formattedName): void
{
    // Create a client.
    $dlpServiceClient = new DlpServiceClient();

    // Prepare the request message.
    $request = (new HybridInspectDlpJobRequest())
        ->setName($formattedName);

    // Call the API and handle any network failures.
    try {
        /** @var HybridInspectResponse $response */
        $response = $dlpServiceClient->hybridInspectDlpJob($request);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedName = DlpServiceClient::dlpJobName('[PROJECT]', '[DLP_JOB]');

    hybrid_inspect_dlp_job_sample($formattedName);
}

hybridInspectJobTrigger

Inspect hybrid content and store findings to a trigger. The inspection will be processed asynchronously. To review the findings monitor the jobs within the trigger.

The async variant is Google\Cloud\Dlp\V2\Client\DlpServiceClient::hybridInspectJobTriggerAsync() .

Parameters
Name Description
request Google\Cloud\Dlp\V2\HybridInspectJobTriggerRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
Type Description
Google\Cloud\Dlp\V2\HybridInspectResponse
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Dlp\V2\Client\DlpServiceClient;
use Google\Cloud\Dlp\V2\HybridInspectJobTriggerRequest;
use Google\Cloud\Dlp\V2\HybridInspectResponse;

/**
 * @param string $formattedName Resource name of the trigger to execute a hybrid inspect on, for
 *                              example `projects/dlp-test-project/jobTriggers/53234423`. Please see
 *                              {@see DlpServiceClient::jobTriggerName()} for help formatting this field.
 */
function hybrid_inspect_job_trigger_sample(string $formattedName): void
{
    // Create a client.
    $dlpServiceClient = new DlpServiceClient();

    // Prepare the request message.
    $request = (new HybridInspectJobTriggerRequest())
        ->setName($formattedName);

    // Call the API and handle any network failures.
    try {
        /** @var HybridInspectResponse $response */
        $response = $dlpServiceClient->hybridInspectJobTrigger($request);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedName = DlpServiceClient::jobTriggerName('[PROJECT]', '[JOB_TRIGGER]');

    hybrid_inspect_job_trigger_sample($formattedName);
}

inspectContent

Finds potentially sensitive info in content.

This method has limits on input size, processing time, and output size.

When no InfoTypes or CustomInfoTypes are specified in this request, the system will automatically choose what detectors to run. By default this may be all types, but may change over time as detectors are updated.

For how to guides, see https://cloud.google.com/sensitive-data-protection/docs/inspecting-images and https://cloud.google.com/sensitive-data-protection/docs/inspecting-text,

The async variant is Google\Cloud\Dlp\V2\Client\DlpServiceClient::inspectContentAsync() .

Parameters
Name Description
request Google\Cloud\Dlp\V2\InspectContentRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
Type Description
Google\Cloud\Dlp\V2\InspectContentResponse
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Dlp\V2\Client\DlpServiceClient;
use Google\Cloud\Dlp\V2\InspectContentRequest;
use Google\Cloud\Dlp\V2\InspectContentResponse;

/**
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function inspect_content_sample(): void
{
    // Create a client.
    $dlpServiceClient = new DlpServiceClient();

    // Prepare the request message.
    $request = new InspectContentRequest();

    // Call the API and handle any network failures.
    try {
        /** @var InspectContentResponse $response */
        $response = $dlpServiceClient->inspectContent($request);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

listColumnDataProfiles

Lists data profiles for an organization.

The async variant is Google\Cloud\Dlp\V2\Client\DlpServiceClient::listColumnDataProfilesAsync() .

Parameters
Name Description
request Google\Cloud\Dlp\V2\ListColumnDataProfilesRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
Type Description
Google\ApiCore\PagedListResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\Dlp\V2\Client\DlpServiceClient;
use Google\Cloud\Dlp\V2\ColumnDataProfile;
use Google\Cloud\Dlp\V2\ListColumnDataProfilesRequest;

/**
 * @param string $formattedParent Resource name of the organization or project, for
 *                                example `organizations/433245324/locations/europe` or
 *                                `projects/project-id/locations/asia`. Please see
 *                                {@see DlpServiceClient::organizationLocationName()} for help formatting this field.
 */
function list_column_data_profiles_sample(string $formattedParent): void
{
    // Create a client.
    $dlpServiceClient = new DlpServiceClient();

    // Prepare the request message.
    $request = (new ListColumnDataProfilesRequest())
        ->setParent($formattedParent);

    // Call the API and handle any network failures.
    try {
        /** @var PagedListResponse $response */
        $response = $dlpServiceClient->listColumnDataProfiles($request);

        /** @var ColumnDataProfile $element */
        foreach ($response as $element) {
            printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
        }
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedParent = DlpServiceClient::organizationLocationName('[ORGANIZATION]', '[LOCATION]');

    list_column_data_profiles_sample($formattedParent);
}

listDeidentifyTemplates

Parameters
Name Description
request Google\Cloud\Dlp\V2\ListDeidentifyTemplatesRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
Type Description
Google\ApiCore\PagedListResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\Dlp\V2\Client\DlpServiceClient;
use Google\Cloud\Dlp\V2\DeidentifyTemplate;
use Google\Cloud\Dlp\V2\ListDeidentifyTemplatesRequest;

/**
 * @param string $formattedParent Parent resource name.
 *
 *                                The format of this value varies depending on the scope of the request
 *                                (project or organization) and whether you have [specified a processing
 *                                location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location):
 *
 *                                + Projects scope, location specified:<br/>
 *                                `projects/`<var>PROJECT_ID</var>`/locations/`<var>LOCATION_ID</var>
 *                                + Projects scope, no location specified (defaults to global):<br/>
 *                                `projects/`<var>PROJECT_ID</var>
 *                                + Organizations scope, location specified:<br/>
 *                                `organizations/`<var>ORG_ID</var>`/locations/`<var>LOCATION_ID</var>
 *                                + Organizations scope, no location specified (defaults to global):<br/>
 *                                `organizations/`<var>ORG_ID</var>
 *
 *                                The following example `parent` string specifies a parent project with the
 *                                identifier `example-project`, and specifies the `europe-west3` location
 *                                for processing data:
 *
 *                                parent=projects/example-project/locations/europe-west3
 *                                Please see {@see DlpServiceClient::organizationLocationName()} for help formatting this field.
 */
function list_deidentify_templates_sample(string $formattedParent): void
{
    // Create a client.
    $dlpServiceClient = new DlpServiceClient();

    // Prepare the request message.
    $request = (new ListDeidentifyTemplatesRequest())
        ->setParent($formattedParent);

    // Call the API and handle any network failures.
    try {
        /** @var PagedListResponse $response */
        $response = $dlpServiceClient->listDeidentifyTemplates($request);

        /** @var DeidentifyTemplate $element */
        foreach ($response as $element) {
            printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
        }
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedParent = DlpServiceClient::organizationLocationName('[ORGANIZATION]', '[LOCATION]');

    list_deidentify_templates_sample($formattedParent);
}

listDiscoveryConfigs

Lists discovery configurations.

The async variant is Google\Cloud\Dlp\V2\Client\DlpServiceClient::listDiscoveryConfigsAsync() .

Parameters
Name Description
request Google\Cloud\Dlp\V2\ListDiscoveryConfigsRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
Type Description
Google\ApiCore\PagedListResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\Dlp\V2\Client\DlpServiceClient;
use Google\Cloud\Dlp\V2\DiscoveryConfig;
use Google\Cloud\Dlp\V2\ListDiscoveryConfigsRequest;

/**
 * @param string $formattedParent Parent resource name.
 *
 *                                The format of this value is as follows:
 *                                `projects/`<var>PROJECT_ID</var>`/locations/`<var>LOCATION_ID</var>
 *
 *                                The following example `parent` string specifies a parent project with the
 *                                identifier `example-project`, and specifies the `europe-west3` location
 *                                for processing data:
 *
 *                                parent=projects/example-project/locations/europe-west3
 *                                Please see {@see DlpServiceClient::locationName()} for help formatting this field.
 */
function list_discovery_configs_sample(string $formattedParent): void
{
    // Create a client.
    $dlpServiceClient = new DlpServiceClient();

    // Prepare the request message.
    $request = (new ListDiscoveryConfigsRequest())
        ->setParent($formattedParent);

    // Call the API and handle any network failures.
    try {
        /** @var PagedListResponse $response */
        $response = $dlpServiceClient->listDiscoveryConfigs($request);

        /** @var DiscoveryConfig $element */
        foreach ($response as $element) {
            printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
        }
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedParent = DlpServiceClient::locationName('[PROJECT]', '[LOCATION]');

    list_discovery_configs_sample($formattedParent);
}

listDlpJobs

Parameters
Name Description
request Google\Cloud\Dlp\V2\ListDlpJobsRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
Type Description
Google\ApiCore\PagedListResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\Dlp\V2\Client\DlpServiceClient;
use Google\Cloud\Dlp\V2\DlpJob;
use Google\Cloud\Dlp\V2\ListDlpJobsRequest;

/**
 * @param string $formattedParent Parent resource name.
 *
 *                                The format of this value varies depending on whether you have [specified a
 *                                processing
 *                                location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location):
 *
 *                                + Projects scope, location specified:<br/>
 *                                `projects/`<var>PROJECT_ID</var>`/locations/`<var>LOCATION_ID</var>
 *                                + Projects scope, no location specified (defaults to global):<br/>
 *                                `projects/`<var>PROJECT_ID</var>
 *
 *                                The following example `parent` string specifies a parent project with the
 *                                identifier `example-project`, and specifies the `europe-west3` location
 *                                for processing data:
 *
 *                                parent=projects/example-project/locations/europe-west3
 *                                Please see {@see DlpServiceClient::projectName()} for help formatting this field.
 */
function list_dlp_jobs_sample(string $formattedParent): void
{
    // Create a client.
    $dlpServiceClient = new DlpServiceClient();

    // Prepare the request message.
    $request = (new ListDlpJobsRequest())
        ->setParent($formattedParent);

    // Call the API and handle any network failures.
    try {
        /** @var PagedListResponse $response */
        $response = $dlpServiceClient->listDlpJobs($request);

        /** @var DlpJob $element */
        foreach ($response as $element) {
            printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
        }
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedParent = DlpServiceClient::projectName('[PROJECT]');

    list_dlp_jobs_sample($formattedParent);
}

listInfoTypes

Returns a list of the sensitive information types that DLP API supports. See https://cloud.google.com/sensitive-data-protection/docs/infotypes-reference to learn more.

The async variant is Google\Cloud\Dlp\V2\Client\DlpServiceClient::listInfoTypesAsync() .

Parameters
Name Description
request Google\Cloud\Dlp\V2\ListInfoTypesRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
Type Description
Google\Cloud\Dlp\V2\ListInfoTypesResponse
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Dlp\V2\Client\DlpServiceClient;
use Google\Cloud\Dlp\V2\ListInfoTypesRequest;
use Google\Cloud\Dlp\V2\ListInfoTypesResponse;

/**
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function list_info_types_sample(): void
{
    // Create a client.
    $dlpServiceClient = new DlpServiceClient();

    // Prepare the request message.
    $request = new ListInfoTypesRequest();

    // Call the API and handle any network failures.
    try {
        /** @var ListInfoTypesResponse $response */
        $response = $dlpServiceClient->listInfoTypes($request);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

listInspectTemplates

Parameters
Name Description
request Google\Cloud\Dlp\V2\ListInspectTemplatesRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
Type Description
Google\ApiCore\PagedListResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\Dlp\V2\Client\DlpServiceClient;
use Google\Cloud\Dlp\V2\InspectTemplate;
use Google\Cloud\Dlp\V2\ListInspectTemplatesRequest;

/**
 * @param string $formattedParent Parent resource name.
 *
 *                                The format of this value varies depending on the scope of the request
 *                                (project or organization) and whether you have [specified a processing
 *                                location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location):
 *
 *                                + Projects scope, location specified:<br/>
 *                                `projects/`<var>PROJECT_ID</var>`/locations/`<var>LOCATION_ID</var>
 *                                + Projects scope, no location specified (defaults to global):<br/>
 *                                `projects/`<var>PROJECT_ID</var>
 *                                + Organizations scope, location specified:<br/>
 *                                `organizations/`<var>ORG_ID</var>`/locations/`<var>LOCATION_ID</var>
 *                                + Organizations scope, no location specified (defaults to global):<br/>
 *                                `organizations/`<var>ORG_ID</var>
 *
 *                                The following example `parent` string specifies a parent project with the
 *                                identifier `example-project`, and specifies the `europe-west3` location
 *                                for processing data:
 *
 *                                parent=projects/example-project/locations/europe-west3
 *                                Please see {@see DlpServiceClient::organizationLocationName()} for help formatting this field.
 */
function list_inspect_templates_sample(string $formattedParent): void
{
    // Create a client.
    $dlpServiceClient = new DlpServiceClient();

    // Prepare the request message.
    $request = (new ListInspectTemplatesRequest())
        ->setParent($formattedParent);

    // Call the API and handle any network failures.
    try {
        /** @var PagedListResponse $response */
        $response = $dlpServiceClient->listInspectTemplates($request);

        /** @var InspectTemplate $element */
        foreach ($response as $element) {
            printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
        }
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedParent = DlpServiceClient::organizationLocationName('[ORGANIZATION]', '[LOCATION]');

    list_inspect_templates_sample($formattedParent);
}

listJobTriggers

Parameters
Name Description
request Google\Cloud\Dlp\V2\ListJobTriggersRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
Type Description
Google\ApiCore\PagedListResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\Dlp\V2\Client\DlpServiceClient;
use Google\Cloud\Dlp\V2\JobTrigger;
use Google\Cloud\Dlp\V2\ListJobTriggersRequest;

/**
 * @param string $formattedParent Parent resource name.
 *
 *                                The format of this value varies depending on whether you have [specified a
 *                                processing
 *                                location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location):
 *
 *                                + Projects scope, location specified:<br/>
 *                                `projects/`<var>PROJECT_ID</var>`/locations/`<var>LOCATION_ID</var>
 *                                + Projects scope, no location specified (defaults to global):<br/>
 *                                `projects/`<var>PROJECT_ID</var>
 *
 *                                The following example `parent` string specifies a parent project with the
 *                                identifier `example-project`, and specifies the `europe-west3` location
 *                                for processing data:
 *
 *                                parent=projects/example-project/locations/europe-west3
 *                                Please see {@see DlpServiceClient::projectName()} for help formatting this field.
 */
function list_job_triggers_sample(string $formattedParent): void
{
    // Create a client.
    $dlpServiceClient = new DlpServiceClient();

    // Prepare the request message.
    $request = (new ListJobTriggersRequest())
        ->setParent($formattedParent);

    // Call the API and handle any network failures.
    try {
        /** @var PagedListResponse $response */
        $response = $dlpServiceClient->listJobTriggers($request);

        /** @var JobTrigger $element */
        foreach ($response as $element) {
            printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
        }
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedParent = DlpServiceClient::projectName('[PROJECT]');

    list_job_triggers_sample($formattedParent);
}

listProjectDataProfiles

Lists data profiles for an organization.

The async variant is Google\Cloud\Dlp\V2\Client\DlpServiceClient::listProjectDataProfilesAsync() .

Parameters
Name Description
request Google\Cloud\Dlp\V2\ListProjectDataProfilesRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
Type Description
Google\ApiCore\PagedListResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\Dlp\V2\Client\DlpServiceClient;
use Google\Cloud\Dlp\V2\ListProjectDataProfilesRequest;
use Google\Cloud\Dlp\V2\ProjectDataProfile;

/**
 * @param string $formattedParent organizations/{org_id}/locations/{loc_id}
 *                                Please see {@see DlpServiceClient::organizationLocationName()} for help formatting this field.
 */
function list_project_data_profiles_sample(string $formattedParent): void
{
    // Create a client.
    $dlpServiceClient = new DlpServiceClient();

    // Prepare the request message.
    $request = (new ListProjectDataProfilesRequest())
        ->setParent($formattedParent);

    // Call the API and handle any network failures.
    try {
        /** @var PagedListResponse $response */
        $response = $dlpServiceClient->listProjectDataProfiles($request);

        /** @var ProjectDataProfile $element */
        foreach ($response as $element) {
            printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
        }
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedParent = DlpServiceClient::organizationLocationName('[ORGANIZATION]', '[LOCATION]');

    list_project_data_profiles_sample($formattedParent);
}

listStoredInfoTypes

Parameters
Name Description
request Google\Cloud\Dlp\V2\ListStoredInfoTypesRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
Type Description
Google\ApiCore\PagedListResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\Dlp\V2\Client\DlpServiceClient;
use Google\Cloud\Dlp\V2\ListStoredInfoTypesRequest;
use Google\Cloud\Dlp\V2\StoredInfoType;

/**
 * @param string $formattedParent Parent resource name.
 *
 *                                The format of this value varies depending on the scope of the request
 *                                (project or organization) and whether you have [specified a processing
 *                                location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location):
 *
 *                                + Projects scope, location specified:<br/>
 *                                `projects/`<var>PROJECT_ID</var>`/locations/`<var>LOCATION_ID</var>
 *                                + Projects scope, no location specified (defaults to global):<br/>
 *                                `projects/`<var>PROJECT_ID</var>
 *
 *                                The following example `parent` string specifies a parent project with the
 *                                identifier `example-project`, and specifies the `europe-west3` location
 *                                for processing data:
 *
 *                                parent=projects/example-project/locations/europe-west3
 *                                Please see {@see DlpServiceClient::organizationLocationName()} for help formatting this field.
 */
function list_stored_info_types_sample(string $formattedParent): void
{
    // Create a client.
    $dlpServiceClient = new DlpServiceClient();

    // Prepare the request message.
    $request = (new ListStoredInfoTypesRequest())
        ->setParent($formattedParent);

    // Call the API and handle any network failures.
    try {
        /** @var PagedListResponse $response */
        $response = $dlpServiceClient->listStoredInfoTypes($request);

        /** @var StoredInfoType $element */
        foreach ($response as $element) {
            printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
        }
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedParent = DlpServiceClient::organizationLocationName('[ORGANIZATION]', '[LOCATION]');

    list_stored_info_types_sample($formattedParent);
}

listTableDataProfiles

Lists data profiles for an organization.

The async variant is Google\Cloud\Dlp\V2\Client\DlpServiceClient::listTableDataProfilesAsync() .

Parameters
Name Description
request Google\Cloud\Dlp\V2\ListTableDataProfilesRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
Type Description
Google\ApiCore\PagedListResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\Dlp\V2\Client\DlpServiceClient;
use Google\Cloud\Dlp\V2\ListTableDataProfilesRequest;
use Google\Cloud\Dlp\V2\TableDataProfile;

/**
 * @param string $formattedParent Resource name of the organization or project, for
 *                                example `organizations/433245324/locations/europe` or
 *                                `projects/project-id/locations/asia`. Please see
 *                                {@see DlpServiceClient::organizationLocationName()} for help formatting this field.
 */
function list_table_data_profiles_sample(string $formattedParent): void
{
    // Create a client.
    $dlpServiceClient = new DlpServiceClient();

    // Prepare the request message.
    $request = (new ListTableDataProfilesRequest())
        ->setParent($formattedParent);

    // Call the API and handle any network failures.
    try {
        /** @var PagedListResponse $response */
        $response = $dlpServiceClient->listTableDataProfiles($request);

        /** @var TableDataProfile $element */
        foreach ($response as $element) {
            printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
        }
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedParent = DlpServiceClient::organizationLocationName('[ORGANIZATION]', '[LOCATION]');

    list_table_data_profiles_sample($formattedParent);
}

redactImage

Redacts potentially sensitive info from an image.

This method has limits on input size, processing time, and output size. See https://cloud.google.com/sensitive-data-protection/docs/redacting-sensitive-data-images to learn more.

When no InfoTypes or CustomInfoTypes are specified in this request, the system will automatically choose what detectors to run. By default this may be all types, but may change over time as detectors are updated.

The async variant is Google\Cloud\Dlp\V2\Client\DlpServiceClient::redactImageAsync() .

Parameters
Name Description
request Google\Cloud\Dlp\V2\RedactImageRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
Type Description
Google\Cloud\Dlp\V2\RedactImageResponse
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Dlp\V2\Client\DlpServiceClient;
use Google\Cloud\Dlp\V2\RedactImageRequest;
use Google\Cloud\Dlp\V2\RedactImageResponse;

/**
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function redact_image_sample(): void
{
    // Create a client.
    $dlpServiceClient = new DlpServiceClient();

    // Prepare the request message.
    $request = new RedactImageRequest();

    // Call the API and handle any network failures.
    try {
        /** @var RedactImageResponse $response */
        $response = $dlpServiceClient->redactImage($request);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

reidentifyContent

Parameters
Name Description
request Google\Cloud\Dlp\V2\ReidentifyContentRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
Type Description
Google\Cloud\Dlp\V2\ReidentifyContentResponse
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Dlp\V2\Client\DlpServiceClient;
use Google\Cloud\Dlp\V2\ReidentifyContentRequest;
use Google\Cloud\Dlp\V2\ReidentifyContentResponse;

/**
 * @param string $formattedParent Parent resource name.
 *
 *                                The format of this value varies depending on whether you have [specified a
 *                                processing
 *                                location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location):
 *
 *                                + Projects scope, location specified:<br/>
 *                                `projects/`<var>PROJECT_ID</var>`/locations/`<var>LOCATION_ID</var>
 *                                + Projects scope, no location specified (defaults to global):<br/>
 *                                `projects/`<var>PROJECT_ID</var>
 *
 *                                The following example `parent` string specifies a parent project with the
 *                                identifier `example-project`, and specifies the `europe-west3` location
 *                                for processing data:
 *
 *                                parent=projects/example-project/locations/europe-west3
 *                                Please see {@see DlpServiceClient::projectName()} for help formatting this field.
 */
function reidentify_content_sample(string $formattedParent): void
{
    // Create a client.
    $dlpServiceClient = new DlpServiceClient();

    // Prepare the request message.
    $request = (new ReidentifyContentRequest())
        ->setParent($formattedParent);

    // Call the API and handle any network failures.
    try {
        /** @var ReidentifyContentResponse $response */
        $response = $dlpServiceClient->reidentifyContent($request);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedParent = DlpServiceClient::projectName('[PROJECT]');

    reidentify_content_sample($formattedParent);
}

updateDeidentifyTemplate

Parameters
Name Description
request Google\Cloud\Dlp\V2\UpdateDeidentifyTemplateRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
Type Description
Google\Cloud\Dlp\V2\DeidentifyTemplate
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Dlp\V2\Client\DlpServiceClient;
use Google\Cloud\Dlp\V2\DeidentifyTemplate;
use Google\Cloud\Dlp\V2\UpdateDeidentifyTemplateRequest;

/**
 * @param string $formattedName Resource name of organization and deidentify template to be
 *                              updated, for example
 *                              `organizations/433245324/deidentifyTemplates/432452342` or
 *                              projects/project-id/deidentifyTemplates/432452342. Please see
 *                              {@see DlpServiceClient::deidentifyTemplateName()} for help formatting this field.
 */
function update_deidentify_template_sample(string $formattedName): void
{
    // Create a client.
    $dlpServiceClient = new DlpServiceClient();

    // Prepare the request message.
    $request = (new UpdateDeidentifyTemplateRequest())
        ->setName($formattedName);

    // Call the API and handle any network failures.
    try {
        /** @var DeidentifyTemplate $response */
        $response = $dlpServiceClient->updateDeidentifyTemplate($request);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedName = DlpServiceClient::deidentifyTemplateName(
        '[ORGANIZATION]',
        '[DEIDENTIFY_TEMPLATE]'
    );

    update_deidentify_template_sample($formattedName);
}

updateDiscoveryConfig

Updates a discovery configuration.

The async variant is Google\Cloud\Dlp\V2\Client\DlpServiceClient::updateDiscoveryConfigAsync() .

Parameters
Name Description
request Google\Cloud\Dlp\V2\UpdateDiscoveryConfigRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
Type Description
Google\Cloud\Dlp\V2\DiscoveryConfig
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Dlp\V2\Client\DlpServiceClient;
use Google\Cloud\Dlp\V2\DiscoveryConfig;
use Google\Cloud\Dlp\V2\DiscoveryConfig\Status;
use Google\Cloud\Dlp\V2\UpdateDiscoveryConfigRequest;

/**
 * @param string $formattedName         Resource name of the project and the configuration, for example
 *                                      `projects/dlp-test-project/discoveryConfigs/53234423`. Please see
 *                                      {@see DlpServiceClient::discoveryConfigName()} for help formatting this field.
 * @param int    $discoveryConfigStatus A status for this configuration.
 */
function update_discovery_config_sample(string $formattedName, int $discoveryConfigStatus): void
{
    // Create a client.
    $dlpServiceClient = new DlpServiceClient();

    // Prepare the request message.
    $discoveryConfig = (new DiscoveryConfig())
        ->setStatus($discoveryConfigStatus);
    $request = (new UpdateDiscoveryConfigRequest())
        ->setName($formattedName)
        ->setDiscoveryConfig($discoveryConfig);

    // Call the API and handle any network failures.
    try {
        /** @var DiscoveryConfig $response */
        $response = $dlpServiceClient->updateDiscoveryConfig($request);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedName = DlpServiceClient::discoveryConfigName(
        '[PROJECT]',
        '[LOCATION]',
        '[DISCOVERY_CONFIG]'
    );
    $discoveryConfigStatus = Status::STATUS_UNSPECIFIED;

    update_discovery_config_sample($formattedName, $discoveryConfigStatus);
}

updateInspectTemplate

Parameters
Name Description
request Google\Cloud\Dlp\V2\UpdateInspectTemplateRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
Type Description
Google\Cloud\Dlp\V2\InspectTemplate
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Dlp\V2\Client\DlpServiceClient;
use Google\Cloud\Dlp\V2\InspectTemplate;
use Google\Cloud\Dlp\V2\UpdateInspectTemplateRequest;

/**
 * @param string $formattedName Resource name of organization and inspectTemplate to be updated,
 *                              for example `organizations/433245324/inspectTemplates/432452342` or
 *                              projects/project-id/inspectTemplates/432452342. Please see
 *                              {@see DlpServiceClient::inspectTemplateName()} for help formatting this field.
 */
function update_inspect_template_sample(string $formattedName): void
{
    // Create a client.
    $dlpServiceClient = new DlpServiceClient();

    // Prepare the request message.
    $request = (new UpdateInspectTemplateRequest())
        ->setName($formattedName);

    // Call the API and handle any network failures.
    try {
        /** @var InspectTemplate $response */
        $response = $dlpServiceClient->updateInspectTemplate($request);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedName = DlpServiceClient::inspectTemplateName('[ORGANIZATION]', '[INSPECT_TEMPLATE]');

    update_inspect_template_sample($formattedName);
}

updateJobTrigger

Parameters
Name Description
request Google\Cloud\Dlp\V2\UpdateJobTriggerRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
Type Description
Google\Cloud\Dlp\V2\JobTrigger
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Dlp\V2\Client\DlpServiceClient;
use Google\Cloud\Dlp\V2\JobTrigger;
use Google\Cloud\Dlp\V2\UpdateJobTriggerRequest;

/**
 * @param string $formattedName Resource name of the project and the triggeredJob, for example
 *                              `projects/dlp-test-project/jobTriggers/53234423`. Please see
 *                              {@see DlpServiceClient::jobTriggerName()} for help formatting this field.
 */
function update_job_trigger_sample(string $formattedName): void
{
    // Create a client.
    $dlpServiceClient = new DlpServiceClient();

    // Prepare the request message.
    $request = (new UpdateJobTriggerRequest())
        ->setName($formattedName);

    // Call the API and handle any network failures.
    try {
        /** @var JobTrigger $response */
        $response = $dlpServiceClient->updateJobTrigger($request);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedName = DlpServiceClient::jobTriggerName('[PROJECT]', '[JOB_TRIGGER]');

    update_job_trigger_sample($formattedName);
}

updateStoredInfoType

Updates the stored infoType by creating a new version. The existing version will continue to be used until the new version is ready.

See https://cloud.google.com/sensitive-data-protection/docs/creating-stored-infotypes to learn more.

The async variant is Google\Cloud\Dlp\V2\Client\DlpServiceClient::updateStoredInfoTypeAsync() .

Parameters
Name Description
request Google\Cloud\Dlp\V2\UpdateStoredInfoTypeRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
Type Description
Google\Cloud\Dlp\V2\StoredInfoType
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Dlp\V2\Client\DlpServiceClient;
use Google\Cloud\Dlp\V2\StoredInfoType;
use Google\Cloud\Dlp\V2\UpdateStoredInfoTypeRequest;

/**
 * @param string $formattedName Resource name of organization and storedInfoType to be updated,
 *                              for example `organizations/433245324/storedInfoTypes/432452342` or
 *                              projects/project-id/storedInfoTypes/432452342. Please see
 *                              {@see DlpServiceClient::storedInfoTypeName()} for help formatting this field.
 */
function update_stored_info_type_sample(string $formattedName): void
{
    // Create a client.
    $dlpServiceClient = new DlpServiceClient();

    // Prepare the request message.
    $request = (new UpdateStoredInfoTypeRequest())
        ->setName($formattedName);

    // Call the API and handle any network failures.
    try {
        /** @var StoredInfoType $response */
        $response = $dlpServiceClient->updateStoredInfoType($request);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedName = DlpServiceClient::storedInfoTypeName('[ORGANIZATION]', '[STORED_INFO_TYPE]');

    update_stored_info_type_sample($formattedName);
}

activateJobTriggerAsync

Parameters
Name Description
request Google\Cloud\Dlp\V2\ActivateJobTriggerRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

cancelDlpJobAsync

Parameters
Name Description
request Google\Cloud\Dlp\V2\CancelDlpJobRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

createDeidentifyTemplateAsync

Parameters
Name Description
request Google\Cloud\Dlp\V2\CreateDeidentifyTemplateRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

createDiscoveryConfigAsync

Parameters
Name Description
request Google\Cloud\Dlp\V2\CreateDiscoveryConfigRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

createDlpJobAsync

Parameters
Name Description
request Google\Cloud\Dlp\V2\CreateDlpJobRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

createInspectTemplateAsync

Parameters
Name Description
request Google\Cloud\Dlp\V2\CreateInspectTemplateRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

createJobTriggerAsync

Parameters
Name Description
request Google\Cloud\Dlp\V2\CreateJobTriggerRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

createStoredInfoTypeAsync

Parameters
Name Description
request Google\Cloud\Dlp\V2\CreateStoredInfoTypeRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

deidentifyContentAsync

Parameters
Name Description
request Google\Cloud\Dlp\V2\DeidentifyContentRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

deleteDeidentifyTemplateAsync

Parameters
Name Description
request Google\Cloud\Dlp\V2\DeleteDeidentifyTemplateRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

deleteDiscoveryConfigAsync

Parameters
Name Description
request Google\Cloud\Dlp\V2\DeleteDiscoveryConfigRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

deleteDlpJobAsync

Parameters
Name Description
request Google\Cloud\Dlp\V2\DeleteDlpJobRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

deleteInspectTemplateAsync

Parameters
Name Description
request Google\Cloud\Dlp\V2\DeleteInspectTemplateRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

deleteJobTriggerAsync

Parameters
Name Description
request Google\Cloud\Dlp\V2\DeleteJobTriggerRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

deleteStoredInfoTypeAsync

Parameters
Name Description
request Google\Cloud\Dlp\V2\DeleteStoredInfoTypeRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

finishDlpJobAsync

Parameters
Name Description
request Google\Cloud\Dlp\V2\FinishDlpJobRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

getColumnDataProfileAsync

Parameters
Name Description
request Google\Cloud\Dlp\V2\GetColumnDataProfileRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

getDeidentifyTemplateAsync

Parameters
Name Description
request Google\Cloud\Dlp\V2\GetDeidentifyTemplateRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

getDiscoveryConfigAsync

Parameters
Name Description
request Google\Cloud\Dlp\V2\GetDiscoveryConfigRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

getDlpJobAsync

Parameters
Name Description
request Google\Cloud\Dlp\V2\GetDlpJobRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

getInspectTemplateAsync

Parameters
Name Description
request Google\Cloud\Dlp\V2\GetInspectTemplateRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

getJobTriggerAsync

Parameters
Name Description
request Google\Cloud\Dlp\V2\GetJobTriggerRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

getProjectDataProfileAsync

Parameters
Name Description
request Google\Cloud\Dlp\V2\GetProjectDataProfileRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

getStoredInfoTypeAsync

Parameters
Name Description
request Google\Cloud\Dlp\V2\GetStoredInfoTypeRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

getTableDataProfileAsync

Parameters
Name Description
request Google\Cloud\Dlp\V2\GetTableDataProfileRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

hybridInspectDlpJobAsync

Parameters
Name Description
request Google\Cloud\Dlp\V2\HybridInspectDlpJobRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

hybridInspectJobTriggerAsync

Parameters
Name Description
request Google\Cloud\Dlp\V2\HybridInspectJobTriggerRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

inspectContentAsync

Parameters
Name Description
request Google\Cloud\Dlp\V2\InspectContentRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

listColumnDataProfilesAsync

Parameters
Name Description
request Google\Cloud\Dlp\V2\ListColumnDataProfilesRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

listDeidentifyTemplatesAsync

Parameters
Name Description
request Google\Cloud\Dlp\V2\ListDeidentifyTemplatesRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

listDiscoveryConfigsAsync

Parameters
Name Description
request Google\Cloud\Dlp\V2\ListDiscoveryConfigsRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

listDlpJobsAsync

Parameters
Name Description
request Google\Cloud\Dlp\V2\ListDlpJobsRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

listInfoTypesAsync

Parameters
Name Description
request Google\Cloud\Dlp\V2\ListInfoTypesRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

listInspectTemplatesAsync

Parameters
Name Description
request Google\Cloud\Dlp\V2\ListInspectTemplatesRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

listJobTriggersAsync

Parameters
Name Description
request Google\Cloud\Dlp\V2\ListJobTriggersRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

listProjectDataProfilesAsync

Parameters
Name Description
request Google\Cloud\Dlp\V2\ListProjectDataProfilesRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

listStoredInfoTypesAsync

Parameters
Name Description
request Google\Cloud\Dlp\V2\ListStoredInfoTypesRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

listTableDataProfilesAsync

Parameters
Name Description
request Google\Cloud\Dlp\V2\ListTableDataProfilesRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

redactImageAsync

Parameters
Name Description
request Google\Cloud\Dlp\V2\RedactImageRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

reidentifyContentAsync

Parameters
Name Description
request Google\Cloud\Dlp\V2\ReidentifyContentRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

updateDeidentifyTemplateAsync

Parameters
Name Description
request Google\Cloud\Dlp\V2\UpdateDeidentifyTemplateRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

updateDiscoveryConfigAsync

Parameters
Name Description
request Google\Cloud\Dlp\V2\UpdateDiscoveryConfigRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

updateInspectTemplateAsync

Parameters
Name Description
request Google\Cloud\Dlp\V2\UpdateInspectTemplateRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

updateJobTriggerAsync

Parameters
Name Description
request Google\Cloud\Dlp\V2\UpdateJobTriggerRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

updateStoredInfoTypeAsync

Parameters
Name Description
request Google\Cloud\Dlp\V2\UpdateStoredInfoTypeRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

static::columnDataProfileName

Formats a string containing the fully-qualified path to represent a column_data_profile resource.

Parameters
Name Description
organization string
location string
columnDataProfile string
Returns
Type Description
string The formatted column_data_profile resource.

static::deidentifyTemplateName

Formats a string containing the fully-qualified path to represent a deidentify_template resource.

Parameters
Name Description
organization string
deidentifyTemplate string
Returns
Type Description
string The formatted deidentify_template resource.

static::discoveryConfigName

Formats a string containing the fully-qualified path to represent a discovery_config resource.

Parameters
Name Description
project string
location string
discoveryConfig string
Returns
Type Description
string The formatted discovery_config resource.

static::dlpJobName

Formats a string containing the fully-qualified path to represent a dlp_job resource.

Parameters
Name Description
project string
dlpJob string
Returns
Type Description
string The formatted dlp_job resource.

static::inspectTemplateName

Formats a string containing the fully-qualified path to represent a inspect_template resource.

Parameters
Name Description
organization string
inspectTemplate string
Returns
Type Description
string The formatted inspect_template resource.

static::jobTriggerName

Formats a string containing the fully-qualified path to represent a job_trigger resource.

Parameters
Name Description
project string
jobTrigger string
Returns
Type Description
string The formatted job_trigger resource.

static::locationName

Formats a string containing the fully-qualified path to represent a location resource.

Parameters
Name Description
project string
location string
Returns
Type Description
string The formatted location resource.

static::organizationName

Formats a string containing the fully-qualified path to represent a organization resource.

Parameter
Name Description
organization string
Returns
Type Description
string The formatted organization resource.

static::organizationDeidentifyTemplateName

Formats a string containing the fully-qualified path to represent a organization_deidentify_template resource.

Parameters
Name Description
organization string
deidentifyTemplate string
Returns
Type Description
string The formatted organization_deidentify_template resource.

static::organizationInspectTemplateName

Formats a string containing the fully-qualified path to represent a organization_inspect_template resource.

Parameters
Name Description
organization string
inspectTemplate string
Returns
Type Description
string The formatted organization_inspect_template resource.

static::organizationLocationName

Formats a string containing the fully-qualified path to represent a organization_location resource.

Parameters
Name Description
organization string
location string
Returns
Type Description
string The formatted organization_location resource.

static::organizationLocationColumnDataProfileName

Formats a string containing the fully-qualified path to represent a organization_location_column_data_profile resource.

Parameters
Name Description
organization string
location string
columnDataProfile string
Returns
Type Description
string The formatted organization_location_column_data_profile resource.

static::organizationLocationDeidentifyTemplateName

Formats a string containing the fully-qualified path to represent a organization_location_deidentify_template resource.

Parameters
Name Description
organization string
location string
deidentifyTemplate string
Returns
Type Description
string The formatted organization_location_deidentify_template resource.

static::organizationLocationInspectTemplateName

Formats a string containing the fully-qualified path to represent a organization_location_inspect_template resource.

Parameters
Name Description
organization string
location string
inspectTemplate string
Returns
Type Description
string The formatted organization_location_inspect_template resource.

static::organizationLocationProjectDataProfileName

Formats a string containing the fully-qualified path to represent a organization_location_project_data_profile resource.

Parameters
Name Description
organization string
location string
projectDataProfile string
Returns
Type Description
string The formatted organization_location_project_data_profile resource.

static::organizationLocationStoredInfoTypeName

Formats a string containing the fully-qualified path to represent a organization_location_stored_info_type resource.

Parameters
Name Description
organization string
location string
storedInfoType string
Returns
Type Description
string The formatted organization_location_stored_info_type resource.

static::organizationLocationTableDataProfileName

Formats a string containing the fully-qualified path to represent a organization_location_table_data_profile resource.

Parameters
Name Description
organization string
location string
tableDataProfile string
Returns
Type Description
string The formatted organization_location_table_data_profile resource.

static::organizationStoredInfoTypeName

Formats a string containing the fully-qualified path to represent a organization_stored_info_type resource.

Parameters
Name Description
organization string
storedInfoType string
Returns
Type Description
string The formatted organization_stored_info_type resource.

static::projectName

Formats a string containing the fully-qualified path to represent a project resource.

Parameter
Name Description
project string
Returns
Type Description
string The formatted project resource.

static::projectDataProfileName

Formats a string containing the fully-qualified path to represent a project_data_profile resource.

Parameters
Name Description
organization string
location string
projectDataProfile string
Returns
Type Description
string The formatted project_data_profile resource.

static::projectDeidentifyTemplateName

Formats a string containing the fully-qualified path to represent a project_deidentify_template resource.

Parameters
Name Description
project string
deidentifyTemplate string
Returns
Type Description
string The formatted project_deidentify_template resource.

static::projectDlpJobName

Formats a string containing the fully-qualified path to represent a project_dlp_job resource.

Parameters
Name Description
project string
dlpJob string
Returns
Type Description
string The formatted project_dlp_job resource.

static::projectInspectTemplateName

Formats a string containing the fully-qualified path to represent a project_inspect_template resource.

Parameters
Name Description
project string
inspectTemplate string
Returns
Type Description
string The formatted project_inspect_template resource.

static::projectJobTriggerName

Formats a string containing the fully-qualified path to represent a project_job_trigger resource.

Parameters
Name Description
project string
jobTrigger string
Returns
Type Description
string The formatted project_job_trigger resource.

static::projectLocationColumnDataProfileName

Formats a string containing the fully-qualified path to represent a project_location_column_data_profile resource.

Parameters
Name Description
project string
location string
columnDataProfile string
Returns
Type Description
string The formatted project_location_column_data_profile resource.

static::projectLocationDeidentifyTemplateName

Formats a string containing the fully-qualified path to represent a project_location_deidentify_template resource.

Parameters
Name Description
project string
location string
deidentifyTemplate string
Returns
Type Description
string The formatted project_location_deidentify_template resource.

static::projectLocationDlpJobName

Formats a string containing the fully-qualified path to represent a project_location_dlp_job resource.

Parameters
Name Description
project string
location string
dlpJob string
Returns
Type Description
string The formatted project_location_dlp_job resource.

static::projectLocationInspectTemplateName

Formats a string containing the fully-qualified path to represent a project_location_inspect_template resource.

Parameters
Name Description
project string
location string
inspectTemplate string
Returns
Type Description
string The formatted project_location_inspect_template resource.

static::projectLocationJobTriggerName

Formats a string containing the fully-qualified path to represent a project_location_job_trigger resource.

Parameters
Name Description
project string
location string
jobTrigger string
Returns
Type Description
string The formatted project_location_job_trigger resource.

static::projectLocationProjectDataProfileName

Formats a string containing the fully-qualified path to represent a project_location_project_data_profile resource.

Parameters
Name Description
project string
location string
projectDataProfile string
Returns
Type Description
string The formatted project_location_project_data_profile resource.

static::projectLocationStoredInfoTypeName

Formats a string containing the fully-qualified path to represent a project_location_stored_info_type resource.

Parameters
Name Description
project string
location string
storedInfoType string
Returns
Type Description
string The formatted project_location_stored_info_type resource.

static::projectLocationTableDataProfileName

Formats a string containing the fully-qualified path to represent a project_location_table_data_profile resource.

Parameters
Name Description
project string
location string
tableDataProfile string
Returns
Type Description
string The formatted project_location_table_data_profile resource.

static::projectStoredInfoTypeName

Formats a string containing the fully-qualified path to represent a project_stored_info_type resource.

Parameters
Name Description
project string
storedInfoType string
Returns
Type Description
string The formatted project_stored_info_type resource.

static::storedInfoTypeName

Formats a string containing the fully-qualified path to represent a stored_info_type resource.

Parameters
Name Description
organization string
storedInfoType string
Returns
Type Description
string The formatted stored_info_type resource.

static::tableDataProfileName

Formats a string containing the fully-qualified path to represent a table_data_profile resource.

Parameters
Name Description
organization string
location string
tableDataProfile string
Returns
Type Description
string The formatted table_data_profile resource.

static::parseName

Parses a formatted name string and returns an associative array of the components in the name.

The following name formats are supported: Template: Pattern

  • columnDataProfile: organizations/{organization}/locations/{location}/columnDataProfiles/{column_data_profile}
  • deidentifyTemplate: organizations/{organization}/deidentifyTemplates/{deidentify_template}
  • discoveryConfig: projects/{project}/locations/{location}/discoveryConfigs/{discovery_config}
  • dlpJob: projects/{project}/dlpJobs/{dlp_job}
  • inspectTemplate: organizations/{organization}/inspectTemplates/{inspect_template}
  • jobTrigger: projects/{project}/jobTriggers/{job_trigger}
  • location: projects/{project}/locations/{location}
  • organization: organizations/{organization}
  • organizationDeidentifyTemplate: organizations/{organization}/deidentifyTemplates/{deidentify_template}
  • organizationInspectTemplate: organizations/{organization}/inspectTemplates/{inspect_template}
  • organizationLocation: organizations/{organization}/locations/{location}
  • organizationLocationColumnDataProfile: organizations/{organization}/locations/{location}/columnDataProfiles/{column_data_profile}
  • organizationLocationDeidentifyTemplate: organizations/{organization}/locations/{location}/deidentifyTemplates/{deidentify_template}
  • organizationLocationInspectTemplate: organizations/{organization}/locations/{location}/inspectTemplates/{inspect_template}
  • organizationLocationProjectDataProfile: organizations/{organization}/locations/{location}/projectDataProfiles/{project_data_profile}
  • organizationLocationStoredInfoType: organizations/{organization}/locations/{location}/storedInfoTypes/{stored_info_type}
  • organizationLocationTableDataProfile: organizations/{organization}/locations/{location}/tableDataProfiles/{table_data_profile}
  • organizationStoredInfoType: organizations/{organization}/storedInfoTypes/{stored_info_type}
  • project: projects/{project}
  • projectDataProfile: organizations/{organization}/locations/{location}/projectDataProfiles/{project_data_profile}
  • projectDeidentifyTemplate: projects/{project}/deidentifyTemplates/{deidentify_template}
  • projectDlpJob: projects/{project}/dlpJobs/{dlp_job}
  • projectInspectTemplate: projects/{project}/inspectTemplates/{inspect_template}
  • projectJobTrigger: projects/{project}/jobTriggers/{job_trigger}
  • projectLocationColumnDataProfile: projects/{project}/locations/{location}/columnDataProfiles/{column_data_profile}
  • projectLocationDeidentifyTemplate: projects/{project}/locations/{location}/deidentifyTemplates/{deidentify_template}
  • projectLocationDlpJob: projects/{project}/locations/{location}/dlpJobs/{dlp_job}
  • projectLocationInspectTemplate: projects/{project}/locations/{location}/inspectTemplates/{inspect_template}
  • projectLocationJobTrigger: projects/{project}/locations/{location}/jobTriggers/{job_trigger}
  • projectLocationProjectDataProfile: projects/{project}/locations/{location}/projectDataProfiles/{project_data_profile}
  • projectLocationStoredInfoType: projects/{project}/locations/{location}/storedInfoTypes/{stored_info_type}
  • projectLocationTableDataProfile: projects/{project}/locations/{location}/tableDataProfiles/{table_data_profile}
  • projectStoredInfoType: projects/{project}/storedInfoTypes/{stored_info_type}
  • storedInfoType: organizations/{organization}/storedInfoTypes/{stored_info_type}
  • tableDataProfile: organizations/{organization}/locations/{location}/tableDataProfiles/{table_data_profile}

The optional $template argument can be supplied to specify a particular pattern, and must match one of the templates listed above. If no $template argument is provided, or if the $template argument does not match one of the templates listed, then parseName will check each of the supported templates, and return the first match.

Parameters
Name Description
formattedName string

The formatted name string

template string

Optional name of template to match

Returns
Type Description
array An associative array from name component IDs to component values.