Methods

new DlpServiceClient([options])

Construct an instance of DlpServiceClient.

Parameters

Name Type Optional Description

options

 

Yes

The configuration object. See the subsequent parameters for more details.

Values in options have the following properties:

Name Type Optional Description

credentials

 

Yes

Credentials object.

credentials.client_email

 

Yes

credentials.private_key

 

Yes

email

 

Yes

Account email address. Required when using a .pem or .p12 keyFilename.

keyFilename

 

Yes

Full path to the a .json, .pem, or .p12 key downloaded from the Google Developers Console. If you provide a path to a JSON file, the projectId option below is not necessary. NOTE: .pem and .p12 require you to specify options.email as well.

port

 

Yes

The port on which to connect to the remote host.

projectId

 

Yes

The project ID from the Google Developer's Console, e.g. 'grape-spaceship-123'. We will also check the environment variable GCLOUD_PROJECT for your project ID. If your app is running in an environment which supports Application Default Credentials, your project ID will be detected automatically.

promise

 

Yes

Custom promise module to use instead of native Promises.

servicePath

 

Yes

The domain name of the API remote host.

Properties

static

apiEndpoint

The DNS address for this API service - same as servicePath(), exists for compatibility reasons.

static

port

The port for this API service.

static

scopes

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

static

servicePath

The DNS address for this API service.

Methods

cancelDlpJob(request[, options][, callback]) → Promise

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

Example

const dlp = require('@google-cloud/dlp');

const client = new dlp.v2.DlpServiceClient({
  // optional auth parameters.
});

const formattedName = client.dlpJobPath('[PROJECT]', '[DLP_JOB]');
client.cancelDlpJob({name: formattedName}).catch(err => {
  console.error(err);
});

Parameters

Name Type Optional Description

request

Object

 

The request object that will be sent.

Values in request have the following properties:

Name Type Optional Description

name

string

 

The name of the DlpJob resource to be cancelled.

options

Object

Yes

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.

callback

function(nullable Error)

Yes

The function which will be called with the result of the API call.

Returns

Promise 

  • The promise which resolves when API call finishes. The promise has a method named "cancel" which cancels the ongoing API call.

createDeidentifyTemplate(request[, options][, callback]) → Promise

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

Example

const dlp = require('@google-cloud/dlp');

const client = new dlp.v2.DlpServiceClient({
  // optional auth parameters.
});

const formattedParent = client.organizationPath('[ORGANIZATION]');
client.createDeidentifyTemplate({parent: formattedParent})
  .then(responses => {
    const response = responses[0];
    // doThingsWith(response)
  })
  .catch(err => {
    console.error(err);
  });

Parameters

Name Type Optional Description

request

Object

 

The request object that will be sent.

Values in request have the following properties:

Name Type Optional Description

parent

string

 

The parent resource name, for example projects/my-project-id or organizations/my-org-id.

deidentifyTemplate

Object

Yes

The DeidentifyTemplate to create.

This object should have the same structure as DeidentifyTemplate

templateId

string

Yes

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.

options

Object

Yes

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.

callback

function(nullable Error, nullable Object)

Yes

The function which will be called with the result of the API call.

The second parameter to the callback is an object representing DeidentifyTemplate.

Returns

Promise 

  • The promise which resolves to an array. The first element of the array is an object representing DeidentifyTemplate. The promise has a method named "cancel" which cancels the ongoing API call.

createDlpJob(request[, options][, callback]) → Promise

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

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

Example

const dlp = require('@google-cloud/dlp');

const client = new dlp.v2.DlpServiceClient({
  // optional auth parameters.
});

const formattedParent = client.projectPath('[PROJECT]');
client.createDlpJob({parent: formattedParent})
  .then(responses => {
    const response = responses[0];
    // doThingsWith(response)
  })
  .catch(err => {
    console.error(err);
  });

Parameters

Name Type Optional Description

request

Object

 

The request object that will be sent.

Values in request have the following properties:

Name Type Optional Description

parent

string

 

The parent resource name, for example projects/my-project-id.

inspectJob

Object

Yes

This object should have the same structure as InspectJobConfig

riskJob

Object

Yes

This object should have the same structure as RiskAnalysisJobConfig

jobId

string

Yes

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.

options

Object

Yes

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.

callback

function(nullable Error, nullable Object)

Yes

The function which will be called with the result of the API call.

The second parameter to the callback is an object representing DlpJob.

Returns

Promise 

  • The promise which resolves to an array. The first element of the array is an object representing DlpJob. The promise has a method named "cancel" which cancels the ongoing API call.

createInspectTemplate(request[, options][, callback]) → Promise

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

Example

const dlp = require('@google-cloud/dlp');

const client = new dlp.v2.DlpServiceClient({
  // optional auth parameters.
});

const formattedParent = client.organizationPath('[ORGANIZATION]');
client.createInspectTemplate({parent: formattedParent})
  .then(responses => {
    const response = responses[0];
    // doThingsWith(response)
  })
  .catch(err => {
    console.error(err);
  });

Parameters

Name Type Optional Description

request

Object

 

The request object that will be sent.

Values in request have the following properties:

Name Type Optional Description

parent

string

 

The parent resource name, for example projects/my-project-id or organizations/my-org-id.

inspectTemplate

Object

Yes

The InspectTemplate to create.

This object should have the same structure as InspectTemplate

templateId

string

Yes

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.

options

Object

Yes

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.

callback

function(nullable Error, nullable Object)

Yes

The function which will be called with the result of the API call.

The second parameter to the callback is an object representing InspectTemplate.

Returns

Promise 

  • The promise which resolves to an array. The first element of the array is an object representing InspectTemplate. The promise has a method named "cancel" which cancels the ongoing API call.

createJobTrigger(request[, options][, callback]) → Promise

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

Example

const dlp = require('@google-cloud/dlp');

const client = new dlp.v2.DlpServiceClient({
  // optional auth parameters.
});

const formattedParent = client.projectPath('[PROJECT]');
client.createJobTrigger({parent: formattedParent})
  .then(responses => {
    const response = responses[0];
    // doThingsWith(response)
  })
  .catch(err => {
    console.error(err);
  });

Parameters

Name Type Optional Description

request

Object

 

The request object that will be sent.

Values in request have the following properties:

Name Type Optional Description

parent

string

 

The parent resource name, for example projects/my-project-id.

jobTrigger

Object

Yes

The JobTrigger to create.

This object should have the same structure as JobTrigger

triggerId

string

Yes

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.

options

Object

Yes

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.

callback

function(nullable Error, nullable Object)

Yes

The function which will be called with the result of the API call.

The second parameter to the callback is an object representing JobTrigger.

Returns

Promise 

  • The promise which resolves to an array. The first element of the array is an object representing JobTrigger. The promise has a method named "cancel" which cancels the ongoing API call.

createStoredInfoType(request[, options][, callback]) → Promise

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

Example

const dlp = require('@google-cloud/dlp');

const client = new dlp.v2.DlpServiceClient({
  // optional auth parameters.
});

const formattedParent = client.organizationPath('[ORGANIZATION]');
client.createStoredInfoType({parent: formattedParent})
  .then(responses => {
    const response = responses[0];
    // doThingsWith(response)
  })
  .catch(err => {
    console.error(err);
  });

Parameters

Name Type Optional Description

request

Object

 

The request object that will be sent.

Values in request have the following properties:

Name Type Optional Description

parent

string

 

The parent resource name, for example projects/my-project-id or organizations/my-org-id.

config

Object

Yes

Configuration of the storedInfoType to create.

This object should have the same structure as StoredInfoTypeConfig

storedInfoTypeId

string

Yes

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.

options

Object

Yes

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.

callback

function(nullable Error, nullable Object)

Yes

The function which will be called with the result of the API call.

The second parameter to the callback is an object representing StoredInfoType.

Returns

Promise 

  • The promise which resolves to an array. The first element of the array is an object representing StoredInfoType. The promise has a method named "cancel" which cancels the ongoing API call.

deidentifyContent(request[, options][, callback]) → Promise

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

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

Example

const dlp = require('@google-cloud/dlp');

const client = new dlp.v2.DlpServiceClient({
  // optional auth parameters.
});

const formattedParent = client.projectPath('[PROJECT]');
client.deidentifyContent({parent: formattedParent})
  .then(responses => {
    const response = responses[0];
    // doThingsWith(response)
  })
  .catch(err => {
    console.error(err);
  });

Parameters

Name Type Optional Description

request

Object

 

The request object that will be sent.

Values in request have the following properties:

Name Type Optional Description

parent

string

 

The parent resource name, for example projects/my-project-id.

