Data Loss Prevention V2 Client - Class DlpServiceClient (1.12.0)

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/dlp/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
NameDescription
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
NameDescription
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
TypeDescription
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/dlp/docs/inspecting-storage and https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more.

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

Parameters
NameDescription
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/dlp/docs/creating-templates-deid to learn more.

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

Parameters
NameDescription
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
TypeDescription
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/dlp/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
NameDescription
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
TypeDescription
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/dlp/docs/inspecting-storage and https://cloud.google.com/dlp/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
NameDescription
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
TypeDescription
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/dlp/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/dlp/docs/creating-templates to learn more.

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

Parameters
NameDescription
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
TypeDescription
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/dlp/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/dlp/docs/creating-job-triggers to learn more.

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

Parameters
NameDescription
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
TypeDescription
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/dlp/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/dlp/docs/creating-stored-infotypes to learn more.

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

Parameters
NameDescription
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
TypeDescription
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/dlp/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/dlp/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
NameDescription
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
TypeDescription
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
NameDescription
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
NameDescription
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/dlp/docs/inspecting-storage and https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more.

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

Parameters
NameDescription
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
NameDescription
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
NameDescription
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
NameDescription
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
NameDescription
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 cancelled. 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);
}

getDeidentifyTemplate

Parameters
NameDescription
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
TypeDescription
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
NameDescription
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
TypeDescription
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
NameDescription
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
TypeDescription
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
NameDescription
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
TypeDescription
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
NameDescription
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
TypeDescription
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);
}

getStoredInfoType

Parameters
NameDescription
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
TypeDescription
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);
}

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
NameDescription
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
TypeDescription
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
NameDescription
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
TypeDescription
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/dlp/docs/inspecting-images and https://cloud.google.com/dlp/docs/inspecting-text,

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

Parameters
NameDescription
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
TypeDescription
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());
    }
}

listDeidentifyTemplates

Parameters
NameDescription
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
TypeDescription
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/dlp/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
NameDescription
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
TypeDescription
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
NameDescription
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
TypeDescription
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/dlp/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/dlp/docs/infotypes-reference to learn more.

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

Parameters
NameDescription
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
TypeDescription
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
NameDescription
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
TypeDescription
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/dlp/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
NameDescription
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
TypeDescription
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/dlp/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);
}

listStoredInfoTypes

Parameters
NameDescription
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
TypeDescription
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/dlp/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);
}

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/dlp/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
NameDescription
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
TypeDescription
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
NameDescription
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
TypeDescription
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/dlp/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
NameDescription
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
TypeDescription
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
NameDescription
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
TypeDescription
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
NameDescription
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
TypeDescription
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
NameDescription
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
TypeDescription
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/dlp/docs/creating-stored-infotypes to learn more.

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

Parameters
NameDescription
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
TypeDescription
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
NameDescription
request Google\Cloud\Dlp\V2\ActivateJobTriggerRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

cancelDlpJobAsync

Parameters
NameDescription
request Google\Cloud\Dlp\V2\CancelDlpJobRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

createDeidentifyTemplateAsync

Parameters
NameDescription
request Google\Cloud\Dlp\V2\CreateDeidentifyTemplateRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

createDiscoveryConfigAsync

Parameters
NameDescription
request Google\Cloud\Dlp\V2\CreateDiscoveryConfigRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

createDlpJobAsync

Parameters
NameDescription
request Google\Cloud\Dlp\V2\CreateDlpJobRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

createInspectTemplateAsync

Parameters
NameDescription
request Google\Cloud\Dlp\V2\CreateInspectTemplateRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

createJobTriggerAsync

Parameters
NameDescription
request Google\Cloud\Dlp\V2\CreateJobTriggerRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

createStoredInfoTypeAsync

Parameters
NameDescription
request Google\Cloud\Dlp\V2\CreateStoredInfoTypeRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

deidentifyContentAsync

Parameters
NameDescription
request Google\Cloud\Dlp\V2\DeidentifyContentRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

deleteDeidentifyTemplateAsync

Parameters
NameDescription
request Google\Cloud\Dlp\V2\DeleteDeidentifyTemplateRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

deleteDiscoveryConfigAsync

Parameters
NameDescription
request Google\Cloud\Dlp\V2\DeleteDiscoveryConfigRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

deleteDlpJobAsync

Parameters
NameDescription
request Google\Cloud\Dlp\V2\DeleteDlpJobRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

deleteInspectTemplateAsync

