Constructor

DlpServiceClient

new DlpServiceClient(options)

Construct an instance of DlpServiceClient.

Parameter

options

Optional

object

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

Values in options have the following properties:

Parameter

credentials

Optional

object

Credentials object.

credentials.client_email

Optional

string

credentials.private_key

Optional

string

email

Optional

string

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

keyFilename

Optional

string

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

Optional

number

The port on which to connect to the remote host.

projectId

Optional

string

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

Optional

function()

Custom promise module to use instead of native Promises.

servicePath

Optional

string

The domain name of the API remote host.

Properties

port

static

The port for this API service.

scopes

static

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

servicePath

static

The DNS address for this API service.

Methods

cancelDlpJob

cancelDlpJob(request, options, callback) returns Promise

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

Parameter

request

Object

The request object that will be sent.

Values in request have the following properties:

Parameter

name

string

The name of the DlpJob resource to be cancelled.

options

Optional

Object

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

callback

Optional

function(nullable Error)

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.

Example

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

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

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

createDeidentifyTemplate

createDeidentifyTemplate(request, options, callback) returns Promise

Creates an Deidentify template for re-using frequently used configuration for Deidentifying content, images, and storage.

Parameter

request

Object

The request object that will be sent.

Values in request have the following properties:

Parameter

parent

string

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

deidentifyTemplate

Optional

Object

The DeidentifyTemplate to create.

This object should have the same structure as DeidentifyTemplate

templateId

Optional

string

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

Optional

Object

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

callback

Optional

function(nullable Error, nullable Object)

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.

Example

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

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

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

createDlpJob

createDlpJob(request, options, callback) returns Promise

Create a new job to inspect storage or calculate risk metrics How-to guide.

Parameter

request

Object

The request object that will be sent.

Values in request have the following properties:

Parameter

parent

string

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

inspectJob

Optional

Object

This object should have the same structure as InspectJobConfig

riskJob

Optional

Object

This object should have the same structure as RiskAnalysisJobConfig

jobId

Optional

string

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

Optional

Object

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

callback

Optional

function(nullable Error, nullable Object)

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.

Example

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

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

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

createInspectTemplate

createInspectTemplate(request, options, callback) returns Promise

Creates an inspect template for re-using frequently used configuration for inspecting content, images, and storage.

Parameter

request

Object

The request object that will be sent.

Values in request have the following properties:

Parameter

parent

string

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

inspectTemplate

Optional

Object

The InspectTemplate to create.

This object should have the same structure as InspectTemplate

templateId

Optional

string

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

Optional

Object

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

callback

Optional

function(nullable Error, nullable Object)

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.

Example

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

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

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

createJobTrigger

createJobTrigger(request, options, callback) returns Promise

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

Parameter

request

Object

The request object that will be sent.

Values in request have the following properties:

Parameter

parent

string

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

jobTrigger

Optional

Object

The JobTrigger to create.

This object should have the same structure as JobTrigger

triggerId

Optional

string

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

Optional

Object

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

callback

Optional

function(nullable Error, nullable Object)

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.

Example

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

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

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

deidentifyContent

deidentifyContent(request, options, callback) returns Promise

De-identifies potentially sensitive info from a ContentItem. This method has limits on input size and output size. How-to guide

Parameter

request

Object

The request object that will be sent.

Values in request have the following properties:

Parameter

parent

string

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

deidentifyConfig

Optional

Object

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

Optional

Object

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

Optional

Object

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

This object should have the same structure as ContentItem

inspectTemplateName

Optional

string

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

Optional

string

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

Optional

Object

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

callback

Optional

function(nullable Error, nullable Object)

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.

Example

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

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

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

deleteDeidentifyTemplate

deleteDeidentifyTemplate(request, options, callback) returns Promise

Deletes inspect templates.

Parameter

request

Object

The request object that will be sent.

Values in request have the following properties:

Parameter

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

Optional

Object

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

callback

Optional

function(nullable Error)

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.

Example

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

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

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

deleteDlpJob

deleteDlpJob(request, options, callback) returns 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.

Parameter

request

Object

The request object that will be sent.

Values in request have the following properties:

Parameter

name

string

The name of the DlpJob resource to be deleted.

options

Optional

Object

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

callback

Optional

function(nullable Error)

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.

Example

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

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

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

deleteInspectTemplate

deleteInspectTemplate(request, options, callback) returns Promise

Deletes inspect templates.

Parameter

request

Object

The request object that will be sent.

Values in request have the following properties:

Parameter

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

Optional

Object

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

callback

Optional

function(nullable Error)

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.

Example

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

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

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