deidentifyConfig

Object

Yes

Configuration for the de-identification of the content item. Items specified here will override the template referenced by the deidentify_template_name argument.

This object should have the same structure as DeidentifyConfig

inspectConfig

Object

Yes

Configuration for the inspector. Items specified here will override the template referenced by the inspect_template_name argument.

This object should have the same structure as InspectConfig

item

Object

Yes

The item to de-identify. Will be treated as text.

This object should have the same structure as ContentItem

inspectTemplateName

string

Yes

Optional 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.

deidentifyTemplateName

string

Yes

Optional 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.

options

Object

Yes

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.

callback

function(nullable Error, nullable Object)

Yes

The function which will be called with the result of the API call.

The second parameter to the callback is an object representing DeidentifyContentResponse.

Returns

Promise 

  • The promise which resolves to an array. The first element of the array is an object representing DeidentifyContentResponse. The promise has a method named "cancel" which cancels the ongoing API call.

deleteDeidentifyTemplate(request[, options][, callback]) → Promise

Deletes a DeidentifyTemplate. See https://cloud.google.com/dlp/docs/creating-templates-deid to learn more.

Example

const dlp = require('@google-cloud/dlp');

const client = new dlp.v2.DlpServiceClient({
  // optional auth parameters.
});

const formattedName = client.organizationDeidentifyTemplatePath('[ORGANIZATION]', '[DEIDENTIFY_TEMPLATE]');
client.deleteDeidentifyTemplate({name: formattedName}).catch(err => {
  console.error(err);
});

Parameters

Name Type Optional Description

request

Object

 

The request object that will be sent.

Values in request have the following properties:

Name Type Optional Description

name

string

 

Resource name of the organization and deidentify template to be deleted, for example organizations/433245324/deidentifyTemplates/432452342 or projects/project-id/deidentifyTemplates/432452342.

options

Object

Yes

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.

callback

function(nullable Error)

Yes

The function which will be called with the result of the API call.

Returns

Promise 

  • The promise which resolves when API call finishes. The promise has a method named "cancel" which cancels the ongoing API call.

deleteDlpJob(request[, options][, callback]) → Promise

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

Example

const dlp = require('@google-cloud/dlp');

const client = new dlp.v2.DlpServiceClient({
  // optional auth parameters.
});

const formattedName = client.dlpJobPath('[PROJECT]', '[DLP_JOB]');
client.deleteDlpJob({name: formattedName}).catch(err => {
  console.error(err);
});

Parameters

Name Type Optional Description

request

Object

 

The request object that will be sent.

Values in request have the following properties:

Name Type Optional Description

name

string

 

The name of the DlpJob resource to be deleted.

options

Object

Yes

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.

callback

function(nullable Error)

Yes

The function which will be called with the result of the API call.

Returns

Promise 

  • The promise which resolves when API call finishes. The promise has a method named "cancel" which cancels the ongoing API call.

deleteInspectTemplate(request[, options][, callback]) → Promise

Deletes an InspectTemplate. See https://cloud.google.com/dlp/docs/creating-templates to learn more.

Example

const dlp = require('@google-cloud/dlp');

const client = new dlp.v2.DlpServiceClient({
  // optional auth parameters.
});

const formattedName = client.organizationInspectTemplatePath('[ORGANIZATION]', '[INSPECT_TEMPLATE]');
client.deleteInspectTemplate({name: formattedName}).catch(err => {
  console.error(err);
});

Parameters

Name Type Optional Description

request

Object

 

The request object that will be sent.

Values in request have the following properties:

Name Type Optional Description

name

string

 

Resource name of the organization and inspectTemplate to be deleted, for example organizations/433245324/inspectTemplates/432452342 or projects/project-id/inspectTemplates/432452342.

options

Object

Yes

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.

callback

function(nullable Error)

Yes

The function which will be called with the result of the API call.

Returns

Promise 

  • The promise which resolves when API call finishes. The promise has a method named "cancel" which cancels the ongoing API call.

deleteJobTrigger(request[, options][, callback]) → Promise

Deletes a job trigger. See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more.

Example

const dlp = require('@google-cloud/dlp');

const client = new dlp.v2.DlpServiceClient({
  // optional auth parameters.
});

const name = '';
client.deleteJobTrigger({name: name}).catch(err => {
  console.error(err);
});

Parameters

Name Type Optional Description

request

Object

 

The request object that will be sent.

Values in request have the following properties:

Name Type Optional Description

name

string

 

Resource name of the project and the triggeredJob, for example projects/dlp-test-project/jobTriggers/53234423.

options

Object

Yes

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.

callback

function(nullable Error)

Yes

The function which will be called with the result of the API call.

Returns

Promise 

  • The promise which resolves when API call finishes. The promise has a method named "cancel" which cancels the ongoing API call.

deleteStoredInfoType(request[, options][, callback]) → Promise

Deletes a stored infoType. See https://cloud.google.com/dlp/docs/creating-stored-infotypes to learn more.

Example

const dlp = require('@google-cloud/dlp');

const client = new dlp.v2.DlpServiceClient({
  // optional auth parameters.
});

const formattedName = client.organizationStoredInfoTypePath('[ORGANIZATION]', '[STORED_INFO_TYPE]');
client.deleteStoredInfoType({name: formattedName}).catch(err => {
  console.error(err);
});

Parameters

Name Type Optional Description

request

Object

 

The request object that will be sent.

Values in request have the following properties:

Name Type Optional Description

name

string

 

Resource name of the organization and storedInfoType to be deleted, for example organizations/433245324/storedInfoTypes/432452342 or projects/project-id/storedInfoTypes/432452342.

options

Object

Yes

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.

callback

function(nullable Error)

Yes

The function which will be called with the result of the API call.

Returns

Promise 

  • The promise which resolves when API call finishes. The promise has a method named "cancel" which cancels the ongoing API call.

dlpJobPath(project, dlpJob) → String

Return a fully-qualified dlp_job resource name string.

Parameters

Name Type Optional Description

project

String

 

dlpJob

String

 

Returns

String 

getDeidentifyTemplate(request[, options][, callback]) → Promise

Gets a DeidentifyTemplate. See https://cloud.google.com/dlp/docs/creating-templates-deid to learn more.

Example

const dlp = require('@google-cloud/dlp');

const client = new dlp.v2.DlpServiceClient({
  // optional auth parameters.
});

const formattedName = client.organizationDeidentifyTemplatePath('[ORGANIZATION]', '[DEIDENTIFY_TEMPLATE]');
client.getDeidentifyTemplate({name: formattedName})
  .then(responses => {
    const response = responses[0];
    // doThingsWith(response)
  })
  .catch(err => {
    console.error(err);
  });

Parameters

Name Type Optional Description

request

Object

 

The request object that will be sent.

Values in request have the following properties:

Name Type Optional Description

name

string

 

Resource name of the organization and deidentify template to be read, for example organizations/433245324/deidentifyTemplates/432452342 or projects/project-id/deidentifyTemplates/432452342.

options

Object

Yes

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.

callback

function(nullable Error, nullable Object)

Yes

The function which will be called with the result of the API call.

The second parameter to the callback is an object representing DeidentifyTemplate.

Returns

Promise 

  • The promise which resolves to an array. The first element of the array is an object representing DeidentifyTemplate. The promise has a method named "cancel" which cancels the ongoing API call.

getDlpJob(request[, options][, callback]) → Promise

Gets the latest state of a long-running DlpJob. See https://cloud.google.com/dlp/docs/inspecting-storage and https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more.

Example

const dlp = require('@google-cloud/dlp');

const client = new dlp.v2.DlpServiceClient({
  // optional auth parameters.
});

const formattedName = client.dlpJobPath('[PROJECT]', '[DLP_JOB]');
client.getDlpJob({name: formattedName})
  .then(responses => {
    const response = responses[0];
    // doThingsWith(response)
  })
  .catch(err => {
    console.error(err);
  });

Parameters

Name Type Optional Description

request

Object

 

The request object that will be sent.

Values in request have the following properties:

Name Type Optional Description

name

string

 

The name of the DlpJob resource.

options

Object

Yes

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.

callback

function(nullable Error, nullable Object)

Yes

The function which will be called with the result of the API call.

The second parameter to the callback is an object representing DlpJob.

Returns

Promise 

  • The promise which resolves to an array. The first element of the array is an object representing DlpJob. The promise has a method named "cancel" which cancels the ongoing API call.

getInspectTemplate(request[, options][, callback]) → Promise

Gets an InspectTemplate. See https://cloud.google.com/dlp/docs/creating-templates to learn more.

Example