Parameters
NameDescription
request Google\Cloud\Dlp\V2\DeleteInspectTemplateRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

deleteJobTriggerAsync

Parameters
NameDescription
request Google\Cloud\Dlp\V2\DeleteJobTriggerRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

deleteStoredInfoTypeAsync

Parameters
NameDescription
request Google\Cloud\Dlp\V2\DeleteStoredInfoTypeRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

finishDlpJobAsync

Parameters
NameDescription
request Google\Cloud\Dlp\V2\FinishDlpJobRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

getDeidentifyTemplateAsync

Parameters
NameDescription
request Google\Cloud\Dlp\V2\GetDeidentifyTemplateRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

getDiscoveryConfigAsync

Parameters
NameDescription
request Google\Cloud\Dlp\V2\GetDiscoveryConfigRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

getDlpJobAsync

Parameters
NameDescription
request Google\Cloud\Dlp\V2\GetDlpJobRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

getInspectTemplateAsync

Parameters
NameDescription
request Google\Cloud\Dlp\V2\GetInspectTemplateRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

getJobTriggerAsync

Parameters
NameDescription
request Google\Cloud\Dlp\V2\GetJobTriggerRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

getStoredInfoTypeAsync

Parameters
NameDescription
request Google\Cloud\Dlp\V2\GetStoredInfoTypeRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

hybridInspectDlpJobAsync

Parameters
NameDescription
request Google\Cloud\Dlp\V2\HybridInspectDlpJobRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

hybridInspectJobTriggerAsync

Parameters
NameDescription
request Google\Cloud\Dlp\V2\HybridInspectJobTriggerRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

inspectContentAsync

Parameters
NameDescription
request Google\Cloud\Dlp\V2\InspectContentRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

listDeidentifyTemplatesAsync

Parameters
NameDescription
request Google\Cloud\Dlp\V2\ListDeidentifyTemplatesRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

listDiscoveryConfigsAsync

Parameters
NameDescription
request Google\Cloud\Dlp\V2\ListDiscoveryConfigsRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

listDlpJobsAsync

Parameters
NameDescription
request Google\Cloud\Dlp\V2\ListDlpJobsRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

listInfoTypesAsync

Parameters
NameDescription
request Google\Cloud\Dlp\V2\ListInfoTypesRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

listInspectTemplatesAsync

Parameters
NameDescription
request Google\Cloud\Dlp\V2\ListInspectTemplatesRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

listJobTriggersAsync

Parameters
NameDescription
request Google\Cloud\Dlp\V2\ListJobTriggersRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

listStoredInfoTypesAsync

Parameters
NameDescription
request Google\Cloud\Dlp\V2\ListStoredInfoTypesRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

redactImageAsync

Parameters
NameDescription
request Google\Cloud\Dlp\V2\RedactImageRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

reidentifyContentAsync

Parameters
NameDescription
request Google\Cloud\Dlp\V2\ReidentifyContentRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

updateDeidentifyTemplateAsync

Parameters
NameDescription
request Google\Cloud\Dlp\V2\UpdateDeidentifyTemplateRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

updateDiscoveryConfigAsync

Parameters
NameDescription
request Google\Cloud\Dlp\V2\UpdateDiscoveryConfigRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

updateInspectTemplateAsync

Parameters
NameDescription
request Google\Cloud\Dlp\V2\UpdateInspectTemplateRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

updateJobTriggerAsync

Parameters
NameDescription
request Google\Cloud\Dlp\V2\UpdateJobTriggerRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

updateStoredInfoTypeAsync

Parameters
NameDescription
request Google\Cloud\Dlp\V2\UpdateStoredInfoTypeRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

static::deidentifyTemplateName

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

Parameters
NameDescription
organization string
deidentifyTemplate string
Returns
TypeDescription
stringThe formatted deidentify_template resource.

static::discoveryConfigName

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

Parameters
NameDescription
project string
location string
discoveryConfig string
Returns
TypeDescription
stringThe formatted discovery_config resource.

static::dlpJobName

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

Parameters
NameDescription
project string
dlpJob string
Returns
TypeDescription
stringThe formatted dlp_job resource.

static::inspectTemplateName

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

Parameters
NameDescription
organization string
inspectTemplate string
Returns
TypeDescription
stringThe formatted inspect_template resource.

static::jobTriggerName

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

Parameters
NameDescription
project string
jobTrigger string
Returns
TypeDescription
stringThe formatted job_trigger resource.

static::locationName

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

Parameters
NameDescription
project string
location string
Returns
TypeDescription
stringThe formatted location resource.

