Class v2.DlpServiceClient (5.11.0)

The Cloud Data Loss Prevention (DLP) API is a service that allows clients to detect the presence of Personally Identifiable Information (PII) and other privacy-sensitive data in user-supplied, unstructured data streams, like text blocks or images. The service also includes methods for sensitive data redaction and scheduling of data scans on Google Cloud Platform based data sets.

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

Package

@google-cloud/dlp

Constructors

(constructor)(opts, gaxInstance)

constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback);

Construct an instance of DlpServiceClient.

Parameters
Name Description
opts ClientOptions
gaxInstance typeof gax | typeof fallback

: loaded instance of google-gax. Useful if you need to avoid loading the default gRPC version and want to use the fallback HTTP implementation. Load only fallback version and pass it to the constructor: ``` const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC const client = new DlpServiceClient({fallback: true}, gax); ```

Properties

apiEndpoint

get apiEndpoint(): string;

The DNS address for this API service.

apiEndpoint

static get apiEndpoint(): string;

The DNS address for this API service - same as servicePath.

auth

auth: gax.GoogleAuth;

descriptors

descriptors: Descriptors;

dlpServiceStub

dlpServiceStub?: Promise<{
        [name: string]: Function;
    }>;

innerApiCalls

innerApiCalls: {
        [name: string]: Function;
    };

locationsClient

locationsClient: LocationsClient;

pathTemplates

pathTemplates: {
        [name: string]: gax.PathTemplate;
    };

port

static get port(): number;

The port for this API service.

scopes

static get scopes(): string[];

The scopes needed to make gRPC calls for every method defined in this service.

servicePath

static get servicePath(): string;

The DNS address for this API service.

universeDomain

get universeDomain(): string;

warn

warn: (code: string, message: string, warnType?: string) => void;

Methods

activateJobTrigger(request, options)

activateJobTrigger(request?: protos.google.privacy.dlp.v2.IActivateJobTriggerRequest, options?: CallOptions): Promise<[
        protos.google.privacy.dlp.v2.IDlpJob,
        protos.google.privacy.dlp.v2.IActivateJobTriggerRequest | undefined,
        {} | undefined
    ]>;

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

Parameters
Name Description
request IActivateJobTriggerRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ protos.google.privacy.dlp.v2.IDlpJob, protos.google.privacy.dlp.v2.IActivateJobTriggerRequest | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the documentation for more details and examples.

Example

  /**
   * This snippet 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.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. Resource name of the trigger to activate, for example
   *  `projects/dlp-test-project/jobTriggers/53234423`.
   */
  // const name = 'abc123'

  // Imports the Dlp library
  const {DlpServiceClient} = require('@google-cloud/dlp').v2;

  // Instantiates a client
  const dlpClient = new DlpServiceClient();

  async function callActivateJobTrigger() {
    // Construct request
    const request = {
      name,
    };

    // Run request
    const response = await dlpClient.activateJobTrigger(request);
    console.log(response);
  }

  callActivateJobTrigger();

activateJobTrigger(request, options, callback)