const dlp = require('@google-cloud/dlp');

const client = new dlp.v2.DlpServiceClient({
  // optional auth parameters.
});


client.getInspectTemplate({})
  .then(responses => {
    const response = responses[0];
    // doThingsWith(response)
  })
  .catch(err => {
    console.error(err);
  });

Parameters

Name Type Optional Description

request

Object

 

The request object that will be sent.

Values in request have the following properties:

Name Type Optional Description

name

string

Yes

Resource name of the organization and inspectTemplate to be read, for example organizations/433245324/inspectTemplates/432452342 or projects/project-id/inspectTemplates/432452342.

options

Object

Yes

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.

callback

function(nullable Error, nullable Object)

Yes

The function which will be called with the result of the API call.

The second parameter to the callback is an object representing InspectTemplate.

Returns

Promise 

  • The promise which resolves to an array. The first element of the array is an object representing InspectTemplate. The promise has a method named "cancel" which cancels the ongoing API call.

getJobTrigger(request[, options][, callback]) → Promise

Gets a job trigger. See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more.

Example

const dlp = require('@google-cloud/dlp');

const client = new dlp.v2.DlpServiceClient({
  // optional auth parameters.
});

const formattedName = client.projectJobTriggerPath('[PROJECT]', '[JOB_TRIGGER]');
client.getJobTrigger({name: formattedName})
  .then(responses => {
    const response = responses[0];
    // doThingsWith(response)
  })
  .catch(err => {
    console.error(err);
  });

Parameters

Name Type Optional Description

request

Object

 

The request object that will be sent.

Values in request have the following properties:

Name Type Optional Description

name

string

 

Resource name of the project and the triggeredJob, for example projects/dlp-test-project/jobTriggers/53234423.

options

Object

Yes

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.

callback

function(nullable Error, nullable Object)

Yes

The function which will be called with the result of the API call.

The second parameter to the callback is an object representing JobTrigger.

Returns

Promise 

  • The promise which resolves to an array. The first element of the array is an object representing JobTrigger. The promise has a method named "cancel" which cancels the ongoing API call.

getProjectId(callback)

Return the project ID used by this class.

Parameter

Name Type Optional Description

callback

function(Error, string)

 

the callback to be called with the current project Id.

getStoredInfoType(request[, options][, callback]) → Promise

Gets a stored infoType. See https://cloud.google.com/dlp/docs/creating-stored-infotypes to learn more.

Example

const dlp = require('@google-cloud/dlp');

const client = new dlp.v2.DlpServiceClient({
  // optional auth parameters.
});

const formattedName = client.organizationStoredInfoTypePath('[ORGANIZATION]', '[STORED_INFO_TYPE]');
client.getStoredInfoType({name: formattedName})
  .then(responses => {
    const response = responses[0];
    // doThingsWith(response)
  })
  .catch(err => {
    console.error(err);
  });

Parameters

Name Type Optional Description

request

Object

 

The request object that will be sent.

Values in request have the following properties:

Name Type Optional Description

name

string

 

Resource name of the organization and storedInfoType to be read, for example organizations/433245324/storedInfoTypes/432452342 or projects/project-id/storedInfoTypes/432452342.

options

Object

Yes

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.

callback

function(nullable Error, nullable Object)

Yes

The function which will be called with the result of the API call.

The second parameter to the callback is an object representing StoredInfoType.

Returns

Promise 

  • The promise which resolves to an array. The first element of the array is an object representing StoredInfoType. The promise has a method named "cancel" which cancels the ongoing API call.

inspectContent(request[, options][, callback]) → Promise

Finds potentially sensitive info in content. This method has limits on input size, processing time, and output size.

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

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

Example

const dlp = require('@google-cloud/dlp');

const client = new dlp.v2.DlpServiceClient({
  // optional auth parameters.
});

const formattedParent = client.projectPath('[PROJECT]');
client.inspectContent({parent: formattedParent})
  .then(responses => {
    const response = responses[0];
    // doThingsWith(response)
  })
  .catch(err => {
    console.error(err);
  });

Parameters

Name Type Optional Description

request

Object

 

The request object that will be sent.

Values in request have the following properties:

Name Type Optional Description

parent

string

 

The parent resource name, for example projects/my-project-id.

inspectConfig

Object

Yes

Configuration for the inspector. What specified here will override the template referenced by the inspect_template_name argument.

This object should have the same structure as InspectConfig

item

Object

Yes

The item to inspect.

This object should have the same structure as ContentItem

inspectTemplateName

string

Yes

Optional 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.

options

Object

Yes

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.

callback

function(nullable Error, nullable Object)

Yes

The function which will be called with the result of the API call.

The second parameter to the callback is an object representing InspectContentResponse.

Returns

Promise 

  • The promise which resolves to an array. The first element of the array is an object representing InspectContentResponse. The promise has a method named "cancel" which cancels the ongoing API call.

listDeidentifyTemplates(request[, options][, callback]) → Promise

Lists DeidentifyTemplates. See https://cloud.google.com/dlp/docs/creating-templates-deid to learn more.

Example

const dlp = require('@google-cloud/dlp');

const client = new dlp.v2.DlpServiceClient({
  // optional auth parameters.
});

// Iterate over all elements.
const formattedParent = client.organizationPath('[ORGANIZATION]');

client.listDeidentifyTemplates({parent: formattedParent})
  .then(responses => {
    const resources = responses[0];
    for (const resource of resources) {
      // doThingsWith(resource)
    }
  })
  .catch(err => {
    console.error(err);
  });

// Or obtain the paged response.
const formattedParent = client.organizationPath('[ORGANIZATION]');


const options = {autoPaginate: false};
const callback = responses => {
  // The actual resources in a response.
  const resources = responses[0];
  // The next request if the response shows that there are more responses.
  const nextRequest = responses[1];
  // The actual response object, if necessary.
  // const rawResponse = responses[2];
  for (const resource of resources) {
    // doThingsWith(resource);
  }
  if (nextRequest) {
    // Fetch the next page.
    return client.listDeidentifyTemplates(nextRequest, options).then(callback);
  }
}
client.listDeidentifyTemplates({parent: formattedParent}, options)
  .then(callback)
  .catch(err => {
    console.error(err);
  });

Parameters

Name Type Optional Description

request

Object

 

The request object that will be sent.

Values in request have the following properties:

Name Type Optional Description

parent

string

 

The parent resource name, for example projects/my-project-id or organizations/my-org-id.

pageSize

number

Yes

The maximum number of resources contained in the underlying API response. If page streaming is performed per-resource, this parameter does not affect the return value. If page streaming is performed per-page, this determines the maximum number of resources in a page.

orderBy

string

Yes

Optional comma separated list of fields to order by, followed by asc or desc postfix. This list is case-insensitive, default sorting order is ascending, redundant space characters are insignificant.

Example: name asc,update_time, create_time desc

Supported fields are:

  • create_time: corresponds to time the template was created.
  • update_time: corresponds to time the template was last updated.
  • name: corresponds to template's name.
  • display_name: corresponds to template's display name.

options

Object

Yes

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.

callback

function(nullable Error, nullable Array, nullable Object, nullable Object)

Yes

The function which will be called with the result of the API call.

The second parameter to the callback is Array of DeidentifyTemplate.

When autoPaginate: false is specified through options, it contains the result in a single response. If the response indicates the next page exists, the third parameter is set to be used for the next request object. The fourth parameter keeps the raw response object of an object representing ListDeidentifyTemplatesResponse.

Returns

Promise 

  • The promise which resolves to an array. The first element of the array is Array of DeidentifyTemplate.

    When autoPaginate: false is specified through options, the array has three elements. The first element is Array of DeidentifyTemplate in a single response. The second element is the next request object if the response indicates the next page exists, or null. The third element is an object representing ListDeidentifyTemplatesResponse.

    The promise has a method named "cancel" which cancels the ongoing API call.

listDeidentifyTemplatesStream(request[, options]) → Stream

Equivalent to listDeidentifyTemplates, but returns a NodeJS Stream object.

This fetches the paged responses for listDeidentifyTemplates continuously and invokes the callback registered for 'data' event for each element in the responses.

The returned object has 'end' method when no more elements are required.

autoPaginate option will be ignored.

Example

const dlp = require('@google-cloud/dlp');

const client = new dlp.v2.DlpServiceClient({
  // optional auth parameters.
});

const formattedParent = client.organizationPath('[ORGANIZATION]');
client.listDeidentifyTemplatesStream({parent: formattedParent})
  .on('data', element => {
    // doThingsWith(element)
  }).on('error', err => {
    console.log(err);
  });

Parameters