static::organizationName

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

Parameter
NameDescription
organization string
Returns
TypeDescription
stringThe formatted organization resource.

static::organizationDeidentifyTemplateName

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

Parameters
NameDescription
organization string
deidentifyTemplate string
Returns
TypeDescription
stringThe formatted organization_deidentify_template resource.

static::organizationInspectTemplateName

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

Parameters
NameDescription
organization string
inspectTemplate string
Returns
TypeDescription
stringThe formatted organization_inspect_template resource.

static::organizationLocationName

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

Parameters
NameDescription
organization string
location string
Returns
TypeDescription
stringThe formatted organization_location resource.

static::organizationLocationDeidentifyTemplateName

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

Parameters
NameDescription
organization string
location string
deidentifyTemplate string
Returns
TypeDescription
stringThe 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
NameDescription
organization string
location string
inspectTemplate string
Returns
TypeDescription
stringThe formatted organization_location_inspect_template resource.

static::organizationLocationStoredInfoTypeName

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

Parameters
NameDescription
organization string
location string
storedInfoType string
Returns
TypeDescription
stringThe formatted organization_location_stored_info_type resource.

static::organizationStoredInfoTypeName

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

Parameters
NameDescription
organization string
storedInfoType string
Returns
TypeDescription
stringThe formatted organization_stored_info_type resource.

static::projectName

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

Parameter
NameDescription
project string
Returns
TypeDescription
stringThe formatted project resource.

static::projectDeidentifyTemplateName

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

Parameters
NameDescription
project string
deidentifyTemplate string
Returns
TypeDescription
stringThe formatted project_deidentify_template resource.

static::projectDlpJobName

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

Parameters
NameDescription
project string
dlpJob string
Returns
TypeDescription
stringThe formatted project_dlp_job resource.

static::projectInspectTemplateName

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

Parameters
NameDescription
project string
inspectTemplate string
Returns
TypeDescription
stringThe formatted project_inspect_template resource.

static::projectJobTriggerName

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

Parameters
NameDescription
project string
jobTrigger string
Returns
TypeDescription
stringThe formatted project_job_trigger resource.

static::projectLocationDeidentifyTemplateName

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

Parameters
NameDescription
project string
location string
deidentifyTemplate string
Returns
TypeDescription
stringThe 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
NameDescription
project string
location string
dlpJob string
Returns
TypeDescription
stringThe 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
NameDescription
project string
location string
inspectTemplate string
Returns
TypeDescription
stringThe 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
NameDescription
project string
location string
jobTrigger string
Returns
TypeDescription
stringThe formatted project_location_job_trigger resource.

static::projectLocationStoredInfoTypeName

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

Parameters
NameDescription
project string
location string
storedInfoType string
Returns
TypeDescription
stringThe formatted project_location_stored_info_type resource.

static::projectStoredInfoTypeName

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

Parameters
NameDescription
project string
storedInfoType string
Returns
TypeDescription
stringThe formatted project_stored_info_type resource.

static::storedInfoTypeName

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

Parameters
NameDescription
organization string
storedInfoType string
Returns
TypeDescription
stringThe formatted stored_info_type 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

  • 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}
  • organizationLocationDeidentifyTemplate: organizations/{organization}/locations/{location}/deidentifyTemplates/{deidentify_template}
  • organizationLocationInspectTemplate: organizations/{organization}/locations/{location}/inspectTemplates/{inspect_template}
  • organizationLocationStoredInfoType: organizations/{organization}/locations/{location}/storedInfoTypes/{stored_info_type}
  • organizationStoredInfoType: organizations/{organization}/storedInfoTypes/{stored_info_type}
  • project: projects/{project}
  • projectDeidentifyTemplate: projects/{project}/deidentifyTemplates/{deidentify_template}
  • projectDlpJob: projects/{project}/dlpJobs/{dlp_job}
  • projectInspectTemplate: projects/{project}/inspectTemplates/{inspect_template}
  • projectJobTrigger: projects/{project}/jobTriggers/{job_trigger}
  • 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}
  • projectLocationStoredInfoType: projects/{project}/locations/{location}/storedInfoTypes/{stored_info_type}
  • projectStoredInfoType: projects/{project}/storedInfoTypes/{stored_info_type}
  • storedInfoType: organizations/{organization}/storedInfoTypes/{stored_info_type}

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
NameDescription
formattedName string

The formatted name string

template string

Optional name of template to match

Returns
TypeDescription
arrayAn associative array from name component IDs to component values.