deleteJobTrigger

deleteJobTrigger(request, options, callback) returns Promise

Deletes a job trigger.

Parameter

request

Object

The request object that will be sent.

Values in request have the following properties:

Parameter

name

string

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

options

Optional

Object

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

callback

Optional

function(nullable Error)

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.

Example

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

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

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

dlpJobPath

dlpJobPath(project, dlpJob) returns String

Return a fully-qualified dlp_job resource name string.

Parameter

project

String

dlpJob

String

Returns

String 

getDeidentifyTemplate

getDeidentifyTemplate(request, options, callback) returns Promise

Gets an inspect template.

Parameter

request

Object

The request object that will be sent.

Values in request have the following properties:

Parameter

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

Optional

Object

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

callback

Optional

function(nullable Error, nullable Object)

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.

Example

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

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

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

getDlpJob

getDlpJob(request, options, callback) returns Promise

Gets the latest state of a long-running DlpJob.

Parameter

request

Object

The request object that will be sent.

Values in request have the following properties:

Parameter

name

string

The name of the DlpJob resource.

options

Optional

Object

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

callback

Optional

function(nullable Error, nullable Object)

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.

Example

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

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

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

getInspectTemplate

getInspectTemplate(request, options, callback) returns Promise

Gets an inspect template.

Parameter

request

Object

The request object that will be sent.

Values in request have the following properties:

Parameter

name

Optional

string

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

options

Optional

Object

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

callback

Optional

function(nullable Error, nullable Object)

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.

Example

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

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


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

getJobTrigger

getJobTrigger(request, options, callback) returns Promise

Gets a job trigger.

Parameter

request

Object

The request object that will be sent.

Values in request have the following properties:

Parameter

name

string

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

options

Optional

Object

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

callback

Optional

function(nullable Error, nullable Object)

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.

Example

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

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

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

getProjectId

getProjectId(callback)

Return the project ID used by this class.

Parameter

callback

function(Error, string)

the callback to be called with the current project Id.

inspectContent

inspectContent(request, options, callback) returns Promise

Finds potentially sensitive info in content. This method has limits on input size, processing time, and output size. How-to guide for text, How-to guide for images

Parameter

request

Object

The request object that will be sent.

Values in request have the following properties:

Parameter

parent

string

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

inspectConfig

Optional

Object

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

Optional

Object

The item to inspect.

This object should have the same structure as ContentItem

inspectTemplateName

Optional

string

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

Optional

Object

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

callback

Optional

function(nullable Error, nullable Object)

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.

Example

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

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

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

listDeidentifyTemplates

listDeidentifyTemplates(request, options, callback) returns Promise

Lists inspect templates.

Parameter

request

Object

The request object that will be sent.

Values in request have the following properties:

Parameter

parent

string

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

pageSize

Optional

number

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.

options

Optional

Object

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

callback

Optional

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

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.

Example

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

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

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

client.listDeidentifyTemplates({parent: formattedParent})
  .then(responses => {
    var resources = responses[0];
    for (let i = 0; i < resources.length; i += 1) {
      // doThingsWith(resources[i])
    }
  })
  .catch(err => {
    console.error(err);
  });

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


var options = {autoPaginate: false};
var callback = responses => {
  // The actual resources in a response.
  var resources = responses[0];
  // The next request if the response shows that there are more responses.
  var nextRequest = responses[1];
  // The actual response object, if necessary.
  // var rawResponse = responses[2];
  for (let i = 0; i < resources.length; i += 1) {
    // doThingsWith(resources[i]);
  }
  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);
  });

listDeidentifyTemplatesStream

listDeidentifyTemplatesStream(request, options) returns 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.

Parameter

request

Object

The request object that will be sent.

Values in request have the following properties:

Parameter

parent

string

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

pageSize

Optional

number

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.

options

Optional

Object

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.

Example

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

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

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

listDlpJobs

listDlpJobs(request, options, callback) returns Promise

Lists DlpJobs that match the specified filter in the request.

Parameter

request

Object

The request object that will be sent.

Values in request have the following properties:

Parameter

parent

string

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

filter

Optional

string

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.
  • Supported fields for risk analysis jobs:
    • state - RUNNING|CANCELED|FINISHED|FAILED
  • 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)

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

pageSize

Optional

number

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

Optional

number

The type of job. Defaults to DlpJobType.INSPECT

The number should be among the values of DlpJobType

options

Optional

Object

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

callback

Optional

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

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.

Example

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

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

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

client.listDlpJobs({parent: formattedParent})
  .then(responses => {
    var resources = responses[0];
    for (let i = 0; i < resources.length; i += 1) {
      // doThingsWith(resources[i])
    }
  })
  .catch(err => {
    console.error(err);
  });

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