Name Type Optional Description

request

Object

 

The request object that will be sent.

Values in request have the following properties:

Name Type Optional Description

parent

string

 

The parent resource name, for example projects/my-project-id or organizations/my-org-id.

pageSize

number

Yes

The maximum number of resources contained in the underlying API response. If page streaming is performed per-resource, this parameter does not affect the return value. If page streaming is performed per-page, this determines the maximum number of resources in a page.

orderBy

string

Yes

Optional comma separated list of fields to order by, followed by asc or desc postfix. This list is case-insensitive, default sorting order is ascending, redundant space characters are insignificant.

Example: name asc,update_time, create_time desc

Supported fields are:

  • create_time: corresponds to time the template was created.
  • update_time: corresponds to time the template was last updated.
  • name: corresponds to template's name.
  • display_name: corresponds to template's display name.

options

Object

Yes

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.

See also
https://nodejs.org/api/stream.html
Returns

Stream 

An object stream which emits an object representing DeidentifyTemplate on 'data' event.

listDlpJobs(request[, options][, callback]) → Promise

Lists DlpJobs that match the specified filter in the request. See https://cloud.google.com/dlp/docs/inspecting-storage and https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more.

Example

const dlp = require('@google-cloud/dlp');

const client = new dlp.v2.DlpServiceClient({
  // optional auth parameters.
});

// Iterate over all elements.
const formattedParent = client.projectPath('[PROJECT]');

client.listDlpJobs({parent: formattedParent})
  .then(responses => {
    const resources = responses[0];
    for (const resource of resources) {
      // doThingsWith(resource)
    }
  })
  .catch(err => {
    console.error(err);
  });

// Or obtain the paged response.
const formattedParent = client.projectPath('[PROJECT]');


const options = {autoPaginate: false};
const callback = responses => {
  // The actual resources in a response.
  const resources = responses[0];
  // The next request if the response shows that there are more responses.
  const nextRequest = responses[1];
  // The actual response object, if necessary.
  // const rawResponse = responses[2];
  for (const resource of resources) {
    // doThingsWith(resource);
  }
  if (nextRequest) {
    // Fetch the next page.
    return client.listDlpJobs(nextRequest, options).then(callback);
  }
}
client.listDlpJobs({parent: formattedParent}, options)
  .then(callback)
  .catch(err => {
    console.error(err);
  });

Parameters

Name Type Optional Description

request

Object

 

The request object that will be sent.

Values in request have the following properties:

Name Type Optional Description

parent

string

 

The parent resource name, for example projects/my-project-id.

filter

string

Yes

Optional. Allows filtering.

Supported syntax:

  • Filter expressions are made up of one or more restrictions.
  • Restrictions can be combined by AND or OR logical operators. A sequence of restrictions implicitly uses AND.
  • A restriction has the form of <field> <operator> <value>.
  • Supported fields/values for inspect jobs:
    • state - PENDING|RUNNING|CANCELED|FINISHED|FAILED
    • inspected_storage - DATASTORE|CLOUD_STORAGE|BIGQUERY
    • trigger_name - The resource name of the trigger that created job.
    • 'end_time` - Corresponds to time the job finished.
    • 'start_time` - Corresponds to time the job finished.
  • Supported fields for risk analysis jobs:
    • state - RUNNING|CANCELED|FINISHED|FAILED
    • 'end_time` - Corresponds to time the job finished.
    • 'start_time` - Corresponds to time the job finished.
  • The operator must be = or !=.

Examples:

  • inspected_storage = cloud_storage AND state = done
  • inspected_storage = cloud_storage OR inspected_storage = bigquery
  • inspected_storage = cloud_storage AND (state = done OR state = canceled)
  • end_time > "2017-12-12T00:00:00+00:00"

The length of this field should be no more than 500 characters.

pageSize

number

Yes

The maximum number of resources contained in the underlying API response. If page streaming is performed per-resource, this parameter does not affect the return value. If page streaming is performed per-page, this determines the maximum number of resources in a page.

type

number

Yes

The type of job. Defaults to DlpJobType.INSPECT

The number should be among the values of DlpJobType

orderBy

string

Yes

Optional comma separated list of fields to order by, followed by asc or desc postfix. This list is case-insensitive, default sorting order is ascending, redundant space characters are insignificant.

Example: name asc, end_time asc, create_time desc

Supported fields are:

  • create_time: corresponds to time the job was created.
  • end_time: corresponds to time the job ended.
  • name: corresponds to job's name.
  • state: corresponds to state

options

Object

Yes

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.

callback

function(nullable Error, nullable Array, nullable Object, nullable Object)

Yes

The function which will be called with the result of the API call.

The second parameter to the callback is Array of DlpJob.

When autoPaginate: false is specified through options, it contains the result in a single response. If the response indicates the next page exists, the third parameter is set to be used for the next request object. The fourth parameter keeps the raw response object of an object representing ListDlpJobsResponse.

Returns

Promise 

  • The promise which resolves to an array. The first element of the array is Array of DlpJob.

    When autoPaginate: false is specified through options, the array has three elements. The first element is Array of DlpJob in a single response. The second element is the next request object if the response indicates the next page exists, or null. The third element is an object representing ListDlpJobsResponse.

    The promise has a method named "cancel" which cancels the ongoing API call.

listDlpJobsStream(request[, options]) → Stream

Equivalent to listDlpJobs, but returns a NodeJS Stream object.

This fetches the paged responses for listDlpJobs continuously and invokes the callback registered for 'data' event for each element in the responses.

The returned object has 'end' method when no more elements are required.

autoPaginate option will be ignored.

Example

const dlp = require('@google-cloud/dlp');

const client = new dlp.v2.DlpServiceClient({
  // optional auth parameters.
});

const formattedParent = client.projectPath('[PROJECT]');
client.listDlpJobsStream({parent: formattedParent})
  .on('data', element => {
    // doThingsWith(element)
  }).on('error', err => {
    console.log(err);
  });

Parameters

Name Type Optional Description

request

Object

 

The request object that will be sent.

Values in request have the following properties:

Name Type Optional Description

parent

string

 

The parent resource name, for example projects/my-project-id.

filter

string

Yes

Optional. Allows filtering.

Supported syntax:

  • Filter expressions are made up of one or more restrictions.
  • Restrictions can be combined by AND or OR logical operators. A sequence of restrictions implicitly uses AND.
  • A restriction has the form of <field> <operator> <value>.
  • Supported fields/values for inspect jobs:
    • state - PENDING|RUNNING|CANCELED|FINISHED|FAILED
    • inspected_storage - DATASTORE|CLOUD_STORAGE|BIGQUERY
    • trigger_name - The resource name of the trigger that created job.
    • 'end_time` - Corresponds to time the job finished.
    • 'start_time` - Corresponds to time the job finished.
  • Supported fields for risk analysis jobs:
    • state - RUNNING|CANCELED|FINISHED|FAILED
    • 'end_time` - Corresponds to time the job finished.
    • 'start_time` - Corresponds to time the job finished.
  • The operator must be = or !=.

Examples:

  • inspected_storage = cloud_storage AND state = done
  • inspected_storage = cloud_storage OR inspected_storage = bigquery
  • inspected_storage = cloud_storage AND (state = done OR state = canceled)
  • end_time > "2017-12-12T00:00:00+00:00"

The length of this field should be no more than 500 characters.

pageSize

number

Yes

The maximum number of resources contained in the underlying API response. If page streaming is performed per-resource, this parameter does not affect the return value. If page streaming is performed per-page, this determines the maximum number of resources in a page.

type

number

Yes

The type of job. Defaults to DlpJobType.INSPECT

The number should be among the values of DlpJobType

orderBy

string

Yes

Optional comma separated list of fields to order by, followed by asc or desc postfix. This list is case-insensitive, default sorting order is ascending, redundant space characters are insignificant.

Example: name asc, end_time asc, create_time desc

Supported fields are:

  • create_time: corresponds to time the job was created.
  • end_time: corresponds to time the job ended.
  • name: corresponds to job's name.
  • state: corresponds to state

options

Object

Yes

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.

See also
https://nodejs.org/api/stream.html
Returns

Stream 

An object stream which emits an object representing DlpJob on 'data' event.

listInfoTypes(request[, options][, callback]) → Promise

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

Example

const dlp = require('@google-cloud/dlp');

const client = new dlp.v2.DlpServiceClient({
  // optional auth parameters.
});


client.listInfoTypes({})
  .then(responses => {
    const response = responses[0];
    // doThingsWith(response)
  })
  .catch(err => {
    console.error(err);
  });

Parameters

Name Type Optional Description