activateJobTrigger(request: protos.google.privacy.dlp.v2.IActivateJobTriggerRequest, options: CallOptions, callback: Callback<protos.google.privacy.dlp.v2.IDlpJob, protos.google.privacy.dlp.v2.IActivateJobTriggerRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IActivateJobTriggerRequest
options CallOptions
callback Callback<protos.google.privacy.dlp.v2.IDlpJob, protos.google.privacy.dlp.v2.IActivateJobTriggerRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

activateJobTrigger(request, callback)

activateJobTrigger(request: protos.google.privacy.dlp.v2.IActivateJobTriggerRequest, callback: Callback<protos.google.privacy.dlp.v2.IDlpJob, protos.google.privacy.dlp.v2.IActivateJobTriggerRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IActivateJobTriggerRequest
callback Callback<protos.google.privacy.dlp.v2.IDlpJob, protos.google.privacy.dlp.v2.IActivateJobTriggerRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

cancelDlpJob(request, options)

cancelDlpJob(request?: protos.google.privacy.dlp.v2.ICancelDlpJobRequest, options?: CallOptions): Promise<[
        protos.google.protobuf.IEmpty,
        protos.google.privacy.dlp.v2.ICancelDlpJobRequest | undefined,
        {} | undefined
    ]>;

Starts asynchronous cancellation on a long-running DlpJob. The server makes a best effort to cancel the DlpJob, but success is not guaranteed. See https://cloud.google.com/sensitive-data-protection/docs/inspecting-storage and https://cloud.google.com/sensitive-data-protection/docs/compute-risk-analysis to learn more.

Parameters
Name Description
request ICancelDlpJobRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ protos.google.protobuf.IEmpty, protos.google.privacy.dlp.v2.ICancelDlpJobRequest | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing Empty. Please see the documentation for more details and examples.

Example

  /**
   * This snippet 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.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The name of the DlpJob resource to be cancelled.
   */
  // const name = 'abc123'

  // Imports the Dlp library
  const {DlpServiceClient} = require('@google-cloud/dlp').v2;

  // Instantiates a client
  const dlpClient = new DlpServiceClient();

  async function callCancelDlpJob() {
    // Construct request
    const request = {
      name,
    };

    // Run request
    const response = await dlpClient.cancelDlpJob(request);
    console.log(response);
  }

  callCancelDlpJob();

cancelDlpJob(request, options, callback)

cancelDlpJob(request: protos.google.privacy.dlp.v2.ICancelDlpJobRequest, options: CallOptions, callback: Callback<protos.google.protobuf.IEmpty, protos.google.privacy.dlp.v2.ICancelDlpJobRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request ICancelDlpJobRequest
options CallOptions
callback Callback<protos.google.protobuf.IEmpty, protos.google.privacy.dlp.v2.ICancelDlpJobRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

cancelDlpJob(request, callback)

cancelDlpJob(request: protos.google.privacy.dlp.v2.ICancelDlpJobRequest, callback: Callback<protos.google.protobuf.IEmpty, protos.google.privacy.dlp.v2.ICancelDlpJobRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request ICancelDlpJobRequest
callback Callback<protos.google.protobuf.IEmpty, protos.google.privacy.dlp.v2.ICancelDlpJobRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

close()

close(): Promise<void>;

Terminate the gRPC channel and close the client.

The client will no longer be usable and all future behavior is undefined.

Returns
Type Description
Promise<void>

{Promise} A promise that resolves when the client is closed.

createConnection(request, options)

createConnection(request?: protos.google.privacy.dlp.v2.ICreateConnectionRequest, options?: CallOptions): Promise<[
        protos.google.privacy.dlp.v2.IConnection,
        protos.google.privacy.dlp.v2.ICreateConnectionRequest | undefined,
        {} | undefined
    ]>;

Create a Connection to an external data source.

Parameters
Name Description
request ICreateConnectionRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ protos.google.privacy.dlp.v2.IConnection, protos.google.privacy.dlp.v2.ICreateConnectionRequest | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing Connection. Please see the documentation for more details and examples.

Example

  /**
   * This snippet 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.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. Parent resource name.
   *  The format of this value varies depending on the scope of the request
   *  (project or organization):
   *  + Projects scope:
   *    `projects/{project_id}/locations/{location_id}`
   *  + Organizations scope:
   *    `organizations/{org_id}/locations/{location_id}`
   */
  // const parent = 'abc123'
  /**
   *  Required. The connection resource.
   */
  // const connection = {}

  // Imports the Dlp library
  const {DlpServiceClient} = require('@google-cloud/dlp').v2;

  // Instantiates a client
  const dlpClient = new DlpServiceClient();

  async function callCreateConnection() {
    // Construct request
    const request = {
      parent,
      connection,
    };

    // Run request
    const response = await dlpClient.createConnection(request);
    console.log(response);
  }

  callCreateConnection();

createConnection(request, options, callback)

createConnection(request: protos.google.privacy.dlp.v2.ICreateConnectionRequest, options: CallOptions, callback: Callback<protos.google.privacy.dlp.v2.IConnection, protos.google.privacy.dlp.v2.ICreateConnectionRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request ICreateConnectionRequest
options CallOptions
callback Callback<protos.google.privacy.dlp.v2.IConnection, protos.google.privacy.dlp.v2.ICreateConnectionRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

createConnection(request, callback)

createConnection(request: protos.google.privacy.dlp.v2.ICreateConnectionRequest, callback: Callback<protos.google.privacy.dlp.v2.IConnection, protos.google.privacy.dlp.v2.ICreateConnectionRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request ICreateConnectionRequest
callback Callback<protos.google.privacy.dlp.v2.IConnection, protos.google.privacy.dlp.v2.ICreateConnectionRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

createDeidentifyTemplate(request, options)

createDeidentifyTemplate(request?: protos.google.privacy.dlp.v2.ICreateDeidentifyTemplateRequest, options?: CallOptions): Promise<[
        protos.google.privacy.dlp.v2.IDeidentifyTemplate,
        protos.google.privacy.dlp.v2.ICreateDeidentifyTemplateRequest | undefined,
        {} | undefined
    ]>;

Creates a DeidentifyTemplate for reusing frequently used configuration for de-identifying content, images, and storage. See https://cloud.google.com/sensitive-data-protection/docs/creating-templates-deid to learn more.

Parameters
Name Description
request ICreateDeidentifyTemplateRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ protos.google.privacy.dlp.v2.IDeidentifyTemplate, protos.google.privacy.dlp.v2.ICreateDeidentifyTemplateRequest | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing DeidentifyTemplate. Please see the documentation for more details and examples.

Example

  /**
   * This snippet 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.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. Parent resource name.
   *  The format of this value varies depending on the scope of the request
   *  (project or organization) and whether you have specified a processing
   *  location (https://cloud.google.com/sensitive-data-protection/docs/specifying-location):
   *  + Projects scope, location specified:
   *    `projects/{project_id}/locations/{location_id}`
   *  + Projects scope, no location specified (defaults to global):
   *    `projects/{project_id}`
   *  + Organizations scope, location specified:
   *    `organizations/{org_id}/locations/{location_id}`
   *  + Organizations scope, no location specified (defaults to global):
   *    `organizations/{org_id}`
   *  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
   */
  // const parent = 'abc123'
  /**
   *  Required. The DeidentifyTemplate to create.
   */
  // const deidentifyTemplate = {}
  /**
   *  The template id can contain uppercase and lowercase letters,
   *  numbers, and hyphens; that is, it must match the regular
   *  expression: `[a-zA-Z\d-_]+`. The maximum length is 100
   *  characters. Can be empty to allow the system to generate one.
   */
  // const templateId = 'abc123'

  // Imports the Dlp library
  const {DlpServiceClient} = require('@google-cloud/dlp').v2;

  // Instantiates a client
  const dlpClient = new DlpServiceClient();

  async function callCreateDeidentifyTemplate() {
    // Construct request
    const request = {
      parent,
      deidentifyTemplate,
    };

    // Run request
    const response = await dlpClient.createDeidentifyTemplate(request);
    console.log(response);
  }

  callCreateDeidentifyTemplate();

createDeidentifyTemplate(request, options, callback)

createDeidentifyTemplate(request: protos.google.privacy.dlp.v2.ICreateDeidentifyTemplateRequest, options: CallOptions, callback: Callback<protos.google.privacy.dlp.v2.IDeidentifyTemplate, protos.google.privacy.dlp.v2.ICreateDeidentifyTemplateRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request ICreateDeidentifyTemplateRequest
options CallOptions
callback Callback<protos.google.privacy.dlp.v2.IDeidentifyTemplate, protos.google.privacy.dlp.v2.ICreateDeidentifyTemplateRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

createDeidentifyTemplate(request, callback)

createDeidentifyTemplate(request: protos.google.privacy.dlp.v2.ICreateDeidentifyTemplateRequest, callback: Callback<protos.google.privacy.dlp.v2.IDeidentifyTemplate, protos.google.privacy.dlp.v2.ICreateDeidentifyTemplateRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request ICreateDeidentifyTemplateRequest
callback Callback<protos.google.privacy.dlp.v2.IDeidentifyTemplate, protos.google.privacy.dlp.v2.ICreateDeidentifyTemplateRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

createDiscoveryConfig(request, options)

createDiscoveryConfig(request?: protos.google.privacy.dlp.v2.ICreateDiscoveryConfigRequest, options?: CallOptions): Promise<[
        protos.google.privacy.dlp.v2.IDiscoveryConfig,
        protos.google.privacy.dlp.v2.ICreateDiscoveryConfigRequest | undefined,
        {} | undefined
    ]>;

Creates a config for discovery to scan and profile storage.

Parameters
Name Description
request ICreateDiscoveryConfigRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ protos.google.privacy.dlp.v2.IDiscoveryConfig, protos.google.privacy.dlp.v2.ICreateDiscoveryConfigRequest | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the documentation for more details and examples.

Example

  /**
   * This snippet 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.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. Parent resource name.
   *  The format of this value varies depending on the scope of the request
   *  (project or organization):
   *  + Projects scope:
   *    `projects/{project_id}/locations/{location_id}`
   *  + Organizations scope:
   *    `organizations/{org_id}/locations/{location_id}`
   *  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
   */
  // const parent = 'abc123'
  /**
   *  Required. The DiscoveryConfig to create.
   */
  // const discoveryConfig = {}
  /**
   *  The config ID can contain uppercase and lowercase letters,
   *  numbers, and hyphens; that is, it must match the regular
   *  expression: `[a-zA-Z\d-_]+`. The maximum length is 100
   *  characters. Can be empty to allow the system to generate one.
   */
  // const configId = 'abc123'

  // Imports the Dlp library
  const {DlpServiceClient} = require('@google-cloud/dlp').v2;

  // Instantiates a client
  const dlpClient = new DlpServiceClient();

  async function callCreateDiscoveryConfig() {
    // Construct request
    const request = {
      parent,
      discoveryConfig,
    };

    // Run request
    const response = await dlpClient.createDiscoveryConfig(request);
    console.log(response);
  }

  callCreateDiscoveryConfig();

createDiscoveryConfig(request, options, callback)

createDiscoveryConfig(request: protos.google.privacy.dlp.v2.ICreateDiscoveryConfigRequest, options: CallOptions, callback: Callback<protos.google.privacy.dlp.v2.IDiscoveryConfig, protos.google.privacy.dlp.v2.ICreateDiscoveryConfigRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request ICreateDiscoveryConfigRequest
options CallOptions
callback Callback<protos.google.privacy.dlp.v2.IDiscoveryConfig, protos.google.privacy.dlp.v2.ICreateDiscoveryConfigRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

createDiscoveryConfig(request, callback)

createDiscoveryConfig(request: protos.google.privacy.dlp.v2.ICreateDiscoveryConfigRequest, callback: Callback<protos.google.privacy.dlp.v2.IDiscoveryConfig, protos.google.privacy.dlp.v2.ICreateDiscoveryConfigRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request ICreateDiscoveryConfigRequest
callback Callback<protos.google.privacy.dlp.v2.IDiscoveryConfig, protos.google.privacy.dlp.v2.ICreateDiscoveryConfigRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

createDlpJob(request, options)

createDlpJob(request?: protos.google.privacy.dlp.v2.ICreateDlpJobRequest, options?: CallOptions): Promise<[
        protos.google.privacy.dlp.v2.IDlpJob,
        protos.google.privacy.dlp.v2.ICreateDlpJobRequest | undefined,
        {} | undefined
    ]>;

Creates a new job to inspect storage or calculate risk metrics. See https://cloud.google.com/sensitive-data-protection/docs/inspecting-storage and https://cloud.google.com/sensitive-data-protection/docs/compute-risk-analysis to learn more.

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

Parameters
Name Description
request ICreateDlpJobRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ protos.google.privacy.dlp.v2.IDlpJob, protos.google.privacy.dlp.v2.ICreateDlpJobRequest | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the documentation for more details and examples.

Example

  /**
   * This snippet 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.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. Parent resource name.
   *  The format of this value varies depending on whether you have specified a
   *  processing
   *  location (https://cloud.google.com/sensitive-data-protection/docs/specifying-location):
   *  + Projects scope, location specified:
   *    `projects/{project_id}/locations/{location_id}`
   *  + Projects scope, no location specified (defaults to global):
   *    `projects/{project_id}`
   *  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
   */
  // const parent = 'abc123'
  /**
   *  An inspection job scans a storage repository for InfoTypes.
   */
  // const inspectJob = {}
  /**
   *  A risk analysis job calculates re-identification risk metrics for a
   *  BigQuery table.
   */
  // const riskJob = {}
  /**
   *  The job id can contain uppercase and lowercase letters,
   *  numbers, and hyphens; that is, it must match the regular
   *  expression: `[a-zA-Z\d-_]+`. The maximum length is 100
   *  characters. Can be empty to allow the system to generate one.
   */
  // const jobId = 'abc123'

  // Imports the Dlp library
  const {DlpServiceClient} = require('@google-cloud/dlp').v2;

  // Instantiates a client
  const dlpClient = new DlpServiceClient();

  async function callCreateDlpJob() {
    // Construct request
    const request = {
      parent,
    };

    // Run request
    const response = await dlpClient.createDlpJob(request);
    console.log(response);
  }

  callCreateDlpJob();

createDlpJob(request, options, callback)

createDlpJob(request: protos.google.privacy.dlp.v2.ICreateDlpJobRequest, options: CallOptions, callback: Callback<protos.google.privacy.dlp.v2.IDlpJob, protos.google.privacy.dlp.v2.ICreateDlpJobRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request ICreateDlpJobRequest
options CallOptions
callback Callback<protos.google.privacy.dlp.v2.IDlpJob, protos.google.privacy.dlp.v2.ICreateDlpJobRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

createDlpJob(request, callback)

createDlpJob(request: protos.google.privacy.dlp.v2.ICreateDlpJobRequest, callback: Callback<protos.google.privacy.dlp.v2.IDlpJob, protos.google.privacy.dlp.v2.ICreateDlpJobRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request ICreateDlpJobRequest
callback Callback<protos.google.privacy.dlp.v2.IDlpJob, protos.google.privacy.dlp.v2.ICreateDlpJobRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

createInspectTemplate(request, options)

createInspectTemplate(request?: protos.google.privacy.dlp.v2.ICreateInspectTemplateRequest, options?: CallOptions): Promise<[
        protos.google.privacy.dlp.v2.IInspectTemplate,
        protos.google.privacy.dlp.v2.ICreateInspectTemplateRequest | undefined,
        {} | undefined
    ]>;

Creates an InspectTemplate for reusing frequently used configuration for inspecting content, images, and storage. See https://cloud.google.com/sensitive-data-protection/docs/creating-templates to learn more.

Parameters
Name Description
request ICreateInspectTemplateRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ protos.google.privacy.dlp.v2.IInspectTemplate, protos.google.privacy.dlp.v2.ICreateInspectTemplateRequest | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing InspectTemplate. Please see the documentation for more details and examples.

Example

  /**
   * This snippet 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.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. Parent resource name.
   *  The format of this value varies depending on the scope of the request
   *  (project or organization) and whether you have specified a processing
   *  location (https://cloud.google.com/sensitive-data-protection/docs/specifying-location):
   *  + Projects scope, location specified:
   *    `projects/{project_id}/locations/{location_id}`
   *  + Projects scope, no location specified (defaults to global):
   *    `projects/{project_id}`
   *  + Organizations scope, location specified:
   *    `organizations/{org_id}/locations/{location_id}`
   *  + Organizations scope, no location specified (defaults to global):
   *    `organizations/{org_id}`
   *  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
   */
  // const parent = 'abc123'
  /**
   *  Required. The InspectTemplate to create.
   */
  // const inspectTemplate = {}
  /**
   *  The template id can contain uppercase and lowercase letters,
   *  numbers, and hyphens; that is, it must match the regular
   *  expression: `[a-zA-Z\d-_]+`. The maximum length is 100
   *  characters. Can be empty to allow the system to generate one.
   */
  // const templateId = 'abc123'

  // Imports the Dlp library
  const {DlpServiceClient} = require('@google-cloud/dlp').v2;

  // Instantiates a client
  const dlpClient = new DlpServiceClient();

  async function callCreateInspectTemplate() {
    // Construct request
    const request = {
      parent,
      inspectTemplate,
    };

    // Run request
    const response = await dlpClient.createInspectTemplate(request);
    console.log(response);
  }

  callCreateInspectTemplate();

createInspectTemplate(request, options, callback)

createInspectTemplate(request: protos.google.privacy.dlp.v2.ICreateInspectTemplateRequest, options: CallOptions, callback: Callback<protos.google.privacy.dlp.v2.IInspectTemplate, protos.google.privacy.dlp.v2.ICreateInspectTemplateRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request ICreateInspectTemplateRequest
options CallOptions
callback Callback<protos.google.privacy.dlp.v2.IInspectTemplate, protos.google.privacy.dlp.v2.ICreateInspectTemplateRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

createInspectTemplate(request, callback)

createInspectTemplate(request: protos.google.privacy.dlp.v2.ICreateInspectTemplateRequest, callback: Callback<protos.google.privacy.dlp.v2.IInspectTemplate, protos.google.privacy.dlp.v2.ICreateInspectTemplateRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request ICreateInspectTemplateRequest
callback Callback<protos.google.privacy.dlp.v2.IInspectTemplate, protos.google.privacy.dlp.v2.ICreateInspectTemplateRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

createJobTrigger(request, options)

createJobTrigger(request?: protos.google.privacy.dlp.v2.ICreateJobTriggerRequest, options?: CallOptions): Promise<[
        protos.google.privacy.dlp.v2.IJobTrigger,
        protos.google.privacy.dlp.v2.ICreateJobTriggerRequest | undefined,
        {} | undefined
    ]>;

Creates a job trigger to run DLP actions such as scanning storage for sensitive information on a set schedule. See https://cloud.google.com/sensitive-data-protection/docs/creating-job-triggers to learn more.

Parameters
Name Description
request ICreateJobTriggerRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ protos.google.privacy.dlp.v2.IJobTrigger, protos.google.privacy.dlp.v2.ICreateJobTriggerRequest | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the documentation for more details and examples.

Example

  /**
   * This snippet 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.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. Parent resource name.
   *  The format of this value varies depending on whether you have specified a
   *  processing
   *  location (https://cloud.google.com/sensitive-data-protection/docs/specifying-location):
   *  + Projects scope, location specified:
   *    `projects/{project_id}/locations/{location_id}`
   *  + Projects scope, no location specified (defaults to global):
   *    `projects/{project_id}`
   *  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
   */
  // const parent = 'abc123'
  /**
   *  Required. The JobTrigger to create.
   */
  // const jobTrigger = {}
  /**
   *  The trigger id can contain uppercase and lowercase letters,
   *  numbers, and hyphens; that is, it must match the regular
   *  expression: `[a-zA-Z\d-_]+`. The maximum length is 100
   *  characters. Can be empty to allow the system to generate one.
   */
  // const triggerId = 'abc123'

  // Imports the Dlp library
  const {DlpServiceClient} = require('@google-cloud/dlp').v2;

  // Instantiates a client
  const dlpClient = new DlpServiceClient();

  async function callCreateJobTrigger() {
    // Construct request
    const request = {
      parent,
      jobTrigger,
    };

    // Run request
    const response = await dlpClient.createJobTrigger(request);
    console.log(response);
  }

  callCreateJobTrigger();

createJobTrigger(request, options, callback)

createJobTrigger(request: protos.google.privacy.dlp.v2.ICreateJobTriggerRequest, options: CallOptions, callback: Callback<protos.google.privacy.dlp.v2.IJobTrigger, protos.google.privacy.dlp.v2.ICreateJobTriggerRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request ICreateJobTriggerRequest
options CallOptions
callback Callback<protos.google.privacy.dlp.v2.IJobTrigger, protos.google.privacy.dlp.v2.ICreateJobTriggerRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

createJobTrigger(request, callback)

createJobTrigger(request: protos.google.privacy.dlp.v2.ICreateJobTriggerRequest, callback: Callback<protos.google.privacy.dlp.v2.IJobTrigger, protos.google.privacy.dlp.v2.ICreateJobTriggerRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request ICreateJobTriggerRequest
callback Callback<protos.google.privacy.dlp.v2.IJobTrigger, protos.google.privacy.dlp.v2.ICreateJobTriggerRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

createStoredInfoType(request, options)

createStoredInfoType(request?: protos.google.privacy.dlp.v2.ICreateStoredInfoTypeRequest, options?: CallOptions): Promise<[
        protos.google.privacy.dlp.v2.IStoredInfoType,
        protos.google.privacy.dlp.v2.ICreateStoredInfoTypeRequest | undefined,
        {} | undefined
    ]>;

Creates a pre-built stored infoType to be used for inspection. See https://cloud.google.com/sensitive-data-protection/docs/creating-stored-infotypes to learn more.

Parameters
Name Description
request ICreateStoredInfoTypeRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ protos.google.privacy.dlp.v2.IStoredInfoType, protos.google.privacy.dlp.v2.ICreateStoredInfoTypeRequest | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing StoredInfoType. Please see the documentation for more details and examples.

Example

  /**
   * This snippet 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.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. Parent resource name.
   *  The format of this value varies depending on the scope of the request
   *  (project or organization) and whether you have specified a processing
   *  location (https://cloud.google.com/sensitive-data-protection/docs/specifying-location):
   *  + Projects scope, location specified:
   *    `projects/{project_id}/locations/{location_id}`
   *  + Projects scope, no location specified (defaults to global):
   *    `projects/{project_id}`
   *  + Organizations scope, location specified:
   *    `organizations/{org_id}/locations/{location_id}`
   *  + Organizations scope, no location specified (defaults to global):
   *    `organizations/{org_id}`
   *  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
   */
  // const parent = 'abc123'
  /**
   *  Required. Configuration of the storedInfoType to create.
   */
  // const config = {}
  /**
   *  The storedInfoType ID can contain uppercase and lowercase letters,
   *  numbers, and hyphens; that is, it must match the regular
   *  expression: `[a-zA-Z\d-_]+`. The maximum length is 100
   *  characters. Can be empty to allow the system to generate one.
   */
  // const storedInfoTypeId = 'abc123'

  // Imports the Dlp library
  const {DlpServiceClient} = require('@google-cloud/dlp').v2;

  // Instantiates a client
  const dlpClient = new DlpServiceClient();

  async function callCreateStoredInfoType() {
    // Construct request
    const request = {
      parent,
      config,
    };

    // Run request
    const response = await dlpClient.createStoredInfoType(request);
    console.log(response);
  }

  callCreateStoredInfoType();

createStoredInfoType(request, options, callback)

createStoredInfoType(request: protos.google.privacy.dlp.v2.ICreateStoredInfoTypeRequest, options: CallOptions, callback: Callback<protos.google.privacy.dlp.v2.IStoredInfoType, protos.google.privacy.dlp.v2.ICreateStoredInfoTypeRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request ICreateStoredInfoTypeRequest
options CallOptions
callback Callback<protos.google.privacy.dlp.v2.IStoredInfoType, protos.google.privacy.dlp.v2.ICreateStoredInfoTypeRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

createStoredInfoType(request, callback)

createStoredInfoType(request: protos.google.privacy.dlp.v2.ICreateStoredInfoTypeRequest, callback: Callback<protos.google.privacy.dlp.v2.IStoredInfoType, protos.google.privacy.dlp.v2.ICreateStoredInfoTypeRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request ICreateStoredInfoTypeRequest
callback Callback<protos.google.privacy.dlp.v2.IStoredInfoType, protos.google.privacy.dlp.v2.ICreateStoredInfoTypeRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

deidentifyContent(request, options)

deidentifyContent(request?: protos.google.privacy.dlp.v2.IDeidentifyContentRequest, options?: CallOptions): Promise<[
        protos.google.privacy.dlp.v2.IDeidentifyContentResponse,
        protos.google.privacy.dlp.v2.IDeidentifyContentRequest | undefined,
        {} | undefined
    ]>;

De-identifies potentially sensitive info from a ContentItem. This method has limits on input size and output size. See https://cloud.google.com/sensitive-data-protection/docs/deidentify-sensitive-data to learn more.

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

Parameters
Name Description
request IDeidentifyContentRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ protos.google.privacy.dlp.v2.IDeidentifyContentResponse, protos.google.privacy.dlp.v2.IDeidentifyContentRequest | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing DeidentifyContentResponse. Please see the documentation for more details and examples.

Example

  /**
   * This snippet 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.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Parent resource name.
   *  The format of this value varies depending on whether you have specified a
   *  processing
   *  location (https://cloud.google.com/sensitive-data-protection/docs/specifying-location):
   *  + Projects scope, location specified:
   *    `projects/{project_id}/locations/{location_id}`
   *  + Projects scope, no location specified (defaults to global):
   *    `projects/{project_id}`
   *  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
   */
  // const parent = 'abc123'
  /**
   *  Configuration for the de-identification of the content item.
   *  Items specified here will override the template referenced by the
   *  deidentify_template_name argument.
   */
  // const deidentifyConfig = {}
  /**
   *  Configuration for the inspector.
   *  Items specified here will override the template referenced by the
   *  inspect_template_name argument.
   */
  // const inspectConfig = {}
  /**
   *  The item to de-identify. Will be treated as text.
   *  This value must be of type
   *  Table google.privacy.dlp.v2.Table  if your
   *  deidentify_config google.privacy.dlp.v2.DeidentifyContentRequest.deidentify_config 
   *  is a
   *  RecordTransformations google.privacy.dlp.v2.RecordTransformations 
   *  object.
   */
  // const item = {}
  /**
   *  Template to use. Any configuration directly specified in
   *  inspect_config will override those set in the template. Singular fields
   *  that are set in this request will replace their corresponding fields in the
   *  template. Repeated fields are appended. Singular sub-messages and groups
   *  are recursively merged.
   */
  // const inspectTemplateName = 'abc123'
  /**
   *  Template to use. Any configuration directly specified in
   *  deidentify_config will override those set in the template. Singular fields
   *  that are set in this request will replace their corresponding fields in the
   *  template. Repeated fields are appended. Singular sub-messages and groups
   *  are recursively merged.
   */
  // const deidentifyTemplateName = 'abc123'

  // Imports the Dlp library
  const {DlpServiceClient} = require('@google-cloud/dlp').v2;

  // Instantiates a client
  const dlpClient = new DlpServiceClient();

  async function callDeidentifyContent() {
    // Construct request
    const request = {
    };

    // Run request
    const response = await dlpClient.deidentifyContent(request);
    console.log(response);
  }

  callDeidentifyContent();

deidentifyContent(request, options, callback)

deidentifyContent(request: protos.google.privacy.dlp.v2.IDeidentifyContentRequest, options: CallOptions, callback: Callback<protos.google.privacy.dlp.v2.IDeidentifyContentResponse, protos.google.privacy.dlp.v2.IDeidentifyContentRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IDeidentifyContentRequest
options CallOptions
callback Callback<protos.google.privacy.dlp.v2.IDeidentifyContentResponse, protos.google.privacy.dlp.v2.IDeidentifyContentRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

deidentifyContent(request, callback)

deidentifyContent(request: protos.google.privacy.dlp.v2.IDeidentifyContentRequest, callback: Callback<protos.google.privacy.dlp.v2.IDeidentifyContentResponse, protos.google.privacy.dlp.v2.IDeidentifyContentRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IDeidentifyContentRequest
callback Callback<protos.google.privacy.dlp.v2.IDeidentifyContentResponse, protos.google.privacy.dlp.v2.IDeidentifyContentRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

deleteConnection(request, options)

deleteConnection(request?: protos.google.privacy.dlp.v2.IDeleteConnectionRequest, options?: CallOptions): Promise<[
        protos.google.protobuf.IEmpty,
        protos.google.privacy.dlp.v2.IDeleteConnectionRequest | undefined,
        {} | undefined
    ]>;

Delete a Connection.

Parameters
Name Description
request IDeleteConnectionRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ protos.google.protobuf.IEmpty, protos.google.privacy.dlp.v2.IDeleteConnectionRequest | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing Empty. Please see the documentation for more details and examples.

Example

  /**
   * This snippet 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.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. Resource name of the Connection to be deleted, in the format:
   *  `projects/{project}/locations/{location}/connections/{connection}`.
   */
  // const name = 'abc123'

  // Imports the Dlp library
  const {DlpServiceClient} = require('@google-cloud/dlp').v2;

  // Instantiates a client
  const dlpClient = new DlpServiceClient();

  async function callDeleteConnection() {
    // Construct request
    const request = {
      name,
    };

    // Run request
    const response = await dlpClient.deleteConnection(request);
    console.log(response);
  }

  callDeleteConnection();

deleteConnection(request, options, callback)

deleteConnection(request: protos.google.privacy.dlp.v2.IDeleteConnectionRequest, options: CallOptions, callback: Callback<protos.google.protobuf.IEmpty, protos.google.privacy.dlp.v2.IDeleteConnectionRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IDeleteConnectionRequest
options CallOptions
callback Callback<protos.google.protobuf.IEmpty, protos.google.privacy.dlp.v2.IDeleteConnectionRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

deleteConnection(request, callback)

deleteConnection(request: protos.google.privacy.dlp.v2.IDeleteConnectionRequest, callback: Callback<protos.google.protobuf.IEmpty, protos.google.privacy.dlp.v2.IDeleteConnectionRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IDeleteConnectionRequest
callback Callback<protos.google.protobuf.IEmpty, protos.google.privacy.dlp.v2.IDeleteConnectionRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

deleteDeidentifyTemplate(request, options)

deleteDeidentifyTemplate(request?: protos.google.privacy.dlp.v2.IDeleteDeidentifyTemplateRequest, options?: CallOptions): Promise<[
        protos.google.protobuf.IEmpty,
        protos.google.privacy.dlp.v2.IDeleteDeidentifyTemplateRequest | undefined,
        {} | undefined
    ]>;
Parameters
Name Description
request IDeleteDeidentifyTemplateRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ protos.google.protobuf.IEmpty, protos.google.privacy.dlp.v2.IDeleteDeidentifyTemplateRequest | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing Empty. Please see the documentation for more details and examples.

Example

  /**
   * This snippet 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.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. Resource name of the organization and deidentify template to be
   *  deleted, for example
   *  `organizations/433245324/deidentifyTemplates/432452342` or
   *  projects/project-id/deidentifyTemplates/432452342.
   */
  // const name = 'abc123'

  // Imports the Dlp library
  const {DlpServiceClient} = require('@google-cloud/dlp').v2;

  // Instantiates a client
  const dlpClient = new DlpServiceClient();

  async function callDeleteDeidentifyTemplate() {
    // Construct request
    const request = {
      name,
    };

    // Run request
    const response = await dlpClient.deleteDeidentifyTemplate(request);
    console.log(response);
  }

  callDeleteDeidentifyTemplate();

deleteDeidentifyTemplate(request, options, callback)

deleteDeidentifyTemplate(request: protos.google.privacy.dlp.v2.IDeleteDeidentifyTemplateRequest, options: CallOptions, callback: Callback<protos.google.protobuf.IEmpty, protos.google.privacy.dlp.v2.IDeleteDeidentifyTemplateRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IDeleteDeidentifyTemplateRequest
options CallOptions
callback Callback<protos.google.protobuf.IEmpty, protos.google.privacy.dlp.v2.IDeleteDeidentifyTemplateRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

deleteDeidentifyTemplate(request, callback)

deleteDeidentifyTemplate(request: protos.google.privacy.dlp.v2.IDeleteDeidentifyTemplateRequest, callback: Callback<protos.google.protobuf.IEmpty, protos.google.privacy.dlp.v2.IDeleteDeidentifyTemplateRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IDeleteDeidentifyTemplateRequest
callback Callback<protos.google.protobuf.IEmpty, protos.google.privacy.dlp.v2.IDeleteDeidentifyTemplateRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

deleteDiscoveryConfig(request, options)

deleteDiscoveryConfig(request?: protos.google.privacy.dlp.v2.IDeleteDiscoveryConfigRequest, options?: CallOptions): Promise<[
        protos.google.protobuf.IEmpty,
        protos.google.privacy.dlp.v2.IDeleteDiscoveryConfigRequest | undefined,
        {} | undefined
    ]>;

Deletes a discovery configuration.

Parameters
Name Description
request IDeleteDiscoveryConfigRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ protos.google.protobuf.IEmpty, protos.google.privacy.dlp.v2.IDeleteDiscoveryConfigRequest | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing Empty. Please see the documentation for more details and examples.

Example

  /**
   * This snippet 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.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. Resource name of the project and the config, for example
   *  `projects/dlp-test-project/discoveryConfigs/53234423`.
   */
  // const name = 'abc123'

  // Imports the Dlp library
  const {DlpServiceClient} = require('@google-cloud/dlp').v2;

  // Instantiates a client
  const dlpClient = new DlpServiceClient();

  async function callDeleteDiscoveryConfig() {
    // Construct request
    const request = {
      name,
    };

    // Run request
    const response = await dlpClient.deleteDiscoveryConfig(request);
    console.log(response);
  }

  callDeleteDiscoveryConfig();

deleteDiscoveryConfig(request, options, callback)

deleteDiscoveryConfig(request: protos.google.privacy.dlp.v2.IDeleteDiscoveryConfigRequest, options: CallOptions, callback: Callback<protos.google.protobuf.IEmpty, protos.google.privacy.dlp.v2.IDeleteDiscoveryConfigRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IDeleteDiscoveryConfigRequest
options CallOptions
callback Callback<protos.google.protobuf.IEmpty, protos.google.privacy.dlp.v2.IDeleteDiscoveryConfigRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

deleteDiscoveryConfig(request, callback)

deleteDiscoveryConfig(request: protos.google.privacy.dlp.v2.IDeleteDiscoveryConfigRequest, callback: Callback<protos.google.protobuf.IEmpty, protos.google.privacy.dlp.v2.IDeleteDiscoveryConfigRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IDeleteDiscoveryConfigRequest
callback Callback<protos.google.protobuf.IEmpty, protos.google.privacy.dlp.v2.IDeleteDiscoveryConfigRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

deleteDlpJob(request, options)

deleteDlpJob(request?: protos.google.privacy.dlp.v2.IDeleteDlpJobRequest, options?: CallOptions): Promise<[
        protos.google.protobuf.IEmpty,
        protos.google.privacy.dlp.v2.IDeleteDlpJobRequest | undefined,
        {} | undefined
    ]>;

Deletes a long-running DlpJob. This method indicates that the client is no longer interested in the DlpJob result. The job will be canceled if possible. See https://cloud.google.com/sensitive-data-protection/docs/inspecting-storage and https://cloud.google.com/sensitive-data-protection/docs/compute-risk-analysis to learn more.

Parameters
Name Description
request IDeleteDlpJobRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ protos.google.protobuf.IEmpty, protos.google.privacy.dlp.v2.IDeleteDlpJobRequest | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing Empty. Please see the documentation for more details and examples.

Example

  /**
   * This snippet 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.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The name of the DlpJob resource to be deleted.
   */
  // const name = 'abc123'

  // Imports the Dlp library
  const {DlpServiceClient} = require('@google-cloud/dlp').v2;

  // Instantiates a client
  const dlpClient = new DlpServiceClient();

  async function callDeleteDlpJob() {
    // Construct request
    const request = {
      name,
    };

    // Run request
    const response = await dlpClient.deleteDlpJob(request);
    console.log(response);
  }

  callDeleteDlpJob();

deleteDlpJob(request, options, callback)

deleteDlpJob(request: protos.google.privacy.dlp.v2.IDeleteDlpJobRequest, options: CallOptions, callback: Callback<protos.google.protobuf.IEmpty, protos.google.privacy.dlp.v2.IDeleteDlpJobRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IDeleteDlpJobRequest
options CallOptions
callback Callback<protos.google.protobuf.IEmpty, protos.google.privacy.dlp.v2.IDeleteDlpJobRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

deleteDlpJob(request, callback)

deleteDlpJob(request: protos.google.privacy.dlp.v2.IDeleteDlpJobRequest, callback: Callback<protos.google.protobuf.IEmpty, protos.google.privacy.dlp.v2.IDeleteDlpJobRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IDeleteDlpJobRequest
callback Callback<protos.google.protobuf.IEmpty, protos.google.privacy.dlp.v2.IDeleteDlpJobRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

deleteFileStoreDataProfile(request, options)

deleteFileStoreDataProfile(request?: protos.google.privacy.dlp.v2.IDeleteFileStoreDataProfileRequest, options?: CallOptions): Promise<[
        protos.google.protobuf.IEmpty,
        (protos.google.privacy.dlp.v2.IDeleteFileStoreDataProfileRequest | undefined),
        {} | undefined
    ]>;

Delete a FileStoreDataProfile. Will not prevent the profile from being regenerated if the resource is still included in a discovery configuration.

Parameters
Name Description
request IDeleteFileStoreDataProfileRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ protos.google.protobuf.IEmpty, (protos.google.privacy.dlp.v2.IDeleteFileStoreDataProfileRequest | undefined), {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing Empty. Please see the documentation for more details and examples.

Example

  /**
   * This snippet 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.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. Resource name of the file store data profile.
   */
  // const name = 'abc123'

  // Imports the Dlp library
  const {DlpServiceClient} = require('@google-cloud/dlp').v2;

  // Instantiates a client
  const dlpClient = new DlpServiceClient();

  async function callDeleteFileStoreDataProfile() {
    // Construct request
    const request = {
      name,
    };

    // Run request
    const response = await dlpClient.deleteFileStoreDataProfile(request);
    console.log(response);
  }

  callDeleteFileStoreDataProfile();

deleteFileStoreDataProfile(request, options, callback)

deleteFileStoreDataProfile(request: protos.google.privacy.dlp.v2.IDeleteFileStoreDataProfileRequest, options: CallOptions, callback: Callback<protos.google.protobuf.IEmpty, protos.google.privacy.dlp.v2.IDeleteFileStoreDataProfileRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IDeleteFileStoreDataProfileRequest
options CallOptions
callback Callback<protos.google.protobuf.IEmpty, protos.google.privacy.dlp.v2.IDeleteFileStoreDataProfileRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

deleteFileStoreDataProfile(request, callback)

deleteFileStoreDataProfile(request: protos.google.privacy.dlp.v2.IDeleteFileStoreDataProfileRequest, callback: Callback<protos.google.protobuf.IEmpty, protos.google.privacy.dlp.v2.IDeleteFileStoreDataProfileRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IDeleteFileStoreDataProfileRequest
callback Callback<protos.google.protobuf.IEmpty, protos.google.privacy.dlp.v2.IDeleteFileStoreDataProfileRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

deleteInspectTemplate(request, options)

deleteInspectTemplate(request?: protos.google.privacy.dlp.v2.IDeleteInspectTemplateRequest, options?: CallOptions): Promise<[
        protos.google.protobuf.IEmpty,
        protos.google.privacy.dlp.v2.IDeleteInspectTemplateRequest | undefined,
        {} | undefined
    ]>;
Parameters
Name Description
request IDeleteInspectTemplateRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ protos.google.protobuf.IEmpty, protos.google.privacy.dlp.v2.IDeleteInspectTemplateRequest | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing Empty. Please see the documentation for more details and examples.

Example

  /**
   * This snippet 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.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. Resource name of the organization and inspectTemplate to be
   *  deleted, for example `organizations/433245324/inspectTemplates/432452342`
   *  or projects/project-id/inspectTemplates/432452342.
   */
  // const name = 'abc123'

  // Imports the Dlp library
  const {DlpServiceClient} = require('@google-cloud/dlp').v2;

  // Instantiates a client
  const dlpClient = new DlpServiceClient();

  async function callDeleteInspectTemplate() {
    // Construct request
    const request = {
      name,
    };

    // Run request
    const response = await dlpClient.deleteInspectTemplate(request);
    console.log(response);
  }

  callDeleteInspectTemplate();

deleteInspectTemplate(request, options, callback)

deleteInspectTemplate(request: protos.google.privacy.dlp.v2.IDeleteInspectTemplateRequest, options: CallOptions, callback: Callback<protos.google.protobuf.IEmpty, protos.google.privacy.dlp.v2.IDeleteInspectTemplateRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IDeleteInspectTemplateRequest
options CallOptions
callback Callback<protos.google.protobuf.IEmpty, protos.google.privacy.dlp.v2.IDeleteInspectTemplateRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

deleteInspectTemplate(request, callback)

deleteInspectTemplate(request: protos.google.privacy.dlp.v2.IDeleteInspectTemplateRequest, callback: Callback<protos.google.protobuf.IEmpty, protos.google.privacy.dlp.v2.IDeleteInspectTemplateRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IDeleteInspectTemplateRequest
callback Callback<protos.google.protobuf.IEmpty, protos.google.privacy.dlp.v2.IDeleteInspectTemplateRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

deleteJobTrigger(request, options)

deleteJobTrigger(request?: protos.google.privacy.dlp.v2.IDeleteJobTriggerRequest, options?: CallOptions): Promise<[
        protos.google.protobuf.IEmpty,
        protos.google.privacy.dlp.v2.IDeleteJobTriggerRequest | undefined,
        {} | undefined
    ]>;
Parameters
Name Description
request IDeleteJobTriggerRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ protos.google.protobuf.IEmpty, protos.google.privacy.dlp.v2.IDeleteJobTriggerRequest | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing Empty. Please see the documentation for more details and examples.

Example

  /**
   * This snippet 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.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. Resource name of the project and the triggeredJob, for example
   *  `projects/dlp-test-project/jobTriggers/53234423`.
   */
  // const name = 'abc123'

  // Imports the Dlp library
  const {DlpServiceClient} = require('@google-cloud/dlp').v2;

  // Instantiates a client
  const dlpClient = new DlpServiceClient();

  async function callDeleteJobTrigger() {
    // Construct request
    const request = {
      name,
    };

    // Run request
    const response = await dlpClient.deleteJobTrigger(request);
    console.log(response);
  }

  callDeleteJobTrigger();

deleteJobTrigger(request, options, callback)

deleteJobTrigger(request: protos.google.privacy.dlp.v2.IDeleteJobTriggerRequest, options: CallOptions, callback: Callback<protos.google.protobuf.IEmpty, protos.google.privacy.dlp.v2.IDeleteJobTriggerRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IDeleteJobTriggerRequest
options CallOptions
callback Callback<protos.google.protobuf.IEmpty, protos.google.privacy.dlp.v2.IDeleteJobTriggerRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

deleteJobTrigger(request, callback)

deleteJobTrigger(request: protos.google.privacy.dlp.v2.IDeleteJobTriggerRequest, callback: Callback<protos.google.protobuf.IEmpty, protos.google.privacy.dlp.v2.IDeleteJobTriggerRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IDeleteJobTriggerRequest
callback Callback<protos.google.protobuf.IEmpty, protos.google.privacy.dlp.v2.IDeleteJobTriggerRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

deleteStoredInfoType(request, options)

deleteStoredInfoType(request?: protos.google.privacy.dlp.v2.IDeleteStoredInfoTypeRequest, options?: CallOptions): Promise<[
        protos.google.protobuf.IEmpty,
        protos.google.privacy.dlp.v2.IDeleteStoredInfoTypeRequest | undefined,
        {} | undefined
    ]>;
Parameters
Name Description
request IDeleteStoredInfoTypeRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ protos.google.protobuf.IEmpty, protos.google.privacy.dlp.v2.IDeleteStoredInfoTypeRequest | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing Empty. Please see the documentation for more details and examples.

Example

  /**
   * This snippet 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.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. Resource name of the organization and storedInfoType to be
   *  deleted, for example `organizations/433245324/storedInfoTypes/432452342` or
   *  projects/project-id/storedInfoTypes/432452342.
   */
  // const name = 'abc123'

  // Imports the Dlp library
  const {DlpServiceClient} = require('@google-cloud/dlp').v2;

  // Instantiates a client
  const dlpClient = new DlpServiceClient();

  async function callDeleteStoredInfoType() {
    // Construct request
    const request = {
      name,
    };

    // Run request
    const response = await dlpClient.deleteStoredInfoType(request);
    console.log(response);
  }

  callDeleteStoredInfoType();

deleteStoredInfoType(request, options, callback)

deleteStoredInfoType(request: protos.google.privacy.dlp.v2.IDeleteStoredInfoTypeRequest, options: CallOptions, callback: Callback<protos.google.protobuf.IEmpty, protos.google.privacy.dlp.v2.IDeleteStoredInfoTypeRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IDeleteStoredInfoTypeRequest
options CallOptions
callback Callback<protos.google.protobuf.IEmpty, protos.google.privacy.dlp.v2.IDeleteStoredInfoTypeRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

deleteStoredInfoType(request, callback)

deleteStoredInfoType(request: protos.google.privacy.dlp.v2.IDeleteStoredInfoTypeRequest, callback: Callback<protos.google.protobuf.IEmpty, protos.google.privacy.dlp.v2.IDeleteStoredInfoTypeRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IDeleteStoredInfoTypeRequest
callback Callback<protos.google.protobuf.IEmpty, protos.google.privacy.dlp.v2.IDeleteStoredInfoTypeRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

deleteTableDataProfile(request, options)

deleteTableDataProfile(request?: protos.google.privacy.dlp.v2.IDeleteTableDataProfileRequest, options?: CallOptions): Promise<[
        protos.google.protobuf.IEmpty,
        protos.google.privacy.dlp.v2.IDeleteTableDataProfileRequest | undefined,
        {} | undefined
    ]>;

Delete a TableDataProfile. Will not prevent the profile from being regenerated if the table is still included in a discovery configuration.

Parameters
Name Description
request IDeleteTableDataProfileRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ protos.google.protobuf.IEmpty, protos.google.privacy.dlp.v2.IDeleteTableDataProfileRequest | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing Empty. Please see the documentation for more details and examples.

Example

  /**
   * This snippet 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.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. Resource name of the table data profile.
   */
  // const name = 'abc123'

  // Imports the Dlp library
  const {DlpServiceClient} = require('@google-cloud/dlp').v2;

  // Instantiates a client
  const dlpClient = new DlpServiceClient();

  async function callDeleteTableDataProfile() {
    // Construct request
    const request = {
      name,
    };

    // Run request
    const response = await dlpClient.deleteTableDataProfile(request);
    console.log(response);
  }

  callDeleteTableDataProfile();

deleteTableDataProfile(request, options, callback)

deleteTableDataProfile(request: protos.google.privacy.dlp.v2.IDeleteTableDataProfileRequest, options: CallOptions, callback: Callback<protos.google.protobuf.IEmpty, protos.google.privacy.dlp.v2.IDeleteTableDataProfileRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IDeleteTableDataProfileRequest
options CallOptions
callback Callback<protos.google.protobuf.IEmpty, protos.google.privacy.dlp.v2.IDeleteTableDataProfileRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

deleteTableDataProfile(request, callback)

deleteTableDataProfile(request: protos.google.privacy.dlp.v2.IDeleteTableDataProfileRequest, callback: Callback<protos.google.protobuf.IEmpty, protos.google.privacy.dlp.v2.IDeleteTableDataProfileRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IDeleteTableDataProfileRequest
callback Callback<protos.google.protobuf.IEmpty, protos.google.privacy.dlp.v2.IDeleteTableDataProfileRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

discoveryConfigPath(project, location, discoveryConfig)

discoveryConfigPath(project: string, location: string, discoveryConfig: string): string;

Return a fully-qualified discoveryConfig resource name string.

Parameters
Name Description
project string
location string
discoveryConfig string
Returns
Type Description
string

{string} Resource name string.

findingPath(project, location, finding)

findingPath(project: string, location: string, finding: string): string;

Return a fully-qualified finding resource name string.

Parameters
Name Description
project string
location string
finding string
Returns
Type Description
string

{string} Resource name string.

finishDlpJob(request, options)

finishDlpJob(request?: protos.google.privacy.dlp.v2.IFinishDlpJobRequest, options?: CallOptions): Promise<[
        protos.google.protobuf.IEmpty,
        protos.google.privacy.dlp.v2.IFinishDlpJobRequest | undefined,
        {} | undefined
    ]>;

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

Parameters
Name Description
request IFinishDlpJobRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ protos.google.protobuf.IEmpty, protos.google.privacy.dlp.v2.IFinishDlpJobRequest | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing Empty. Please see the documentation for more details and examples.

Example

  /**
   * This snippet 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.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The name of the DlpJob resource to be finished.
   */
  // const name = 'abc123'

  // Imports the Dlp library
  const {DlpServiceClient} = require('@google-cloud/dlp').v2;

  // Instantiates a client
  const dlpClient = new DlpServiceClient();

  async function callFinishDlpJob() {
    // Construct request
    const request = {
      name,
    };

    // Run request
    const response = await dlpClient.finishDlpJob(request);
    console.log(response);
  }

  callFinishDlpJob();

finishDlpJob(request, options, callback)

finishDlpJob(request: protos.google.privacy.dlp.v2.IFinishDlpJobRequest, options: CallOptions, callback: Callback<protos.google.protobuf.IEmpty, protos.google.privacy.dlp.v2.IFinishDlpJobRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IFinishDlpJobRequest
options CallOptions
callback Callback<protos.google.protobuf.IEmpty, protos.google.privacy.dlp.v2.IFinishDlpJobRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

finishDlpJob(request, callback)

finishDlpJob(request: protos.google.privacy.dlp.v2.IFinishDlpJobRequest, callback: Callback<protos.google.protobuf.IEmpty, protos.google.privacy.dlp.v2.IFinishDlpJobRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IFinishDlpJobRequest
callback Callback<protos.google.protobuf.IEmpty, protos.google.privacy.dlp.v2.IFinishDlpJobRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

getColumnDataProfile(request, options)

getColumnDataProfile(request?: protos.google.privacy.dlp.v2.IGetColumnDataProfileRequest, options?: CallOptions): Promise<[
        protos.google.privacy.dlp.v2.IColumnDataProfile,
        protos.google.privacy.dlp.v2.IGetColumnDataProfileRequest | undefined,
        {} | undefined
    ]>;

Gets a column data profile.

Parameters
Name Description
request IGetColumnDataProfileRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ protos.google.privacy.dlp.v2.IColumnDataProfile, protos.google.privacy.dlp.v2.IGetColumnDataProfileRequest | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the documentation for more details and examples.

Example

  /**
   * This snippet 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.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. Resource name, for example
   *  `organizations/12345/locations/us/columnDataProfiles/53234423`.
   */
  // const name = 'abc123'

  // Imports the Dlp library
  const {DlpServiceClient} = require('@google-cloud/dlp').v2;

  // Instantiates a client
  const dlpClient = new DlpServiceClient();

  async function callGetColumnDataProfile() {
    // Construct request
    const request = {
      name,
    };

    // Run request
    const response = await dlpClient.getColumnDataProfile(request);
    console.log(response);
  }

  callGetColumnDataProfile();

getColumnDataProfile(request, options, callback)

getColumnDataProfile(request: protos.google.privacy.dlp.v2.IGetColumnDataProfileRequest, options: CallOptions, callback: Callback<protos.google.privacy.dlp.v2.IColumnDataProfile, protos.google.privacy.dlp.v2.IGetColumnDataProfileRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IGetColumnDataProfileRequest
options CallOptions
callback Callback<protos.google.privacy.dlp.v2.IColumnDataProfile, protos.google.privacy.dlp.v2.IGetColumnDataProfileRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

getColumnDataProfile(request, callback)

getColumnDataProfile(request: protos.google.privacy.dlp.v2.IGetColumnDataProfileRequest, callback: Callback<protos.google.privacy.dlp.v2.IColumnDataProfile, protos.google.privacy.dlp.v2.IGetColumnDataProfileRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IGetColumnDataProfileRequest
callback Callback<protos.google.privacy.dlp.v2.IColumnDataProfile, protos.google.privacy.dlp.v2.IGetColumnDataProfileRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

getConnection(request, options)

getConnection(request?: protos.google.privacy.dlp.v2.IGetConnectionRequest, options?: CallOptions): Promise<[
        protos.google.privacy.dlp.v2.IConnection,
        protos.google.privacy.dlp.v2.IGetConnectionRequest | undefined,
        {} | undefined
    ]>;

Get a Connection by name.

Parameters
Name Description
request IGetConnectionRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ protos.google.privacy.dlp.v2.IConnection, protos.google.privacy.dlp.v2.IGetConnectionRequest | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing Connection. Please see the documentation for more details and examples.

Example

  /**
   * This snippet 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.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. Resource name in the format:
   *  `projects/{project}/locations/{location}/connections/{connection}`.
   */
  // const name = 'abc123'

  // Imports the Dlp library
  const {DlpServiceClient} = require('@google-cloud/dlp').v2;

  // Instantiates a client
  const dlpClient = new DlpServiceClient();

  async function callGetConnection() {
    // Construct request
    const request = {
      name,
    };

    // Run request
    const response = await dlpClient.getConnection(request);
    console.log(response);
  }

  callGetConnection();

getConnection(request, options, callback)

getConnection(request: protos.google.privacy.dlp.v2.IGetConnectionRequest, options: CallOptions, callback: Callback<protos.google.privacy.dlp.v2.IConnection, protos.google.privacy.dlp.v2.IGetConnectionRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IGetConnectionRequest
options CallOptions
callback Callback<protos.google.privacy.dlp.v2.IConnection, protos.google.privacy.dlp.v2.IGetConnectionRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

getConnection(request, callback)

getConnection(request: protos.google.privacy.dlp.v2.IGetConnectionRequest, callback: Callback<protos.google.privacy.dlp.v2.IConnection, protos.google.privacy.dlp.v2.IGetConnectionRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IGetConnectionRequest
callback Callback<protos.google.privacy.dlp.v2.IConnection, protos.google.privacy.dlp.v2.IGetConnectionRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

getDeidentifyTemplate(request, options)

getDeidentifyTemplate(request?: protos.google.privacy.dlp.v2.IGetDeidentifyTemplateRequest, options?: CallOptions): Promise<[
        protos.google.privacy.dlp.v2.IDeidentifyTemplate,
        protos.google.privacy.dlp.v2.IGetDeidentifyTemplateRequest | undefined,
        {} | undefined
    ]>;
Parameters
Name Description
request IGetDeidentifyTemplateRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ protos.google.privacy.dlp.v2.IDeidentifyTemplate, protos.google.privacy.dlp.v2.IGetDeidentifyTemplateRequest | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing DeidentifyTemplate. Please see the documentation for more details and examples.

Example

  /**
   * This snippet 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.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. Resource name of the organization and deidentify template to be
   *  read, for example `organizations/433245324/deidentifyTemplates/432452342`
   *  or projects/project-id/deidentifyTemplates/432452342.
   */
  // const name = 'abc123'

  // Imports the Dlp library
  const {DlpServiceClient} = require('@google-cloud/dlp').v2;

  // Instantiates a client
  const dlpClient = new DlpServiceClient();

  async function callGetDeidentifyTemplate() {
    // Construct request
    const request = {
      name,
    };

    // Run request
    const response = await dlpClient.getDeidentifyTemplate(request);
    console.log(response);
  }

  callGetDeidentifyTemplate();

getDeidentifyTemplate(request, options, callback)

getDeidentifyTemplate(request: protos.google.privacy.dlp.v2.IGetDeidentifyTemplateRequest, options: CallOptions, callback: Callback<protos.google.privacy.dlp.v2.IDeidentifyTemplate, protos.google.privacy.dlp.v2.IGetDeidentifyTemplateRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IGetDeidentifyTemplateRequest
options CallOptions
callback Callback<protos.google.privacy.dlp.v2.IDeidentifyTemplate, protos.google.privacy.dlp.v2.IGetDeidentifyTemplateRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

getDeidentifyTemplate(request, callback)

getDeidentifyTemplate(request: protos.google.privacy.dlp.v2.IGetDeidentifyTemplateRequest, callback: Callback<protos.google.privacy.dlp.v2.IDeidentifyTemplate, protos.google.privacy.dlp.v2.IGetDeidentifyTemplateRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IGetDeidentifyTemplateRequest
callback Callback<protos.google.privacy.dlp.v2.IDeidentifyTemplate, protos.google.privacy.dlp.v2.IGetDeidentifyTemplateRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

getDiscoveryConfig(request, options)

getDiscoveryConfig(request?: protos.google.privacy.dlp.v2.IGetDiscoveryConfigRequest, options?: CallOptions): Promise<[
        protos.google.privacy.dlp.v2.IDiscoveryConfig,
        protos.google.privacy.dlp.v2.IGetDiscoveryConfigRequest | undefined,
        {} | undefined
    ]>;

Gets a discovery configuration.

Parameters
Name Description
request IGetDiscoveryConfigRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ protos.google.privacy.dlp.v2.IDiscoveryConfig, protos.google.privacy.dlp.v2.IGetDiscoveryConfigRequest | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the documentation for more details and examples.

Example

  /**
   * This snippet 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.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. Resource name of the project and the configuration, for example
   *  `projects/dlp-test-project/discoveryConfigs/53234423`.
   */
  // const name = 'abc123'

  // Imports the Dlp library
  const {DlpServiceClient} = require('@google-cloud/dlp').v2;

  // Instantiates a client
  const dlpClient = new DlpServiceClient();

  async function callGetDiscoveryConfig() {
    // Construct request
    const request = {
      name,
    };

    // Run request
    const response = await dlpClient.getDiscoveryConfig(request);
    console.log(response);
  }

  callGetDiscoveryConfig();

getDiscoveryConfig(request, options, callback)

getDiscoveryConfig(request: protos.google.privacy.dlp.v2.IGetDiscoveryConfigRequest, options: CallOptions, callback: Callback<protos.google.privacy.dlp.v2.IDiscoveryConfig, protos.google.privacy.dlp.v2.IGetDiscoveryConfigRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IGetDiscoveryConfigRequest
options CallOptions
callback Callback<protos.google.privacy.dlp.v2.IDiscoveryConfig, protos.google.privacy.dlp.v2.IGetDiscoveryConfigRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

getDiscoveryConfig(request, callback)

getDiscoveryConfig(request: protos.google.privacy.dlp.v2.IGetDiscoveryConfigRequest, callback: Callback<protos.google.privacy.dlp.v2.IDiscoveryConfig, protos.google.privacy.dlp.v2.IGetDiscoveryConfigRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IGetDiscoveryConfigRequest
callback Callback<protos.google.privacy.dlp.v2.IDiscoveryConfig, protos.google.privacy.dlp.v2.IGetDiscoveryConfigRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

getDlpJob(request, options)

getDlpJob(request?: protos.google.privacy.dlp.v2.IGetDlpJobRequest, options?: CallOptions): Promise<[
        protos.google.privacy.dlp.v2.IDlpJob,
        protos.google.privacy.dlp.v2.IGetDlpJobRequest | undefined,
        {} | undefined
    ]>;
Parameters
Name Description
request IGetDlpJobRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ protos.google.privacy.dlp.v2.IDlpJob, protos.google.privacy.dlp.v2.IGetDlpJobRequest | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the documentation for more details and examples.

Example

  /**
   * This snippet 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.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The name of the DlpJob resource.
   */
  // const name = 'abc123'

  // Imports the Dlp library
  const {DlpServiceClient} = require('@google-cloud/dlp').v2;

  // Instantiates a client
  const dlpClient = new DlpServiceClient();

  async function callGetDlpJob() {
    // Construct request
    const request = {
      name,
    };

    // Run request
    const response = await dlpClient.getDlpJob(request);
    console.log(response);
  }

  callGetDlpJob();

getDlpJob(request, options, callback)

getDlpJob(request: protos.google.privacy.dlp.v2.IGetDlpJobRequest, options: CallOptions, callback: Callback<protos.google.privacy.dlp.v2.IDlpJob, protos.google.privacy.dlp.v2.IGetDlpJobRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IGetDlpJobRequest
options CallOptions
callback Callback<protos.google.privacy.dlp.v2.IDlpJob, protos.google.privacy.dlp.v2.IGetDlpJobRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

getDlpJob(request, callback)

getDlpJob(request: protos.google.privacy.dlp.v2.IGetDlpJobRequest, callback: Callback<protos.google.privacy.dlp.v2.IDlpJob, protos.google.privacy.dlp.v2.IGetDlpJobRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IGetDlpJobRequest
callback Callback<protos.google.privacy.dlp.v2.IDlpJob, protos.google.privacy.dlp.v2.IGetDlpJobRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

getFileStoreDataProfile(request, options)

getFileStoreDataProfile(request?: protos.google.privacy.dlp.v2.IGetFileStoreDataProfileRequest, options?: CallOptions): Promise<[
        protos.google.privacy.dlp.v2.IFileStoreDataProfile,
        protos.google.privacy.dlp.v2.IGetFileStoreDataProfileRequest | undefined,
        {} | undefined
    ]>;

Gets a file store data profile.

Parameters
Name Description
request IGetFileStoreDataProfileRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ protos.google.privacy.dlp.v2.IFileStoreDataProfile, protos.google.privacy.dlp.v2.IGetFileStoreDataProfileRequest | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the documentation for more details and examples.

Example

  /**
   * This snippet 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.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. Resource name, for example
   *  `organizations/12345/locations/us/fileStoreDataProfiles/53234423`.
   */
  // const name = 'abc123'

  // Imports the Dlp library
  const {DlpServiceClient} = require('@google-cloud/dlp').v2;

  // Instantiates a client
  const dlpClient = new DlpServiceClient();

  async function callGetFileStoreDataProfile() {
    // Construct request
    const request = {
      name,
    };

    // Run request
    const response = await dlpClient.getFileStoreDataProfile(request);
    console.log(response);
  }

  callGetFileStoreDataProfile();

getFileStoreDataProfile(request, options, callback)

getFileStoreDataProfile(request: protos.google.privacy.dlp.v2.IGetFileStoreDataProfileRequest, options: CallOptions, callback: Callback<protos.google.privacy.dlp.v2.IFileStoreDataProfile, protos.google.privacy.dlp.v2.IGetFileStoreDataProfileRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IGetFileStoreDataProfileRequest
options CallOptions
callback Callback<protos.google.privacy.dlp.v2.IFileStoreDataProfile, protos.google.privacy.dlp.v2.IGetFileStoreDataProfileRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

getFileStoreDataProfile(request, callback)

getFileStoreDataProfile(request: protos.google.privacy.dlp.v2.IGetFileStoreDataProfileRequest, callback: Callback<protos.google.privacy.dlp.v2.IFileStoreDataProfile, protos.google.privacy.dlp.v2.IGetFileStoreDataProfileRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IGetFileStoreDataProfileRequest
callback Callback<protos.google.privacy.dlp.v2.IFileStoreDataProfile, protos.google.privacy.dlp.v2.IGetFileStoreDataProfileRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

getInspectTemplate(request, options)

getInspectTemplate(request?: protos.google.privacy.dlp.v2.IGetInspectTemplateRequest, options?: CallOptions): Promise<[
        protos.google.privacy.dlp.v2.IInspectTemplate,
        protos.google.privacy.dlp.v2.IGetInspectTemplateRequest | undefined,
        {} | undefined
    ]>;
Parameters
Name Description
request IGetInspectTemplateRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ protos.google.privacy.dlp.v2.IInspectTemplate, protos.google.privacy.dlp.v2.IGetInspectTemplateRequest | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing InspectTemplate. Please see the documentation for more details and examples.

Example

  /**
   * This snippet 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.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. Resource name of the organization and inspectTemplate to be read,
   *  for example `organizations/433245324/inspectTemplates/432452342` or
   *  projects/project-id/inspectTemplates/432452342.
   */
  // const name = 'abc123'

  // Imports the Dlp library
  const {DlpServiceClient} = require('@google-cloud/dlp').v2;

  // Instantiates a client
  const dlpClient = new DlpServiceClient();

  async function callGetInspectTemplate() {
    // Construct request
    const request = {
      name,
    };

    // Run request
    const response = await dlpClient.getInspectTemplate(request);
    console.log(response);
  }

  callGetInspectTemplate();

getInspectTemplate(request, options, callback)

getInspectTemplate(request: protos.google.privacy.dlp.v2.IGetInspectTemplateRequest, options: CallOptions, callback: Callback<protos.google.privacy.dlp.v2.IInspectTemplate, protos.google.privacy.dlp.v2.IGetInspectTemplateRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IGetInspectTemplateRequest
options CallOptions
callback Callback<protos.google.privacy.dlp.v2.IInspectTemplate, protos.google.privacy.dlp.v2.IGetInspectTemplateRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

getInspectTemplate(request, callback)

getInspectTemplate(request: protos.google.privacy.dlp.v2.IGetInspectTemplateRequest, callback: Callback<protos.google.privacy.dlp.v2.IInspectTemplate, protos.google.privacy.dlp.v2.IGetInspectTemplateRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IGetInspectTemplateRequest
callback Callback<protos.google.privacy.dlp.v2.IInspectTemplate, protos.google.privacy.dlp.v2.IGetInspectTemplateRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

getJobTrigger(request, options)

getJobTrigger(request?: protos.google.privacy.dlp.v2.IGetJobTriggerRequest, options?: CallOptions): Promise<[
        protos.google.privacy.dlp.v2.IJobTrigger,
        protos.google.privacy.dlp.v2.IGetJobTriggerRequest | undefined,
        {} | undefined
    ]>;
Parameters
Name Description
request IGetJobTriggerRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ protos.google.privacy.dlp.v2.IJobTrigger, protos.google.privacy.dlp.v2.IGetJobTriggerRequest | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the documentation for more details and examples.

Example

  /**
   * This snippet 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.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. Resource name of the project and the triggeredJob, for example
   *  `projects/dlp-test-project/jobTriggers/53234423`.
   */
  // const name = 'abc123'

  // Imports the Dlp library
  const {DlpServiceClient} = require('@google-cloud/dlp').v2;

  // Instantiates a client
  const dlpClient = new DlpServiceClient();

  async function callGetJobTrigger() {
    // Construct request
    const request = {
      name,
    };

    // Run request
    const response = await dlpClient.getJobTrigger(request);
    console.log(response);
  }

  callGetJobTrigger();

getJobTrigger(request, options, callback)

getJobTrigger(request: protos.google.privacy.dlp.v2.IGetJobTriggerRequest, options: CallOptions, callback: Callback<protos.google.privacy.dlp.v2.IJobTrigger, protos.google.privacy.dlp.v2.IGetJobTriggerRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IGetJobTriggerRequest
options CallOptions
callback Callback<protos.google.privacy.dlp.v2.IJobTrigger, protos.google.privacy.dlp.v2.IGetJobTriggerRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

getJobTrigger(request, callback)

getJobTrigger(request: protos.google.privacy.dlp.v2.IGetJobTriggerRequest, callback: Callback<protos.google.privacy.dlp.v2.IJobTrigger, protos.google.privacy.dlp.v2.IGetJobTriggerRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IGetJobTriggerRequest
callback Callback<protos.google.privacy.dlp.v2.IJobTrigger, protos.google.privacy.dlp.v2.IGetJobTriggerRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

getLocation(request, options, callback)

getLocation(request: LocationProtos.google.cloud.location.IGetLocationRequest, options?: gax.CallOptions | Callback<LocationProtos.google.cloud.location.ILocation, LocationProtos.google.cloud.location.IGetLocationRequest | null | undefined, {} | null | undefined>, callback?: Callback<LocationProtos.google.cloud.location.ILocation, LocationProtos.google.cloud.location.IGetLocationRequest | null | undefined, {} | null | undefined>): Promise<LocationProtos.google.cloud.location.ILocation>;

Gets information about a location.

Parameters
Name Description
request LocationProtos.google.cloud.location.IGetLocationRequest

The request object that will be sent.

options CallOptions | Callback<google.cloud.location.ILocation, google.cloud.location.IGetLocationRequest | null | undefined, {} | null | undefined>

Call options. See CallOptions for more details.

callback Callback<google.cloud.location.ILocation, google.cloud.location.IGetLocationRequest | null | undefined, {} | null | undefined>
Returns
Type Description
Promise<google.cloud.location.ILocation>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the documentation for more details and examples.

Example

const [response] = await client.getLocation(request);

getProjectDataProfile(request, options)

getProjectDataProfile(request?: protos.google.privacy.dlp.v2.IGetProjectDataProfileRequest, options?: CallOptions): Promise<[
        protos.google.privacy.dlp.v2.IProjectDataProfile,
        protos.google.privacy.dlp.v2.IGetProjectDataProfileRequest | undefined,
        {} | undefined
    ]>;

Gets a project data profile.

Parameters
Name Description
request IGetProjectDataProfileRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ protos.google.privacy.dlp.v2.IProjectDataProfile, protos.google.privacy.dlp.v2.IGetProjectDataProfileRequest | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing ProjectDataProfile. Please see the documentation for more details and examples.

Example

  /**
   * This snippet 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.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. Resource name, for example
   *  `organizations/12345/locations/us/projectDataProfiles/53234423`.
   */
  // const name = 'abc123'

  // Imports the Dlp library
  const {DlpServiceClient} = require('@google-cloud/dlp').v2;

  // Instantiates a client
  const dlpClient = new DlpServiceClient();

  async function callGetProjectDataProfile() {
    // Construct request
    const request = {
      name,
    };

    // Run request
    const response = await dlpClient.getProjectDataProfile(request);
    console.log(response);
  }

  callGetProjectDataProfile();

getProjectDataProfile(request, options, callback)

getProjectDataProfile(request: protos.google.privacy.dlp.v2.IGetProjectDataProfileRequest, options: CallOptions, callback: Callback<protos.google.privacy.dlp.v2.IProjectDataProfile, protos.google.privacy.dlp.v2.IGetProjectDataProfileRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IGetProjectDataProfileRequest
options CallOptions
callback Callback<protos.google.privacy.dlp.v2.IProjectDataProfile, protos.google.privacy.dlp.v2.IGetProjectDataProfileRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

getProjectDataProfile(request, callback)

getProjectDataProfile(request: protos.google.privacy.dlp.v2.IGetProjectDataProfileRequest, callback: Callback<protos.google.privacy.dlp.v2.IProjectDataProfile, protos.google.privacy.dlp.v2.IGetProjectDataProfileRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IGetProjectDataProfileRequest
callback Callback<protos.google.privacy.dlp.v2.IProjectDataProfile, protos.google.privacy.dlp.v2.IGetProjectDataProfileRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

getProjectId()

getProjectId(): Promise<string>;
Returns
Type Description
Promise<string>

getProjectId(callback)

getProjectId(callback: Callback<string, undefined, undefined>): void;
Parameter
Name Description
callback Callback<string, undefined, undefined>
Returns
Type Description
void

getStoredInfoType(request, options)

getStoredInfoType(request?: protos.google.privacy.dlp.v2.IGetStoredInfoTypeRequest, options?: CallOptions): Promise<[
        protos.google.privacy.dlp.v2.IStoredInfoType,
        protos.google.privacy.dlp.v2.IGetStoredInfoTypeRequest | undefined