var options = {autoPaginate: false};
var callback = responses => {
  // The actual resources in a response.
  var resources = responses[0];
  // The next request if the response shows that there are more responses.
  var nextRequest = responses[1];
  // The actual response object, if necessary.
  // var rawResponse = responses[2];
  for (let i = 0; i < resources.length; i += 1) {
    // doThingsWith(resources[i]);
  }
  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);
  });

listDlpJobsStream

listDlpJobsStream(request, options) returns 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.

Parameter

request

Object

The request object that will be sent.

Values in request have the following properties:

Parameter

parent

string

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

filter

Optional

string

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.
  • Supported fields for risk analysis jobs:
    • state - RUNNING|CANCELED|FINISHED|FAILED
  • 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)

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

pageSize

Optional

number

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

Optional

number

The type of job. Defaults to DlpJobType.INSPECT

The number should be among the values of DlpJobType

options

Optional

Object

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.

Example

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

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

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

listInfoTypes

listInfoTypes(request, options, callback) returns Promise

Returns sensitive information types DLP supports.

Parameter

request

Object

The request object that will be sent.

Values in request have the following properties:

Parameter

languageCode

Optional

string

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

Optional

string

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

options

Optional

Object

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

callback

Optional

function(nullable Error, nullable Object)

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.

Example

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

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


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

listInspectTemplates

listInspectTemplates(request, options, callback) returns Promise

Lists inspect templates.

Parameter

request

Object

The request object that will be sent.

Values in request have the following properties:

Parameter

parent

string

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

pageSize

Optional

number

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.

options

Optional

Object

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

callback

Optional

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

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.

Example

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

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

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

client.listInspectTemplates({parent: formattedParent})
  .then(responses => {
    var resources = responses[0];
    for (let i = 0; i < resources.length; i += 1) {
      // doThingsWith(resources[i])
    }
  })
  .catch(err => {
    console.error(err);
  });

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


var options = {autoPaginate: false};
var callback = responses => {
  // The actual resources in a response.
  var resources = responses[0];
  // The next request if the response shows that there are more responses.
  var nextRequest = responses[1];
  // The actual response object, if necessary.
  // var rawResponse = responses[2];
  for (let i = 0; i < resources.length; i += 1) {
    // doThingsWith(resources[i]);
  }
  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);
  });

listInspectTemplatesStream

listInspectTemplatesStream(request, options) returns 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.

Parameter

request

Object

The request object that will be sent.

Values in request have the following properties:

Parameter

parent

string

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

pageSize

Optional

number

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.

options

Optional

Object

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.

Example

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

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

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

listJobTriggers

listJobTriggers(request, options, callback) returns Promise

Lists job triggers.

Parameter

request

Object

The request object that will be sent.

Values in request have the following properties:

Parameter

parent

string

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

pageSize

Optional

number

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

Optional

string

Optional comma separated list of triggeredJob fields to order by, followed by 'asc/desc' postfix, i.e. "create_time asc,name desc,schedule_mode asc". This list is case-insensitive.

Example: "name asc,schedule_mode desc, status desc"

Supported filters keys and values are:

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

options

Optional

Object

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

callback

Optional

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

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.

Example

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

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

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

client.listJobTriggers({parent: formattedParent})
  .then(responses => {
    var resources = responses[0];
    for (let i = 0; i < resources.length; i += 1) {
      // doThingsWith(resources[i])
    }
  })
  .catch(err => {
    console.error(err);
  });

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


var options = {autoPaginate: false};
var callback = responses => {
  // The actual resources in a response.
  var resources = responses[0];
  // The next request if the response shows that there are more responses.
  var nextRequest = responses[1];
  // The actual response object, if necessary.
  // var rawResponse = responses[2];
  for (let i = 0; i < resources.length; i += 1) {
    // doThingsWith(resources[i]);
  }
  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);
  });

listJobTriggersStream

listJobTriggersStream(request, options) returns 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.

Parameter

request

Object

The request object that will be sent.

Values in request have the following properties:

Parameter

parent

string

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

pageSize

Optional

number

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

Optional

string

Optional comma separated list of triggeredJob fields to order by, followed by 'asc/desc' postfix, i.e. "create_time asc,name desc,schedule_mode asc". This list is case-insensitive.

Example: "name asc,schedule_mode desc, status desc"

Supported filters keys and values are:

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

options

Optional

Object

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.

Example

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

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

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

matchDeidentifyTemplateFromOrganizationDeidentifyTemplateName