request

Object

 

The request object that will be sent.

Values in request have the following properties:

Name Type Optional Description

languageCode

string

Yes

Optional BCP-47 language code for localized infoType friendly names. If omitted, or if localized strings are not available, en-US strings will be returned.

filter

string

Yes

Optional filter to only return infoTypes supported by certain parts of the API. Defaults to supported_by=INSPECT.

options

Object

Yes

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.

callback

function(nullable Error, nullable Object)

Yes

The function which will be called with the result of the API call.

The second parameter to the callback is an object representing ListInfoTypesResponse.

Returns

Promise 

  • The promise which resolves to an array. The first element of the array is an object representing ListInfoTypesResponse. The promise has a method named "cancel" which cancels the ongoing API call.

listInspectTemplates(request[, options][, callback]) → Promise

Lists InspectTemplates. See https://cloud.google.com/dlp/docs/creating-templates to learn more.

Example

const dlp = require('@google-cloud/dlp');

const client = new dlp.v2.DlpServiceClient({
  // optional auth parameters.
});

// Iterate over all elements.
const formattedParent = client.organizationPath('[ORGANIZATION]');

client.listInspectTemplates({parent: formattedParent})
  .then(responses => {
    const resources = responses[0];
    for (const resource of resources) {
      // doThingsWith(resource)
    }
  })
  .catch(err => {
    console.error(err);
  });

// Or obtain the paged response.
const formattedParent = client.organizationPath('[ORGANIZATION]');


const options = {autoPaginate: false};
const callback = responses => {
  // The actual resources in a response.
  const resources = responses[0];
  // The next request if the response shows that there are more responses.
  const nextRequest = responses[1];
  // The actual response object, if necessary.
  // const rawResponse = responses[2];
  for (const resource of resources) {
    // doThingsWith(resource);
  }
  if (nextRequest) {
    // Fetch the next page.
    return client.listInspectTemplates(nextRequest, options).then(callback);
  }
}
client.listInspectTemplates({parent: formattedParent}, options)
  .then(callback)
  .catch(err => {
    console.error(err);
  });

Parameters

Name Type Optional Description

request

Object

 

The request object that will be sent.

Values in request have the following properties:

Name Type Optional Description

parent

string

 

The parent resource name, for example projects/my-project-id or organizations/my-org-id.

pageSize

number

Yes

The maximum number of resources contained in the underlying API response. If page streaming is performed per-resource, this parameter does not affect the return value. If page streaming is performed per-page, this determines the maximum number of resources in a page.

orderBy

string

Yes

Optional comma separated list of fields to order by, followed by asc or desc postfix. This list is case-insensitive, default sorting order is ascending, redundant space characters are insignificant.

Example: name asc,update_time, create_time desc

Supported fields are:

  • create_time: corresponds to time the template was created.
  • update_time: corresponds to time the template was last updated.
  • name: corresponds to template's name.
  • display_name: corresponds to template's display name.

options

Object

Yes

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.

callback

function(nullable Error, nullable Array, nullable Object, nullable Object)

Yes

The function which will be called with the result of the API call.

The second parameter to the callback is Array of InspectTemplate.

When autoPaginate: false is specified through options, it contains the result in a single response. If the response indicates the next page exists, the third parameter is set to be used for the next request object. The fourth parameter keeps the raw response object of an object representing ListInspectTemplatesResponse.

Returns

Promise 

  • The promise which resolves to an array. The first element of the array is Array of InspectTemplate.

    When autoPaginate: false is specified through options, the array has three elements. The first element is Array of InspectTemplate in a single response. The second element is the next request object if the response indicates the next page exists, or null. The third element is an object representing ListInspectTemplatesResponse.

    The promise has a method named "cancel" which cancels the ongoing API call.

listInspectTemplatesStream(request[, options]) → Stream

Equivalent to listInspectTemplates, but returns a NodeJS Stream object.

This fetches the paged responses for listInspectTemplates continuously and invokes the callback registered for 'data' event for each element in the responses.

The returned object has 'end' method when no more elements are required.

autoPaginate option will be ignored.

Example

const dlp = require('@google-cloud/dlp');

const client = new dlp.v2.DlpServiceClient({
  // optional auth parameters.
});

const formattedParent = client.organizationPath('[ORGANIZATION]');
client.listInspectTemplatesStream({parent: formattedParent})
  .on('data', element => {
    // doThingsWith(element)
  }).on('error', err => {
    console.log(err);
  });

Parameters

Name Type Optional Description

request

Object

 

The request object that will be sent.

Values in request have the following properties:

Name Type Optional Description

parent

string

 

The parent resource name, for example projects/my-project-id or organizations/my-org-id.

pageSize

number

Yes

The maximum number of resources contained in the underlying API response. If page streaming is performed per-resource, this parameter does not affect the return value. If page streaming is performed per-page, this determines the maximum number of resources in a page.

orderBy

string

Yes

Optional comma separated list of fields to order by, followed by asc or desc postfix. This list is case-insensitive, default sorting order is ascending, redundant space characters are insignificant.

Example: name asc,update_time, create_time desc

Supported fields are:

  • create_time: corresponds to time the template was created.
  • update_time: corresponds to time the template was last updated.
  • name: corresponds to template's name.
  • display_name: corresponds to template's display name.

options

Object

Yes

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.

See also
https://nodejs.org/api/stream.html
Returns

Stream 

An object stream which emits an object representing InspectTemplate on 'data' event.

listJobTriggers(request[, options][, callback]) → Promise

Lists job triggers. See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more.

Example

const dlp = require('@google-cloud/dlp');

const client = new dlp.v2.DlpServiceClient({
  // optional auth parameters.
});

// Iterate over all elements.
const formattedParent = client.projectPath('[PROJECT]');

client.listJobTriggers({parent: formattedParent})
  .then(responses => {
    const resources = responses[0];
    for (const resource of resources) {
      // doThingsWith(resource)
    }
  })
  .catch(err => {
    console.error(err);
  });

// Or obtain the paged response.
const formattedParent = client.projectPath('[PROJECT]');


const options = {autoPaginate: false};
const callback = responses => {
  // The actual resources in a response.
  const resources = responses[0];
  // The next request if the response shows that there are more responses.
  const nextRequest = responses[1];
  // The actual response object, if necessary.
  // const rawResponse = responses[2];
  for (const resource of resources) {
    // doThingsWith(resource);
  }
  if (nextRequest) {
    // Fetch the next page.
    return client.listJobTriggers(nextRequest, options).then(callback);
  }
}
client.listJobTriggers({parent: formattedParent}, options)
  .then(callback)
  .catch(err => {
    console.error(err);
  });

Parameters

Name Type Optional Description

request

Object

 

The request object that will be sent.

Values in request have the following properties:

Name Type Optional Description

parent

string

 

The parent resource name, for example projects/my-project-id.

pageSize

number

Yes

The maximum number of resources contained in the underlying API response. If page streaming is performed per-resource, this parameter does not affect the return value. If page streaming is performed per-page, this determines the maximum number of resources in a page.

orderBy

string

Yes

Optional comma separated list of triggeredJob fields to order by, followed by asc or desc postfix. This list is case-insensitive, default sorting order is ascending, redundant space characters are insignificant.

Example: name asc,update_time, create_time desc

Supported fields are:

  • create_time: corresponds to time the JobTrigger was created.
  • update_time: corresponds to time the JobTrigger was last updated.
  • last_run_time: corresponds to the last time the JobTrigger ran.
  • name: corresponds to JobTrigger's name.
  • display_name: corresponds to JobTrigger's display name.
  • status: corresponds to JobTrigger's status.

filter

string

Yes

Optional. Allows filtering.

Supported syntax:

  • Filter expressions are made up of one or more restrictions.
  • Restrictions can be combined by AND or OR logical operators. A sequence of restrictions implicitly uses AND.
  • A restriction has the form of <field> <operator> <value>.
  • Supported fields/values for inspect jobs:
    • status - HEALTHY|PAUSED|CANCELLED
    • inspected_storage - DATASTORE|CLOUD_STORAGE|BIGQUERY
    • 'last_run_time` - RFC 3339 formatted timestamp, surrounded by quotation marks. Nanoseconds are ignored.
    • 'error_count' - Number of errors that have occurred while running.
  • The operator must be = or != for status and inspected_storage.

Examples:

  • inspected_storage = cloud_storage AND status = HEALTHY
  • inspected_storage = cloud_storage OR inspected_storage = bigquery
  • inspected_storage = cloud_storage AND (state = PAUSED OR state = HEALTHY)
  • last_run_time > "2017-12-12T00:00:00+00:00"