matchDeidentifyTemplateFromOrganizationDeidentifyTemplateName(organizationDeidentifyTemplateName) returns String

Parse the organizationDeidentifyTemplateName from a organization_deidentify_template resource.

Parameter

organizationDeidentifyTemplateName

String

A fully-qualified path representing a organization_deidentify_template resources.

Returns

String 

  • A string representing the deidentify_template.

matchDeidentifyTemplateFromProjectDeidentifyTemplateName

matchDeidentifyTemplateFromProjectDeidentifyTemplateName(projectDeidentifyTemplateName) returns String

Parse the projectDeidentifyTemplateName from a project_deidentify_template resource.

Parameter

projectDeidentifyTemplateName

String

A fully-qualified path representing a project_deidentify_template resources.

Returns

String 

  • A string representing the deidentify_template.

matchDlpJobFromDlpJobName

matchDlpJobFromDlpJobName(dlpJobName) returns String

Parse the dlpJobName from a dlp_job resource.

Parameter

dlpJobName

String

A fully-qualified path representing a dlp_job resources.

Returns

String 

  • A string representing the dlp_job.

matchInspectTemplateFromOrganizationInspectTemplateName

matchInspectTemplateFromOrganizationInspectTemplateName(organizationInspectTemplateName) returns String

Parse the organizationInspectTemplateName from a organization_inspect_template resource.

Parameter

organizationInspectTemplateName

String

A fully-qualified path representing a organization_inspect_template resources.

Returns

String 

  • A string representing the inspect_template.

matchInspectTemplateFromProjectInspectTemplateName

matchInspectTemplateFromProjectInspectTemplateName(projectInspectTemplateName) returns String

Parse the projectInspectTemplateName from a project_inspect_template resource.

Parameter

projectInspectTemplateName

String

A fully-qualified path representing a project_inspect_template resources.

Returns

String 

  • A string representing the inspect_template.

matchJobTriggerFromProjectJobTriggerName

matchJobTriggerFromProjectJobTriggerName(projectJobTriggerName) returns String

Parse the projectJobTriggerName from a project_job_trigger resource.

Parameter

projectJobTriggerName

String

A fully-qualified path representing a project_job_trigger resources.

Returns

String 

  • A string representing the job_trigger.

matchOrganizationFromOrganizationDeidentifyTemplateName

matchOrganizationFromOrganizationDeidentifyTemplateName(organizationDeidentifyTemplateName) returns String

Parse the organizationDeidentifyTemplateName from a organization_deidentify_template resource.

Parameter

organizationDeidentifyTemplateName

String

A fully-qualified path representing a organization_deidentify_template resources.

Returns

String 

  • A string representing the organization.

matchOrganizationFromOrganizationInspectTemplateName

matchOrganizationFromOrganizationInspectTemplateName(organizationInspectTemplateName) returns String

Parse the organizationInspectTemplateName from a organization_inspect_template resource.

Parameter

organizationInspectTemplateName

String

A fully-qualified path representing a organization_inspect_template resources.

Returns

String 

  • A string representing the organization.

matchOrganizationFromOrganizationName

matchOrganizationFromOrganizationName(organizationName) returns String

Parse the organizationName from a organization resource.

Parameter

organizationName

String

A fully-qualified path representing a organization resources.

Returns

String 

  • A string representing the organization.

matchProjectFromDlpJobName

matchProjectFromDlpJobName(dlpJobName) returns String

Parse the dlpJobName from a dlp_job resource.

Parameter

dlpJobName

String

A fully-qualified path representing a dlp_job resources.

Returns

String 

  • A string representing the project.

matchProjectFromProjectDeidentifyTemplateName

matchProjectFromProjectDeidentifyTemplateName(projectDeidentifyTemplateName) returns String

Parse the projectDeidentifyTemplateName from a project_deidentify_template resource.

Parameter

projectDeidentifyTemplateName

String

A fully-qualified path representing a project_deidentify_template resources.

Returns

String 

  • A string representing the project.

matchProjectFromProjectInspectTemplateName

matchProjectFromProjectInspectTemplateName(projectInspectTemplateName) returns String

Parse the projectInspectTemplateName from a project_inspect_template resource.

Parameter

projectInspectTemplateName

String

A fully-qualified path representing a project_inspect_template resources.

Returns

String 

  • A string representing the project.

matchProjectFromProjectJobTriggerName

matchProjectFromProjectJobTriggerName(projectJobTriggerName) returns String

Parse the projectJobTriggerName from a project_job_trigger resource.

Parameter

projectJobTriggerName

String

A fully-qualified path representing a project_job_trigger resources.