The length of this field should be no more than 500 characters.

options

Object

Yes

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.

callback

function(nullable Error, nullable Array, nullable Object, nullable Object)

Yes

The function which will be called with the result of the API call.

The second parameter to the callback is Array of JobTrigger.

When autoPaginate: false is specified through options, it contains the result in a single response. If the response indicates the next page exists, the third parameter is set to be used for the next request object. The fourth parameter keeps the raw response object of an object representing ListJobTriggersResponse.

Returns

Promise 

  • The promise which resolves to an array. The first element of the array is Array of JobTrigger.

    When autoPaginate: false is specified through options, the array has three elements. The first element is Array of JobTrigger in a single response. The second element is the next request object if the response indicates the next page exists, or null. The third element is an object representing ListJobTriggersResponse.

    The promise has a method named "cancel" which cancels the ongoing API call.

listJobTriggersStream(request[, options]) → Stream

Equivalent to listJobTriggers, but returns a NodeJS Stream object.

This fetches the paged responses for listJobTriggers continuously and invokes the callback registered for 'data' event for each element in the responses.

The returned object has 'end' method when no more elements are required.

autoPaginate option will be ignored.

Example

const dlp = require('@google-cloud/dlp');

const client = new dlp.v2.DlpServiceClient({
  // optional auth parameters.
});

const formattedParent = client.projectPath('[PROJECT]');
client.listJobTriggersStream({parent: formattedParent})
  .on('data', element => {
    // doThingsWith(element)
  }).on('error', err => {
    console.log(err);
  });

Parameters

Name Type Optional Description

request

Object

 

The request object that will be sent.

Values in request have the following properties:

Name Type Optional Description

parent

string

 

The parent resource name, for example projects/my-project-id.

pageSize

number

Yes

The maximum number of resources contained in the underlying API response. If page streaming is performed per-resource, this parameter does not affect the return value. If page streaming is performed per-page, this determines the maximum number of resources in a page.

orderBy

string

Yes

Optional comma separated list of triggeredJob fields to order by, followed by asc or desc postfix. This list is case-insensitive, default sorting order is ascending, redundant space characters are insignificant.

Example: name asc,update_time, create_time desc

Supported fields are:

  • create_time: corresponds to time the JobTrigger was created.
  • update_time: corresponds to time the JobTrigger was last updated.
  • last_run_time: corresponds to the last time the JobTrigger ran.
  • name: corresponds to JobTrigger's name.
  • display_name: corresponds to JobTrigger's display name.
  • status: corresponds to JobTrigger's status.

filter

string

Yes

Optional. Allows filtering.

Supported syntax:

  • Filter expressions are made up of one or more restrictions.
  • Restrictions can be combined by AND or OR logical operators. A sequence of restrictions implicitly uses AND.
  • A restriction has the form of <field> <operator> <value>.
  • Supported fields/values for inspect jobs:
    • status - HEALTHY|PAUSED|CANCELLED
    • inspected_storage - DATASTORE|CLOUD_STORAGE|BIGQUERY
    • 'last_run_time` - RFC 3339 formatted timestamp, surrounded by quotation marks. Nanoseconds are ignored.
    • 'error_count' - Number of errors that have occurred while running.
  • The operator must be = or != for status and inspected_storage.

Examples:

  • inspected_storage = cloud_storage AND status = HEALTHY
  • inspected_storage = cloud_storage OR inspected_storage = bigquery
  • inspected_storage = cloud_storage AND (state = PAUSED OR state = HEALTHY)
  • last_run_time > "2017-12-12T00:00:00+00:00"

The length of this field should be no more than 500 characters.

options

Object

Yes

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.

See also
https://nodejs.org/api/stream.html
Returns

Stream 

An object stream which emits an object representing JobTrigger on 'data' event.

listStoredInfoTypes(request[, options][, callback]) → Promise

Lists stored infoTypes. See https://cloud.google.com/dlp/docs/creating-stored-infotypes to learn more.

Example

const dlp = require('@google-cloud/dlp');

const client = new dlp.v2.DlpServiceClient({
  // optional auth parameters.
});

// Iterate over all elements.
const formattedParent = client.organizationPath('[ORGANIZATION]');

client.listStoredInfoTypes({parent: formattedParent})
  .then(responses => {
    const resources = responses[0];
    for (const resource of resources) {
      // doThingsWith(resource)
    }
  })
  .catch(err => {
    console.error(err);
  });

// Or obtain the paged response.
const formattedParent = client.organizationPath('[ORGANIZATION]');


const options = {autoPaginate: false};
const callback = responses => {
  // The actual resources in a response.
  const resources = responses[0];
  // The next request if the response shows that there are more responses.
  const nextRequest = responses[1];
  // The actual response object, if necessary.
  // const rawResponse = responses[2];
  for (const resource of resources) {
    // doThingsWith(resource);
  }
  if (nextRequest) {
    // Fetch the next page.
    return client.listStoredInfoTypes(nextRequest, options).then(callback);
  }
}
client.listStoredInfoTypes({parent: formattedParent}, options)
  .then(callback)
  .catch(err => {
    console.error(err);
  });

Parameters

Name Type Optional Description

request

Object

 

The request object that will be sent.

Values in request have the following properties:

Name Type Optional Description

parent

string

 

The parent resource name, for example projects/my-project-id or organizations/my-org-id.

pageSize

number

Yes

The maximum number of resources contained in the underlying API response. If page streaming is performed per-resource, this parameter does not affect the return value. If page streaming is performed per-page, this determines the maximum number of resources in a page.

orderBy

string

Yes

Optional comma separated list of fields to order by, followed by asc or desc postfix. This list is case-insensitive, default sorting order is ascending, redundant space characters are insignificant.

Example: name asc, display_name, create_time desc

Supported fields are:

  • create_time: corresponds to time the most recent version of the resource was created.
  • state: corresponds to the state of the resource.
  • name: corresponds to resource name.
  • display_name: corresponds to info type's display name.

options

Object

Yes

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.

callback

function(nullable Error, nullable Array, nullable Object, nullable Object)

Yes

The function which will be called with the result of the API call.

The second parameter to the callback is Array of StoredInfoType.

When autoPaginate: false is specified through options, it contains the result in a single response. If the response indicates the next page exists, the third parameter is set to be used for the next request object. The fourth parameter keeps the raw response object of an object representing ListStoredInfoTypesResponse.

Returns

Promise 

  • The promise which resolves to an array. The first element of the array is Array of StoredInfoType.

    When autoPaginate: false is specified through options, the array has three elements. The first element is Array of StoredInfoType in a single response. The second element is the next request object if the response indicates the next page exists, or null. The third element is an object representing ListStoredInfoTypesResponse.

    The promise has a method named "cancel" which cancels the ongoing API call.

listStoredInfoTypesStream(request[, options]) → Stream

Equivalent to listStoredInfoTypes, but returns a NodeJS Stream object.

This fetches the paged responses for listStoredInfoTypes continuously and invokes the callback registered for 'data' event for each element in the responses.

The returned object has 'end' method when no more elements are required.

autoPaginate option will be ignored.

Example

const dlp = require('@google-cloud/dlp');

const client = new dlp.v2.DlpServiceClient({
  // optional auth parameters.
});

const formattedParent = client.organizationPath('[ORGANIZATION]');
client.listStoredInfoTypesStream({parent: formattedParent})
  .on('data', element => {
    // doThingsWith(element)
  }).on('error', err => {
    console.log(err);
  });

Parameters

Name Type Optional Description

request

Object

 

The request object that will be sent.

Values in request have the following properties:

Name Type Optional Description

parent

string

 

The parent resource name, for example projects/my-project-id or organizations/my-org-id.

pageSize

number

Yes

The maximum number of resources contained in the underlying API response. If page streaming is performed per-resource, this parameter does not affect the return value. If page streaming is performed per-page, this determines the maximum number of resources in a page.

orderBy

string

Yes

Optional comma separated list of fields to order by, followed by asc or desc postfix. This list is case-insensitive, default sorting order is ascending, redundant space characters are insignificant.

Example: name asc, display_name, create_time desc

Supported fields are:

  • create_time: corresponds to time the most recent version of the resource was created.
  • state: corresponds to the state of the resource.
  • name: corresponds to resource name.
  • display_name: corresponds to info type's display name.

options

Object

Yes

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.

See also
https://nodejs.org/api/stream.html
Returns

Stream 

An object stream which emits an object representing StoredInfoType on 'data' event.

matchDeidentifyTemplateFromOrganizationDeidentifyTemplateName(organizationDeidentifyTemplateName) → String

Parse the organizationDeidentifyTemplateName from a organization_deidentify_template resource.

Parameter

Name Type Optional Description

organizationDeidentifyTemplateName

String

 

A fully-qualified path representing a organization_deidentify_template resources.

Returns

String 

  • A string representing the deidentify_template.

matchDeidentifyTemplateFromProjectDeidentifyTemplateName(projectDeidentifyTemplateName) → String

Parse the projectDeidentifyTemplateName from a project_deidentify_template resource.

Parameter

Name Type Optional Description

projectDeidentifyTemplateName

String

 

A fully-qualified path representing a project_deidentify_template resources.

Returns

String 

  • A string representing the deidentify_template.

matchDlpJobFromDlpJobName(dlpJobName) → String

Parse the dlpJobName from a dlp_job resource.

Parameter

Name Type Optional Description

dlpJobName

String

 

A fully-qualified path representing a dlp_job resources.

Returns

String 

  • A string representing the dlp_job.

matchInspectTemplateFromOrganizationInspectTemplateName(organizationInspectTemplateName) → String

Parse the organizationInspectTemplateName from a organization_inspect_template resource.

Parameter

Name Type Optional Description

organizationInspectTemplateName

String

 

A fully-qualified path representing a organization_inspect_template resources.

Returns

String 

  • A string representing the inspect_template.

matchInspectTemplateFromProjectInspectTemplateName(projectInspectTemplateName) → String

Parse the projectInspectTemplateName from a project_inspect_template resource.

Parameter

Name Type Optional Description

projectInspectTemplateName

String

 

A fully-qualified path representing a project_inspect_template resources.

Returns

String 

  • A string representing the inspect_template.

matchJobTriggerFromProjectJobTriggerName(projectJobTriggerName) → String

Parse the projectJobTriggerName from a project_job_trigger resource.

Parameter

Name Type Optional Description

projectJobTriggerName

String

 

A fully-qualified path representing a project_job_trigger resources.

Returns

String 

  • A string representing the job_trigger.

matchOrganizationFromOrganizationDeidentifyTemplateName(organizationDeidentifyTemplateName) → String

Parse the organizationDeidentifyTemplateName from a organization_deidentify_template resource.

Parameter

Name Type Optional Description

organizationDeidentifyTemplateName

String

 

A fully-qualified path representing a organization_deidentify_template resources.

Returns

String 

  • A string representing the organization.

matchOrganizationFromOrganizationInspectTemplateName(organizationInspectTemplateName) → String

Parse the organizationInspectTemplateName from a organization_inspect_template resource.

Parameter

Name Type Optional Description

organizationInspectTemplateName

String

 

A fully-qualified path representing a organization_inspect_template resources.

Returns

String 

  • A string representing the organization.

matchOrganizationFromOrganizationName(organizationName) → String

Parse the organizationName from a organization resource.

Parameter

Name Type Optional Description

organizationName

String

 

A fully-qualified path representing a organization resources.

Returns

String 

  • A string representing the organization.

matchOrganizationFromOrganizationStoredInfoTypeName(organizationStoredInfoTypeName) → String

Parse the organizationStoredInfoTypeName from a organization_stored_info_type resource.

Parameter

Name Type Optional Description

organizationStoredInfoTypeName

String

 

A fully-qualified path representing a organization_stored_info_type resources.

Returns

String 

  • A string representing the organization.

matchProjectFromDlpJobName(dlpJobName) → String

Parse the dlpJobName from a dlp_job resource.

Parameter

Name Type Optional Description

dlpJobName

String

 

A fully-qualified path representing a dlp_job resources.

Returns

String 

  • A string representing the project.

matchProjectFromProjectDeidentifyTemplateName(projectDeidentifyTemplateName) → String

Parse the projectDeidentifyTemplateName from a project_deidentify_template resource.

Parameter

Name Type Optional Description

projectDeidentifyTemplateName

String

 

A fully-qualified path representing a project_deidentify_template resources.

Returns

String 

  • A string representing the project.

matchProjectFromProjectInspectTemplateName(projectInspectTemplateName) → String

Parse the projectInspectTemplateName from a project_inspect_template resource.

Parameter

Name Type Optional Description

projectInspectTemplateName

String

 

A fully-qualified path representing a project_inspect_template resources.

Returns

String 

  • A string representing the project.

matchProjectFromProjectJobTriggerName(projectJobTriggerName) → String

Parse the projectJobTriggerName from a project_job_trigger resource.

Parameter

Name Type Optional Description

projectJobTriggerName

String

 

A fully-qualified path representing a project_job_trigger resources.

Returns

String 

  • A string representing the project.

matchProjectFromProjectName(projectName) → String

Parse the projectName from a project resource.

Parameter

Name Type Optional Description

projectName

String

 

A fully-qualified path representing a project resources.

Returns

String 

  • A string representing the project.

matchProjectFromProjectStoredInfoTypeName(projectStoredInfoTypeName) → String

Parse the projectStoredInfoTypeName from a project_stored_info_type resource.

Parameter

Name Type Optional Description

projectStoredInfoTypeName

String

 

A fully-qualified path representing a project_stored_info_type resources.

Returns

String 

  • A string representing the project.

matchStoredInfoTypeFromOrganizationStoredInfoTypeName(organizationStoredInfoTypeName) → String

Parse the organizationStoredInfoTypeName from a organization_stored_info_type resource.

Parameter

Name Type Optional Description

organizationStoredInfoTypeName

String

 

A fully-qualified path representing a organization_stored_info_type resources.

Returns

String 

  • A string representing the stored_info_type.

matchStoredInfoTypeFromProjectStoredInfoTypeName(projectStoredInfoTypeName) → String

Parse the projectStoredInfoTypeName from a project_stored_info_type resource.

Parameter

Name Type Optional Description

projectStoredInfoTypeName

String

 

A fully-qualified path representing a project_stored_info_type resources.

Returns

String 

  • A string representing the stored_info_type.

organizationDeidentifyTemplatePath(organization, deidentifyTemplate) → String

Return a fully-qualified organization_deidentify_template resource name string.

Parameters

Name Type Optional Description

organization

String

 

deidentifyTemplate

String

 

Returns

String 

organizationInspectTemplatePath(organization, inspectTemplate) → String

Return a fully-qualified organization_inspect_template resource name string.

Parameters

Name Type Optional Description

organization

String

 

inspectTemplate

String

 

Returns

String 

organizationPath(organization) → String

Return a fully-qualified organization resource name string.

Parameter

Name Type Optional Description

organization

String

 

Returns

String 

organizationStoredInfoTypePath(organization, storedInfoType) → String

Return a fully-qualified organization_stored_info_type resource name string.

Parameters

Name Type Optional Description

organization

String

 

storedInfoType

String

 

Returns

String 

projectDeidentifyTemplatePath(project, deidentifyTemplate) → String

Return a fully-qualified project_deidentify_template resource name string.

Parameters

Name Type Optional Description

project

String

 

deidentifyTemplate

String

 

Returns

String 

projectInspectTemplatePath(project, inspectTemplate) → String

Return a fully-qualified project_inspect_template resource name string.

Parameters

Name Type Optional Description

project

String

 

inspectTemplate

String

 

Returns

String 

projectJobTriggerPath(project, jobTrigger) → String

Return a fully-qualified project_job_trigger resource name string.

Parameters

Name Type Optional Description

project

String

 

jobTrigger

String

 

Returns

String 

projectPath(project) → String

Return a fully-qualified project resource name string.

Parameter

Name Type Optional Description

project

String

 

Returns

String 

projectStoredInfoTypePath(project, storedInfoType) → String

Return a fully-qualified project_stored_info_type resource name string.

Parameters

Name Type Optional Description

project

String

 

storedInfoType

String

 

Returns

String 

redactImage(request[, options][, callback]) → Promise

Redacts potentially sensitive info from an image. This method has limits on input size, processing time, and output size. See https://cloud.google.com/dlp/docs/redacting-sensitive-data-images to learn more.

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

Example

const dlp = require('@google-cloud/dlp');

const client = new dlp.v2.DlpServiceClient({
  // optional auth parameters.
});

const formattedParent = client.projectPath('[PROJECT]');
client.redactImage({parent: formattedParent})
  .then(responses => {
    const response = responses[0];
    // doThingsWith(response)
  })
  .catch(err => {
    console.error(err);
  });

Parameters

Name Type Optional Description

request

Object

 

The request object that will be sent.

Values in request have the following properties:

Name Type Optional Description

parent

string

 

The parent resource name, for example projects/my-project-id.

inspectConfig

Object

Yes

Configuration for the inspector.