Returns

String 

  • A string representing the project.

matchProjectFromProjectName

matchProjectFromProjectName(projectName) returns String

Parse the projectName from a project resource.

Parameter

projectName

String

A fully-qualified path representing a project resources.

Returns

String 

  • A string representing the project.

organizationDeidentifyTemplatePath

organizationDeidentifyTemplatePath(organization, deidentifyTemplate) returns String

Return a fully-qualified organization_deidentify_template resource name string.

Parameter

organization

String

deidentifyTemplate

String

Returns

String 

organizationInspectTemplatePath

organizationInspectTemplatePath(organization, inspectTemplate) returns String

Return a fully-qualified organization_inspect_template resource name string.

Parameter

organization

String

inspectTemplate

String

Returns

String 

organizationPath

organizationPath(organization) returns String

Return a fully-qualified organization resource name string.

Parameter

organization

String

Returns

String 

projectDeidentifyTemplatePath

projectDeidentifyTemplatePath(project, deidentifyTemplate) returns String

Return a fully-qualified project_deidentify_template resource name string.

Parameter

project

String

deidentifyTemplate

String

Returns

String 

projectInspectTemplatePath

projectInspectTemplatePath(project, inspectTemplate) returns String

Return a fully-qualified project_inspect_template resource name string.

Parameter

project

String

inspectTemplate

String

Returns

String 

projectJobTriggerPath

projectJobTriggerPath(project, jobTrigger) returns String

Return a fully-qualified project_job_trigger resource name string.

Parameter

project

String

jobTrigger

String

Returns

String 

projectPath

projectPath(project) returns String

Return a fully-qualified project resource name string.

Parameter

project

String

Returns

String 

redactImage

redactImage(request, options, callback) returns Promise

Redacts potentially sensitive info from an image. This method has limits on input size, processing time, and output size. How-to guide

Parameter

request

Object

The request object that will be sent.

Values in request have the following properties:

Parameter

parent

string

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

inspectConfig

Optional

Object

Configuration for the inspector.

This object should have the same structure as InspectConfig

imageRedactionConfigs

Optional

Array of Object

The configuration for specifying what content to redact from images.

This object should have the same structure as ImageRedactionConfig

byteItem

Optional

Object

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

This object should have the same structure as ByteContentItem

options

Optional

Object

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

callback

Optional

function(nullable Error, nullable Object)

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.

Example

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

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

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

reidentifyContent

reidentifyContent(request, options, callback) returns Promise

Re-identify content that has been de-identified.

Parameter

request

Object

The request object that will be sent.

Values in request have the following properties:

Parameter

parent

string

The parent resource name.

reidentifyConfig

Optional

Object

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

Optional

Object

Configuration for the inspector.

This object should have the same structure as InspectConfig

item

Optional

Object

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

This object should have the same structure as ContentItem

inspectTemplateName

Optional

string

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

Optional

string

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

Optional

Object

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

callback

Optional

function(nullable Error, nullable Object)

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.

Example

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

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

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

updateDeidentifyTemplate

updateDeidentifyTemplate(request, options, callback) returns Promise

Updates the inspect template.

Parameter

request

Object

The request object that will be sent.

Values in request have the following properties:

Parameter

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

Optional

Object

New DeidentifyTemplate value.

This object should have the same structure as DeidentifyTemplate

updateMask

Optional

Object

Mask to control which fields get updated.

This object should have the same structure as FieldMask

options

Optional

Object

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

callback

Optional

function(nullable Error, nullable Object)

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.

Example

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

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

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

updateInspectTemplate

updateInspectTemplate(request, options, callback) returns Promise

Updates the inspect template.

Parameter

request

Object

The request object that will be sent.

Values in request have the following properties:

Parameter

name

string

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

inspectTemplate

Optional

Object

New InspectTemplate value.

This object should have the same structure as InspectTemplate

updateMask

Optional

Object

Mask to control which fields get updated.

This object should have the same structure as FieldMask

options

Optional

Object

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

callback

Optional

function(nullable Error, nullable Object)

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.

Example

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

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

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

updateJobTrigger

updateJobTrigger(request, options, callback) returns Promise

Updates a job trigger.

Parameter

request

Object

The request object that will be sent.

Values in request have the following properties:

Parameter

name

string

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

jobTrigger

Optional

Object

New JobTrigger value.

This object should have the same structure as JobTrigger

updateMask

Optional

Object

Mask to control which fields get updated.

This object should have the same structure as FieldMask

options

Optional

Object

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

callback

Optional

function(nullable Error, nullable Object)

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.

Example

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

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

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