This object should have the same structure as InspectConfig

imageRedactionConfigs

Array of Object

Yes

The configuration for specifying what content to redact from images.

This object should have the same structure as ImageRedactionConfig

includeFindings

boolean

Yes

Whether the response should include findings along with the redacted image.

byteItem

Object

Yes

The content must be PNG, JPEG, SVG or BMP.

This object should have the same structure as ByteContentItem

options

Object

Yes

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.

callback

function(nullable Error, nullable Object)

Yes

The function which will be called with the result of the API call.

The second parameter to the callback is an object representing RedactImageResponse.

Returns

Promise 

  • The promise which resolves to an array. The first element of the array is an object representing RedactImageResponse. The promise has a method named "cancel" which cancels the ongoing API call.

reidentifyContent(request[, options][, callback]) → Promise

Re-identifies content that has been de-identified. See https://cloud.google.com/dlp/docs/pseudonymization#re-identification_in_free_text_code_example to learn more.

Example

const dlp = require('@google-cloud/dlp');

const client = new dlp.v2.DlpServiceClient({
  // optional auth parameters.
});

const formattedParent = client.projectPath('[PROJECT]');
client.reidentifyContent({parent: formattedParent})
  .then(responses => {
    const response = responses[0];
    // doThingsWith(response)
  })
  .catch(err => {
    console.error(err);
  });

Parameters

Name Type Optional Description

request

Object

 

The request object that will be sent.

Values in request have the following properties:

Name Type Optional Description

parent

string

 

The parent resource name.

reidentifyConfig

Object

Yes

Configuration for the re-identification of the content item. This field shares the same proto message type that is used for de-identification, however its usage here is for the reversal of the previous de-identification. Re-identification is performed by examining the transformations used to de-identify the items and executing the reverse. This requires that only reversible transformations be provided here. The reversible transformations are:

  • CryptoReplaceFfxFpeConfig

This object should have the same structure as DeidentifyConfig

inspectConfig

Object

Yes

Configuration for the inspector.

This object should have the same structure as InspectConfig

item

Object

Yes

The item to re-identify. Will be treated as text.

This object should have the same structure as ContentItem

inspectTemplateName

string

Yes

Optional 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.

reidentifyTemplateName

string

Yes

Optional template to use. References an instance of DeidentifyTemplate. Any configuration directly specified in reidentify_config or 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.

options

Object

Yes

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.

callback

function(nullable Error, nullable Object)

Yes

The function which will be called with the result of the API call.

The second parameter to the callback is an object representing ReidentifyContentResponse.

Returns

Promise 

  • The promise which resolves to an array. The first element of the array is an object representing ReidentifyContentResponse. The promise has a method named "cancel" which cancels the ongoing API call.

updateDeidentifyTemplate(request[, options][, callback]) → Promise

Updates the DeidentifyTemplate. See https://cloud.google.com/dlp/docs/creating-templates-deid to learn more.

Example

const dlp = require('@google-cloud/dlp');

const client = new dlp.v2.DlpServiceClient({
  // optional auth parameters.
});

const formattedName = client.organizationDeidentifyTemplatePath('[ORGANIZATION]', '[DEIDENTIFY_TEMPLATE]');
client.updateDeidentifyTemplate({name: formattedName})
  .then(responses => {
    const response = responses[0];
    // doThingsWith(response)
  })
  .catch(err => {
    console.error(err);
  });

Parameters

Name Type Optional Description

request

Object

 

The request object that will be sent.

Values in request have the following properties:

Name Type Optional Description

name

string

 

Resource name of organization and deidentify template to be updated, for example organizations/433245324/deidentifyTemplates/432452342 or projects/project-id/deidentifyTemplates/432452342.

deidentifyTemplate

Object

Yes

New DeidentifyTemplate value.

This object should have the same structure as DeidentifyTemplate

updateMask

Object

Yes

Mask to control which fields get updated.

This object should have the same structure as FieldMask

options

Object

Yes

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.

callback

function(nullable Error, nullable Object)

Yes

The function which will be called with the result of the API call.

The second parameter to the callback is an object representing DeidentifyTemplate.

Returns

Promise 

  • The promise which resolves to an array. The first element of the array is an object representing DeidentifyTemplate. The promise has a method named "cancel" which cancels the ongoing API call.

updateInspectTemplate(request[, options][, callback]) → Promise

Updates the InspectTemplate. See https://cloud.google.com/dlp/docs/creating-templates to learn more.

Example

const dlp = require('@google-cloud/dlp');

const client = new dlp.v2.DlpServiceClient({
  // optional auth parameters.
});

const formattedName = client.organizationInspectTemplatePath('[ORGANIZATION]', '[INSPECT_TEMPLATE]');
client.updateInspectTemplate({name: formattedName})
  .then(responses => {
    const response = responses[0];
    // doThingsWith(response)
  })
  .catch(err => {
    console.error(err);
  });

Parameters

Name Type Optional Description

request

Object

 

The request object that will be sent.

Values in request have the following properties:

Name Type Optional Description

name

string

 

Resource name of organization and inspectTemplate to be updated, for example organizations/433245324/inspectTemplates/432452342 or projects/project-id/inspectTemplates/432452342.

inspectTemplate

Object

Yes

New InspectTemplate value.

This object should have the same structure as InspectTemplate

updateMask

Object

Yes

Mask to control which fields get updated.

This object should have the same structure as FieldMask

options

Object

Yes

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.

callback

function(nullable Error, nullable Object)

Yes

The function which will be called with the result of the API call.

The second parameter to the callback is an object representing InspectTemplate.

Returns

Promise 

  • The promise which resolves to an array. The first element of the array is an object representing InspectTemplate. The promise has a method named "cancel" which cancels the ongoing API call.

updateJobTrigger(request[, options][, callback]) → Promise

Updates a job trigger. See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more.

Example

const dlp = require('@google-cloud/dlp');

const client = new dlp.v2.DlpServiceClient({
  // optional auth parameters.
});

const formattedName = client.projectJobTriggerPath('[PROJECT]', '[JOB_TRIGGER]');
client.updateJobTrigger({name: formattedName})
  .then(responses => {
    const response = responses[0];
    // doThingsWith(response)
  })
  .catch(err => {
    console.error(err);
  });

Parameters

Name Type Optional Description

request

Object

 

The request object that will be sent.

Values in request have the following properties:

Name Type Optional Description

name

string

 

Resource name of the project and the triggeredJob, for example projects/dlp-test-project/jobTriggers/53234423.

jobTrigger

Object

Yes

New JobTrigger value.

This object should have the same structure as JobTrigger

updateMask

Object

Yes

Mask to control which fields get updated.

This object should have the same structure as FieldMask

options

Object

Yes

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.

callback

function(nullable Error, nullable Object)

Yes

The function which will be called with the result of the API call.

The second parameter to the callback is an object representing JobTrigger.

Returns

Promise 

  • The promise which resolves to an array. The first element of the array is an object representing JobTrigger. The promise has a method named "cancel" which cancels the ongoing API call.

updateStoredInfoType(request[, options][, callback]) → Promise

Updates the stored infoType by creating a new version. The existing version will continue to be used until the new version is ready. See https://cloud.google.com/dlp/docs/creating-stored-infotypes to learn more.

Example

const dlp = require('@google-cloud/dlp');

const client = new dlp.v2.DlpServiceClient({
  // optional auth parameters.
});

const formattedName = client.organizationStoredInfoTypePath('[ORGANIZATION]', '[STORED_INFO_TYPE]');
client.updateStoredInfoType({name: formattedName})
  .then(responses => {
    const response = responses[0];
    // doThingsWith(response)
  })
  .catch(err => {
    console.error(err);
  });

Parameters

Name Type Optional Description

request

Object

 

The request object that will be sent.

Values in request have the following properties:

Name Type Optional Description

name

string

 

Resource name of organization and storedInfoType to be updated, for example organizations/433245324/storedInfoTypes/432452342 or projects/project-id/storedInfoTypes/432452342.

config

Object

Yes

Updated configuration for the storedInfoType. If not provided, a new version of the storedInfoType will be created with the existing configuration.

This object should have the same structure as StoredInfoTypeConfig

updateMask

Object

Yes

Mask to control which fields get updated.

This object should have the same structure as FieldMask

options

Object

Yes

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.

callback

function(nullable Error, nullable Object)

Yes

The function which will be called with the result of the API call.

The second parameter to the callback is an object representing StoredInfoType.

Returns

Promise 

  • The promise which resolves to an array. The first element of the array is an object representing StoredInfoType. The promise has a method named "cancel" which cancels the ongoing API call.