From 33168b5bfe204f939b810c2d9cf0b14dc60fc53b Mon Sep 17 00:00:00 2001 From: Xiaozhen Liu Date: Tue, 28 Jan 2020 11:54:33 -0800 Subject: [PATCH] feat!: move to typescript code generation (#393) * move to ts * run synth tool * copyright * merge * lint * fix compile * lint * copy from ts micro test out --- packages/google-privacy-dlp/.gitignore | 1 + packages/google-privacy-dlp/.jsdoc.js | 2 +- packages/google-privacy-dlp/package.json | 35 +- .../google/cloud/common_resources.proto | 52 + packages/google-privacy-dlp/src/index.js | 88 - packages/google-privacy-dlp/src/index.ts | 24 + .../src/v2/dlp_service_client.js | 3429 ------------ .../src/v2/dlp_service_client.ts | 3940 +++++++++++++ .../src/v2/dlp_service_client_config.json | 39 +- .../src/v2/dlp_service_proto_list.json | 1 + .../v2/doc/google/privacy/dlp/v2/doc_dlp.js | 4937 ----------------- .../doc/google/privacy/dlp/v2/doc_storage.js | 1000 ---- .../src/v2/doc/google/protobuf/doc_any.js | 137 - .../v2/doc/google/protobuf/doc_duration.js | 97 - .../src/v2/doc/google/protobuf/doc_empty.js | 34 - .../v2/doc/google/protobuf/doc_field_mask.js | 228 - .../v2/doc/google/protobuf/doc_timestamp.js | 117 - .../src/v2/doc/google/rpc/doc_status.js | 47 - .../src/v2/doc/google/type/doc_date.js | 49 - .../src/v2/doc/google/type/doc_timeofday.js | 43 - .../src/{browser.js => v2/index.ts} | 12 +- packages/google-privacy-dlp/synth.metadata | 183 +- packages/google-privacy-dlp/synth.py | 18 +- .../system-test/.eslintrc.yml | 4 - ...moke_test.js => dlp_service_smoke_test.ts} | 16 +- .../system-test/fixtures/sample/src/index.js | 27 + .../fixtures/sample/src/index.ts} | 12 +- .../google-privacy-dlp/system-test/install.ts | 51 + .../{gapic-v2.js => gapic-dlp_service-v2.ts} | 1867 +++---- packages/google-privacy-dlp/test/mocha.opts | 3 - packages/google-privacy-dlp/tsconfig.json | 19 + packages/google-privacy-dlp/tslint.json | 3 + packages/google-privacy-dlp/webpack.config.js | 40 +- 33 files changed, 5005 insertions(+), 11550 deletions(-) create mode 100644 packages/google-privacy-dlp/protos/google/cloud/common_resources.proto delete mode 100644 packages/google-privacy-dlp/src/index.js create mode 100644 packages/google-privacy-dlp/src/index.ts delete mode 100644 packages/google-privacy-dlp/src/v2/dlp_service_client.js create mode 100644 packages/google-privacy-dlp/src/v2/dlp_service_client.ts delete mode 100644 packages/google-privacy-dlp/src/v2/doc/google/privacy/dlp/v2/doc_dlp.js delete mode 100644 packages/google-privacy-dlp/src/v2/doc/google/privacy/dlp/v2/doc_storage.js delete mode 100644 packages/google-privacy-dlp/src/v2/doc/google/protobuf/doc_any.js delete mode 100644 packages/google-privacy-dlp/src/v2/doc/google/protobuf/doc_duration.js delete mode 100644 packages/google-privacy-dlp/src/v2/doc/google/protobuf/doc_empty.js delete mode 100644 packages/google-privacy-dlp/src/v2/doc/google/protobuf/doc_field_mask.js delete mode 100644 packages/google-privacy-dlp/src/v2/doc/google/protobuf/doc_timestamp.js delete mode 100644 packages/google-privacy-dlp/src/v2/doc/google/rpc/doc_status.js delete mode 100644 packages/google-privacy-dlp/src/v2/doc/google/type/doc_date.js delete mode 100644 packages/google-privacy-dlp/src/v2/doc/google/type/doc_timeofday.js rename packages/google-privacy-dlp/src/{browser.js => v2/index.ts} (69%) delete mode 100644 packages/google-privacy-dlp/system-test/.eslintrc.yml rename packages/google-privacy-dlp/system-test/{dlp_service_smoke_test.js => dlp_service_smoke_test.ts} (86%) create mode 100644 packages/google-privacy-dlp/system-test/fixtures/sample/src/index.js rename packages/google-privacy-dlp/{src/v2/index.js => system-test/fixtures/sample/src/index.ts} (64%) create mode 100644 packages/google-privacy-dlp/system-test/install.ts rename packages/google-privacy-dlp/test/{gapic-v2.js => gapic-dlp_service-v2.ts} (50%) delete mode 100644 packages/google-privacy-dlp/test/mocha.opts create mode 100644 packages/google-privacy-dlp/tsconfig.json create mode 100644 packages/google-privacy-dlp/tslint.json diff --git a/packages/google-privacy-dlp/.gitignore b/packages/google-privacy-dlp/.gitignore index 7320a52910d..752bffc0d9f 100644 --- a/packages/google-privacy-dlp/.gitignore +++ b/packages/google-privacy-dlp/.gitignore @@ -9,3 +9,4 @@ system-test/*key.json *.lock package-lock.json __pycache__/ +build/ diff --git a/packages/google-privacy-dlp/.jsdoc.js b/packages/google-privacy-dlp/.jsdoc.js index 037ef753b91..bd924c7d7ec 100644 --- a/packages/google-privacy-dlp/.jsdoc.js +++ b/packages/google-privacy-dlp/.jsdoc.js @@ -31,7 +31,7 @@ module.exports = { source: { excludePattern: '(^|\\/|\\\\)[._]', include: [ - 'src' + 'build/src' ], includePattern: '\\.js$' }, diff --git a/packages/google-privacy-dlp/package.json b/packages/google-privacy-dlp/package.json index 0ebb3f6e8f5..0157b14979d 100644 --- a/packages/google-privacy-dlp/package.json +++ b/packages/google-privacy-dlp/package.json @@ -8,10 +8,10 @@ "node": ">=8.10.0" }, "repository": "googleapis/nodejs-dlp", - "main": "src/index.js", + "main": "build/src/index.js", "files": [ - "protos", - "src", + "build/protos", + "build/src", "AUTHORS", "COPYING" ], @@ -29,25 +29,32 @@ "DLP API" ], "scripts": { + "test": "c8 mocha build/test", + "samples-test": "cd samples/ && npm link ../ && npm install && npm test && cd ../", + "system-test": "mocha build/system-test", "docs": "jsdoc -c .jsdoc.js", - "lint": "eslint '**/*.js'", - "samples-test": "cd samples/ && npm link ../ && npm test && cd ../", - "system-test": "mocha system-test/*.js --timeout 600000", - "test": "c8 mocha", - "fix": "eslint --fix '**/*.js'", + "lint": "gts fix && eslint --fix samples/*.js", + "fix": "gts fix", "docs-test": "linkinator docs", - "predocs-test": "npm run docs" + "clean": "gts clean", + "compile": "tsc -p . && cp -r protos build/", + "compile-protos": "compileProtos src", + "predocs-test": "npm run docs", + "prepare": "npm run compile" }, "dependencies": { - "google-gax": "^1.7.5", + "google-gax": "^1.9.0", "protobufjs": "^6.8.0" }, "devDependencies": { + "@types/mocha": "^5.2.5", + "@types/node": "^12.0.0", "eslint": "^6.0.0", "eslint-config-prettier": "^6.0.0", "eslint-plugin-node": "^11.0.0", "eslint-plugin-prettier": "^3.0.0", "intelli-espower-loader": "^1.0.1", + "gts": "^1.0.0", "jsdoc": "^3.5.5", "jsdoc-fresh": "^1.0.1", "jsdoc-region-tag": "^1.0.2", @@ -55,6 +62,12 @@ "mocha": "^7.0.0", "c8": "^7.0.0", "power-assert": "^1.4.4", - "prettier": "^1.7.4" + "null-loader": "^3.0.0", + "pack-n-play": "^1.0.0-2", + "prettier": "^1.11.1", + "ts-loader": "^6.2.1", + "typescript": "^3.7.0", + "webpack": "^4.41.2", + "webpack-cli": "^3.3.10" } } diff --git a/packages/google-privacy-dlp/protos/google/cloud/common_resources.proto b/packages/google-privacy-dlp/protos/google/cloud/common_resources.proto new file mode 100644 index 00000000000..56c9f800d5e --- /dev/null +++ b/packages/google-privacy-dlp/protos/google/cloud/common_resources.proto @@ -0,0 +1,52 @@ +// Copyright 2019 Google LLC. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// This file contains stub messages for common resources in GCP. +// It is not intended to be directly generated, and is instead used by +// other tooling to be able to match common resource patterns. +syntax = "proto3"; + +package google.cloud; + +import "google/api/resource.proto"; + + +option (google.api.resource_definition) = { + type: "cloudresourcemanager.googleapis.com/Project" + pattern: "projects/{project}" +}; + + +option (google.api.resource_definition) = { + type: "cloudresourcemanager.googleapis.com/Organization" + pattern: "organizations/{organization}" +}; + + +option (google.api.resource_definition) = { + type: "cloudresourcemanager.googleapis.com/Folder" + pattern: "folders/{folder}" +}; + + +option (google.api.resource_definition) = { + type: "cloudbilling.googleapis.com/BillingAccount" + pattern: "billingAccounts/{billing_account}" +}; + +option (google.api.resource_definition) = { + type: "locations.googleapis.com/Location" + pattern: "projects/{project}/locations/{location}" +}; + diff --git a/packages/google-privacy-dlp/src/index.js b/packages/google-privacy-dlp/src/index.js deleted file mode 100644 index 0b3285a83fb..00000000000 --- a/packages/google-privacy-dlp/src/index.js +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright 2018 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/** - * @namespace google - */ -/** - * @namespace google.privacy - */ -/** - * @namespace google.privacy.dlp - */ -/** - * @namespace google.privacy.dlp.v2 - */ -/** - * @namespace google.protobuf - */ -/** - * @namespace google.rpc - */ -/** - * @namespace google.type - */ - -'use strict'; - -// Import the clients for each version supported by this package. -const gapic = Object.freeze({ - v2: require('./v2'), -}); - -/** - * The `@google-cloud/dlp` package has the following named exports: - * - * - `DlpServiceClient` - Reference to - * {@link v2.DlpServiceClient} - * - `v2` - This is used for selecting or pinning a - * particular backend service version. It exports: - * - `DlpServiceClient` - Reference to - * {@link v2.DlpServiceClient} - * - * @module {object} @google-cloud/dlp - * @alias nodejs-dlp - * - * @example Install the client library with npm: - * npm install --save @google-cloud/dlp - * - * @example Import the client library: - * const dlp = require('@google-cloud/dlp'); - * - * @example Create a client that uses Application Default Credentials (ADC): - * const client = new dlp.DlpServiceClient(); - * - * @example Create a client with explicit credentials: - * const client = new dlp.DlpServiceClient({ - * projectId: 'your-project-id', - * keyFilename: '/path/to/keyfile.json', - * }); - */ - -/** - * @type {object} - * @property {constructor} DlpServiceClient - * Reference to {@link v2.DlpServiceClient} - */ -module.exports = gapic.v2; - -/** - * @type {object} - * @property {constructor} DlpServiceClient - * Reference to {@link v2.DlpServiceClient} - */ -module.exports.v2 = gapic.v2; - -// Alias `module.exports` as `module.exports.default`, for future-proofing. -module.exports.default = Object.assign({}, module.exports); diff --git a/packages/google-privacy-dlp/src/index.ts b/packages/google-privacy-dlp/src/index.ts new file mode 100644 index 00000000000..e57b0e192c3 --- /dev/null +++ b/packages/google-privacy-dlp/src/index.ts @@ -0,0 +1,24 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as v2 from './v2'; +const DlpServiceClient = v2.DlpServiceClient; +export {v2, DlpServiceClient}; +// For compatibility with JavaScript libraries we need to provide this default export: +// tslint:disable-next-line no-default-export +export default {v2, DlpServiceClient}; diff --git a/packages/google-privacy-dlp/src/v2/dlp_service_client.js b/packages/google-privacy-dlp/src/v2/dlp_service_client.js deleted file mode 100644 index af3d3f5ff34..00000000000 --- a/packages/google-privacy-dlp/src/v2/dlp_service_client.js +++ /dev/null @@ -1,3429 +0,0 @@ -// Copyright 2020 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -'use strict'; - -const gapicConfig = require('./dlp_service_client_config.json'); -const gax = require('google-gax'); -const path = require('path'); - -const VERSION = require('../../package.json').version; - -/** - * The Cloud Data Loss Prevention (DLP) API is a service that allows clients - * to detect the presence of Personally Identifiable Information (PII) and other - * privacy-sensitive data in user-supplied, unstructured data streams, like text - * blocks or images. - * The service also includes methods for sensitive data redaction and - * scheduling of data scans on Google Cloud Platform based data sets. - * - * To learn more about concepts and find how-to guides see - * https://cloud.google.com/dlp/docs/. - * - * @class - * @memberof v2 - */ -class DlpServiceClient { - /** - * Construct an instance of DlpServiceClient. - * - * @param {object} [options] - The configuration object. See the subsequent - * parameters for more details. - * @param {object} [options.credentials] - Credentials object. - * @param {string} [options.credentials.client_email] - * @param {string} [options.credentials.private_key] - * @param {string} [options.email] - Account email address. Required when - * using a .pem or .p12 keyFilename. - * @param {string} [options.keyFilename] - 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. - * @param {number} [options.port] - The port on which to connect to - * the remote host. - * @param {string} [options.projectId] - 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 - * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, - * your project ID will be detected automatically. - * @param {function} [options.promise] - Custom promise module to use instead - * of native Promises. - * @param {string} [options.apiEndpoint] - The domain name of the - * API remote host. - */ - constructor(opts) { - opts = opts || {}; - this._descriptors = {}; - - if (global.isBrowser) { - // If we're in browser, we use gRPC fallback. - opts.fallback = true; - } - - // If we are in browser, we are already using fallback because of the - // "browser" field in package.json. - // But if we were explicitly requested to use fallback, let's do it now. - const gaxModule = !global.isBrowser && opts.fallback ? gax.fallback : gax; - - const servicePath = - opts.servicePath || opts.apiEndpoint || this.constructor.servicePath; - - // Ensure that options include the service address and port. - opts = Object.assign( - { - clientConfig: {}, - port: this.constructor.port, - servicePath, - }, - opts - ); - - // Create a `gaxGrpc` object, with any grpc-specific options - // sent to the client. - opts.scopes = this.constructor.scopes; - const gaxGrpc = new gaxModule.GrpcClient(opts); - - // Save the auth object to the client, for use by other methods. - this.auth = gaxGrpc.auth; - - // Determine the client header string. - const clientHeader = []; - - if (typeof process !== 'undefined' && 'versions' in process) { - clientHeader.push(`gl-node/${process.versions.node}`); - } - clientHeader.push(`gax/${gaxModule.version}`); - if (opts.fallback) { - clientHeader.push(`gl-web/${gaxModule.version}`); - } else { - clientHeader.push(`grpc/${gaxGrpc.grpcVersion}`); - } - clientHeader.push(`gapic/${VERSION}`); - if (opts.libName && opts.libVersion) { - clientHeader.push(`${opts.libName}/${opts.libVersion}`); - } - - // Load the applicable protos. - // For Node.js, pass the path to JSON proto file. - // For browsers, pass the JSON content. - - const nodejsProtoPath = path.join( - __dirname, - '..', - '..', - 'protos', - 'protos.json' - ); - const protos = gaxGrpc.loadProto( - opts.fallback ? require('../../protos/protos.json') : nodejsProtoPath - ); - - // This API contains "path templates"; forward-slash-separated - // identifiers to uniquely identify resources within the API. - // Create useful helper objects for these. - this._pathTemplates = { - dlpJobPathTemplate: new gaxModule.PathTemplate( - 'projects/{project}/dlpJobs/{dlp_job}' - ), - organizationPathTemplate: new gaxModule.PathTemplate( - 'organizations/{organization}' - ), - organizationDeidentifyTemplatePathTemplate: new gaxModule.PathTemplate( - 'organizations/{organization}/deidentifyTemplates/{deidentify_template}' - ), - organizationInspectTemplatePathTemplate: new gaxModule.PathTemplate( - 'organizations/{organization}/inspectTemplates/{inspect_template}' - ), - organizationStoredInfoTypePathTemplate: new gaxModule.PathTemplate( - 'organizations/{organization}/storedInfoTypes/{stored_info_type}' - ), - projectPathTemplate: new gaxModule.PathTemplate('projects/{project}'), - projectDeidentifyTemplatePathTemplate: new gaxModule.PathTemplate( - 'projects/{project}/deidentifyTemplates/{deidentify_template}' - ), - projectInspectTemplatePathTemplate: new gaxModule.PathTemplate( - 'projects/{project}/inspectTemplates/{inspect_template}' - ), - projectJobTriggerPathTemplate: new gaxModule.PathTemplate( - 'projects/{project}/jobTriggers/{job_trigger}' - ), - projectStoredInfoTypePathTemplate: new gaxModule.PathTemplate( - 'projects/{project}/storedInfoTypes/{stored_info_type}' - ), - }; - - // Some of the methods on this service return "paged" results, - // (e.g. 50 results at a time, with tokens to get subsequent - // pages). Denote the keys used for pagination and results. - this._descriptors.page = { - listInspectTemplates: new gaxModule.PageDescriptor( - 'pageToken', - 'nextPageToken', - 'inspectTemplates' - ), - listDeidentifyTemplates: new gaxModule.PageDescriptor( - 'pageToken', - 'nextPageToken', - 'deidentifyTemplates' - ), - listDlpJobs: new gaxModule.PageDescriptor( - 'pageToken', - 'nextPageToken', - 'jobs' - ), - listJobTriggers: new gaxModule.PageDescriptor( - 'pageToken', - 'nextPageToken', - 'jobTriggers' - ), - listStoredInfoTypes: new gaxModule.PageDescriptor( - 'pageToken', - 'nextPageToken', - 'storedInfoTypes' - ), - }; - - // Put together the default options sent with requests. - const defaults = gaxGrpc.constructSettings( - 'google.privacy.dlp.v2.DlpService', - gapicConfig, - opts.clientConfig, - {'x-goog-api-client': clientHeader.join(' ')} - ); - - // Set up a dictionary of "inner API calls"; the core implementation - // of calling the API is handled in `google-gax`, with this code - // merely providing the destination and request information. - this._innerApiCalls = {}; - - // Put together the "service stub" for - // google.privacy.dlp.v2.DlpService. - const dlpServiceStub = gaxGrpc.createStub( - opts.fallback - ? protos.lookupService('google.privacy.dlp.v2.DlpService') - : protos.google.privacy.dlp.v2.DlpService, - opts - ); - - // Iterate over each of the methods that the service provides - // and create an API call method for each. - const dlpServiceStubMethods = [ - 'inspectContent', - 'redactImage', - 'deidentifyContent', - 'reidentifyContent', - 'listInfoTypes', - 'createInspectTemplate', - 'updateInspectTemplate', - 'getInspectTemplate', - 'listInspectTemplates', - 'deleteInspectTemplate', - 'createDeidentifyTemplate', - 'updateDeidentifyTemplate', - 'getDeidentifyTemplate', - 'listDeidentifyTemplates', - 'deleteDeidentifyTemplate', - 'createDlpJob', - 'listDlpJobs', - 'getDlpJob', - 'deleteDlpJob', - 'cancelDlpJob', - 'listJobTriggers', - 'getJobTrigger', - 'deleteJobTrigger', - 'updateJobTrigger', - 'createJobTrigger', - 'createStoredInfoType', - 'updateStoredInfoType', - 'getStoredInfoType', - 'listStoredInfoTypes', - 'deleteStoredInfoType', - ]; - for (const methodName of dlpServiceStubMethods) { - const innerCallPromise = dlpServiceStub.then( - stub => (...args) => { - return stub[methodName].apply(stub, args); - }, - err => () => { - throw err; - } - ); - this._innerApiCalls[methodName] = gaxModule.createApiCall( - innerCallPromise, - defaults[methodName], - this._descriptors.page[methodName] - ); - } - } - - /** - * The DNS address for this API service. - */ - static get servicePath() { - return 'dlp.googleapis.com'; - } - - /** - * The DNS address for this API service - same as servicePath(), - * exists for compatibility reasons. - */ - static get apiEndpoint() { - return 'dlp.googleapis.com'; - } - - /** - * The port for this API service. - */ - static get port() { - return 443; - } - - /** - * The scopes needed to make gRPC calls for every method defined - * in this service. - */ - static get scopes() { - return ['https://www.googleapis.com/auth/cloud-platform']; - } - - /** - * Return the project ID used by this class. - * @param {function(Error, string)} callback - the callback to - * be called with the current project Id. - */ - getProjectId(callback) { - return this.auth.getProjectId(callback); - } - - // ------------------- - // -- Service calls -- - // ------------------- - - /** - * 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, - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * The parent resource name, for example projects/my-project-id. - * @param {Object} [request.inspectConfig] - * 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]{@link google.privacy.dlp.v2.InspectConfig} - * @param {Object} [request.item] - * The item to inspect. - * - * This object should have the same structure as [ContentItem]{@link google.privacy.dlp.v2.ContentItem} - * @param {string} [request.inspectTemplateName] - * 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. - * @param {string} [request.locationId] - * The geographic location to process content inspection. Reserved for future - * extensions. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [InspectContentResponse]{@link google.privacy.dlp.v2.InspectContentResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [InspectContentResponse]{@link google.privacy.dlp.v2.InspectContentResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @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); - * }); - */ - inspectContent(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent, - }); - - return this._innerApiCalls.inspectContent(request, options, callback); - } - - /** - * 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. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * The parent resource name, for example projects/my-project-id. - * @param {string} [request.locationId] - * The geographic location to process the request. Reserved for future - * extensions. - * @param {Object} [request.inspectConfig] - * Configuration for the inspector. - * - * This object should have the same structure as [InspectConfig]{@link google.privacy.dlp.v2.InspectConfig} - * @param {Object[]} [request.imageRedactionConfigs] - * The configuration for specifying what content to redact from images. - * - * This object should have the same structure as [ImageRedactionConfig]{@link google.privacy.dlp.v2.ImageRedactionConfig} - * @param {boolean} [request.includeFindings] - * Whether the response should include findings along with the redacted - * image. - * @param {Object} [request.byteItem] - * The content must be PNG, JPEG, SVG or BMP. - * - * This object should have the same structure as [ByteContentItem]{@link google.privacy.dlp.v2.ByteContentItem} - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [RedactImageResponse]{@link google.privacy.dlp.v2.RedactImageResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [RedactImageResponse]{@link google.privacy.dlp.v2.RedactImageResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @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); - * }); - */ - redactImage(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent, - }); - - return this._innerApiCalls.redactImage(request, options, callback); - } - - /** - * 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. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * The parent resource name, for example projects/my-project-id. - * @param {Object} [request.deidentifyConfig] - * 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]{@link google.privacy.dlp.v2.DeidentifyConfig} - * @param {Object} [request.inspectConfig] - * 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]{@link google.privacy.dlp.v2.InspectConfig} - * @param {Object} [request.item] - * The item to de-identify. Will be treated as text. - * - * This object should have the same structure as [ContentItem]{@link google.privacy.dlp.v2.ContentItem} - * @param {string} [request.inspectTemplateName] - * 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. - * @param {string} [request.deidentifyTemplateName] - * 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. - * @param {string} [request.locationId] - * The geographic location to process de-identification. Reserved for future - * extensions. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [DeidentifyContentResponse]{@link google.privacy.dlp.v2.DeidentifyContentResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [DeidentifyContentResponse]{@link google.privacy.dlp.v2.DeidentifyContentResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @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); - * }); - */ - deidentifyContent(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent, - }); - - return this._innerApiCalls.deidentifyContent(request, options, callback); - } - - /** - * 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. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent resource name. - * @param {Object} [request.reidentifyConfig] - * 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: - * - * - `CryptoDeterministicConfig` - * - `CryptoReplaceFfxFpeConfig` - * - * This object should have the same structure as [DeidentifyConfig]{@link google.privacy.dlp.v2.DeidentifyConfig} - * @param {Object} [request.inspectConfig] - * Configuration for the inspector. - * - * This object should have the same structure as [InspectConfig]{@link google.privacy.dlp.v2.InspectConfig} - * @param {Object} [request.item] - * The item to re-identify. Will be treated as text. - * - * This object should have the same structure as [ContentItem]{@link google.privacy.dlp.v2.ContentItem} - * @param {string} [request.inspectTemplateName] - * 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. - * @param {string} [request.reidentifyTemplateName] - * 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. - * @param {string} [request.locationId] - * The geographic location to process content reidentification. Reserved for - * future extensions. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [ReidentifyContentResponse]{@link google.privacy.dlp.v2.ReidentifyContentResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [ReidentifyContentResponse]{@link google.privacy.dlp.v2.ReidentifyContentResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @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); - * }); - */ - reidentifyContent(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent, - }); - - return this._innerApiCalls.reidentifyContent(request, options, callback); - } - - /** - * 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. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} [request.languageCode] - * BCP-47 language code for localized infoType friendly - * names. If omitted, or if localized strings are not available, - * en-US strings will be returned. - * @param {string} [request.filter] - * filter to only return infoTypes supported by certain parts of the - * API. Defaults to supported_by=INSPECT. - * @param {string} [request.locationId] - * The geographic location to list info types. Reserved for future - * extensions. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [ListInfoTypesResponse]{@link google.privacy.dlp.v2.ListInfoTypesResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [ListInfoTypesResponse]{@link google.privacy.dlp.v2.ListInfoTypesResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @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); - * }); - */ - listInfoTypes(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - location_id: request.locationId, - }); - - return this._innerApiCalls.listInfoTypes(request, options, callback); - } - - /** - * 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. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent resource name, for example projects/my-project-id or - * organizations/my-org-id. - * @param {Object} [request.inspectTemplate] - * Required. The InspectTemplate to create. - * - * This object should have the same structure as [InspectTemplate]{@link google.privacy.dlp.v2.InspectTemplate} - * @param {string} [request.templateId] - * 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. - * @param {string} [request.locationId] - * The geographic location to store the inspection template. Reserved for - * future extensions. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [InspectTemplate]{@link google.privacy.dlp.v2.InspectTemplate}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [InspectTemplate]{@link google.privacy.dlp.v2.InspectTemplate}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @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); - * }); - */ - createInspectTemplate(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent, - }); - - return this._innerApiCalls.createInspectTemplate( - request, - options, - callback - ); - } - - /** - * Updates the InspectTemplate. - * See https://cloud.google.com/dlp/docs/creating-templates to learn more. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. Resource name of organization and inspectTemplate to be updated, for - * example `organizations/433245324/inspectTemplates/432452342` or - * projects/project-id/inspectTemplates/432452342. - * @param {Object} [request.inspectTemplate] - * New InspectTemplate value. - * - * This object should have the same structure as [InspectTemplate]{@link google.privacy.dlp.v2.InspectTemplate} - * @param {Object} [request.updateMask] - * Mask to control which fields get updated. - * - * This object should have the same structure as [FieldMask]{@link google.protobuf.FieldMask} - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [InspectTemplate]{@link google.privacy.dlp.v2.InspectTemplate}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [InspectTemplate]{@link google.privacy.dlp.v2.InspectTemplate}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @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); - * }); - */ - updateInspectTemplate(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name, - }); - - return this._innerApiCalls.updateInspectTemplate( - request, - options, - callback - ); - } - - /** - * Gets an InspectTemplate. - * See https://cloud.google.com/dlp/docs/creating-templates to learn more. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} [request.name] - * Required. Resource name of the organization and inspectTemplate to be read, for - * example `organizations/433245324/inspectTemplates/432452342` or - * projects/project-id/inspectTemplates/432452342. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [InspectTemplate]{@link google.privacy.dlp.v2.InspectTemplate}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [InspectTemplate]{@link google.privacy.dlp.v2.InspectTemplate}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @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); - * }); - */ - getInspectTemplate(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name, - }); - - return this._innerApiCalls.getInspectTemplate(request, options, callback); - } - - /** - * Lists InspectTemplates. - * See https://cloud.google.com/dlp/docs/creating-templates to learn more. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent resource name, for example projects/my-project-id or - * organizations/my-org-id. - * @param {number} [request.pageSize] - * 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. - * @param {string} [request.orderBy] - * 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. - * @param {string} [request.locationId] - * The geographic location where inspection templates will be retrieved from. - * Use `-` for all locations. Reserved for future extensions. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Array, ?Object, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is Array of [InspectTemplate]{@link google.privacy.dlp.v2.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]{@link google.privacy.dlp.v2.ListInspectTemplatesResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [InspectTemplate]{@link google.privacy.dlp.v2.InspectTemplate}. - * - * When autoPaginate: false is specified through options, the array has three elements. - * The first element is Array of [InspectTemplate]{@link google.privacy.dlp.v2.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]{@link google.privacy.dlp.v2.ListInspectTemplatesResponse}. - * - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @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); - * }); - */ - listInspectTemplates(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent, - }); - - return this._innerApiCalls.listInspectTemplates(request, options, callback); - } - - /** - * Equivalent to {@link listInspectTemplates}, but returns a NodeJS Stream object. - * - * This fetches the paged responses for {@link 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. - * - * @see {@link https://nodejs.org/api/stream.html} - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent resource name, for example projects/my-project-id or - * organizations/my-org-id. - * @param {number} [request.pageSize] - * 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. - * @param {string} [request.orderBy] - * 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. - * @param {string} [request.locationId] - * The geographic location where inspection templates will be retrieved from. - * Use `-` for all locations. Reserved for future extensions. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @returns {Stream} - * An object stream which emits an object representing [InspectTemplate]{@link google.privacy.dlp.v2.InspectTemplate} on 'data' event. - * - * @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); - * }); - */ - listInspectTemplatesStream(request, options) { - options = options || {}; - - return this._descriptors.page.listInspectTemplates.createStream( - this._innerApiCalls.listInspectTemplates, - request, - options - ); - } - - /** - * Deletes an InspectTemplate. - * See https://cloud.google.com/dlp/docs/creating-templates to learn more. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. Resource name of the organization and inspectTemplate to be deleted, for - * example `organizations/433245324/inspectTemplates/432452342` or - * projects/project-id/inspectTemplates/432452342. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error)} [callback] - * 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'); - * - * 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); - * }); - */ - deleteInspectTemplate(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name, - }); - - return this._innerApiCalls.deleteInspectTemplate( - request, - options, - callback - ); - } - - /** - * 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. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent resource name, for example projects/my-project-id or - * organizations/my-org-id. - * @param {Object} [request.deidentifyTemplate] - * Required. The DeidentifyTemplate to create. - * - * This object should have the same structure as [DeidentifyTemplate]{@link google.privacy.dlp.v2.DeidentifyTemplate} - * @param {string} [request.templateId] - * 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. - * @param {string} [request.locationId] - * The geographic location to store the deidentification template. Reserved - * for future extensions. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [DeidentifyTemplate]{@link google.privacy.dlp.v2.DeidentifyTemplate}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [DeidentifyTemplate]{@link google.privacy.dlp.v2.DeidentifyTemplate}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @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); - * }); - */ - createDeidentifyTemplate(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent, - }); - - return this._innerApiCalls.createDeidentifyTemplate( - request, - options, - callback - ); - } - - /** - * Updates the DeidentifyTemplate. - * See https://cloud.google.com/dlp/docs/creating-templates-deid to learn - * more. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. Resource name of organization and deidentify template to be updated, for - * example `organizations/433245324/deidentifyTemplates/432452342` or - * projects/project-id/deidentifyTemplates/432452342. - * @param {Object} [request.deidentifyTemplate] - * New DeidentifyTemplate value. - * - * This object should have the same structure as [DeidentifyTemplate]{@link google.privacy.dlp.v2.DeidentifyTemplate} - * @param {Object} [request.updateMask] - * Mask to control which fields get updated. - * - * This object should have the same structure as [FieldMask]{@link google.protobuf.FieldMask} - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [DeidentifyTemplate]{@link google.privacy.dlp.v2.DeidentifyTemplate}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [DeidentifyTemplate]{@link google.privacy.dlp.v2.DeidentifyTemplate}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @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); - * }); - */ - updateDeidentifyTemplate(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name, - }); - - return this._innerApiCalls.updateDeidentifyTemplate( - request, - options, - callback - ); - } - - /** - * Gets a DeidentifyTemplate. - * See https://cloud.google.com/dlp/docs/creating-templates-deid to learn - * more. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. Resource name of the organization and deidentify template to be read, for - * example `organizations/433245324/deidentifyTemplates/432452342` or - * projects/project-id/deidentifyTemplates/432452342. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [DeidentifyTemplate]{@link google.privacy.dlp.v2.DeidentifyTemplate}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [DeidentifyTemplate]{@link google.privacy.dlp.v2.DeidentifyTemplate}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @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); - * }); - */ - getDeidentifyTemplate(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name, - }); - - return this._innerApiCalls.getDeidentifyTemplate( - request, - options, - callback - ); - } - - /** - * Lists DeidentifyTemplates. - * See https://cloud.google.com/dlp/docs/creating-templates-deid to learn - * more. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent resource name, for example projects/my-project-id or - * organizations/my-org-id. - * @param {number} [request.pageSize] - * 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. - * @param {string} [request.orderBy] - * 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. - * @param {string} [request.locationId] - * The geographic location where deidentifications templates will be retrieved - * from. Use `-` for all locations. Reserved for future extensions. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Array, ?Object, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is Array of [DeidentifyTemplate]{@link google.privacy.dlp.v2.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]{@link google.privacy.dlp.v2.ListDeidentifyTemplatesResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [DeidentifyTemplate]{@link google.privacy.dlp.v2.DeidentifyTemplate}. - * - * When autoPaginate: false is specified through options, the array has three elements. - * The first element is Array of [DeidentifyTemplate]{@link google.privacy.dlp.v2.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]{@link google.privacy.dlp.v2.ListDeidentifyTemplatesResponse}. - * - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @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); - * }); - */ - listDeidentifyTemplates(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent, - }); - - return this._innerApiCalls.listDeidentifyTemplates( - request, - options, - callback - ); - } - - /** - * Equivalent to {@link listDeidentifyTemplates}, but returns a NodeJS Stream object. - * - * This fetches the paged responses for {@link 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. - * - * @see {@link https://nodejs.org/api/stream.html} - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent resource name, for example projects/my-project-id or - * organizations/my-org-id. - * @param {number} [request.pageSize] - * 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. - * @param {string} [request.orderBy] - * 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. - * @param {string} [request.locationId] - * The geographic location where deidentifications templates will be retrieved - * from. Use `-` for all locations. Reserved for future extensions. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @returns {Stream} - * An object stream which emits an object representing [DeidentifyTemplate]{@link google.privacy.dlp.v2.DeidentifyTemplate} on 'data' event. - * - * @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); - * }); - */ - listDeidentifyTemplatesStream(request, options) { - options = options || {}; - - return this._descriptors.page.listDeidentifyTemplates.createStream( - this._innerApiCalls.listDeidentifyTemplates, - request, - options - ); - } - - /** - * Deletes a DeidentifyTemplate. - * See https://cloud.google.com/dlp/docs/creating-templates-deid to learn - * more. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. Resource name of the organization and deidentify template to be deleted, - * for example `organizations/433245324/deidentifyTemplates/432452342` or - * projects/project-id/deidentifyTemplates/432452342. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error)} [callback] - * 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'); - * - * 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); - * }); - */ - deleteDeidentifyTemplate(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name, - }); - - return this._innerApiCalls.deleteDeidentifyTemplate( - request, - options, - callback - ); - } - - /** - * 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. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent resource name, for example projects/my-project-id. - * @param {Object} [request.inspectJob] - * Set to control what and how to inspect. - * - * This object should have the same structure as [InspectJobConfig]{@link google.privacy.dlp.v2.InspectJobConfig} - * @param {Object} [request.riskJob] - * Set to choose what metric to calculate. - * - * This object should have the same structure as [RiskAnalysisJobConfig]{@link google.privacy.dlp.v2.RiskAnalysisJobConfig} - * @param {string} [request.jobId] - * 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. - * @param {string} [request.locationId] - * The geographic location to store and process the job. Reserved for - * future extensions. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [DlpJob]{@link google.privacy.dlp.v2.DlpJob}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [DlpJob]{@link google.privacy.dlp.v2.DlpJob}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @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); - * }); - */ - createDlpJob(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent, - }); - - return this._innerApiCalls.createDlpJob(request, options, callback); - } - - /** - * 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. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent resource name, for example projects/my-project-id. - * @param {string} [request.filter] - * 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. - * @param {number} [request.pageSize] - * 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. - * @param {number} [request.type] - * The type of job. Defaults to `DlpJobType.INSPECT` - * - * The number should be among the values of [DlpJobType]{@link google.privacy.dlp.v2.DlpJobType} - * @param {string} [request.orderBy] - * 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` - * @param {string} [request.locationId] - * The geographic location where jobs will be retrieved from. - * Use `-` for all locations. Reserved for future extensions. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Array, ?Object, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is Array of [DlpJob]{@link google.privacy.dlp.v2.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]{@link google.privacy.dlp.v2.ListDlpJobsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [DlpJob]{@link google.privacy.dlp.v2.DlpJob}. - * - * When autoPaginate: false is specified through options, the array has three elements. - * The first element is Array of [DlpJob]{@link google.privacy.dlp.v2.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]{@link google.privacy.dlp.v2.ListDlpJobsResponse}. - * - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @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); - * }); - */ - listDlpJobs(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent, - }); - - return this._innerApiCalls.listDlpJobs(request, options, callback); - } - - /** - * Equivalent to {@link listDlpJobs}, but returns a NodeJS Stream object. - * - * This fetches the paged responses for {@link 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. - * - * @see {@link https://nodejs.org/api/stream.html} - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent resource name, for example projects/my-project-id. - * @param {string} [request.filter] - * 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. - * @param {number} [request.pageSize] - * 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. - * @param {number} [request.type] - * The type of job. Defaults to `DlpJobType.INSPECT` - * - * The number should be among the values of [DlpJobType]{@link google.privacy.dlp.v2.DlpJobType} - * @param {string} [request.orderBy] - * 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` - * @param {string} [request.locationId] - * The geographic location where jobs will be retrieved from. - * Use `-` for all locations. Reserved for future extensions. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @returns {Stream} - * An object stream which emits an object representing [DlpJob]{@link google.privacy.dlp.v2.DlpJob} on 'data' event. - * - * @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); - * }); - */ - listDlpJobsStream(request, options) { - options = options || {}; - - return this._descriptors.page.listDlpJobs.createStream( - this._innerApiCalls.listDlpJobs, - request, - options - ); - } - - /** - * 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. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the DlpJob resource. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [DlpJob]{@link google.privacy.dlp.v2.DlpJob}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [DlpJob]{@link google.privacy.dlp.v2.DlpJob}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @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); - * }); - */ - getDlpJob(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name, - }); - - return this._innerApiCalls.getDlpJob(request, options, callback); - } - - /** - * 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. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the DlpJob resource to be deleted. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error)} [callback] - * 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'); - * - * 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); - * }); - */ - deleteDlpJob(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name, - }); - - return this._innerApiCalls.deleteDlpJob(request, options, callback); - } - - /** - * 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. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the DlpJob resource to be cancelled. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error)} [callback] - * 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'); - * - * 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); - * }); - */ - cancelDlpJob(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name, - }); - - return this._innerApiCalls.cancelDlpJob(request, options, callback); - } - - /** - * Lists job triggers. - * See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent resource name, for example `projects/my-project-id`. - * @param {number} [request.pageSize] - * 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. - * @param {string} [request.orderBy] - * 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. - * @param {string} [request.filter] - * 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. - * @param {string} [request.locationId] - * The geographic location where job triggers will be retrieved from. - * Use `-` for all locations. Reserved for future extensions. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Array, ?Object, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is Array of [JobTrigger]{@link google.privacy.dlp.v2.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]{@link google.privacy.dlp.v2.ListJobTriggersResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [JobTrigger]{@link google.privacy.dlp.v2.JobTrigger}. - * - * When autoPaginate: false is specified through options, the array has three elements. - * The first element is Array of [JobTrigger]{@link google.privacy.dlp.v2.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]{@link google.privacy.dlp.v2.ListJobTriggersResponse}. - * - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @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); - * }); - */ - listJobTriggers(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent, - }); - - return this._innerApiCalls.listJobTriggers(request, options, callback); - } - - /** - * Equivalent to {@link listJobTriggers}, but returns a NodeJS Stream object. - * - * This fetches the paged responses for {@link 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. - * - * @see {@link https://nodejs.org/api/stream.html} - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent resource name, for example `projects/my-project-id`. - * @param {number} [request.pageSize] - * 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. - * @param {string} [request.orderBy] - * 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. - * @param {string} [request.filter] - * 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. - * @param {string} [request.locationId] - * The geographic location where job triggers will be retrieved from. - * Use `-` for all locations. Reserved for future extensions. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @returns {Stream} - * An object stream which emits an object representing [JobTrigger]{@link google.privacy.dlp.v2.JobTrigger} on 'data' event. - * - * @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); - * }); - */ - listJobTriggersStream(request, options) { - options = options || {}; - - return this._descriptors.page.listJobTriggers.createStream( - this._innerApiCalls.listJobTriggers, - request, - options - ); - } - - /** - * Gets a job trigger. - * See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. Resource name of the project and the triggeredJob, for example - * `projects/dlp-test-project/jobTriggers/53234423`. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [JobTrigger]{@link google.privacy.dlp.v2.JobTrigger}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [JobTrigger]{@link google.privacy.dlp.v2.JobTrigger}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @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); - * }); - */ - getJobTrigger(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name, - }); - - return this._innerApiCalls.getJobTrigger(request, options, callback); - } - - /** - * Deletes a job trigger. - * See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. Resource name of the project and the triggeredJob, for example - * `projects/dlp-test-project/jobTriggers/53234423`. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error)} [callback] - * 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'); - * - * const client = new dlp.v2.DlpServiceClient({ - * // optional auth parameters. - * }); - * - * const name = ''; - * client.deleteJobTrigger({name: name}).catch(err => { - * console.error(err); - * }); - */ - deleteJobTrigger(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name, - }); - - return this._innerApiCalls.deleteJobTrigger(request, options, callback); - } - - /** - * Updates a job trigger. - * See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. Resource name of the project and the triggeredJob, for example - * `projects/dlp-test-project/jobTriggers/53234423`. - * @param {Object} [request.jobTrigger] - * New JobTrigger value. - * - * This object should have the same structure as [JobTrigger]{@link google.privacy.dlp.v2.JobTrigger} - * @param {Object} [request.updateMask] - * Mask to control which fields get updated. - * - * This object should have the same structure as [FieldMask]{@link google.protobuf.FieldMask} - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [JobTrigger]{@link google.privacy.dlp.v2.JobTrigger}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [JobTrigger]{@link google.privacy.dlp.v2.JobTrigger}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @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); - * }); - */ - updateJobTrigger(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name, - }); - - return this._innerApiCalls.updateJobTrigger(request, options, callback); - } - - /** - * 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. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent resource name, for example projects/my-project-id. - * @param {Object} [request.jobTrigger] - * Required. The JobTrigger to create. - * - * This object should have the same structure as [JobTrigger]{@link google.privacy.dlp.v2.JobTrigger} - * @param {string} [request.triggerId] - * 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. - * @param {string} [request.locationId] - * The geographic location to store the job trigger. Reserved for - * future extensions. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [JobTrigger]{@link google.privacy.dlp.v2.JobTrigger}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [JobTrigger]{@link google.privacy.dlp.v2.JobTrigger}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @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); - * }); - */ - createJobTrigger(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent, - }); - - return this._innerApiCalls.createJobTrigger(request, options, callback); - } - - /** - * Creates a pre-built stored infoType to be used for inspection. - * See https://cloud.google.com/dlp/docs/creating-stored-infotypes to - * learn more. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent resource name, for example projects/my-project-id or - * organizations/my-org-id. - * @param {Object} [request.config] - * Required. Configuration of the storedInfoType to create. - * - * This object should have the same structure as [StoredInfoTypeConfig]{@link google.privacy.dlp.v2.StoredInfoTypeConfig} - * @param {string} [request.storedInfoTypeId] - * 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. - * @param {string} [request.locationId] - * The geographic location to store the stored infoType. Reserved for - * future extensions. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [StoredInfoType]{@link google.privacy.dlp.v2.StoredInfoType}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [StoredInfoType]{@link google.privacy.dlp.v2.StoredInfoType}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @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); - * }); - */ - createStoredInfoType(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent, - }); - - return this._innerApiCalls.createStoredInfoType(request, options, callback); - } - - /** - * 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. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. Resource name of organization and storedInfoType to be updated, for - * example `organizations/433245324/storedInfoTypes/432452342` or - * projects/project-id/storedInfoTypes/432452342. - * @param {Object} [request.config] - * 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]{@link google.privacy.dlp.v2.StoredInfoTypeConfig} - * @param {Object} [request.updateMask] - * Mask to control which fields get updated. - * - * This object should have the same structure as [FieldMask]{@link google.protobuf.FieldMask} - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [StoredInfoType]{@link google.privacy.dlp.v2.StoredInfoType}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [StoredInfoType]{@link google.privacy.dlp.v2.StoredInfoType}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @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); - * }); - */ - updateStoredInfoType(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name, - }); - - return this._innerApiCalls.updateStoredInfoType(request, options, callback); - } - - /** - * Gets a stored infoType. - * See https://cloud.google.com/dlp/docs/creating-stored-infotypes to - * learn more. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. Resource name of the organization and storedInfoType to be read, for - * example `organizations/433245324/storedInfoTypes/432452342` or - * projects/project-id/storedInfoTypes/432452342. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [StoredInfoType]{@link google.privacy.dlp.v2.StoredInfoType}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [StoredInfoType]{@link google.privacy.dlp.v2.StoredInfoType}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @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); - * }); - */ - getStoredInfoType(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name, - }); - - return this._innerApiCalls.getStoredInfoType(request, options, callback); - } - - /** - * Lists stored infoTypes. - * See https://cloud.google.com/dlp/docs/creating-stored-infotypes to - * learn more. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent resource name, for example projects/my-project-id or - * organizations/my-org-id. - * @param {number} [request.pageSize] - * 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. - * @param {string} [request.orderBy] - * 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. - * @param {string} [request.locationId] - * The geographic location where stored infoTypes will be retrieved from. - * Use `-` for all locations. Reserved for future extensions. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Array, ?Object, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is Array of [StoredInfoType]{@link google.privacy.dlp.v2.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]{@link google.privacy.dlp.v2.ListStoredInfoTypesResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [StoredInfoType]{@link google.privacy.dlp.v2.StoredInfoType}. - * - * When autoPaginate: false is specified through options, the array has three elements. - * The first element is Array of [StoredInfoType]{@link google.privacy.dlp.v2.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]{@link google.privacy.dlp.v2.ListStoredInfoTypesResponse}. - * - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @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); - * }); - */ - listStoredInfoTypes(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent, - }); - - return this._innerApiCalls.listStoredInfoTypes(request, options, callback); - } - - /** - * Equivalent to {@link listStoredInfoTypes}, but returns a NodeJS Stream object. - * - * This fetches the paged responses for {@link 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. - * - * @see {@link https://nodejs.org/api/stream.html} - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent resource name, for example projects/my-project-id or - * organizations/my-org-id. - * @param {number} [request.pageSize] - * 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. - * @param {string} [request.orderBy] - * 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. - * @param {string} [request.locationId] - * The geographic location where stored infoTypes will be retrieved from. - * Use `-` for all locations. Reserved for future extensions. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @returns {Stream} - * An object stream which emits an object representing [StoredInfoType]{@link google.privacy.dlp.v2.StoredInfoType} on 'data' event. - * - * @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); - * }); - */ - listStoredInfoTypesStream(request, options) { - options = options || {}; - - return this._descriptors.page.listStoredInfoTypes.createStream( - this._innerApiCalls.listStoredInfoTypes, - request, - options - ); - } - - /** - * Deletes a stored infoType. - * See https://cloud.google.com/dlp/docs/creating-stored-infotypes to - * learn more. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. Resource name of the organization and storedInfoType to be deleted, for - * example `organizations/433245324/storedInfoTypes/432452342` or - * projects/project-id/storedInfoTypes/432452342. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error)} [callback] - * 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'); - * - * 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); - * }); - */ - deleteStoredInfoType(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name, - }); - - return this._innerApiCalls.deleteStoredInfoType(request, options, callback); - } - - // -------------------- - // -- Path templates -- - // -------------------- - - /** - * Return a fully-qualified dlp_job resource name string. - * - * @param {String} project - * @param {String} dlpJob - * @returns {String} - */ - dlpJobPath(project, dlpJob) { - return this._pathTemplates.dlpJobPathTemplate.render({ - project: project, - dlp_job: dlpJob, - }); - } - - /** - * Return a fully-qualified organization resource name string. - * - * @param {String} organization - * @returns {String} - */ - organizationPath(organization) { - return this._pathTemplates.organizationPathTemplate.render({ - organization: organization, - }); - } - - /** - * Return a fully-qualified organization_deidentify_template resource name string. - * - * @param {String} organization - * @param {String} deidentifyTemplate - * @returns {String} - */ - organizationDeidentifyTemplatePath(organization, deidentifyTemplate) { - return this._pathTemplates.organizationDeidentifyTemplatePathTemplate.render( - { - organization: organization, - deidentify_template: deidentifyTemplate, - } - ); - } - - /** - * Return a fully-qualified organization_inspect_template resource name string. - * - * @param {String} organization - * @param {String} inspectTemplate - * @returns {String} - */ - organizationInspectTemplatePath(organization, inspectTemplate) { - return this._pathTemplates.organizationInspectTemplatePathTemplate.render({ - organization: organization, - inspect_template: inspectTemplate, - }); - } - - /** - * Return a fully-qualified organization_stored_info_type resource name string. - * - * @param {String} organization - * @param {String} storedInfoType - * @returns {String} - */ - organizationStoredInfoTypePath(organization, storedInfoType) { - return this._pathTemplates.organizationStoredInfoTypePathTemplate.render({ - organization: organization, - stored_info_type: storedInfoType, - }); - } - - /** - * Return a fully-qualified project resource name string. - * - * @param {String} project - * @returns {String} - */ - projectPath(project) { - return this._pathTemplates.projectPathTemplate.render({ - project: project, - }); - } - - /** - * Return a fully-qualified project_deidentify_template resource name string. - * - * @param {String} project - * @param {String} deidentifyTemplate - * @returns {String} - */ - projectDeidentifyTemplatePath(project, deidentifyTemplate) { - return this._pathTemplates.projectDeidentifyTemplatePathTemplate.render({ - project: project, - deidentify_template: deidentifyTemplate, - }); - } - - /** - * Return a fully-qualified project_inspect_template resource name string. - * - * @param {String} project - * @param {String} inspectTemplate - * @returns {String} - */ - projectInspectTemplatePath(project, inspectTemplate) { - return this._pathTemplates.projectInspectTemplatePathTemplate.render({ - project: project, - inspect_template: inspectTemplate, - }); - } - - /** - * Return a fully-qualified project_job_trigger resource name string. - * - * @param {String} project - * @param {String} jobTrigger - * @returns {String} - */ - projectJobTriggerPath(project, jobTrigger) { - return this._pathTemplates.projectJobTriggerPathTemplate.render({ - project: project, - job_trigger: jobTrigger, - }); - } - - /** - * Return a fully-qualified project_stored_info_type resource name string. - * - * @param {String} project - * @param {String} storedInfoType - * @returns {String} - */ - projectStoredInfoTypePath(project, storedInfoType) { - return this._pathTemplates.projectStoredInfoTypePathTemplate.render({ - project: project, - stored_info_type: storedInfoType, - }); - } - - /** - * Parse the dlpJobName from a dlp_job resource. - * - * @param {String} dlpJobName - * A fully-qualified path representing a dlp_job resources. - * @returns {String} - A string representing the project. - */ - matchProjectFromDlpJobName(dlpJobName) { - return this._pathTemplates.dlpJobPathTemplate.match(dlpJobName).project; - } - - /** - * Parse the dlpJobName from a dlp_job resource. - * - * @param {String} dlpJobName - * A fully-qualified path representing a dlp_job resources. - * @returns {String} - A string representing the dlp_job. - */ - matchDlpJobFromDlpJobName(dlpJobName) { - return this._pathTemplates.dlpJobPathTemplate.match(dlpJobName).dlp_job; - } - - /** - * Parse the organizationName from a organization resource. - * - * @param {String} organizationName - * A fully-qualified path representing a organization resources. - * @returns {String} - A string representing the organization. - */ - matchOrganizationFromOrganizationName(organizationName) { - return this._pathTemplates.organizationPathTemplate.match(organizationName) - .organization; - } - - /** - * Parse the organizationDeidentifyTemplateName from a organization_deidentify_template resource. - * - * @param {String} organizationDeidentifyTemplateName - * A fully-qualified path representing a organization_deidentify_template resources. - * @returns {String} - A string representing the organization. - */ - matchOrganizationFromOrganizationDeidentifyTemplateName( - organizationDeidentifyTemplateName - ) { - return this._pathTemplates.organizationDeidentifyTemplatePathTemplate.match( - organizationDeidentifyTemplateName - ).organization; - } - - /** - * Parse the organizationDeidentifyTemplateName from a organization_deidentify_template resource. - * - * @param {String} organizationDeidentifyTemplateName - * A fully-qualified path representing a organization_deidentify_template resources. - * @returns {String} - A string representing the deidentify_template. - */ - matchDeidentifyTemplateFromOrganizationDeidentifyTemplateName( - organizationDeidentifyTemplateName - ) { - return this._pathTemplates.organizationDeidentifyTemplatePathTemplate.match( - organizationDeidentifyTemplateName - ).deidentify_template; - } - - /** - * Parse the organizationInspectTemplateName from a organization_inspect_template resource. - * - * @param {String} organizationInspectTemplateName - * A fully-qualified path representing a organization_inspect_template resources. - * @returns {String} - A string representing the organization. - */ - matchOrganizationFromOrganizationInspectTemplateName( - organizationInspectTemplateName - ) { - return this._pathTemplates.organizationInspectTemplatePathTemplate.match( - organizationInspectTemplateName - ).organization; - } - - /** - * Parse the organizationInspectTemplateName from a organization_inspect_template resource. - * - * @param {String} organizationInspectTemplateName - * A fully-qualified path representing a organization_inspect_template resources. - * @returns {String} - A string representing the inspect_template. - */ - matchInspectTemplateFromOrganizationInspectTemplateName( - organizationInspectTemplateName - ) { - return this._pathTemplates.organizationInspectTemplatePathTemplate.match( - organizationInspectTemplateName - ).inspect_template; - } - - /** - * Parse the organizationStoredInfoTypeName from a organization_stored_info_type resource. - * - * @param {String} organizationStoredInfoTypeName - * A fully-qualified path representing a organization_stored_info_type resources. - * @returns {String} - A string representing the organization. - */ - matchOrganizationFromOrganizationStoredInfoTypeName( - organizationStoredInfoTypeName - ) { - return this._pathTemplates.organizationStoredInfoTypePathTemplate.match( - organizationStoredInfoTypeName - ).organization; - } - - /** - * Parse the organizationStoredInfoTypeName from a organization_stored_info_type resource. - * - * @param {String} organizationStoredInfoTypeName - * A fully-qualified path representing a organization_stored_info_type resources. - * @returns {String} - A string representing the stored_info_type. - */ - matchStoredInfoTypeFromOrganizationStoredInfoTypeName( - organizationStoredInfoTypeName - ) { - return this._pathTemplates.organizationStoredInfoTypePathTemplate.match( - organizationStoredInfoTypeName - ).stored_info_type; - } - - /** - * Parse the projectName from a project resource. - * - * @param {String} projectName - * A fully-qualified path representing a project resources. - * @returns {String} - A string representing the project. - */ - matchProjectFromProjectName(projectName) { - return this._pathTemplates.projectPathTemplate.match(projectName).project; - } - - /** - * Parse the projectDeidentifyTemplateName from a project_deidentify_template resource. - * - * @param {String} projectDeidentifyTemplateName - * A fully-qualified path representing a project_deidentify_template resources. - * @returns {String} - A string representing the project. - */ - matchProjectFromProjectDeidentifyTemplateName(projectDeidentifyTemplateName) { - return this._pathTemplates.projectDeidentifyTemplatePathTemplate.match( - projectDeidentifyTemplateName - ).project; - } - - /** - * Parse the projectDeidentifyTemplateName from a project_deidentify_template resource. - * - * @param {String} projectDeidentifyTemplateName - * A fully-qualified path representing a project_deidentify_template resources. - * @returns {String} - A string representing the deidentify_template. - */ - matchDeidentifyTemplateFromProjectDeidentifyTemplateName( - projectDeidentifyTemplateName - ) { - return this._pathTemplates.projectDeidentifyTemplatePathTemplate.match( - projectDeidentifyTemplateName - ).deidentify_template; - } - - /** - * Parse the projectInspectTemplateName from a project_inspect_template resource. - * - * @param {String} projectInspectTemplateName - * A fully-qualified path representing a project_inspect_template resources. - * @returns {String} - A string representing the project. - */ - matchProjectFromProjectInspectTemplateName(projectInspectTemplateName) { - return this._pathTemplates.projectInspectTemplatePathTemplate.match( - projectInspectTemplateName - ).project; - } - - /** - * Parse the projectInspectTemplateName from a project_inspect_template resource. - * - * @param {String} projectInspectTemplateName - * A fully-qualified path representing a project_inspect_template resources. - * @returns {String} - A string representing the inspect_template. - */ - matchInspectTemplateFromProjectInspectTemplateName( - projectInspectTemplateName - ) { - return this._pathTemplates.projectInspectTemplatePathTemplate.match( - projectInspectTemplateName - ).inspect_template; - } - - /** - * Parse the projectJobTriggerName from a project_job_trigger resource. - * - * @param {String} projectJobTriggerName - * A fully-qualified path representing a project_job_trigger resources. - * @returns {String} - A string representing the project. - */ - matchProjectFromProjectJobTriggerName(projectJobTriggerName) { - return this._pathTemplates.projectJobTriggerPathTemplate.match( - projectJobTriggerName - ).project; - } - - /** - * Parse the projectJobTriggerName from a project_job_trigger resource. - * - * @param {String} projectJobTriggerName - * A fully-qualified path representing a project_job_trigger resources. - * @returns {String} - A string representing the job_trigger. - */ - matchJobTriggerFromProjectJobTriggerName(projectJobTriggerName) { - return this._pathTemplates.projectJobTriggerPathTemplate.match( - projectJobTriggerName - ).job_trigger; - } - - /** - * Parse the projectStoredInfoTypeName from a project_stored_info_type resource. - * - * @param {String} projectStoredInfoTypeName - * A fully-qualified path representing a project_stored_info_type resources. - * @returns {String} - A string representing the project. - */ - matchProjectFromProjectStoredInfoTypeName(projectStoredInfoTypeName) { - return this._pathTemplates.projectStoredInfoTypePathTemplate.match( - projectStoredInfoTypeName - ).project; - } - - /** - * Parse the projectStoredInfoTypeName from a project_stored_info_type resource. - * - * @param {String} projectStoredInfoTypeName - * A fully-qualified path representing a project_stored_info_type resources. - * @returns {String} - A string representing the stored_info_type. - */ - matchStoredInfoTypeFromProjectStoredInfoTypeName(projectStoredInfoTypeName) { - return this._pathTemplates.projectStoredInfoTypePathTemplate.match( - projectStoredInfoTypeName - ).stored_info_type; - } -} - -module.exports = DlpServiceClient; diff --git a/packages/google-privacy-dlp/src/v2/dlp_service_client.ts b/packages/google-privacy-dlp/src/v2/dlp_service_client.ts new file mode 100644 index 00000000000..d4872b836e3 --- /dev/null +++ b/packages/google-privacy-dlp/src/v2/dlp_service_client.ts @@ -0,0 +1,3940 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as gax from 'google-gax'; +import { + APICallback, + Callback, + CallOptions, + Descriptors, + ClientOptions, + PaginationCallback, + PaginationResponse, +} from 'google-gax'; +import * as path from 'path'; + +import {Transform} from 'stream'; +import * as protosTypes from '../../protos/protos'; +import * as gapicConfig from './dlp_service_client_config.json'; + +const version = require('../../../package.json').version; + +/** + * The Cloud Data Loss Prevention (DLP) API is a service that allows clients + * to detect the presence of Personally Identifiable Information (PII) and other + * privacy-sensitive data in user-supplied, unstructured data streams, like text + * blocks or images. + * The service also includes methods for sensitive data redaction and + * scheduling of data scans on Google Cloud Platform based data sets. + * + * To learn more about concepts and find how-to guides see + * https://cloud.google.com/dlp/docs/. + * @class + * @memberof v2 + */ +export class DlpServiceClient { + private _descriptors: Descriptors = {page: {}, stream: {}, longrunning: {}}; + private _innerApiCalls: {[name: string]: Function}; + private _pathTemplates: {[name: string]: gax.PathTemplate}; + private _terminated = false; + auth: gax.GoogleAuth; + dlpServiceStub: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of DlpServiceClient. + * + * @param {object} [options] - The configuration object. See the subsequent + * parameters for more details. + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - 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. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - 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 + * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {function} [options.promise] - Custom promise module to use instead + * of native Promises. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + */ + + constructor(opts?: ClientOptions) { + // Ensure that options include the service address and port. + const staticMembers = this.constructor as typeof DlpServiceClient; + const servicePath = + opts && opts.servicePath + ? opts.servicePath + : opts && opts.apiEndpoint + ? opts.apiEndpoint + : staticMembers.servicePath; + const port = opts && opts.port ? opts.port : staticMembers.port; + + if (!opts) { + opts = {servicePath, port}; + } + opts.servicePath = opts.servicePath || servicePath; + opts.port = opts.port || port; + opts.clientConfig = opts.clientConfig || {}; + + const isBrowser = typeof window !== 'undefined'; + if (isBrowser) { + opts.fallback = true; + } + // If we are in browser, we are already using fallback because of the + // "browser" field in package.json. + // But if we were explicitly requested to use fallback, let's do it now. + const gaxModule = !isBrowser && opts.fallback ? gax.fallback : gax; + + // Create a `gaxGrpc` object, with any grpc-specific options + // sent to the client. + opts.scopes = (this.constructor as typeof DlpServiceClient).scopes; + const gaxGrpc = new gaxModule.GrpcClient(opts); + + // Save the auth object to the client, for use by other methods. + this.auth = gaxGrpc.auth as gax.GoogleAuth; + + // Determine the client header string. + const clientHeader = [`gax/${gaxModule.version}`, `gapic/${version}`]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + // For Node.js, pass the path to JSON proto file. + // For browsers, pass the JSON content. + + const nodejsProtoPath = path.join( + __dirname, + '..', + '..', + 'protos', + 'protos.json' + ); + const protos = gaxGrpc.loadProto( + opts.fallback ? require('../../protos/protos.json') : nodejsProtoPath + ); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this._pathTemplates = { + projectPathTemplate: new gaxModule.PathTemplate('projects/{project}'), + organizationPathTemplate: new gaxModule.PathTemplate( + 'organizations/{organization}' + ), + organizationInspectTemplatePathTemplate: new gaxModule.PathTemplate( + 'organizations/{organization}/inspectTemplates/{inspect_template}' + ), + projectInspectTemplatePathTemplate: new gaxModule.PathTemplate( + 'projects/{project}/inspectTemplates/{inspect_template}' + ), + jobTriggerPathTemplate: new gaxModule.PathTemplate( + 'projects/{project}/jobTriggers/{job_trigger}' + ), + dlpJobPathTemplate: new gaxModule.PathTemplate( + 'projects/{project}/dlpJobs/{dlp_job}' + ), + organizationDeidentifyTemplatePathTemplate: new gaxModule.PathTemplate( + 'organizations/{organization}/deidentifyTemplates/{deidentify_template}' + ), + projectDeidentifyTemplatePathTemplate: new gaxModule.PathTemplate( + 'projects/{project}/deidentifyTemplates/{deidentify_template}' + ), + organizationStoredInfoTypePathTemplate: new gaxModule.PathTemplate( + 'organizations/{organization}/storedInfoTypes/{stored_info_type}' + ), + projectStoredInfoTypePathTemplate: new gaxModule.PathTemplate( + 'projects/{project}/storedInfoTypes/{stored_info_type}' + ), + }; + + // Some of the methods on this service return "paged" results, + // (e.g. 50 results at a time, with tokens to get subsequent + // pages). Denote the keys used for pagination and results. + this._descriptors.page = { + listInspectTemplates: new gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'inspectTemplates' + ), + listDeidentifyTemplates: new gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'deidentifyTemplates' + ), + listJobTriggers: new gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'jobTriggers' + ), + listDlpJobs: new gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'jobs' + ), + listStoredInfoTypes: new gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'storedInfoTypes' + ), + }; + + // Put together the default options sent with requests. + const defaults = gaxGrpc.constructSettings( + 'google.privacy.dlp.v2.DlpService', + gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, + {'x-goog-api-client': clientHeader.join(' ')} + ); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this._innerApiCalls = {}; + + // Put together the "service stub" for + // google.privacy.dlp.v2.DlpService. + this.dlpServiceStub = gaxGrpc.createStub( + opts.fallback + ? (protos as protobuf.Root).lookupService( + 'google.privacy.dlp.v2.DlpService' + ) + : // tslint:disable-next-line no-any + (protos as any).google.privacy.dlp.v2.DlpService, + opts + ) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const dlpServiceStubMethods = [ + 'inspectContent', + 'redactImage', + 'deidentifyContent', + 'reidentifyContent', + 'listInfoTypes', + 'createInspectTemplate', + 'updateInspectTemplate', + 'getInspectTemplate', + 'listInspectTemplates', + 'deleteInspectTemplate', + 'createDeidentifyTemplate', + 'updateDeidentifyTemplate', + 'getDeidentifyTemplate', + 'listDeidentifyTemplates', + 'deleteDeidentifyTemplate', + 'createJobTrigger', + 'updateJobTrigger', + 'getJobTrigger', + 'listJobTriggers', + 'deleteJobTrigger', + 'activateJobTrigger', + 'createDlpJob', + 'listDlpJobs', + 'getDlpJob', + 'deleteDlpJob', + 'cancelDlpJob', + 'createStoredInfoType', + 'updateStoredInfoType', + 'getStoredInfoType', + 'listStoredInfoTypes', + 'deleteStoredInfoType', + ]; + + for (const methodName of dlpServiceStubMethods) { + const innerCallPromise = this.dlpServiceStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + return stub[methodName].apply(stub, args); + }, + (err: Error | null | undefined) => () => { + throw err; + } + ); + + const apiCall = gaxModule.createApiCall( + innerCallPromise, + defaults[methodName], + this._descriptors.page[methodName] || + this._descriptors.stream[methodName] || + this._descriptors.longrunning[methodName] + ); + + this._innerApiCalls[methodName] = ( + argument: {}, + callOptions?: CallOptions, + callback?: APICallback + ) => { + return apiCall(argument, callOptions, callback); + }; + } + } + + /** + * The DNS address for this API service. + */ + static get servicePath() { + return 'dlp.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + */ + static get apiEndpoint() { + return 'dlp.googleapis.com'; + } + + /** + * The port for this API service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + */ + static get scopes() { + return ['https://www.googleapis.com/auth/cloud-platform']; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @param {function(Error, string)} callback - the callback to + * be called with the current project Id. + */ + getProjectId( + callback?: Callback + ): Promise | void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- + inspectContent( + request: protosTypes.google.privacy.dlp.v2.IInspectContentRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.privacy.dlp.v2.IInspectContentResponse, + protosTypes.google.privacy.dlp.v2.IInspectContentRequest | undefined, + {} | undefined + ] + >; + inspectContent( + request: protosTypes.google.privacy.dlp.v2.IInspectContentRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.privacy.dlp.v2.IInspectContentResponse, + protosTypes.google.privacy.dlp.v2.IInspectContentRequest | undefined, + {} | undefined + > + ): void; + /** + * 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, + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * The parent resource name, for example projects/my-project-id. + * @param {google.privacy.dlp.v2.InspectConfig} request.inspectConfig + * Configuration for the inspector. What specified here will override + * the template referenced by the inspect_template_name argument. + * @param {google.privacy.dlp.v2.ContentItem} request.item + * The item to inspect. + * @param {string} request.inspectTemplateName + * 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. + * @param {string} request.locationId + * The geographic location to process content inspection. Reserved for future + * extensions. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [InspectContentResponse]{@link google.privacy.dlp.v2.InspectContentResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + inspectContent( + request: protosTypes.google.privacy.dlp.v2.IInspectContentRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.privacy.dlp.v2.IInspectContentResponse, + protosTypes.google.privacy.dlp.v2.IInspectContentRequest | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.privacy.dlp.v2.IInspectContentResponse, + protosTypes.google.privacy.dlp.v2.IInspectContentRequest | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.privacy.dlp.v2.IInspectContentResponse, + protosTypes.google.privacy.dlp.v2.IInspectContentRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + return this._innerApiCalls.inspectContent(request, options, callback); + } + redactImage( + request: protosTypes.google.privacy.dlp.v2.IRedactImageRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.privacy.dlp.v2.IRedactImageResponse, + protosTypes.google.privacy.dlp.v2.IRedactImageRequest | undefined, + {} | undefined + ] + >; + redactImage( + request: protosTypes.google.privacy.dlp.v2.IRedactImageRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.privacy.dlp.v2.IRedactImageResponse, + protosTypes.google.privacy.dlp.v2.IRedactImageRequest | undefined, + {} | undefined + > + ): void; + /** + * 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. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * The parent resource name, for example projects/my-project-id. + * @param {string} request.locationId + * The geographic location to process the request. Reserved for future + * extensions. + * @param {google.privacy.dlp.v2.InspectConfig} request.inspectConfig + * Configuration for the inspector. + * @param {number[]} request.imageRedactionConfigs + * The configuration for specifying what content to redact from images. + * @param {boolean} request.includeFindings + * Whether the response should include findings along with the redacted + * image. + * @param {google.privacy.dlp.v2.ByteContentItem} request.byteItem + * The content must be PNG, JPEG, SVG or BMP. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [RedactImageResponse]{@link google.privacy.dlp.v2.RedactImageResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + redactImage( + request: protosTypes.google.privacy.dlp.v2.IRedactImageRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.privacy.dlp.v2.IRedactImageResponse, + protosTypes.google.privacy.dlp.v2.IRedactImageRequest | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.privacy.dlp.v2.IRedactImageResponse, + protosTypes.google.privacy.dlp.v2.IRedactImageRequest | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.privacy.dlp.v2.IRedactImageResponse, + protosTypes.google.privacy.dlp.v2.IRedactImageRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + return this._innerApiCalls.redactImage(request, options, callback); + } + deidentifyContent( + request: protosTypes.google.privacy.dlp.v2.IDeidentifyContentRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.privacy.dlp.v2.IDeidentifyContentResponse, + protosTypes.google.privacy.dlp.v2.IDeidentifyContentRequest | undefined, + {} | undefined + ] + >; + deidentifyContent( + request: protosTypes.google.privacy.dlp.v2.IDeidentifyContentRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.privacy.dlp.v2.IDeidentifyContentResponse, + protosTypes.google.privacy.dlp.v2.IDeidentifyContentRequest | undefined, + {} | undefined + > + ): void; + /** + * 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. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * The parent resource name, for example projects/my-project-id. + * @param {google.privacy.dlp.v2.DeidentifyConfig} request.deidentifyConfig + * Configuration for the de-identification of the content item. + * Items specified here will override the template referenced by the + * deidentify_template_name argument. + * @param {google.privacy.dlp.v2.InspectConfig} request.inspectConfig + * Configuration for the inspector. + * Items specified here will override the template referenced by the + * inspect_template_name argument. + * @param {google.privacy.dlp.v2.ContentItem} request.item + * The item to de-identify. Will be treated as text. + * @param {string} request.inspectTemplateName + * 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. + * @param {string} request.deidentifyTemplateName + * 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. + * @param {string} request.locationId + * The geographic location to process de-identification. Reserved for future + * extensions. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [DeidentifyContentResponse]{@link google.privacy.dlp.v2.DeidentifyContentResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + deidentifyContent( + request: protosTypes.google.privacy.dlp.v2.IDeidentifyContentRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.privacy.dlp.v2.IDeidentifyContentResponse, + | protosTypes.google.privacy.dlp.v2.IDeidentifyContentRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.privacy.dlp.v2.IDeidentifyContentResponse, + protosTypes.google.privacy.dlp.v2.IDeidentifyContentRequest | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.privacy.dlp.v2.IDeidentifyContentResponse, + protosTypes.google.privacy.dlp.v2.IDeidentifyContentRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + return this._innerApiCalls.deidentifyContent(request, options, callback); + } + reidentifyContent( + request: protosTypes.google.privacy.dlp.v2.IReidentifyContentRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.privacy.dlp.v2.IReidentifyContentResponse, + protosTypes.google.privacy.dlp.v2.IReidentifyContentRequest | undefined, + {} | undefined + ] + >; + reidentifyContent( + request: protosTypes.google.privacy.dlp.v2.IReidentifyContentRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.privacy.dlp.v2.IReidentifyContentResponse, + protosTypes.google.privacy.dlp.v2.IReidentifyContentRequest | undefined, + {} | undefined + > + ): void; + /** + * 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. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource name. + * @param {google.privacy.dlp.v2.DeidentifyConfig} request.reidentifyConfig + * 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: + * + * - `CryptoDeterministicConfig` + * - `CryptoReplaceFfxFpeConfig` + * @param {google.privacy.dlp.v2.InspectConfig} request.inspectConfig + * Configuration for the inspector. + * @param {google.privacy.dlp.v2.ContentItem} request.item + * The item to re-identify. Will be treated as text. + * @param {string} request.inspectTemplateName + * 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. + * @param {string} request.reidentifyTemplateName + * 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. + * @param {string} request.locationId + * The geographic location to process content reidentification. Reserved for + * future extensions. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [ReidentifyContentResponse]{@link google.privacy.dlp.v2.ReidentifyContentResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + reidentifyContent( + request: protosTypes.google.privacy.dlp.v2.IReidentifyContentRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.privacy.dlp.v2.IReidentifyContentResponse, + | protosTypes.google.privacy.dlp.v2.IReidentifyContentRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.privacy.dlp.v2.IReidentifyContentResponse, + protosTypes.google.privacy.dlp.v2.IReidentifyContentRequest | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.privacy.dlp.v2.IReidentifyContentResponse, + protosTypes.google.privacy.dlp.v2.IReidentifyContentRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + return this._innerApiCalls.reidentifyContent(request, options, callback); + } + listInfoTypes( + request: protosTypes.google.privacy.dlp.v2.IListInfoTypesRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.privacy.dlp.v2.IListInfoTypesResponse, + protosTypes.google.privacy.dlp.v2.IListInfoTypesRequest | undefined, + {} | undefined + ] + >; + listInfoTypes( + request: protosTypes.google.privacy.dlp.v2.IListInfoTypesRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.privacy.dlp.v2.IListInfoTypesResponse, + protosTypes.google.privacy.dlp.v2.IListInfoTypesRequest | undefined, + {} | undefined + > + ): void; + /** + * 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. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.languageCode + * BCP-47 language code for localized infoType friendly + * names. If omitted, or if localized strings are not available, + * en-US strings will be returned. + * @param {string} request.filter + * filter to only return infoTypes supported by certain parts of the + * API. Defaults to supported_by=INSPECT. + * @param {string} request.locationId + * The geographic location to list info types. Reserved for future + * extensions. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [ListInfoTypesResponse]{@link google.privacy.dlp.v2.ListInfoTypesResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + listInfoTypes( + request: protosTypes.google.privacy.dlp.v2.IListInfoTypesRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.privacy.dlp.v2.IListInfoTypesResponse, + protosTypes.google.privacy.dlp.v2.IListInfoTypesRequest | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.privacy.dlp.v2.IListInfoTypesResponse, + protosTypes.google.privacy.dlp.v2.IListInfoTypesRequest | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.privacy.dlp.v2.IListInfoTypesResponse, + protosTypes.google.privacy.dlp.v2.IListInfoTypesRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + return this._innerApiCalls.listInfoTypes(request, options, callback); + } + createInspectTemplate( + request: protosTypes.google.privacy.dlp.v2.ICreateInspectTemplateRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.privacy.dlp.v2.IInspectTemplate, + ( + | protosTypes.google.privacy.dlp.v2.ICreateInspectTemplateRequest + | undefined + ), + {} | undefined + ] + >; + createInspectTemplate( + request: protosTypes.google.privacy.dlp.v2.ICreateInspectTemplateRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.privacy.dlp.v2.IInspectTemplate, + | protosTypes.google.privacy.dlp.v2.ICreateInspectTemplateRequest + | undefined, + {} | undefined + > + ): void; + /** + * 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. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource name, for example projects/my-project-id or + * organizations/my-org-id. + * @param {google.privacy.dlp.v2.InspectTemplate} request.inspectTemplate + * Required. The InspectTemplate to create. + * @param {string} request.templateId + * 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. + * @param {string} request.locationId + * The geographic location to store the inspection template. Reserved for + * future extensions. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [InspectTemplate]{@link google.privacy.dlp.v2.InspectTemplate}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + createInspectTemplate( + request: protosTypes.google.privacy.dlp.v2.ICreateInspectTemplateRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.privacy.dlp.v2.IInspectTemplate, + | protosTypes.google.privacy.dlp.v2.ICreateInspectTemplateRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.privacy.dlp.v2.IInspectTemplate, + | protosTypes.google.privacy.dlp.v2.ICreateInspectTemplateRequest + | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.privacy.dlp.v2.IInspectTemplate, + ( + | protosTypes.google.privacy.dlp.v2.ICreateInspectTemplateRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + return this._innerApiCalls.createInspectTemplate( + request, + options, + callback + ); + } + updateInspectTemplate( + request: protosTypes.google.privacy.dlp.v2.IUpdateInspectTemplateRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.privacy.dlp.v2.IInspectTemplate, + ( + | protosTypes.google.privacy.dlp.v2.IUpdateInspectTemplateRequest + | undefined + ), + {} | undefined + ] + >; + updateInspectTemplate( + request: protosTypes.google.privacy.dlp.v2.IUpdateInspectTemplateRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.privacy.dlp.v2.IInspectTemplate, + | protosTypes.google.privacy.dlp.v2.IUpdateInspectTemplateRequest + | undefined, + {} | undefined + > + ): void; + /** + * Updates the InspectTemplate. + * See https://cloud.google.com/dlp/docs/creating-templates to learn more. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Resource name of organization and inspectTemplate to be updated, for + * example `organizations/433245324/inspectTemplates/432452342` or + * projects/project-id/inspectTemplates/432452342. + * @param {google.privacy.dlp.v2.InspectTemplate} request.inspectTemplate + * New InspectTemplate value. + * @param {google.protobuf.FieldMask} request.updateMask + * Mask to control which fields get updated. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [InspectTemplate]{@link google.privacy.dlp.v2.InspectTemplate}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + updateInspectTemplate( + request: protosTypes.google.privacy.dlp.v2.IUpdateInspectTemplateRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.privacy.dlp.v2.IInspectTemplate, + | protosTypes.google.privacy.dlp.v2.IUpdateInspectTemplateRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.privacy.dlp.v2.IInspectTemplate, + | protosTypes.google.privacy.dlp.v2.IUpdateInspectTemplateRequest + | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.privacy.dlp.v2.IInspectTemplate, + ( + | protosTypes.google.privacy.dlp.v2.IUpdateInspectTemplateRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + return this._innerApiCalls.updateInspectTemplate( + request, + options, + callback + ); + } + getInspectTemplate( + request: protosTypes.google.privacy.dlp.v2.IGetInspectTemplateRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.privacy.dlp.v2.IInspectTemplate, + protosTypes.google.privacy.dlp.v2.IGetInspectTemplateRequest | undefined, + {} | undefined + ] + >; + getInspectTemplate( + request: protosTypes.google.privacy.dlp.v2.IGetInspectTemplateRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.privacy.dlp.v2.IInspectTemplate, + protosTypes.google.privacy.dlp.v2.IGetInspectTemplateRequest | undefined, + {} | undefined + > + ): void; + /** + * Gets an InspectTemplate. + * See https://cloud.google.com/dlp/docs/creating-templates to learn more. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Resource name of the organization and inspectTemplate to be read, for + * example `organizations/433245324/inspectTemplates/432452342` or + * projects/project-id/inspectTemplates/432452342. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [InspectTemplate]{@link google.privacy.dlp.v2.InspectTemplate}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getInspectTemplate( + request: protosTypes.google.privacy.dlp.v2.IGetInspectTemplateRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.privacy.dlp.v2.IInspectTemplate, + | protosTypes.google.privacy.dlp.v2.IGetInspectTemplateRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.privacy.dlp.v2.IInspectTemplate, + protosTypes.google.privacy.dlp.v2.IGetInspectTemplateRequest | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.privacy.dlp.v2.IInspectTemplate, + protosTypes.google.privacy.dlp.v2.IGetInspectTemplateRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + return this._innerApiCalls.getInspectTemplate(request, options, callback); + } + deleteInspectTemplate( + request: protosTypes.google.privacy.dlp.v2.IDeleteInspectTemplateRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.protobuf.IEmpty, + ( + | protosTypes.google.privacy.dlp.v2.IDeleteInspectTemplateRequest + | undefined + ), + {} | undefined + ] + >; + deleteInspectTemplate( + request: protosTypes.google.privacy.dlp.v2.IDeleteInspectTemplateRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.protobuf.IEmpty, + | protosTypes.google.privacy.dlp.v2.IDeleteInspectTemplateRequest + | undefined, + {} | undefined + > + ): void; + /** + * Deletes an InspectTemplate. + * See https://cloud.google.com/dlp/docs/creating-templates to learn more. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Resource name of the organization and inspectTemplate to be deleted, for + * example `organizations/433245324/inspectTemplates/432452342` or + * projects/project-id/inspectTemplates/432452342. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + deleteInspectTemplate( + request: protosTypes.google.privacy.dlp.v2.IDeleteInspectTemplateRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.protobuf.IEmpty, + | protosTypes.google.privacy.dlp.v2.IDeleteInspectTemplateRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.protobuf.IEmpty, + | protosTypes.google.privacy.dlp.v2.IDeleteInspectTemplateRequest + | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.protobuf.IEmpty, + ( + | protosTypes.google.privacy.dlp.v2.IDeleteInspectTemplateRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + return this._innerApiCalls.deleteInspectTemplate( + request, + options, + callback + ); + } + createDeidentifyTemplate( + request: protosTypes.google.privacy.dlp.v2.ICreateDeidentifyTemplateRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.privacy.dlp.v2.IDeidentifyTemplate, + ( + | protosTypes.google.privacy.dlp.v2.ICreateDeidentifyTemplateRequest + | undefined + ), + {} | undefined + ] + >; + createDeidentifyTemplate( + request: protosTypes.google.privacy.dlp.v2.ICreateDeidentifyTemplateRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.privacy.dlp.v2.IDeidentifyTemplate, + | protosTypes.google.privacy.dlp.v2.ICreateDeidentifyTemplateRequest + | undefined, + {} | undefined + > + ): void; + /** + * 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. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource name, for example projects/my-project-id or + * organizations/my-org-id. + * @param {google.privacy.dlp.v2.DeidentifyTemplate} request.deidentifyTemplate + * Required. The DeidentifyTemplate to create. + * @param {string} request.templateId + * 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. + * @param {string} request.locationId + * The geographic location to store the deidentification template. Reserved + * for future extensions. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [DeidentifyTemplate]{@link google.privacy.dlp.v2.DeidentifyTemplate}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + createDeidentifyTemplate( + request: protosTypes.google.privacy.dlp.v2.ICreateDeidentifyTemplateRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.privacy.dlp.v2.IDeidentifyTemplate, + | protosTypes.google.privacy.dlp.v2.ICreateDeidentifyTemplateRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.privacy.dlp.v2.IDeidentifyTemplate, + | protosTypes.google.privacy.dlp.v2.ICreateDeidentifyTemplateRequest + | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.privacy.dlp.v2.IDeidentifyTemplate, + ( + | protosTypes.google.privacy.dlp.v2.ICreateDeidentifyTemplateRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + return this._innerApiCalls.createDeidentifyTemplate( + request, + options, + callback + ); + } + updateDeidentifyTemplate( + request: protosTypes.google.privacy.dlp.v2.IUpdateDeidentifyTemplateRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.privacy.dlp.v2.IDeidentifyTemplate, + ( + | protosTypes.google.privacy.dlp.v2.IUpdateDeidentifyTemplateRequest + | undefined + ), + {} | undefined + ] + >; + updateDeidentifyTemplate( + request: protosTypes.google.privacy.dlp.v2.IUpdateDeidentifyTemplateRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.privacy.dlp.v2.IDeidentifyTemplate, + | protosTypes.google.privacy.dlp.v2.IUpdateDeidentifyTemplateRequest + | undefined, + {} | undefined + > + ): void; + /** + * Updates the DeidentifyTemplate. + * See https://cloud.google.com/dlp/docs/creating-templates-deid to learn + * more. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Resource name of organization and deidentify template to be updated, for + * example `organizations/433245324/deidentifyTemplates/432452342` or + * projects/project-id/deidentifyTemplates/432452342. + * @param {google.privacy.dlp.v2.DeidentifyTemplate} request.deidentifyTemplate + * New DeidentifyTemplate value. + * @param {google.protobuf.FieldMask} request.updateMask + * Mask to control which fields get updated. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [DeidentifyTemplate]{@link google.privacy.dlp.v2.DeidentifyTemplate}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + updateDeidentifyTemplate( + request: protosTypes.google.privacy.dlp.v2.IUpdateDeidentifyTemplateRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.privacy.dlp.v2.IDeidentifyTemplate, + | protosTypes.google.privacy.dlp.v2.IUpdateDeidentifyTemplateRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.privacy.dlp.v2.IDeidentifyTemplate, + | protosTypes.google.privacy.dlp.v2.IUpdateDeidentifyTemplateRequest + | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.privacy.dlp.v2.IDeidentifyTemplate, + ( + | protosTypes.google.privacy.dlp.v2.IUpdateDeidentifyTemplateRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + return this._innerApiCalls.updateDeidentifyTemplate( + request, + options, + callback + ); + } + getDeidentifyTemplate( + request: protosTypes.google.privacy.dlp.v2.IGetDeidentifyTemplateRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.privacy.dlp.v2.IDeidentifyTemplate, + ( + | protosTypes.google.privacy.dlp.v2.IGetDeidentifyTemplateRequest + | undefined + ), + {} | undefined + ] + >; + getDeidentifyTemplate( + request: protosTypes.google.privacy.dlp.v2.IGetDeidentifyTemplateRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.privacy.dlp.v2.IDeidentifyTemplate, + | protosTypes.google.privacy.dlp.v2.IGetDeidentifyTemplateRequest + | undefined, + {} | undefined + > + ): void; + /** + * Gets a DeidentifyTemplate. + * See https://cloud.google.com/dlp/docs/creating-templates-deid to learn + * more. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Resource name of the organization and deidentify template to be read, for + * example `organizations/433245324/deidentifyTemplates/432452342` or + * projects/project-id/deidentifyTemplates/432452342. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [DeidentifyTemplate]{@link google.privacy.dlp.v2.DeidentifyTemplate}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getDeidentifyTemplate( + request: protosTypes.google.privacy.dlp.v2.IGetDeidentifyTemplateRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.privacy.dlp.v2.IDeidentifyTemplate, + | protosTypes.google.privacy.dlp.v2.IGetDeidentifyTemplateRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.privacy.dlp.v2.IDeidentifyTemplate, + | protosTypes.google.privacy.dlp.v2.IGetDeidentifyTemplateRequest + | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.privacy.dlp.v2.IDeidentifyTemplate, + ( + | protosTypes.google.privacy.dlp.v2.IGetDeidentifyTemplateRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + return this._innerApiCalls.getDeidentifyTemplate( + request, + options, + callback + ); + } + deleteDeidentifyTemplate( + request: protosTypes.google.privacy.dlp.v2.IDeleteDeidentifyTemplateRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.protobuf.IEmpty, + ( + | protosTypes.google.privacy.dlp.v2.IDeleteDeidentifyTemplateRequest + | undefined + ), + {} | undefined + ] + >; + deleteDeidentifyTemplate( + request: protosTypes.google.privacy.dlp.v2.IDeleteDeidentifyTemplateRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.protobuf.IEmpty, + | protosTypes.google.privacy.dlp.v2.IDeleteDeidentifyTemplateRequest + | undefined, + {} | undefined + > + ): void; + /** + * Deletes a DeidentifyTemplate. + * See https://cloud.google.com/dlp/docs/creating-templates-deid to learn + * more. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Resource name of the organization and deidentify template to be deleted, + * for example `organizations/433245324/deidentifyTemplates/432452342` or + * projects/project-id/deidentifyTemplates/432452342. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + deleteDeidentifyTemplate( + request: protosTypes.google.privacy.dlp.v2.IDeleteDeidentifyTemplateRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.protobuf.IEmpty, + | protosTypes.google.privacy.dlp.v2.IDeleteDeidentifyTemplateRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.protobuf.IEmpty, + | protosTypes.google.privacy.dlp.v2.IDeleteDeidentifyTemplateRequest + | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.protobuf.IEmpty, + ( + | protosTypes.google.privacy.dlp.v2.IDeleteDeidentifyTemplateRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + return this._innerApiCalls.deleteDeidentifyTemplate( + request, + options, + callback + ); + } + createJobTrigger( + request: protosTypes.google.privacy.dlp.v2.ICreateJobTriggerRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.privacy.dlp.v2.IJobTrigger, + protosTypes.google.privacy.dlp.v2.ICreateJobTriggerRequest | undefined, + {} | undefined + ] + >; + createJobTrigger( + request: protosTypes.google.privacy.dlp.v2.ICreateJobTriggerRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.privacy.dlp.v2.IJobTrigger, + protosTypes.google.privacy.dlp.v2.ICreateJobTriggerRequest | undefined, + {} | undefined + > + ): void; + /** + * 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. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource name, for example projects/my-project-id. + * @param {google.privacy.dlp.v2.JobTrigger} request.jobTrigger + * Required. The JobTrigger to create. + * @param {string} request.triggerId + * 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. + * @param {string} request.locationId + * The geographic location to store the job trigger. Reserved for + * future extensions. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [JobTrigger]{@link google.privacy.dlp.v2.JobTrigger}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + createJobTrigger( + request: protosTypes.google.privacy.dlp.v2.ICreateJobTriggerRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.privacy.dlp.v2.IJobTrigger, + | protosTypes.google.privacy.dlp.v2.ICreateJobTriggerRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.privacy.dlp.v2.IJobTrigger, + protosTypes.google.privacy.dlp.v2.ICreateJobTriggerRequest | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.privacy.dlp.v2.IJobTrigger, + protosTypes.google.privacy.dlp.v2.ICreateJobTriggerRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + return this._innerApiCalls.createJobTrigger(request, options, callback); + } + updateJobTrigger( + request: protosTypes.google.privacy.dlp.v2.IUpdateJobTriggerRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.privacy.dlp.v2.IJobTrigger, + protosTypes.google.privacy.dlp.v2.IUpdateJobTriggerRequest | undefined, + {} | undefined + ] + >; + updateJobTrigger( + request: protosTypes.google.privacy.dlp.v2.IUpdateJobTriggerRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.privacy.dlp.v2.IJobTrigger, + protosTypes.google.privacy.dlp.v2.IUpdateJobTriggerRequest | undefined, + {} | undefined + > + ): void; + /** + * Updates a job trigger. + * See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Resource name of the project and the triggeredJob, for example + * `projects/dlp-test-project/jobTriggers/53234423`. + * @param {google.privacy.dlp.v2.JobTrigger} request.jobTrigger + * New JobTrigger value. + * @param {google.protobuf.FieldMask} request.updateMask + * Mask to control which fields get updated. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [JobTrigger]{@link google.privacy.dlp.v2.JobTrigger}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + updateJobTrigger( + request: protosTypes.google.privacy.dlp.v2.IUpdateJobTriggerRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.privacy.dlp.v2.IJobTrigger, + | protosTypes.google.privacy.dlp.v2.IUpdateJobTriggerRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.privacy.dlp.v2.IJobTrigger, + protosTypes.google.privacy.dlp.v2.IUpdateJobTriggerRequest | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.privacy.dlp.v2.IJobTrigger, + protosTypes.google.privacy.dlp.v2.IUpdateJobTriggerRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + return this._innerApiCalls.updateJobTrigger(request, options, callback); + } + getJobTrigger( + request: protosTypes.google.privacy.dlp.v2.IGetJobTriggerRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.privacy.dlp.v2.IJobTrigger, + protosTypes.google.privacy.dlp.v2.IGetJobTriggerRequest | undefined, + {} | undefined + ] + >; + getJobTrigger( + request: protosTypes.google.privacy.dlp.v2.IGetJobTriggerRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.privacy.dlp.v2.IJobTrigger, + protosTypes.google.privacy.dlp.v2.IGetJobTriggerRequest | undefined, + {} | undefined + > + ): void; + /** + * Gets a job trigger. + * See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Resource name of the project and the triggeredJob, for example + * `projects/dlp-test-project/jobTriggers/53234423`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [JobTrigger]{@link google.privacy.dlp.v2.JobTrigger}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getJobTrigger( + request: protosTypes.google.privacy.dlp.v2.IGetJobTriggerRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.privacy.dlp.v2.IJobTrigger, + protosTypes.google.privacy.dlp.v2.IGetJobTriggerRequest | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.privacy.dlp.v2.IJobTrigger, + protosTypes.google.privacy.dlp.v2.IGetJobTriggerRequest | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.privacy.dlp.v2.IJobTrigger, + protosTypes.google.privacy.dlp.v2.IGetJobTriggerRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + return this._innerApiCalls.getJobTrigger(request, options, callback); + } + deleteJobTrigger( + request: protosTypes.google.privacy.dlp.v2.IDeleteJobTriggerRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.protobuf.IEmpty, + protosTypes.google.privacy.dlp.v2.IDeleteJobTriggerRequest | undefined, + {} | undefined + ] + >; + deleteJobTrigger( + request: protosTypes.google.privacy.dlp.v2.IDeleteJobTriggerRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.protobuf.IEmpty, + protosTypes.google.privacy.dlp.v2.IDeleteJobTriggerRequest | undefined, + {} | undefined + > + ): void; + /** + * Deletes a job trigger. + * See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Resource name of the project and the triggeredJob, for example + * `projects/dlp-test-project/jobTriggers/53234423`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + deleteJobTrigger( + request: protosTypes.google.privacy.dlp.v2.IDeleteJobTriggerRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.protobuf.IEmpty, + | protosTypes.google.privacy.dlp.v2.IDeleteJobTriggerRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.protobuf.IEmpty, + protosTypes.google.privacy.dlp.v2.IDeleteJobTriggerRequest | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.protobuf.IEmpty, + protosTypes.google.privacy.dlp.v2.IDeleteJobTriggerRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + return this._innerApiCalls.deleteJobTrigger(request, options, callback); + } + activateJobTrigger( + request: protosTypes.google.privacy.dlp.v2.IActivateJobTriggerRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.privacy.dlp.v2.IDlpJob, + protosTypes.google.privacy.dlp.v2.IActivateJobTriggerRequest | undefined, + {} | undefined + ] + >; + activateJobTrigger( + request: protosTypes.google.privacy.dlp.v2.IActivateJobTriggerRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.privacy.dlp.v2.IDlpJob, + protosTypes.google.privacy.dlp.v2.IActivateJobTriggerRequest | undefined, + {} | undefined + > + ): void; + /** + * Activate a job trigger. Causes the immediate execute of a trigger + * instead of waiting on the trigger event to occur. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Resource name of the trigger to activate, for example + * `projects/dlp-test-project/jobTriggers/53234423`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [DlpJob]{@link google.privacy.dlp.v2.DlpJob}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + activateJobTrigger( + request: protosTypes.google.privacy.dlp.v2.IActivateJobTriggerRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.privacy.dlp.v2.IDlpJob, + | protosTypes.google.privacy.dlp.v2.IActivateJobTriggerRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.privacy.dlp.v2.IDlpJob, + protosTypes.google.privacy.dlp.v2.IActivateJobTriggerRequest | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.privacy.dlp.v2.IDlpJob, + protosTypes.google.privacy.dlp.v2.IActivateJobTriggerRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + return this._innerApiCalls.activateJobTrigger(request, options, callback); + } + createDlpJob( + request: protosTypes.google.privacy.dlp.v2.ICreateDlpJobRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.privacy.dlp.v2.IDlpJob, + protosTypes.google.privacy.dlp.v2.ICreateDlpJobRequest | undefined, + {} | undefined + ] + >; + createDlpJob( + request: protosTypes.google.privacy.dlp.v2.ICreateDlpJobRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.privacy.dlp.v2.IDlpJob, + protosTypes.google.privacy.dlp.v2.ICreateDlpJobRequest | undefined, + {} | undefined + > + ): void; + /** + * 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. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource name, for example projects/my-project-id. + * @param {google.privacy.dlp.v2.InspectJobConfig} request.inspectJob + * Set to control what and how to inspect. + * @param {google.privacy.dlp.v2.RiskAnalysisJobConfig} request.riskJob + * Set to choose what metric to calculate. + * @param {string} request.jobId + * 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. + * @param {string} request.locationId + * The geographic location to store and process the job. Reserved for + * future extensions. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [DlpJob]{@link google.privacy.dlp.v2.DlpJob}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + createDlpJob( + request: protosTypes.google.privacy.dlp.v2.ICreateDlpJobRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.privacy.dlp.v2.IDlpJob, + protosTypes.google.privacy.dlp.v2.ICreateDlpJobRequest | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.privacy.dlp.v2.IDlpJob, + protosTypes.google.privacy.dlp.v2.ICreateDlpJobRequest | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.privacy.dlp.v2.IDlpJob, + protosTypes.google.privacy.dlp.v2.ICreateDlpJobRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + return this._innerApiCalls.createDlpJob(request, options, callback); + } + getDlpJob( + request: protosTypes.google.privacy.dlp.v2.IGetDlpJobRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.privacy.dlp.v2.IDlpJob, + protosTypes.google.privacy.dlp.v2.IGetDlpJobRequest | undefined, + {} | undefined + ] + >; + getDlpJob( + request: protosTypes.google.privacy.dlp.v2.IGetDlpJobRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.privacy.dlp.v2.IDlpJob, + protosTypes.google.privacy.dlp.v2.IGetDlpJobRequest | undefined, + {} | undefined + > + ): void; + /** + * 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. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the DlpJob resource. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [DlpJob]{@link google.privacy.dlp.v2.DlpJob}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getDlpJob( + request: protosTypes.google.privacy.dlp.v2.IGetDlpJobRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.privacy.dlp.v2.IDlpJob, + protosTypes.google.privacy.dlp.v2.IGetDlpJobRequest | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.privacy.dlp.v2.IDlpJob, + protosTypes.google.privacy.dlp.v2.IGetDlpJobRequest | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.privacy.dlp.v2.IDlpJob, + protosTypes.google.privacy.dlp.v2.IGetDlpJobRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + return this._innerApiCalls.getDlpJob(request, options, callback); + } + deleteDlpJob( + request: protosTypes.google.privacy.dlp.v2.IDeleteDlpJobRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.protobuf.IEmpty, + protosTypes.google.privacy.dlp.v2.IDeleteDlpJobRequest | undefined, + {} | undefined + ] + >; + deleteDlpJob( + request: protosTypes.google.privacy.dlp.v2.IDeleteDlpJobRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.protobuf.IEmpty, + protosTypes.google.privacy.dlp.v2.IDeleteDlpJobRequest | undefined, + {} | undefined + > + ): void; + /** + * 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. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the DlpJob resource to be deleted. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + deleteDlpJob( + request: protosTypes.google.privacy.dlp.v2.IDeleteDlpJobRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.protobuf.IEmpty, + protosTypes.google.privacy.dlp.v2.IDeleteDlpJobRequest | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.protobuf.IEmpty, + protosTypes.google.privacy.dlp.v2.IDeleteDlpJobRequest | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.protobuf.IEmpty, + protosTypes.google.privacy.dlp.v2.IDeleteDlpJobRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + return this._innerApiCalls.deleteDlpJob(request, options, callback); + } + cancelDlpJob( + request: protosTypes.google.privacy.dlp.v2.ICancelDlpJobRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.protobuf.IEmpty, + protosTypes.google.privacy.dlp.v2.ICancelDlpJobRequest | undefined, + {} | undefined + ] + >; + cancelDlpJob( + request: protosTypes.google.privacy.dlp.v2.ICancelDlpJobRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.protobuf.IEmpty, + protosTypes.google.privacy.dlp.v2.ICancelDlpJobRequest | undefined, + {} | undefined + > + ): void; + /** + * 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. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the DlpJob resource to be cancelled. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + cancelDlpJob( + request: protosTypes.google.privacy.dlp.v2.ICancelDlpJobRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.protobuf.IEmpty, + protosTypes.google.privacy.dlp.v2.ICancelDlpJobRequest | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.protobuf.IEmpty, + protosTypes.google.privacy.dlp.v2.ICancelDlpJobRequest | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.protobuf.IEmpty, + protosTypes.google.privacy.dlp.v2.ICancelDlpJobRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + return this._innerApiCalls.cancelDlpJob(request, options, callback); + } + createStoredInfoType( + request: protosTypes.google.privacy.dlp.v2.ICreateStoredInfoTypeRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.privacy.dlp.v2.IStoredInfoType, + ( + | protosTypes.google.privacy.dlp.v2.ICreateStoredInfoTypeRequest + | undefined + ), + {} | undefined + ] + >; + createStoredInfoType( + request: protosTypes.google.privacy.dlp.v2.ICreateStoredInfoTypeRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.privacy.dlp.v2.IStoredInfoType, + | protosTypes.google.privacy.dlp.v2.ICreateStoredInfoTypeRequest + | undefined, + {} | undefined + > + ): void; + /** + * Creates a pre-built stored infoType to be used for inspection. + * See https://cloud.google.com/dlp/docs/creating-stored-infotypes to + * learn more. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource name, for example projects/my-project-id or + * organizations/my-org-id. + * @param {google.privacy.dlp.v2.StoredInfoTypeConfig} request.config + * Required. Configuration of the storedInfoType to create. + * @param {string} request.storedInfoTypeId + * 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. + * @param {string} request.locationId + * The geographic location to store the stored infoType. Reserved for + * future extensions. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [StoredInfoType]{@link google.privacy.dlp.v2.StoredInfoType}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + createStoredInfoType( + request: protosTypes.google.privacy.dlp.v2.ICreateStoredInfoTypeRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.privacy.dlp.v2.IStoredInfoType, + | protosTypes.google.privacy.dlp.v2.ICreateStoredInfoTypeRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.privacy.dlp.v2.IStoredInfoType, + | protosTypes.google.privacy.dlp.v2.ICreateStoredInfoTypeRequest + | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.privacy.dlp.v2.IStoredInfoType, + ( + | protosTypes.google.privacy.dlp.v2.ICreateStoredInfoTypeRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + return this._innerApiCalls.createStoredInfoType(request, options, callback); + } + updateStoredInfoType( + request: protosTypes.google.privacy.dlp.v2.IUpdateStoredInfoTypeRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.privacy.dlp.v2.IStoredInfoType, + ( + | protosTypes.google.privacy.dlp.v2.IUpdateStoredInfoTypeRequest + | undefined + ), + {} | undefined + ] + >; + updateStoredInfoType( + request: protosTypes.google.privacy.dlp.v2.IUpdateStoredInfoTypeRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.privacy.dlp.v2.IStoredInfoType, + | protosTypes.google.privacy.dlp.v2.IUpdateStoredInfoTypeRequest + | undefined, + {} | undefined + > + ): void; + /** + * 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. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Resource name of organization and storedInfoType to be updated, for + * example `organizations/433245324/storedInfoTypes/432452342` or + * projects/project-id/storedInfoTypes/432452342. + * @param {google.privacy.dlp.v2.StoredInfoTypeConfig} request.config + * Updated configuration for the storedInfoType. If not provided, a new + * version of the storedInfoType will be created with the existing + * configuration. + * @param {google.protobuf.FieldMask} request.updateMask + * Mask to control which fields get updated. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [StoredInfoType]{@link google.privacy.dlp.v2.StoredInfoType}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + updateStoredInfoType( + request: protosTypes.google.privacy.dlp.v2.IUpdateStoredInfoTypeRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.privacy.dlp.v2.IStoredInfoType, + | protosTypes.google.privacy.dlp.v2.IUpdateStoredInfoTypeRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.privacy.dlp.v2.IStoredInfoType, + | protosTypes.google.privacy.dlp.v2.IUpdateStoredInfoTypeRequest + | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.privacy.dlp.v2.IStoredInfoType, + ( + | protosTypes.google.privacy.dlp.v2.IUpdateStoredInfoTypeRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + return this._innerApiCalls.updateStoredInfoType(request, options, callback); + } + getStoredInfoType( + request: protosTypes.google.privacy.dlp.v2.IGetStoredInfoTypeRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.privacy.dlp.v2.IStoredInfoType, + protosTypes.google.privacy.dlp.v2.IGetStoredInfoTypeRequest | undefined, + {} | undefined + ] + >; + getStoredInfoType( + request: protosTypes.google.privacy.dlp.v2.IGetStoredInfoTypeRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.privacy.dlp.v2.IStoredInfoType, + protosTypes.google.privacy.dlp.v2.IGetStoredInfoTypeRequest | undefined, + {} | undefined + > + ): void; + /** + * Gets a stored infoType. + * See https://cloud.google.com/dlp/docs/creating-stored-infotypes to + * learn more. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Resource name of the organization and storedInfoType to be read, for + * example `organizations/433245324/storedInfoTypes/432452342` or + * projects/project-id/storedInfoTypes/432452342. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [StoredInfoType]{@link google.privacy.dlp.v2.StoredInfoType}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getStoredInfoType( + request: protosTypes.google.privacy.dlp.v2.IGetStoredInfoTypeRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.privacy.dlp.v2.IStoredInfoType, + | protosTypes.google.privacy.dlp.v2.IGetStoredInfoTypeRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.privacy.dlp.v2.IStoredInfoType, + protosTypes.google.privacy.dlp.v2.IGetStoredInfoTypeRequest | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.privacy.dlp.v2.IStoredInfoType, + protosTypes.google.privacy.dlp.v2.IGetStoredInfoTypeRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + return this._innerApiCalls.getStoredInfoType(request, options, callback); + } + deleteStoredInfoType( + request: protosTypes.google.privacy.dlp.v2.IDeleteStoredInfoTypeRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.protobuf.IEmpty, + ( + | protosTypes.google.privacy.dlp.v2.IDeleteStoredInfoTypeRequest + | undefined + ), + {} | undefined + ] + >; + deleteStoredInfoType( + request: protosTypes.google.privacy.dlp.v2.IDeleteStoredInfoTypeRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.protobuf.IEmpty, + | protosTypes.google.privacy.dlp.v2.IDeleteStoredInfoTypeRequest + | undefined, + {} | undefined + > + ): void; + /** + * Deletes a stored infoType. + * See https://cloud.google.com/dlp/docs/creating-stored-infotypes to + * learn more. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Resource name of the organization and storedInfoType to be deleted, for + * example `organizations/433245324/storedInfoTypes/432452342` or + * projects/project-id/storedInfoTypes/432452342. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + deleteStoredInfoType( + request: protosTypes.google.privacy.dlp.v2.IDeleteStoredInfoTypeRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.protobuf.IEmpty, + | protosTypes.google.privacy.dlp.v2.IDeleteStoredInfoTypeRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.protobuf.IEmpty, + | protosTypes.google.privacy.dlp.v2.IDeleteStoredInfoTypeRequest + | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.protobuf.IEmpty, + ( + | protosTypes.google.privacy.dlp.v2.IDeleteStoredInfoTypeRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + return this._innerApiCalls.deleteStoredInfoType(request, options, callback); + } + + listInspectTemplates( + request: protosTypes.google.privacy.dlp.v2.IListInspectTemplatesRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.privacy.dlp.v2.IInspectTemplate[], + protosTypes.google.privacy.dlp.v2.IListInspectTemplatesRequest | null, + protosTypes.google.privacy.dlp.v2.IListInspectTemplatesResponse + ] + >; + listInspectTemplates( + request: protosTypes.google.privacy.dlp.v2.IListInspectTemplatesRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.privacy.dlp.v2.IInspectTemplate[], + protosTypes.google.privacy.dlp.v2.IListInspectTemplatesRequest | null, + protosTypes.google.privacy.dlp.v2.IListInspectTemplatesResponse + > + ): void; + /** + * Lists InspectTemplates. + * See https://cloud.google.com/dlp/docs/creating-templates to learn more. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource name, for example projects/my-project-id or + * organizations/my-org-id. + * @param {string} request.pageToken + * Page token to continue retrieval. Comes from previous call + * to `ListInspectTemplates`. + * @param {number} request.pageSize + * Size of the page, can be limited by server. If zero server returns + * a page of max size 100. + * @param {string} request.orderBy + * 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. + * @param {string} request.locationId + * The geographic location where inspection templates will be retrieved from. + * Use `-` for all locations. Reserved for future extensions. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [InspectTemplate]{@link google.privacy.dlp.v2.InspectTemplate}. + * The client library support auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * + * When autoPaginate: false is specified through options, the array has three elements. + * The first element is Array of [InspectTemplate]{@link google.privacy.dlp.v2.InspectTemplate} that corresponds to + * the one page received from the API server. + * If the second element is not null it contains the request object of type [ListInspectTemplatesRequest]{@link google.privacy.dlp.v2.ListInspectTemplatesRequest} + * that can be used to obtain the next page of the results. + * If it is null, the next page does not exist. + * The third element contains the raw response received from the API server. Its type is + * [ListInspectTemplatesResponse]{@link google.privacy.dlp.v2.ListInspectTemplatesResponse}. + * + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + listInspectTemplates( + request: protosTypes.google.privacy.dlp.v2.IListInspectTemplatesRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.privacy.dlp.v2.IInspectTemplate[], + protosTypes.google.privacy.dlp.v2.IListInspectTemplatesRequest | null, + protosTypes.google.privacy.dlp.v2.IListInspectTemplatesResponse + >, + callback?: Callback< + protosTypes.google.privacy.dlp.v2.IInspectTemplate[], + protosTypes.google.privacy.dlp.v2.IListInspectTemplatesRequest | null, + protosTypes.google.privacy.dlp.v2.IListInspectTemplatesResponse + > + ): Promise< + [ + protosTypes.google.privacy.dlp.v2.IInspectTemplate[], + protosTypes.google.privacy.dlp.v2.IListInspectTemplatesRequest | null, + protosTypes.google.privacy.dlp.v2.IListInspectTemplatesResponse + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + return this._innerApiCalls.listInspectTemplates(request, options, callback); + } + + /** + * Equivalent to {@link listInspectTemplates}, but returns a NodeJS Stream object. + * + * This fetches the paged responses for {@link 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. + * + * @see {@link https://nodejs.org/api/stream.html} + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource name, for example projects/my-project-id or + * organizations/my-org-id. + * @param {string} request.pageToken + * Page token to continue retrieval. Comes from previous call + * to `ListInspectTemplates`. + * @param {number} request.pageSize + * Size of the page, can be limited by server. If zero server returns + * a page of max size 100. + * @param {string} request.orderBy + * 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. + * @param {string} request.locationId + * The geographic location where inspection templates will be retrieved from. + * Use `-` for all locations. Reserved for future extensions. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [InspectTemplate]{@link google.privacy.dlp.v2.InspectTemplate} on 'data' event. + */ + listInspectTemplatesStream( + request?: protosTypes.google.privacy.dlp.v2.IListInspectTemplatesRequest, + options?: gax.CallOptions | {} + ): Transform { + request = request || {}; + const callSettings = new gax.CallSettings(options); + return this._descriptors.page.listInspectTemplates.createStream( + this._innerApiCalls.listInspectTemplates as gax.GaxCall, + request, + callSettings + ); + } + listDeidentifyTemplates( + request: protosTypes.google.privacy.dlp.v2.IListDeidentifyTemplatesRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.privacy.dlp.v2.IDeidentifyTemplate[], + protosTypes.google.privacy.dlp.v2.IListDeidentifyTemplatesRequest | null, + protosTypes.google.privacy.dlp.v2.IListDeidentifyTemplatesResponse + ] + >; + listDeidentifyTemplates( + request: protosTypes.google.privacy.dlp.v2.IListDeidentifyTemplatesRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.privacy.dlp.v2.IDeidentifyTemplate[], + protosTypes.google.privacy.dlp.v2.IListDeidentifyTemplatesRequest | null, + protosTypes.google.privacy.dlp.v2.IListDeidentifyTemplatesResponse + > + ): void; + /** + * Lists DeidentifyTemplates. + * See https://cloud.google.com/dlp/docs/creating-templates-deid to learn + * more. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource name, for example projects/my-project-id or + * organizations/my-org-id. + * @param {string} request.pageToken + * Page token to continue retrieval. Comes from previous call + * to `ListDeidentifyTemplates`. + * @param {number} request.pageSize + * Size of the page, can be limited by server. If zero server returns + * a page of max size 100. + * @param {string} request.orderBy + * 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. + * @param {string} request.locationId + * The geographic location where deidentifications templates will be retrieved + * from. Use `-` for all locations. Reserved for future extensions. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [DeidentifyTemplate]{@link google.privacy.dlp.v2.DeidentifyTemplate}. + * The client library support auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * + * When autoPaginate: false is specified through options, the array has three elements. + * The first element is Array of [DeidentifyTemplate]{@link google.privacy.dlp.v2.DeidentifyTemplate} that corresponds to + * the one page received from the API server. + * If the second element is not null it contains the request object of type [ListDeidentifyTemplatesRequest]{@link google.privacy.dlp.v2.ListDeidentifyTemplatesRequest} + * that can be used to obtain the next page of the results. + * If it is null, the next page does not exist. + * The third element contains the raw response received from the API server. Its type is + * [ListDeidentifyTemplatesResponse]{@link google.privacy.dlp.v2.ListDeidentifyTemplatesResponse}. + * + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + listDeidentifyTemplates( + request: protosTypes.google.privacy.dlp.v2.IListDeidentifyTemplatesRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.privacy.dlp.v2.IDeidentifyTemplate[], + protosTypes.google.privacy.dlp.v2.IListDeidentifyTemplatesRequest | null, + protosTypes.google.privacy.dlp.v2.IListDeidentifyTemplatesResponse + >, + callback?: Callback< + protosTypes.google.privacy.dlp.v2.IDeidentifyTemplate[], + protosTypes.google.privacy.dlp.v2.IListDeidentifyTemplatesRequest | null, + protosTypes.google.privacy.dlp.v2.IListDeidentifyTemplatesResponse + > + ): Promise< + [ + protosTypes.google.privacy.dlp.v2.IDeidentifyTemplate[], + protosTypes.google.privacy.dlp.v2.IListDeidentifyTemplatesRequest | null, + protosTypes.google.privacy.dlp.v2.IListDeidentifyTemplatesResponse + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + return this._innerApiCalls.listDeidentifyTemplates( + request, + options, + callback + ); + } + + /** + * Equivalent to {@link listDeidentifyTemplates}, but returns a NodeJS Stream object. + * + * This fetches the paged responses for {@link 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. + * + * @see {@link https://nodejs.org/api/stream.html} + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource name, for example projects/my-project-id or + * organizations/my-org-id. + * @param {string} request.pageToken + * Page token to continue retrieval. Comes from previous call + * to `ListDeidentifyTemplates`. + * @param {number} request.pageSize + * Size of the page, can be limited by server. If zero server returns + * a page of max size 100. + * @param {string} request.orderBy + * 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. + * @param {string} request.locationId + * The geographic location where deidentifications templates will be retrieved + * from. Use `-` for all locations. Reserved for future extensions. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [DeidentifyTemplate]{@link google.privacy.dlp.v2.DeidentifyTemplate} on 'data' event. + */ + listDeidentifyTemplatesStream( + request?: protosTypes.google.privacy.dlp.v2.IListDeidentifyTemplatesRequest, + options?: gax.CallOptions | {} + ): Transform { + request = request || {}; + const callSettings = new gax.CallSettings(options); + return this._descriptors.page.listDeidentifyTemplates.createStream( + this._innerApiCalls.listDeidentifyTemplates as gax.GaxCall, + request, + callSettings + ); + } + listJobTriggers( + request: protosTypes.google.privacy.dlp.v2.IListJobTriggersRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.privacy.dlp.v2.IJobTrigger[], + protosTypes.google.privacy.dlp.v2.IListJobTriggersRequest | null, + protosTypes.google.privacy.dlp.v2.IListJobTriggersResponse + ] + >; + listJobTriggers( + request: protosTypes.google.privacy.dlp.v2.IListJobTriggersRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.privacy.dlp.v2.IJobTrigger[], + protosTypes.google.privacy.dlp.v2.IListJobTriggersRequest | null, + protosTypes.google.privacy.dlp.v2.IListJobTriggersResponse + > + ): void; + /** + * Lists job triggers. + * See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource name, for example `projects/my-project-id`. + * @param {string} request.pageToken + * Page token to continue retrieval. Comes from previous call + * to ListJobTriggers. `order_by` field must not + * change for subsequent calls. + * @param {number} request.pageSize + * Size of the page, can be limited by a server. + * @param {string} request.orderBy + * 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. + * @param {string} request.filter + * 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. + * @param {string} request.locationId + * The geographic location where job triggers will be retrieved from. + * Use `-` for all locations. Reserved for future extensions. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [JobTrigger]{@link google.privacy.dlp.v2.JobTrigger}. + * The client library support auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * + * When autoPaginate: false is specified through options, the array has three elements. + * The first element is Array of [JobTrigger]{@link google.privacy.dlp.v2.JobTrigger} that corresponds to + * the one page received from the API server. + * If the second element is not null it contains the request object of type [ListJobTriggersRequest]{@link google.privacy.dlp.v2.ListJobTriggersRequest} + * that can be used to obtain the next page of the results. + * If it is null, the next page does not exist. + * The third element contains the raw response received from the API server. Its type is + * [ListJobTriggersResponse]{@link google.privacy.dlp.v2.ListJobTriggersResponse}. + * + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + listJobTriggers( + request: protosTypes.google.privacy.dlp.v2.IListJobTriggersRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.privacy.dlp.v2.IJobTrigger[], + protosTypes.google.privacy.dlp.v2.IListJobTriggersRequest | null, + protosTypes.google.privacy.dlp.v2.IListJobTriggersResponse + >, + callback?: Callback< + protosTypes.google.privacy.dlp.v2.IJobTrigger[], + protosTypes.google.privacy.dlp.v2.IListJobTriggersRequest | null, + protosTypes.google.privacy.dlp.v2.IListJobTriggersResponse + > + ): Promise< + [ + protosTypes.google.privacy.dlp.v2.IJobTrigger[], + protosTypes.google.privacy.dlp.v2.IListJobTriggersRequest | null, + protosTypes.google.privacy.dlp.v2.IListJobTriggersResponse + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + return this._innerApiCalls.listJobTriggers(request, options, callback); + } + + /** + * Equivalent to {@link listJobTriggers}, but returns a NodeJS Stream object. + * + * This fetches the paged responses for {@link 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. + * + * @see {@link https://nodejs.org/api/stream.html} + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource name, for example `projects/my-project-id`. + * @param {string} request.pageToken + * Page token to continue retrieval. Comes from previous call + * to ListJobTriggers. `order_by` field must not + * change for subsequent calls. + * @param {number} request.pageSize + * Size of the page, can be limited by a server. + * @param {string} request.orderBy + * 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. + * @param {string} request.filter + * 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. + * @param {string} request.locationId + * The geographic location where job triggers will be retrieved from. + * Use `-` for all locations. Reserved for future extensions. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [JobTrigger]{@link google.privacy.dlp.v2.JobTrigger} on 'data' event. + */ + listJobTriggersStream( + request?: protosTypes.google.privacy.dlp.v2.IListJobTriggersRequest, + options?: gax.CallOptions | {} + ): Transform { + request = request || {}; + const callSettings = new gax.CallSettings(options); + return this._descriptors.page.listJobTriggers.createStream( + this._innerApiCalls.listJobTriggers as gax.GaxCall, + request, + callSettings + ); + } + listDlpJobs( + request: protosTypes.google.privacy.dlp.v2.IListDlpJobsRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.privacy.dlp.v2.IDlpJob[], + protosTypes.google.privacy.dlp.v2.IListDlpJobsRequest | null, + protosTypes.google.privacy.dlp.v2.IListDlpJobsResponse + ] + >; + listDlpJobs( + request: protosTypes.google.privacy.dlp.v2.IListDlpJobsRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.privacy.dlp.v2.IDlpJob[], + protosTypes.google.privacy.dlp.v2.IListDlpJobsRequest | null, + protosTypes.google.privacy.dlp.v2.IListDlpJobsResponse + > + ): void; + /** + * 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. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource name, for example projects/my-project-id. + * @param {string} request.filter + * 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. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * @param {google.privacy.dlp.v2.DlpJobType} request.type + * The type of job. Defaults to `DlpJobType.INSPECT` + * @param {string} request.orderBy + * 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` + * @param {string} request.locationId + * The geographic location where jobs will be retrieved from. + * Use `-` for all locations. Reserved for future extensions. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [DlpJob]{@link google.privacy.dlp.v2.DlpJob}. + * The client library support auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * + * When autoPaginate: false is specified through options, the array has three elements. + * The first element is Array of [DlpJob]{@link google.privacy.dlp.v2.DlpJob} that corresponds to + * the one page received from the API server. + * If the second element is not null it contains the request object of type [ListDlpJobsRequest]{@link google.privacy.dlp.v2.ListDlpJobsRequest} + * that can be used to obtain the next page of the results. + * If it is null, the next page does not exist. + * The third element contains the raw response received from the API server. Its type is + * [ListDlpJobsResponse]{@link google.privacy.dlp.v2.ListDlpJobsResponse}. + * + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + listDlpJobs( + request: protosTypes.google.privacy.dlp.v2.IListDlpJobsRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.privacy.dlp.v2.IDlpJob[], + protosTypes.google.privacy.dlp.v2.IListDlpJobsRequest | null, + protosTypes.google.privacy.dlp.v2.IListDlpJobsResponse + >, + callback?: Callback< + protosTypes.google.privacy.dlp.v2.IDlpJob[], + protosTypes.google.privacy.dlp.v2.IListDlpJobsRequest | null, + protosTypes.google.privacy.dlp.v2.IListDlpJobsResponse + > + ): Promise< + [ + protosTypes.google.privacy.dlp.v2.IDlpJob[], + protosTypes.google.privacy.dlp.v2.IListDlpJobsRequest | null, + protosTypes.google.privacy.dlp.v2.IListDlpJobsResponse + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + return this._innerApiCalls.listDlpJobs(request, options, callback); + } + + /** + * Equivalent to {@link listDlpJobs}, but returns a NodeJS Stream object. + * + * This fetches the paged responses for {@link 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. + * + * @see {@link https://nodejs.org/api/stream.html} + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource name, for example projects/my-project-id. + * @param {string} request.filter + * 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. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * @param {google.privacy.dlp.v2.DlpJobType} request.type + * The type of job. Defaults to `DlpJobType.INSPECT` + * @param {string} request.orderBy + * 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` + * @param {string} request.locationId + * The geographic location where jobs will be retrieved from. + * Use `-` for all locations. Reserved for future extensions. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [DlpJob]{@link google.privacy.dlp.v2.DlpJob} on 'data' event. + */ + listDlpJobsStream( + request?: protosTypes.google.privacy.dlp.v2.IListDlpJobsRequest, + options?: gax.CallOptions | {} + ): Transform { + request = request || {}; + const callSettings = new gax.CallSettings(options); + return this._descriptors.page.listDlpJobs.createStream( + this._innerApiCalls.listDlpJobs as gax.GaxCall, + request, + callSettings + ); + } + listStoredInfoTypes( + request: protosTypes.google.privacy.dlp.v2.IListStoredInfoTypesRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.privacy.dlp.v2.IStoredInfoType[], + protosTypes.google.privacy.dlp.v2.IListStoredInfoTypesRequest | null, + protosTypes.google.privacy.dlp.v2.IListStoredInfoTypesResponse + ] + >; + listStoredInfoTypes( + request: protosTypes.google.privacy.dlp.v2.IListStoredInfoTypesRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.privacy.dlp.v2.IStoredInfoType[], + protosTypes.google.privacy.dlp.v2.IListStoredInfoTypesRequest | null, + protosTypes.google.privacy.dlp.v2.IListStoredInfoTypesResponse + > + ): void; + /** + * Lists stored infoTypes. + * See https://cloud.google.com/dlp/docs/creating-stored-infotypes to + * learn more. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource name, for example projects/my-project-id or + * organizations/my-org-id. + * @param {string} request.pageToken + * Page token to continue retrieval. Comes from previous call + * to `ListStoredInfoTypes`. + * @param {number} request.pageSize + * Size of the page, can be limited by server. If zero server returns + * a page of max size 100. + * @param {string} request.orderBy + * 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. + * @param {string} request.locationId + * The geographic location where stored infoTypes will be retrieved from. + * Use `-` for all locations. Reserved for future extensions. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [StoredInfoType]{@link google.privacy.dlp.v2.StoredInfoType}. + * The client library support auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * + * When autoPaginate: false is specified through options, the array has three elements. + * The first element is Array of [StoredInfoType]{@link google.privacy.dlp.v2.StoredInfoType} that corresponds to + * the one page received from the API server. + * If the second element is not null it contains the request object of type [ListStoredInfoTypesRequest]{@link google.privacy.dlp.v2.ListStoredInfoTypesRequest} + * that can be used to obtain the next page of the results. + * If it is null, the next page does not exist. + * The third element contains the raw response received from the API server. Its type is + * [ListStoredInfoTypesResponse]{@link google.privacy.dlp.v2.ListStoredInfoTypesResponse}. + * + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + listStoredInfoTypes( + request: protosTypes.google.privacy.dlp.v2.IListStoredInfoTypesRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.privacy.dlp.v2.IStoredInfoType[], + protosTypes.google.privacy.dlp.v2.IListStoredInfoTypesRequest | null, + protosTypes.google.privacy.dlp.v2.IListStoredInfoTypesResponse + >, + callback?: Callback< + protosTypes.google.privacy.dlp.v2.IStoredInfoType[], + protosTypes.google.privacy.dlp.v2.IListStoredInfoTypesRequest | null, + protosTypes.google.privacy.dlp.v2.IListStoredInfoTypesResponse + > + ): Promise< + [ + protosTypes.google.privacy.dlp.v2.IStoredInfoType[], + protosTypes.google.privacy.dlp.v2.IListStoredInfoTypesRequest | null, + protosTypes.google.privacy.dlp.v2.IListStoredInfoTypesResponse + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + return this._innerApiCalls.listStoredInfoTypes(request, options, callback); + } + + /** + * Equivalent to {@link listStoredInfoTypes}, but returns a NodeJS Stream object. + * + * This fetches the paged responses for {@link 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. + * + * @see {@link https://nodejs.org/api/stream.html} + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource name, for example projects/my-project-id or + * organizations/my-org-id. + * @param {string} request.pageToken + * Page token to continue retrieval. Comes from previous call + * to `ListStoredInfoTypes`. + * @param {number} request.pageSize + * Size of the page, can be limited by server. If zero server returns + * a page of max size 100. + * @param {string} request.orderBy + * 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. + * @param {string} request.locationId + * The geographic location where stored infoTypes will be retrieved from. + * Use `-` for all locations. Reserved for future extensions. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [StoredInfoType]{@link google.privacy.dlp.v2.StoredInfoType} on 'data' event. + */ + listStoredInfoTypesStream( + request?: protosTypes.google.privacy.dlp.v2.IListStoredInfoTypesRequest, + options?: gax.CallOptions | {} + ): Transform { + request = request || {}; + const callSettings = new gax.CallSettings(options); + return this._descriptors.page.listStoredInfoTypes.createStream( + this._innerApiCalls.listStoredInfoTypes as gax.GaxCall, + request, + callSettings + ); + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified project resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectPath(project: string) { + return this._pathTemplates.projectPathTemplate.render({ + project, + }); + } + + /** + * Parse the project from Project resource. + * + * @param {string} projectName + * A fully-qualified path representing Project resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectName(projectName: string) { + return this._pathTemplates.projectPathTemplate.match(projectName).project; + } + + /** + * Return a fully-qualified organization resource name string. + * + * @param {string} organization + * @returns {string} Resource name string. + */ + organizationPath(organization: string) { + return this._pathTemplates.organizationPathTemplate.render({ + organization, + }); + } + + /** + * Parse the organization from Organization resource. + * + * @param {string} organizationName + * A fully-qualified path representing Organization resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationName(organizationName: string) { + return this._pathTemplates.organizationPathTemplate.match(organizationName) + .organization; + } + + /** + * Return a fully-qualified organizationInspectTemplate resource name string. + * + * @param {string} organization + * @param {string} inspect_template + * @returns {string} Resource name string. + */ + organizationInspectTemplatePath( + organization: string, + inspectTemplate: string + ) { + return this._pathTemplates.organizationInspectTemplatePathTemplate.render({ + organization, + inspect_template: inspectTemplate, + }); + } + + /** + * Parse the organization from OrganizationInspectTemplate resource. + * + * @param {string} organizationInspectTemplateName + * A fully-qualified path representing organization_inspect_template resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationInspectTemplateName( + organizationInspectTemplateName: string + ) { + return this._pathTemplates.organizationInspectTemplatePathTemplate.match( + organizationInspectTemplateName + ).organization; + } + + /** + * Parse the inspect_template from OrganizationInspectTemplate resource. + * + * @param {string} organizationInspectTemplateName + * A fully-qualified path representing organization_inspect_template resource. + * @returns {string} A string representing the inspect_template. + */ + matchInspectTemplateFromOrganizationInspectTemplateName( + organizationInspectTemplateName: string + ) { + return this._pathTemplates.organizationInspectTemplatePathTemplate.match( + organizationInspectTemplateName + ).inspect_template; + } + + /** + * Return a fully-qualified projectInspectTemplate resource name string. + * + * @param {string} project + * @param {string} inspect_template + * @returns {string} Resource name string. + */ + projectInspectTemplatePath(project: string, inspectTemplate: string) { + return this._pathTemplates.projectInspectTemplatePathTemplate.render({ + project, + inspect_template: inspectTemplate, + }); + } + + /** + * Parse the project from ProjectInspectTemplate resource. + * + * @param {string} projectInspectTemplateName + * A fully-qualified path representing project_inspect_template resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectInspectTemplateName( + projectInspectTemplateName: string + ) { + return this._pathTemplates.projectInspectTemplatePathTemplate.match( + projectInspectTemplateName + ).project; + } + + /** + * Parse the inspect_template from ProjectInspectTemplate resource. + * + * @param {string} projectInspectTemplateName + * A fully-qualified path representing project_inspect_template resource. + * @returns {string} A string representing the inspect_template. + */ + matchInspectTemplateFromProjectInspectTemplateName( + projectInspectTemplateName: string + ) { + return this._pathTemplates.projectInspectTemplatePathTemplate.match( + projectInspectTemplateName + ).inspect_template; + } + + /** + * Return a fully-qualified jobTrigger resource name string. + * + * @param {string} project + * @param {string} job_trigger + * @returns {string} Resource name string. + */ + jobTriggerPath(project: string, jobTrigger: string) { + return this._pathTemplates.jobTriggerPathTemplate.render({ + project, + job_trigger: jobTrigger, + }); + } + + /** + * Parse the project from JobTrigger resource. + * + * @param {string} jobTriggerName + * A fully-qualified path representing JobTrigger resource. + * @returns {string} A string representing the project. + */ + matchProjectFromJobTriggerName(jobTriggerName: string) { + return this._pathTemplates.jobTriggerPathTemplate.match(jobTriggerName) + .project; + } + + /** + * Parse the job_trigger from JobTrigger resource. + * + * @param {string} jobTriggerName + * A fully-qualified path representing JobTrigger resource. + * @returns {string} A string representing the job_trigger. + */ + matchJobTriggerFromJobTriggerName(jobTriggerName: string) { + return this._pathTemplates.jobTriggerPathTemplate.match(jobTriggerName) + .job_trigger; + } + + /** + * Return a fully-qualified dlpJob resource name string. + * + * @param {string} project + * @param {string} dlp_job + * @returns {string} Resource name string. + */ + dlpJobPath(project: string, dlpJob: string) { + return this._pathTemplates.dlpJobPathTemplate.render({ + project, + dlp_job: dlpJob, + }); + } + + /** + * Parse the project from DlpJob resource. + * + * @param {string} dlpJobName + * A fully-qualified path representing DlpJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDlpJobName(dlpJobName: string) { + return this._pathTemplates.dlpJobPathTemplate.match(dlpJobName).project; + } + + /** + * Parse the dlp_job from DlpJob resource. + * + * @param {string} dlpJobName + * A fully-qualified path representing DlpJob resource. + * @returns {string} A string representing the dlp_job. + */ + matchDlpJobFromDlpJobName(dlpJobName: string) { + return this._pathTemplates.dlpJobPathTemplate.match(dlpJobName).dlp_job; + } + + /** + * Return a fully-qualified organizationDeidentifyTemplate resource name string. + * + * @param {string} organization + * @param {string} deidentify_template + * @returns {string} Resource name string. + */ + organizationDeidentifyTemplatePath( + organization: string, + deidentifyTemplate: string + ) { + return this._pathTemplates.organizationDeidentifyTemplatePathTemplate.render( + { + organization, + deidentify_template: deidentifyTemplate, + } + ); + } + + /** + * Parse the organization from OrganizationDeidentifyTemplate resource. + * + * @param {string} organizationDeidentifyTemplateName + * A fully-qualified path representing organization_deidentify_template resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationDeidentifyTemplateName( + organizationDeidentifyTemplateName: string + ) { + return this._pathTemplates.organizationDeidentifyTemplatePathTemplate.match( + organizationDeidentifyTemplateName + ).organization; + } + + /** + * Parse the deidentify_template from OrganizationDeidentifyTemplate resource. + * + * @param {string} organizationDeidentifyTemplateName + * A fully-qualified path representing organization_deidentify_template resource. + * @returns {string} A string representing the deidentify_template. + */ + matchDeidentifyTemplateFromOrganizationDeidentifyTemplateName( + organizationDeidentifyTemplateName: string + ) { + return this._pathTemplates.organizationDeidentifyTemplatePathTemplate.match( + organizationDeidentifyTemplateName + ).deidentify_template; + } + + /** + * Return a fully-qualified projectDeidentifyTemplate resource name string. + * + * @param {string} project + * @param {string} deidentify_template + * @returns {string} Resource name string. + */ + projectDeidentifyTemplatePath(project: string, deidentifyTemplate: string) { + return this._pathTemplates.projectDeidentifyTemplatePathTemplate.render({ + project, + deidentify_template: deidentifyTemplate, + }); + } + + /** + * Parse the project from ProjectDeidentifyTemplate resource. + * + * @param {string} projectDeidentifyTemplateName + * A fully-qualified path representing project_deidentify_template resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectDeidentifyTemplateName( + projectDeidentifyTemplateName: string + ) { + return this._pathTemplates.projectDeidentifyTemplatePathTemplate.match( + projectDeidentifyTemplateName + ).project; + } + + /** + * Parse the deidentify_template from ProjectDeidentifyTemplate resource. + * + * @param {string} projectDeidentifyTemplateName + * A fully-qualified path representing project_deidentify_template resource. + * @returns {string} A string representing the deidentify_template. + */ + matchDeidentifyTemplateFromProjectDeidentifyTemplateName( + projectDeidentifyTemplateName: string + ) { + return this._pathTemplates.projectDeidentifyTemplatePathTemplate.match( + projectDeidentifyTemplateName + ).deidentify_template; + } + + /** + * Return a fully-qualified organizationStoredInfoType resource name string. + * + * @param {string} organization + * @param {string} stored_info_type + * @returns {string} Resource name string. + */ + organizationStoredInfoTypePath(organization: string, storedInfoType: string) { + return this._pathTemplates.organizationStoredInfoTypePathTemplate.render({ + organization, + stored_info_type: storedInfoType, + }); + } + + /** + * Parse the organization from OrganizationStoredInfoType resource. + * + * @param {string} organizationStoredInfoTypeName + * A fully-qualified path representing organization_stored_info_type resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationStoredInfoTypeName( + organizationStoredInfoTypeName: string + ) { + return this._pathTemplates.organizationStoredInfoTypePathTemplate.match( + organizationStoredInfoTypeName + ).organization; + } + + /** + * Parse the stored_info_type from OrganizationStoredInfoType resource. + * + * @param {string} organizationStoredInfoTypeName + * A fully-qualified path representing organization_stored_info_type resource. + * @returns {string} A string representing the stored_info_type. + */ + matchStoredInfoTypeFromOrganizationStoredInfoTypeName( + organizationStoredInfoTypeName: string + ) { + return this._pathTemplates.organizationStoredInfoTypePathTemplate.match( + organizationStoredInfoTypeName + ).stored_info_type; + } + + /** + * Return a fully-qualified projectStoredInfoType resource name string. + * + * @param {string} project + * @param {string} stored_info_type + * @returns {string} Resource name string. + */ + projectStoredInfoTypePath(project: string, storedInfoType: string) { + return this._pathTemplates.projectStoredInfoTypePathTemplate.render({ + project, + stored_info_type: storedInfoType, + }); + } + + /** + * Parse the project from ProjectStoredInfoType resource. + * + * @param {string} projectStoredInfoTypeName + * A fully-qualified path representing project_stored_info_type resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectStoredInfoTypeName(projectStoredInfoTypeName: string) { + return this._pathTemplates.projectStoredInfoTypePathTemplate.match( + projectStoredInfoTypeName + ).project; + } + + /** + * Parse the stored_info_type from ProjectStoredInfoType resource. + * + * @param {string} projectStoredInfoTypeName + * A fully-qualified path representing project_stored_info_type resource. + * @returns {string} A string representing the stored_info_type. + */ + matchStoredInfoTypeFromProjectStoredInfoTypeName( + projectStoredInfoTypeName: string + ) { + return this._pathTemplates.projectStoredInfoTypePathTemplate.match( + projectStoredInfoTypeName + ).stored_info_type; + } + + /** + * Terminate the GRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + */ + close(): Promise { + if (!this._terminated) { + return this.dlpServiceStub.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-privacy-dlp/src/v2/dlp_service_client_config.json b/packages/google-privacy-dlp/src/v2/dlp_service_client_config.json index 32915cf7878..51ba5b04bd8 100644 --- a/packages/google-privacy-dlp/src/v2/dlp_service_client_config.json +++ b/packages/google-privacy-dlp/src/v2/dlp_service_client_config.json @@ -2,20 +2,20 @@ "interfaces": { "google.privacy.dlp.v2.DlpService": { "retry_codes": { + "non_idempotent": [], "idempotent": [ "DEADLINE_EXCEEDED", "UNAVAILABLE" - ], - "non_idempotent": [] + ] }, "retry_params": { "default": { "initial_retry_delay_millis": 100, "retry_delay_multiplier": 1.3, "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 20000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 20000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, "total_timeout_millis": 600000 } }, @@ -95,52 +95,57 @@ "retry_codes_name": "idempotent", "retry_params_name": "default" }, - "CreateDlpJob": { + "CreateJobTrigger": { "timeout_millis": 300000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, - "ListDlpJobs": { + "UpdateJobTrigger": { + "timeout_millis": 300000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetJobTrigger": { "timeout_millis": 300000, "retry_codes_name": "idempotent", "retry_params_name": "default" }, - "GetDlpJob": { + "ListJobTriggers": { "timeout_millis": 300000, "retry_codes_name": "idempotent", "retry_params_name": "default" }, - "DeleteDlpJob": { + "DeleteJobTrigger": { "timeout_millis": 300000, "retry_codes_name": "idempotent", "retry_params_name": "default" }, - "CancelDlpJob": { + "ActivateJobTrigger": { "timeout_millis": 300000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, - "ListJobTriggers": { + "CreateDlpJob": { "timeout_millis": 300000, - "retry_codes_name": "idempotent", + "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, - "GetJobTrigger": { + "ListDlpJobs": { "timeout_millis": 300000, "retry_codes_name": "idempotent", "retry_params_name": "default" }, - "DeleteJobTrigger": { + "GetDlpJob": { "timeout_millis": 300000, "retry_codes_name": "idempotent", "retry_params_name": "default" }, - "UpdateJobTrigger": { + "DeleteDlpJob": { "timeout_millis": 300000, - "retry_codes_name": "non_idempotent", + "retry_codes_name": "idempotent", "retry_params_name": "default" }, - "CreateJobTrigger": { + "CancelDlpJob": { "timeout_millis": 300000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" diff --git a/packages/google-privacy-dlp/src/v2/dlp_service_proto_list.json b/packages/google-privacy-dlp/src/v2/dlp_service_proto_list.json index a73c6ba5ae7..8e267f82e78 100644 --- a/packages/google-privacy-dlp/src/v2/dlp_service_proto_list.json +++ b/packages/google-privacy-dlp/src/v2/dlp_service_proto_list.json @@ -1,3 +1,4 @@ [ + "../../protos/google/privacy/dlp/v2/storage.proto", "../../protos/google/privacy/dlp/v2/dlp.proto" ] diff --git a/packages/google-privacy-dlp/src/v2/doc/google/privacy/dlp/v2/doc_dlp.js b/packages/google-privacy-dlp/src/v2/doc/google/privacy/dlp/v2/doc_dlp.js deleted file mode 100644 index dc15cbaeafe..00000000000 --- a/packages/google-privacy-dlp/src/v2/doc/google/privacy/dlp/v2/doc_dlp.js +++ /dev/null @@ -1,4937 +0,0 @@ -// Copyright 2020 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * List of exclude infoTypes. - * - * @property {Object[]} infoTypes - * InfoType list in ExclusionRule rule drops a finding when it overlaps or - * contained within with a finding of an infoType from this list. For - * example, for `InspectionRuleSet.info_types` containing "PHONE_NUMBER"` and - * `exclusion_rule` containing `exclude_info_types.info_types` with - * "EMAIL_ADDRESS" the phone number findings are dropped if they overlap - * with EMAIL_ADDRESS finding. - * That leads to "555-222-2222@example.org" to generate only a single - * finding, namely email address. - * - * This object should have the same structure as [InfoType]{@link google.privacy.dlp.v2.InfoType} - * - * @typedef ExcludeInfoTypes - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.ExcludeInfoTypes definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ -const ExcludeInfoTypes = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * The rule that specifies conditions when findings of infoTypes specified in - * `InspectionRuleSet` are removed from results. - * - * @property {Object} dictionary - * Dictionary which defines the rule. - * - * This object should have the same structure as [Dictionary]{@link google.privacy.dlp.v2.Dictionary} - * - * @property {Object} regex - * Regular expression which defines the rule. - * - * This object should have the same structure as [Regex]{@link google.privacy.dlp.v2.Regex} - * - * @property {Object} excludeInfoTypes - * Set of infoTypes for which findings would affect this rule. - * - * This object should have the same structure as [ExcludeInfoTypes]{@link google.privacy.dlp.v2.ExcludeInfoTypes} - * - * @property {number} matchingType - * How the rule is applied, see MatchingType documentation for details. - * - * The number should be among the values of [MatchingType]{@link google.privacy.dlp.v2.MatchingType} - * - * @typedef ExclusionRule - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.ExclusionRule definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ -const ExclusionRule = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * A single inspection rule to be applied to infoTypes, specified in - * `InspectionRuleSet`. - * - * @property {Object} hotwordRule - * Hotword-based detection rule. - * - * This object should have the same structure as [HotwordRule]{@link google.privacy.dlp.v2.HotwordRule} - * - * @property {Object} exclusionRule - * Exclusion rule. - * - * This object should have the same structure as [ExclusionRule]{@link google.privacy.dlp.v2.ExclusionRule} - * - * @typedef InspectionRule - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.InspectionRule definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ -const InspectionRule = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Rule set for modifying a set of infoTypes to alter behavior under certain - * circumstances, depending on the specific details of the rules within the set. - * - * @property {Object[]} infoTypes - * List of infoTypes this rule set is applied to. - * - * This object should have the same structure as [InfoType]{@link google.privacy.dlp.v2.InfoType} - * - * @property {Object[]} rules - * Set of rules to be applied to infoTypes. The rules are applied in order. - * - * This object should have the same structure as [InspectionRule]{@link google.privacy.dlp.v2.InspectionRule} - * - * @typedef InspectionRuleSet - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.InspectionRuleSet definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ -const InspectionRuleSet = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Configuration description of the scanning process. - * When used with redactContent only info_types and min_likelihood are currently - * used. - * - * @property {Object[]} infoTypes - * Restricts what info_types to look for. The values must correspond to - * InfoType values returned by ListInfoTypes or listed at - * https://cloud.google.com/dlp/docs/infotypes-reference. - * - * When no InfoTypes or CustomInfoTypes are specified in a request, the - * system may automatically choose what detectors to run. By default this may - * be all types, but may change over time as detectors are updated. - * - * If you need precise control and predictability as to what detectors are - * run you should specify specific InfoTypes listed in the reference, - * otherwise a default list will be used, which may change over time. - * - * This object should have the same structure as [InfoType]{@link google.privacy.dlp.v2.InfoType} - * - * @property {number} minLikelihood - * Only returns findings equal or above this threshold. The default is - * POSSIBLE. - * See https://cloud.google.com/dlp/docs/likelihood to learn more. - * - * The number should be among the values of [Likelihood]{@link google.privacy.dlp.v2.Likelihood} - * - * @property {Object} limits - * Configuration to control the number of findings returned. - * - * This object should have the same structure as [FindingLimits]{@link google.privacy.dlp.v2.FindingLimits} - * - * @property {boolean} includeQuote - * When true, a contextual quote from the data that triggered a finding is - * included in the response; see Finding.quote. - * - * @property {boolean} excludeInfoTypes - * When true, excludes type information of the findings. - * - * @property {Object[]} customInfoTypes - * CustomInfoTypes provided by the user. See - * https://cloud.google.com/dlp/docs/creating-custom-infotypes to learn more. - * - * This object should have the same structure as [CustomInfoType]{@link google.privacy.dlp.v2.CustomInfoType} - * - * @property {number[]} contentOptions - * List of options defining data content to scan. - * If empty, text, images, and other content will be included. - * - * The number should be among the values of [ContentOption]{@link google.privacy.dlp.v2.ContentOption} - * - * @property {Object[]} ruleSet - * Set of rules to apply to the findings for this InspectConfig. - * Exclusion rules, contained in the set are executed in the end, other - * rules are executed in the order they are specified for each info type. - * - * This object should have the same structure as [InspectionRuleSet]{@link google.privacy.dlp.v2.InspectionRuleSet} - * - * @typedef InspectConfig - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.InspectConfig definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ -const InspectConfig = { - // This is for documentation. Actual contents will be loaded by gRPC. - - /** - * Configuration to control the number of findings returned. - * - * @property {number} maxFindingsPerItem - * Max number of findings that will be returned for each item scanned. - * When set within `InspectDataSourceRequest`, - * the maximum returned is 2000 regardless if this is set higher. - * When set within `InspectContentRequest`, this field is ignored. - * - * @property {number} maxFindingsPerRequest - * Max number of findings that will be returned per request/job. - * When set within `InspectContentRequest`, the maximum returned is 2000 - * regardless if this is set higher. - * - * @property {Object[]} maxFindingsPerInfoType - * Configuration of findings limit given for specified infoTypes. - * - * This object should have the same structure as [InfoTypeLimit]{@link google.privacy.dlp.v2.InfoTypeLimit} - * - * @typedef FindingLimits - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.InspectConfig.FindingLimits definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ - FindingLimits: { - // This is for documentation. Actual contents will be loaded by gRPC. - - /** - * Max findings configuration per infoType, per content item or long - * running DlpJob. - * - * @property {Object} infoType - * Type of information the findings limit applies to. Only one limit per - * info_type should be provided. If InfoTypeLimit does not have an - * info_type, the DLP API applies the limit against all info_types that - * are found but not specified in another InfoTypeLimit. - * - * This object should have the same structure as [InfoType]{@link google.privacy.dlp.v2.InfoType} - * - * @property {number} maxFindings - * Max findings limit for the given infoType. - * - * @typedef InfoTypeLimit - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.InspectConfig.FindingLimits.InfoTypeLimit definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ - InfoTypeLimit: { - // This is for documentation. Actual contents will be loaded by gRPC. - } - } -}; - -/** - * Container for bytes to inspect or redact. - * - * @property {number} type - * The type of data stored in the bytes string. Default will be TEXT_UTF8. - * - * The number should be among the values of [BytesType]{@link google.privacy.dlp.v2.BytesType} - * - * @property {Buffer} data - * Content data to inspect or redact. - * - * @typedef ByteContentItem - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.ByteContentItem definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ -const ByteContentItem = { - // This is for documentation. Actual contents will be loaded by gRPC. - - /** - * The type of data being sent to in data. - * - * @enum {number} - * @memberof google.privacy.dlp.v2 - */ - BytesType: { - - /** - * Unused - */ - BYTES_TYPE_UNSPECIFIED: 0, - - /** - * Any image type. - */ - IMAGE: 6, - - /** - * jpeg - */ - IMAGE_JPEG: 1, - - /** - * bmp - */ - IMAGE_BMP: 2, - - /** - * png - */ - IMAGE_PNG: 3, - - /** - * svg - */ - IMAGE_SVG: 4, - - /** - * plain text - */ - TEXT_UTF8: 5, - - /** - * avro - */ - AVRO: 11 - } -}; - -/** - * Container structure for the content to inspect. - * - * @property {string} value - * String data to inspect or redact. - * - * @property {Object} table - * Structured content for inspection. See - * https://cloud.google.com/dlp/docs/inspecting-text#inspecting_a_table to - * learn more. - * - * This object should have the same structure as [Table]{@link google.privacy.dlp.v2.Table} - * - * @property {Object} byteItem - * Content data to inspect or redact. Replaces `type` and `data`. - * - * This object should have the same structure as [ByteContentItem]{@link google.privacy.dlp.v2.ByteContentItem} - * - * @typedef ContentItem - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.ContentItem definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ -const ContentItem = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Structured content to inspect. Up to 50,000 `Value`s per request allowed. - * See https://cloud.google.com/dlp/docs/inspecting-text#inspecting_a_table to - * learn more. - * - * @property {Object[]} headers - * Headers of the table. - * - * This object should have the same structure as [FieldId]{@link google.privacy.dlp.v2.FieldId} - * - * @property {Object[]} rows - * Rows of the table. - * - * This object should have the same structure as [Row]{@link google.privacy.dlp.v2.Row} - * - * @typedef Table - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.Table definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ -const Table = { - // This is for documentation. Actual contents will be loaded by gRPC. - - /** - * Values of the row. - * - * @property {Object[]} values - * Individual cells. - * - * This object should have the same structure as [Value]{@link google.privacy.dlp.v2.Value} - * - * @typedef Row - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.Table.Row definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ - Row: { - // This is for documentation. Actual contents will be loaded by gRPC. - } -}; - -/** - * All the findings for a single scanned item. - * - * @property {Object[]} findings - * List of findings for an item. - * - * This object should have the same structure as [Finding]{@link google.privacy.dlp.v2.Finding} - * - * @property {boolean} findingsTruncated - * If true, then this item might have more findings than were returned, - * and the findings returned are an arbitrary subset of all findings. - * The findings list might be truncated because the input items were too - * large, or because the server reached the maximum amount of resources - * allowed for a single API call. For best results, divide the input into - * smaller batches. - * - * @typedef InspectResult - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.InspectResult definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ -const InspectResult = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Represents a piece of potentially sensitive content. - * - * @property {string} quote - * The content that was found. Even if the content is not textual, it - * may be converted to a textual representation here. - * Provided if `include_quote` is true and the finding is - * less than or equal to 4096 bytes long. If the finding exceeds 4096 bytes - * in length, the quote may be omitted. - * - * @property {Object} infoType - * The type of content that might have been found. - * Provided if `excluded_types` is false. - * - * This object should have the same structure as [InfoType]{@link google.privacy.dlp.v2.InfoType} - * - * @property {number} likelihood - * Confidence of how likely it is that the `info_type` is correct. - * - * The number should be among the values of [Likelihood]{@link google.privacy.dlp.v2.Likelihood} - * - * @property {Object} location - * Where the content was found. - * - * This object should have the same structure as [Location]{@link google.privacy.dlp.v2.Location} - * - * @property {Object} createTime - * Timestamp when finding was detected. - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * - * @property {Object} quoteInfo - * Contains data parsed from quotes. Only populated if include_quote was set - * to true and a supported infoType was requested. Currently supported - * infoTypes: DATE, DATE_OF_BIRTH and TIME. - * - * This object should have the same structure as [QuoteInfo]{@link google.privacy.dlp.v2.QuoteInfo} - * - * @typedef Finding - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.Finding definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ -const Finding = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Specifies the location of the finding. - * - * @property {Object} byteRange - * Zero-based byte offsets delimiting the finding. - * These are relative to the finding's containing element. - * Note that when the content is not textual, this references - * the UTF-8 encoded textual representation of the content. - * Omitted if content is an image. - * - * This object should have the same structure as [Range]{@link google.privacy.dlp.v2.Range} - * - * @property {Object} codepointRange - * Unicode character offsets delimiting the finding. - * These are relative to the finding's containing element. - * Provided when the content is text. - * - * This object should have the same structure as [Range]{@link google.privacy.dlp.v2.Range} - * - * @property {Object[]} contentLocations - * List of nested objects pointing to the precise location of the finding - * within the file or record. - * - * This object should have the same structure as [ContentLocation]{@link google.privacy.dlp.v2.ContentLocation} - * - * @typedef Location - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.Location definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ -const Location = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Findings container location data. - * - * @property {string} containerName - * Name of the container where the finding is located. - * The top level name is the source file name or table name. Names of some - * common storage containers are formatted as follows: - * - * * BigQuery tables: `{project_id}:{dataset_id}.{table_id}` - * * Cloud Storage files: `gs://{bucket}/{path}` - * * Datastore namespace: {namespace} - * - * Nested names could be absent if the embedded object has no string - * identifier (for an example an image contained within a document). - * - * @property {Object} recordLocation - * Location within a row or record of a database table. - * - * This object should have the same structure as [RecordLocation]{@link google.privacy.dlp.v2.RecordLocation} - * - * @property {Object} imageLocation - * Location within an image's pixels. - * - * This object should have the same structure as [ImageLocation]{@link google.privacy.dlp.v2.ImageLocation} - * - * @property {Object} documentLocation - * Location data for document files. - * - * This object should have the same structure as [DocumentLocation]{@link google.privacy.dlp.v2.DocumentLocation} - * - * @property {Object} containerTimestamp - * Findings container modification timestamp, if applicable. - * For Google Cloud Storage contains last file modification timestamp. - * For BigQuery table contains last_modified_time property. - * For Datastore - not populated. - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * - * @property {string} containerVersion - * Findings container version, if available - * ("generation" for Google Cloud Storage). - * - * @typedef ContentLocation - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.ContentLocation definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ -const ContentLocation = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Location of a finding within a document. - * - * @property {number} fileOffset - * Offset of the line, from the beginning of the file, where the finding - * is located. - * - * @typedef DocumentLocation - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.DocumentLocation definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ -const DocumentLocation = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Location of a finding within a row or record. - * - * @property {Object} recordKey - * Key of the finding. - * - * This object should have the same structure as [RecordKey]{@link google.privacy.dlp.v2.RecordKey} - * - * @property {Object} fieldId - * Field id of the field containing the finding. - * - * This object should have the same structure as [FieldId]{@link google.privacy.dlp.v2.FieldId} - * - * @property {Object} tableLocation - * Location within a `ContentItem.Table`. - * - * This object should have the same structure as [TableLocation]{@link google.privacy.dlp.v2.TableLocation} - * - * @typedef RecordLocation - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.RecordLocation definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ -const RecordLocation = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Location of a finding within a table. - * - * @property {number} rowIndex - * The zero-based index of the row where the finding is located. - * - * @typedef TableLocation - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.TableLocation definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ -const TableLocation = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Generic half-open interval [start, end) - * - * @property {number} start - * Index of the first character of the range (inclusive). - * - * @property {number} end - * Index of the last character of the range (exclusive). - * - * @typedef Range - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.Range definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ -const Range = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Location of the finding within an image. - * - * @property {Object[]} boundingBoxes - * Bounding boxes locating the pixels within the image containing the finding. - * - * This object should have the same structure as [BoundingBox]{@link google.privacy.dlp.v2.BoundingBox} - * - * @typedef ImageLocation - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.ImageLocation definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ -const ImageLocation = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Bounding box encompassing detected text within an image. - * - * @property {number} top - * Top coordinate of the bounding box. (0,0) is upper left. - * - * @property {number} left - * Left coordinate of the bounding box. (0,0) is upper left. - * - * @property {number} width - * Width of the bounding box in pixels. - * - * @property {number} height - * Height of the bounding box in pixels. - * - * @typedef BoundingBox - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.BoundingBox definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ -const BoundingBox = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Request to search for potentially sensitive info in an image and redact it - * by covering it with a colored rectangle. - * - * @property {string} parent - * The parent resource name, for example projects/my-project-id. - * - * @property {string} locationId - * The geographic location to process the request. Reserved for future - * extensions. - * - * @property {Object} inspectConfig - * Configuration for the inspector. - * - * This object should have the same structure as [InspectConfig]{@link google.privacy.dlp.v2.InspectConfig} - * - * @property {Object[]} imageRedactionConfigs - * The configuration for specifying what content to redact from images. - * - * This object should have the same structure as [ImageRedactionConfig]{@link google.privacy.dlp.v2.ImageRedactionConfig} - * - * @property {boolean} includeFindings - * Whether the response should include findings along with the redacted - * image. - * - * @property {Object} byteItem - * The content must be PNG, JPEG, SVG or BMP. - * - * This object should have the same structure as [ByteContentItem]{@link google.privacy.dlp.v2.ByteContentItem} - * - * @typedef RedactImageRequest - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.RedactImageRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ -const RedactImageRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. - - /** - * Configuration for determining how redaction of images should occur. - * - * @property {Object} infoType - * Only one per info_type should be provided per request. If not - * specified, and redact_all_text is false, the DLP API will redact all - * text that it matches against all info_types that are found, but not - * specified in another ImageRedactionConfig. - * - * This object should have the same structure as [InfoType]{@link google.privacy.dlp.v2.InfoType} - * - * @property {boolean} redactAllText - * If true, all text found in the image, regardless whether it matches an - * info_type, is redacted. Only one should be provided. - * - * @property {Object} redactionColor - * The color to use when redacting content from an image. If not specified, - * the default is black. - * - * This object should have the same structure as [Color]{@link google.privacy.dlp.v2.Color} - * - * @typedef ImageRedactionConfig - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.RedactImageRequest.ImageRedactionConfig definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ - ImageRedactionConfig: { - // This is for documentation. Actual contents will be loaded by gRPC. - } -}; - -/** - * Represents a color in the RGB color space. - * - * @property {number} red - * The amount of red in the color as a value in the interval [0, 1]. - * - * @property {number} green - * The amount of green in the color as a value in the interval [0, 1]. - * - * @property {number} blue - * The amount of blue in the color as a value in the interval [0, 1]. - * - * @typedef Color - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.Color definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ -const Color = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Results of redacting an image. - * - * @property {Buffer} redactedImage - * The redacted image. The type will be the same as the original image. - * - * @property {string} extractedText - * If an image was being inspected and the InspectConfig's include_quote was - * set to true, then this field will include all text, if any, that was found - * in the image. - * - * @property {Object} inspectResult - * The findings. Populated when include_findings in the request is true. - * - * This object should have the same structure as [InspectResult]{@link google.privacy.dlp.v2.InspectResult} - * - * @typedef RedactImageResponse - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.RedactImageResponse definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ -const RedactImageResponse = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Request to de-identify a list of items. - * - * @property {string} parent - * The parent resource name, for example projects/my-project-id. - * - * @property {Object} deidentifyConfig - * 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]{@link google.privacy.dlp.v2.DeidentifyConfig} - * - * @property {Object} inspectConfig - * 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]{@link google.privacy.dlp.v2.InspectConfig} - * - * @property {Object} item - * The item to de-identify. Will be treated as text. - * - * This object should have the same structure as [ContentItem]{@link google.privacy.dlp.v2.ContentItem} - * - * @property {string} inspectTemplateName - * 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. - * - * @property {string} deidentifyTemplateName - * 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. - * - * @property {string} locationId - * The geographic location to process de-identification. Reserved for future - * extensions. - * - * @typedef DeidentifyContentRequest - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.DeidentifyContentRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ -const DeidentifyContentRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Results of de-identifying a ContentItem. - * - * @property {Object} item - * The de-identified item. - * - * This object should have the same structure as [ContentItem]{@link google.privacy.dlp.v2.ContentItem} - * - * @property {Object} overview - * An overview of the changes that were made on the `item`. - * - * This object should have the same structure as [TransformationOverview]{@link google.privacy.dlp.v2.TransformationOverview} - * - * @typedef DeidentifyContentResponse - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.DeidentifyContentResponse definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ -const DeidentifyContentResponse = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Request to re-identify an item. - * - * @property {string} parent - * Required. The parent resource name. - * - * @property {Object} reidentifyConfig - * 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: - * - * - `CryptoDeterministicConfig` - * - `CryptoReplaceFfxFpeConfig` - * - * This object should have the same structure as [DeidentifyConfig]{@link google.privacy.dlp.v2.DeidentifyConfig} - * - * @property {Object} inspectConfig - * Configuration for the inspector. - * - * This object should have the same structure as [InspectConfig]{@link google.privacy.dlp.v2.InspectConfig} - * - * @property {Object} item - * The item to re-identify. Will be treated as text. - * - * This object should have the same structure as [ContentItem]{@link google.privacy.dlp.v2.ContentItem} - * - * @property {string} inspectTemplateName - * 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. - * - * @property {string} reidentifyTemplateName - * 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. - * - * @property {string} locationId - * The geographic location to process content reidentification. Reserved for - * future extensions. - * - * @typedef ReidentifyContentRequest - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.ReidentifyContentRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ -const ReidentifyContentRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Results of re-identifying a item. - * - * @property {Object} item - * The re-identified item. - * - * This object should have the same structure as [ContentItem]{@link google.privacy.dlp.v2.ContentItem} - * - * @property {Object} overview - * An overview of the changes that were made to the `item`. - * - * This object should have the same structure as [TransformationOverview]{@link google.privacy.dlp.v2.TransformationOverview} - * - * @typedef ReidentifyContentResponse - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.ReidentifyContentResponse definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ -const ReidentifyContentResponse = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Request to search for potentially sensitive info in a ContentItem. - * - * @property {string} parent - * The parent resource name, for example projects/my-project-id. - * - * @property {Object} inspectConfig - * 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]{@link google.privacy.dlp.v2.InspectConfig} - * - * @property {Object} item - * The item to inspect. - * - * This object should have the same structure as [ContentItem]{@link google.privacy.dlp.v2.ContentItem} - * - * @property {string} inspectTemplateName - * 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. - * - * @property {string} locationId - * The geographic location to process content inspection. Reserved for future - * extensions. - * - * @typedef InspectContentRequest - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.InspectContentRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ -const InspectContentRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Results of inspecting an item. - * - * @property {Object} result - * The findings. - * - * This object should have the same structure as [InspectResult]{@link google.privacy.dlp.v2.InspectResult} - * - * @typedef InspectContentResponse - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.InspectContentResponse definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ -const InspectContentResponse = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Cloud repository for storing output. - * - * @property {Object} table - * Store findings in an existing table or a new table in an existing - * dataset. If table_id is not set a new one will be generated - * for you with the following format: - * dlp_googleapis_yyyy_mm_dd_[dlp_job_id]. Pacific timezone will be used for - * generating the date details. - * - * For Inspect, each column in an existing output table must have the same - * name, type, and mode of a field in the `Finding` object. - * - * For Risk, an existing output table should be the output of a previous - * Risk analysis job run on the same source table, with the same privacy - * metric and quasi-identifiers. Risk jobs that analyze the same table but - * compute a different privacy metric, or use different sets of - * quasi-identifiers, cannot store their results in the same table. - * - * This object should have the same structure as [BigQueryTable]{@link google.privacy.dlp.v2.BigQueryTable} - * - * @property {number} outputSchema - * Schema used for writing the findings for Inspect jobs. This field is only - * used for Inspect and must be unspecified for Risk jobs. Columns are derived - * from the `Finding` object. If appending to an existing table, any columns - * from the predefined schema that are missing will be added. No columns in - * the existing table will be deleted. - * - * If unspecified, then all available columns will be used for a new table or - * an (existing) table with no schema, and no changes will be made to an - * existing table that has a schema. - * - * The number should be among the values of [OutputSchema]{@link google.privacy.dlp.v2.OutputSchema} - * - * @typedef OutputStorageConfig - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.OutputStorageConfig definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ -const OutputStorageConfig = { - // This is for documentation. Actual contents will be loaded by gRPC. - - /** - * Predefined schemas for storing findings. - * - * @enum {number} - * @memberof google.privacy.dlp.v2 - */ - OutputSchema: { - - /** - * Unused. - */ - OUTPUT_SCHEMA_UNSPECIFIED: 0, - - /** - * Basic schema including only `info_type`, `quote`, `certainty`, and - * `timestamp`. - */ - BASIC_COLUMNS: 1, - - /** - * Schema tailored to findings from scanning Google Cloud Storage. - */ - GCS_COLUMNS: 2, - - /** - * Schema tailored to findings from scanning Google Datastore. - */ - DATASTORE_COLUMNS: 3, - - /** - * Schema tailored to findings from scanning Google BigQuery. - */ - BIG_QUERY_COLUMNS: 4, - - /** - * Schema containing all columns. - */ - ALL_COLUMNS: 5 - } -}; - -/** - * Statistics regarding a specific InfoType. - * - * @property {Object} infoType - * The type of finding this stat is for. - * - * This object should have the same structure as [InfoType]{@link google.privacy.dlp.v2.InfoType} - * - * @property {number} count - * Number of findings for this infoType. - * - * @typedef InfoTypeStats - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.InfoTypeStats definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ -const InfoTypeStats = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * The results of an inspect DataSource job. - * - * @property {Object} requestedOptions - * The configuration used for this job. - * - * This object should have the same structure as [RequestedOptions]{@link google.privacy.dlp.v2.RequestedOptions} - * - * @property {Object} result - * A summary of the outcome of this inspect job. - * - * This object should have the same structure as [Result]{@link google.privacy.dlp.v2.Result} - * - * @typedef InspectDataSourceDetails - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.InspectDataSourceDetails definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ -const InspectDataSourceDetails = { - // This is for documentation. Actual contents will be loaded by gRPC. - - /** - * Snapshot of the inspection configuration. - * - * @property {Object} snapshotInspectTemplate - * If run with an InspectTemplate, a snapshot of its state at the time of - * this run. - * - * This object should have the same structure as [InspectTemplate]{@link google.privacy.dlp.v2.InspectTemplate} - * - * @property {Object} jobConfig - * Inspect config. - * - * This object should have the same structure as [InspectJobConfig]{@link google.privacy.dlp.v2.InspectJobConfig} - * - * @typedef RequestedOptions - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.InspectDataSourceDetails.RequestedOptions definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ - RequestedOptions: { - // This is for documentation. Actual contents will be loaded by gRPC. - }, - - /** - * All result fields mentioned below are updated while the job is processing. - * - * @property {number} processedBytes - * Total size in bytes that were processed. - * - * @property {number} totalEstimatedBytes - * Estimate of the number of bytes to process. - * - * @property {Object[]} infoTypeStats - * Statistics of how many instances of each info type were found during - * inspect job. - * - * This object should have the same structure as [InfoTypeStats]{@link google.privacy.dlp.v2.InfoTypeStats} - * - * @typedef Result - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.InspectDataSourceDetails.Result definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ - Result: { - // This is for documentation. Actual contents will be loaded by gRPC. - } -}; - -/** - * InfoType description. - * - * @property {string} name - * Internal name of the infoType. - * - * @property {string} displayName - * Human readable form of the infoType name. - * - * @property {number[]} supportedBy - * Which parts of the API supports this InfoType. - * - * The number should be among the values of [InfoTypeSupportedBy]{@link google.privacy.dlp.v2.InfoTypeSupportedBy} - * - * @property {string} description - * Description of the infotype. Translated when language is provided in the - * request. - * - * @typedef InfoTypeDescription - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.InfoTypeDescription definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ -const InfoTypeDescription = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Request for the list of infoTypes. - * - * @property {string} languageCode - * BCP-47 language code for localized infoType friendly - * names. If omitted, or if localized strings are not available, - * en-US strings will be returned. - * - * @property {string} filter - * filter to only return infoTypes supported by certain parts of the - * API. Defaults to supported_by=INSPECT. - * - * @property {string} locationId - * The geographic location to list info types. Reserved for future - * extensions. - * - * @typedef ListInfoTypesRequest - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.ListInfoTypesRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ -const ListInfoTypesRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Response to the ListInfoTypes request. - * - * @property {Object[]} infoTypes - * Set of sensitive infoTypes. - * - * This object should have the same structure as [InfoTypeDescription]{@link google.privacy.dlp.v2.InfoTypeDescription} - * - * @typedef ListInfoTypesResponse - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.ListInfoTypesResponse definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ -const ListInfoTypesResponse = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Configuration for a risk analysis job. See - * https://cloud.google.com/dlp/docs/concepts-risk-analysis to learn more. - * - * @property {Object} privacyMetric - * Privacy metric to compute. - * - * This object should have the same structure as [PrivacyMetric]{@link google.privacy.dlp.v2.PrivacyMetric} - * - * @property {Object} sourceTable - * Input dataset to compute metrics over. - * - * This object should have the same structure as [BigQueryTable]{@link google.privacy.dlp.v2.BigQueryTable} - * - * @property {Object[]} actions - * Actions to execute at the completion of the job. Are executed in the order - * provided. - * - * This object should have the same structure as [Action]{@link google.privacy.dlp.v2.Action} - * - * @typedef RiskAnalysisJobConfig - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.RiskAnalysisJobConfig definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ -const RiskAnalysisJobConfig = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * A column with a semantic tag attached. - * - * @property {Object} field - * Required. Identifies the column. - * - * This object should have the same structure as [FieldId]{@link google.privacy.dlp.v2.FieldId} - * - * @property {Object} infoType - * A column can be tagged with a InfoType to use the relevant public - * dataset as a statistical model of population, if available. We - * currently support US ZIP codes, region codes, ages and genders. - * To programmatically obtain the list of supported InfoTypes, use - * ListInfoTypes with the supported_by=RISK_ANALYSIS filter. - * - * This object should have the same structure as [InfoType]{@link google.privacy.dlp.v2.InfoType} - * - * @property {string} customTag - * A column can be tagged with a custom tag. In this case, the user must - * indicate an auxiliary table that contains statistical information on - * the possible values of this column (below). - * - * @property {Object} inferred - * If no semantic tag is indicated, we infer the statistical model from - * the distribution of values in the input data - * - * This object should have the same structure as [Empty]{@link google.protobuf.Empty} - * - * @typedef QuasiId - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.QuasiId definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ -const QuasiId = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * An auxiliary table containing statistical information on the relative - * frequency of different quasi-identifiers values. It has one or several - * quasi-identifiers columns, and one column that indicates the relative - * frequency of each quasi-identifier tuple. - * If a tuple is present in the data but not in the auxiliary table, the - * corresponding relative frequency is assumed to be zero (and thus, the - * tuple is highly reidentifiable). - * - * @property {Object} table - * Required. Auxiliary table location. - * - * This object should have the same structure as [BigQueryTable]{@link google.privacy.dlp.v2.BigQueryTable} - * - * @property {Object[]} quasiIds - * Required. Quasi-identifier columns. - * - * This object should have the same structure as [QuasiIdentifierField]{@link google.privacy.dlp.v2.QuasiIdentifierField} - * - * @property {Object} relativeFrequency - * Required. The relative frequency column must contain a floating-point number - * between 0 and 1 (inclusive). Null values are assumed to be zero. - * - * This object should have the same structure as [FieldId]{@link google.privacy.dlp.v2.FieldId} - * - * @typedef StatisticalTable - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.StatisticalTable definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ -const StatisticalTable = { - // This is for documentation. Actual contents will be loaded by gRPC. - - /** - * A quasi-identifier column has a custom_tag, used to know which column - * in the data corresponds to which column in the statistical model. - * - * @property {Object} field - * Identifies the column. - * - * This object should have the same structure as [FieldId]{@link google.privacy.dlp.v2.FieldId} - * - * @property {string} customTag - * A column can be tagged with a custom tag. In this case, the user must - * indicate an auxiliary table that contains statistical information on - * the possible values of this column (below). - * - * @typedef QuasiIdentifierField - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.StatisticalTable.QuasiIdentifierField definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ - QuasiIdentifierField: { - // This is for documentation. Actual contents will be loaded by gRPC. - } -}; - -/** - * Privacy metric to compute for reidentification risk analysis. - * - * @property {Object} numericalStatsConfig - * Numerical stats - * - * This object should have the same structure as [NumericalStatsConfig]{@link google.privacy.dlp.v2.NumericalStatsConfig} - * - * @property {Object} categoricalStatsConfig - * Categorical stats - * - * This object should have the same structure as [CategoricalStatsConfig]{@link google.privacy.dlp.v2.CategoricalStatsConfig} - * - * @property {Object} kAnonymityConfig - * K-anonymity - * - * This object should have the same structure as [KAnonymityConfig]{@link google.privacy.dlp.v2.KAnonymityConfig} - * - * @property {Object} lDiversityConfig - * l-diversity - * - * This object should have the same structure as [LDiversityConfig]{@link google.privacy.dlp.v2.LDiversityConfig} - * - * @property {Object} kMapEstimationConfig - * k-map - * - * This object should have the same structure as [KMapEstimationConfig]{@link google.privacy.dlp.v2.KMapEstimationConfig} - * - * @property {Object} deltaPresenceEstimationConfig - * delta-presence - * - * This object should have the same structure as [DeltaPresenceEstimationConfig]{@link google.privacy.dlp.v2.DeltaPresenceEstimationConfig} - * - * @typedef PrivacyMetric - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.PrivacyMetric definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ -const PrivacyMetric = { - // This is for documentation. Actual contents will be loaded by gRPC. - - /** - * Compute numerical stats over an individual column, including - * min, max, and quantiles. - * - * @property {Object} field - * Field to compute numerical stats on. Supported types are - * integer, float, date, datetime, timestamp, time. - * - * This object should have the same structure as [FieldId]{@link google.privacy.dlp.v2.FieldId} - * - * @typedef NumericalStatsConfig - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.PrivacyMetric.NumericalStatsConfig definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ - NumericalStatsConfig: { - // This is for documentation. Actual contents will be loaded by gRPC. - }, - - /** - * Compute numerical stats over an individual column, including - * number of distinct values and value count distribution. - * - * @property {Object} field - * Field to compute categorical stats on. All column types are - * supported except for arrays and structs. However, it may be more - * informative to use NumericalStats when the field type is supported, - * depending on the data. - * - * This object should have the same structure as [FieldId]{@link google.privacy.dlp.v2.FieldId} - * - * @typedef CategoricalStatsConfig - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.PrivacyMetric.CategoricalStatsConfig definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ - CategoricalStatsConfig: { - // This is for documentation. Actual contents will be loaded by gRPC. - }, - - /** - * k-anonymity metric, used for analysis of reidentification risk. - * - * @property {Object[]} quasiIds - * Set of fields to compute k-anonymity over. When multiple fields are - * specified, they are considered a single composite key. Structs and - * repeated data types are not supported; however, nested fields are - * supported so long as they are not structs themselves or nested within - * a repeated field. - * - * This object should have the same structure as [FieldId]{@link google.privacy.dlp.v2.FieldId} - * - * @property {Object} entityId - * Message indicating that multiple rows might be associated to a - * single individual. If the same entity_id is associated to multiple - * quasi-identifier tuples over distinct rows, we consider the entire - * collection of tuples as the composite quasi-identifier. This collection - * is a multiset: the order in which the different tuples appear in the - * dataset is ignored, but their frequency is taken into account. - * - * Important note: a maximum of 1000 rows can be associated to a single - * entity ID. If more rows are associated with the same entity ID, some - * might be ignored. - * - * This object should have the same structure as [EntityId]{@link google.privacy.dlp.v2.EntityId} - * - * @typedef KAnonymityConfig - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.PrivacyMetric.KAnonymityConfig definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ - KAnonymityConfig: { - // This is for documentation. Actual contents will be loaded by gRPC. - }, - - /** - * l-diversity metric, used for analysis of reidentification risk. - * - * @property {Object[]} quasiIds - * Set of quasi-identifiers indicating how equivalence classes are - * defined for the l-diversity computation. When multiple fields are - * specified, they are considered a single composite key. - * - * This object should have the same structure as [FieldId]{@link google.privacy.dlp.v2.FieldId} - * - * @property {Object} sensitiveAttribute - * Sensitive field for computing the l-value. - * - * This object should have the same structure as [FieldId]{@link google.privacy.dlp.v2.FieldId} - * - * @typedef LDiversityConfig - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.PrivacyMetric.LDiversityConfig definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ - LDiversityConfig: { - // This is for documentation. Actual contents will be loaded by gRPC. - }, - - /** - * Reidentifiability metric. This corresponds to a risk model similar to what - * is called "journalist risk" in the literature, except the attack dataset is - * statistically modeled instead of being perfectly known. This can be done - * using publicly available data (like the US Census), or using a custom - * statistical model (indicated as one or several BigQuery tables), or by - * extrapolating from the distribution of values in the input dataset. - * - * @property {Object[]} quasiIds - * Required. Fields considered to be quasi-identifiers. No two columns can have the - * same tag. - * - * This object should have the same structure as [TaggedField]{@link google.privacy.dlp.v2.TaggedField} - * - * @property {string} regionCode - * ISO 3166-1 alpha-2 region code to use in the statistical modeling. - * Set if no column is tagged with a region-specific InfoType (like - * US_ZIP_5) or a region code. - * - * @property {Object[]} auxiliaryTables - * Several auxiliary tables can be used in the analysis. Each custom_tag - * used to tag a quasi-identifiers column must appear in exactly one column - * of one auxiliary table. - * - * This object should have the same structure as [AuxiliaryTable]{@link google.privacy.dlp.v2.AuxiliaryTable} - * - * @typedef KMapEstimationConfig - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ - KMapEstimationConfig: { - // This is for documentation. Actual contents will be loaded by gRPC. - - /** - * A column with a semantic tag attached. - * - * @property {Object} field - * Required. Identifies the column. - * - * This object should have the same structure as [FieldId]{@link google.privacy.dlp.v2.FieldId} - * - * @property {Object} infoType - * A column can be tagged with a InfoType to use the relevant public - * dataset as a statistical model of population, if available. We - * currently support US ZIP codes, region codes, ages and genders. - * To programmatically obtain the list of supported InfoTypes, use - * ListInfoTypes with the supported_by=RISK_ANALYSIS filter. - * - * This object should have the same structure as [InfoType]{@link google.privacy.dlp.v2.InfoType} - * - * @property {string} customTag - * A column can be tagged with a custom tag. In this case, the user must - * indicate an auxiliary table that contains statistical information on - * the possible values of this column (below). - * - * @property {Object} inferred - * If no semantic tag is indicated, we infer the statistical model from - * the distribution of values in the input data - * - * This object should have the same structure as [Empty]{@link google.protobuf.Empty} - * - * @typedef TaggedField - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.TaggedField definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ - TaggedField: { - // This is for documentation. Actual contents will be loaded by gRPC. - }, - - /** - * An auxiliary table contains statistical information on the relative - * frequency of different quasi-identifiers values. It has one or several - * quasi-identifiers columns, and one column that indicates the relative - * frequency of each quasi-identifier tuple. - * If a tuple is present in the data but not in the auxiliary table, the - * corresponding relative frequency is assumed to be zero (and thus, the - * tuple is highly reidentifiable). - * - * @property {Object} table - * Required. Auxiliary table location. - * - * This object should have the same structure as [BigQueryTable]{@link google.privacy.dlp.v2.BigQueryTable} - * - * @property {Object[]} quasiIds - * Required. Quasi-identifier columns. - * - * This object should have the same structure as [QuasiIdField]{@link google.privacy.dlp.v2.QuasiIdField} - * - * @property {Object} relativeFrequency - * Required. The relative frequency column must contain a floating-point number - * between 0 and 1 (inclusive). Null values are assumed to be zero. - * - * This object should have the same structure as [FieldId]{@link google.privacy.dlp.v2.FieldId} - * - * @typedef AuxiliaryTable - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.AuxiliaryTable definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ - AuxiliaryTable: { - // This is for documentation. Actual contents will be loaded by gRPC. - - /** - * A quasi-identifier column has a custom_tag, used to know which column - * in the data corresponds to which column in the statistical model. - * - * @property {Object} field - * Identifies the column. - * - * This object should have the same structure as [FieldId]{@link google.privacy.dlp.v2.FieldId} - * - * @property {string} customTag - * A auxiliary field. - * - * @typedef QuasiIdField - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.AuxiliaryTable.QuasiIdField definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ - QuasiIdField: { - // This is for documentation. Actual contents will be loaded by gRPC. - } - } - }, - - /** - * δ-presence metric, used to estimate how likely it is for an attacker to - * figure out that one given individual appears in a de-identified dataset. - * Similarly to the k-map metric, we cannot compute δ-presence exactly without - * knowing the attack dataset, so we use a statistical model instead. - * - * @property {Object[]} quasiIds - * Required. Fields considered to be quasi-identifiers. No two fields can have the - * same tag. - * - * This object should have the same structure as [QuasiId]{@link google.privacy.dlp.v2.QuasiId} - * - * @property {string} regionCode - * ISO 3166-1 alpha-2 region code to use in the statistical modeling. - * Set if no column is tagged with a region-specific InfoType (like - * US_ZIP_5) or a region code. - * - * @property {Object[]} auxiliaryTables - * Several auxiliary tables can be used in the analysis. Each custom_tag - * used to tag a quasi-identifiers field must appear in exactly one - * field of one auxiliary table. - * - * This object should have the same structure as [StatisticalTable]{@link google.privacy.dlp.v2.StatisticalTable} - * - * @typedef DeltaPresenceEstimationConfig - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.PrivacyMetric.DeltaPresenceEstimationConfig definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ - DeltaPresenceEstimationConfig: { - // This is for documentation. Actual contents will be loaded by gRPC. - } -}; - -/** - * Result of a risk analysis operation request. - * - * @property {Object} requestedPrivacyMetric - * Privacy metric to compute. - * - * This object should have the same structure as [PrivacyMetric]{@link google.privacy.dlp.v2.PrivacyMetric} - * - * @property {Object} requestedSourceTable - * Input dataset to compute metrics over. - * - * This object should have the same structure as [BigQueryTable]{@link google.privacy.dlp.v2.BigQueryTable} - * - * @property {Object} numericalStatsResult - * Numerical stats result - * - * This object should have the same structure as [NumericalStatsResult]{@link google.privacy.dlp.v2.NumericalStatsResult} - * - * @property {Object} categoricalStatsResult - * Categorical stats result - * - * This object should have the same structure as [CategoricalStatsResult]{@link google.privacy.dlp.v2.CategoricalStatsResult} - * - * @property {Object} kAnonymityResult - * K-anonymity result - * - * This object should have the same structure as [KAnonymityResult]{@link google.privacy.dlp.v2.KAnonymityResult} - * - * @property {Object} lDiversityResult - * L-divesity result - * - * This object should have the same structure as [LDiversityResult]{@link google.privacy.dlp.v2.LDiversityResult} - * - * @property {Object} kMapEstimationResult - * K-map result - * - * This object should have the same structure as [KMapEstimationResult]{@link google.privacy.dlp.v2.KMapEstimationResult} - * - * @property {Object} deltaPresenceEstimationResult - * Delta-presence result - * - * This object should have the same structure as [DeltaPresenceEstimationResult]{@link google.privacy.dlp.v2.DeltaPresenceEstimationResult} - * - * @typedef AnalyzeDataSourceRiskDetails - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ -const AnalyzeDataSourceRiskDetails = { - // This is for documentation. Actual contents will be loaded by gRPC. - - /** - * Result of the numerical stats computation. - * - * @property {Object} minValue - * Minimum value appearing in the column. - * - * This object should have the same structure as [Value]{@link google.privacy.dlp.v2.Value} - * - * @property {Object} maxValue - * Maximum value appearing in the column. - * - * This object should have the same structure as [Value]{@link google.privacy.dlp.v2.Value} - * - * @property {Object[]} quantileValues - * List of 99 values that partition the set of field values into 100 equal - * sized buckets. - * - * This object should have the same structure as [Value]{@link google.privacy.dlp.v2.Value} - * - * @typedef NumericalStatsResult - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.NumericalStatsResult definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ - NumericalStatsResult: { - // This is for documentation. Actual contents will be loaded by gRPC. - }, - - /** - * Result of the categorical stats computation. - * - * @property {Object[]} valueFrequencyHistogramBuckets - * Histogram of value frequencies in the column. - * - * This object should have the same structure as [CategoricalStatsHistogramBucket]{@link google.privacy.dlp.v2.CategoricalStatsHistogramBucket} - * - * @typedef CategoricalStatsResult - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.CategoricalStatsResult definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ - CategoricalStatsResult: { - // This is for documentation. Actual contents will be loaded by gRPC. - - /** - * Histogram of value frequencies in the column. - * - * @property {number} valueFrequencyLowerBound - * Lower bound on the value frequency of the values in this bucket. - * - * @property {number} valueFrequencyUpperBound - * Upper bound on the value frequency of the values in this bucket. - * - * @property {number} bucketSize - * Total number of values in this bucket. - * - * @property {Object[]} bucketValues - * Sample of value frequencies in this bucket. The total number of - * values returned per bucket is capped at 20. - * - * This object should have the same structure as [ValueFrequency]{@link google.privacy.dlp.v2.ValueFrequency} - * - * @property {number} bucketValueCount - * Total number of distinct values in this bucket. - * - * @typedef CategoricalStatsHistogramBucket - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.CategoricalStatsResult.CategoricalStatsHistogramBucket definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ - CategoricalStatsHistogramBucket: { - // This is for documentation. Actual contents will be loaded by gRPC. - } - }, - - /** - * Result of the k-anonymity computation. - * - * @property {Object[]} equivalenceClassHistogramBuckets - * Histogram of k-anonymity equivalence classes. - * - * This object should have the same structure as [KAnonymityHistogramBucket]{@link google.privacy.dlp.v2.KAnonymityHistogramBucket} - * - * @typedef KAnonymityResult - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResult definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ - KAnonymityResult: { - // This is for documentation. Actual contents will be loaded by gRPC. - - /** - * The set of columns' values that share the same ldiversity value - * - * @property {Object[]} quasiIdsValues - * Set of values defining the equivalence class. One value per - * quasi-identifier column in the original KAnonymity metric message. - * The order is always the same as the original request. - * - * This object should have the same structure as [Value]{@link google.privacy.dlp.v2.Value} - * - * @property {number} equivalenceClassSize - * Size of the equivalence class, for example number of rows with the - * above set of values. - * - * @typedef KAnonymityEquivalenceClass - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResult.KAnonymityEquivalenceClass definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ - KAnonymityEquivalenceClass: { - // This is for documentation. Actual contents will be loaded by gRPC. - }, - - /** - * Histogram of k-anonymity equivalence classes. - * - * @property {number} equivalenceClassSizeLowerBound - * Lower bound on the size of the equivalence classes in this bucket. - * - * @property {number} equivalenceClassSizeUpperBound - * Upper bound on the size of the equivalence classes in this bucket. - * - * @property {number} bucketSize - * Total number of equivalence classes in this bucket. - * - * @property {Object[]} bucketValues - * Sample of equivalence classes in this bucket. The total number of - * classes returned per bucket is capped at 20. - * - * This object should have the same structure as [KAnonymityEquivalenceClass]{@link google.privacy.dlp.v2.KAnonymityEquivalenceClass} - * - * @property {number} bucketValueCount - * Total number of distinct equivalence classes in this bucket. - * - * @typedef KAnonymityHistogramBucket - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResult.KAnonymityHistogramBucket definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ - KAnonymityHistogramBucket: { - // This is for documentation. Actual contents will be loaded by gRPC. - } - }, - - /** - * Result of the l-diversity computation. - * - * @property {Object[]} sensitiveValueFrequencyHistogramBuckets - * Histogram of l-diversity equivalence class sensitive value frequencies. - * - * This object should have the same structure as [LDiversityHistogramBucket]{@link google.privacy.dlp.v2.LDiversityHistogramBucket} - * - * @typedef LDiversityResult - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.LDiversityResult definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ - LDiversityResult: { - // This is for documentation. Actual contents will be loaded by gRPC. - - /** - * The set of columns' values that share the same ldiversity value. - * - * @property {Object[]} quasiIdsValues - * Quasi-identifier values defining the k-anonymity equivalence - * class. The order is always the same as the original request. - * - * This object should have the same structure as [Value]{@link google.privacy.dlp.v2.Value} - * - * @property {number} equivalenceClassSize - * Size of the k-anonymity equivalence class. - * - * @property {number} numDistinctSensitiveValues - * Number of distinct sensitive values in this equivalence class. - * - * @property {Object[]} topSensitiveValues - * Estimated frequencies of top sensitive values. - * - * This object should have the same structure as [ValueFrequency]{@link google.privacy.dlp.v2.ValueFrequency} - * - * @typedef LDiversityEquivalenceClass - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.LDiversityResult.LDiversityEquivalenceClass definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ - LDiversityEquivalenceClass: { - // This is for documentation. Actual contents will be loaded by gRPC. - }, - - /** - * Histogram of l-diversity equivalence class sensitive value frequencies. - * - * @property {number} sensitiveValueFrequencyLowerBound - * Lower bound on the sensitive value frequencies of the equivalence - * classes in this bucket. - * - * @property {number} sensitiveValueFrequencyUpperBound - * Upper bound on the sensitive value frequencies of the equivalence - * classes in this bucket. - * - * @property {number} bucketSize - * Total number of equivalence classes in this bucket. - * - * @property {Object[]} bucketValues - * Sample of equivalence classes in this bucket. The total number of - * classes returned per bucket is capped at 20. - * - * This object should have the same structure as [LDiversityEquivalenceClass]{@link google.privacy.dlp.v2.LDiversityEquivalenceClass} - * - * @property {number} bucketValueCount - * Total number of distinct equivalence classes in this bucket. - * - * @typedef LDiversityHistogramBucket - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.LDiversityResult.LDiversityHistogramBucket definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ - LDiversityHistogramBucket: { - // This is for documentation. Actual contents will be loaded by gRPC. - } - }, - - /** - * Result of the reidentifiability analysis. Note that these results are an - * estimation, not exact values. - * - * @property {Object[]} kMapEstimationHistogram - * The intervals [min_anonymity, max_anonymity] do not overlap. If a value - * doesn't correspond to any such interval, the associated frequency is - * zero. For example, the following records: - * {min_anonymity: 1, max_anonymity: 1, frequency: 17} - * {min_anonymity: 2, max_anonymity: 3, frequency: 42} - * {min_anonymity: 5, max_anonymity: 10, frequency: 99} - * mean that there are no record with an estimated anonymity of 4, 5, or - * larger than 10. - * - * This object should have the same structure as [KMapEstimationHistogramBucket]{@link google.privacy.dlp.v2.KMapEstimationHistogramBucket} - * - * @typedef KMapEstimationResult - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ - KMapEstimationResult: { - // This is for documentation. Actual contents will be loaded by gRPC. - - /** - * A tuple of values for the quasi-identifier columns. - * - * @property {Object[]} quasiIdsValues - * The quasi-identifier values. - * - * This object should have the same structure as [Value]{@link google.privacy.dlp.v2.Value} - * - * @property {number} estimatedAnonymity - * The estimated anonymity for these quasi-identifier values. - * - * @typedef KMapEstimationQuasiIdValues - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult.KMapEstimationQuasiIdValues definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ - KMapEstimationQuasiIdValues: { - // This is for documentation. Actual contents will be loaded by gRPC. - }, - - /** - * A KMapEstimationHistogramBucket message with the following values: - * min_anonymity: 3 - * max_anonymity: 5 - * frequency: 42 - * means that there are 42 records whose quasi-identifier values correspond - * to 3, 4 or 5 people in the overlying population. An important particular - * case is when min_anonymity = max_anonymity = 1: the frequency field then - * corresponds to the number of uniquely identifiable records. - * - * @property {number} minAnonymity - * Always positive. - * - * @property {number} maxAnonymity - * Always greater than or equal to min_anonymity. - * - * @property {number} bucketSize - * Number of records within these anonymity bounds. - * - * @property {Object[]} bucketValues - * Sample of quasi-identifier tuple values in this bucket. The total - * number of classes returned per bucket is capped at 20. - * - * This object should have the same structure as [KMapEstimationQuasiIdValues]{@link google.privacy.dlp.v2.KMapEstimationQuasiIdValues} - * - * @property {number} bucketValueCount - * Total number of distinct quasi-identifier tuple values in this bucket. - * - * @typedef KMapEstimationHistogramBucket - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult.KMapEstimationHistogramBucket definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ - KMapEstimationHistogramBucket: { - // This is for documentation. Actual contents will be loaded by gRPC. - } - }, - - /** - * Result of the δ-presence computation. Note that these results are an - * estimation, not exact values. - * - * @property {Object[]} deltaPresenceEstimationHistogram - * The intervals [min_probability, max_probability) do not overlap. If a - * value doesn't correspond to any such interval, the associated frequency - * is zero. For example, the following records: - * {min_probability: 0, max_probability: 0.1, frequency: 17} - * {min_probability: 0.2, max_probability: 0.3, frequency: 42} - * {min_probability: 0.3, max_probability: 0.4, frequency: 99} - * mean that there are no record with an estimated probability in [0.1, 0.2) - * nor larger or equal to 0.4. - * - * This object should have the same structure as [DeltaPresenceEstimationHistogramBucket]{@link google.privacy.dlp.v2.DeltaPresenceEstimationHistogramBucket} - * - * @typedef DeltaPresenceEstimationResult - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.DeltaPresenceEstimationResult definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ - DeltaPresenceEstimationResult: { - // This is for documentation. Actual contents will be loaded by gRPC. - - /** - * A tuple of values for the quasi-identifier columns. - * - * @property {Object[]} quasiIdsValues - * The quasi-identifier values. - * - * This object should have the same structure as [Value]{@link google.privacy.dlp.v2.Value} - * - * @property {number} estimatedProbability - * The estimated probability that a given individual sharing these - * quasi-identifier values is in the dataset. This value, typically called - * δ, is the ratio between the number of records in the dataset with these - * quasi-identifier values, and the total number of individuals (inside - * *and* outside the dataset) with these quasi-identifier values. - * For example, if there are 15 individuals in the dataset who share the - * same quasi-identifier values, and an estimated 100 people in the entire - * population with these values, then δ is 0.15. - * - * @typedef DeltaPresenceEstimationQuasiIdValues - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.DeltaPresenceEstimationResult.DeltaPresenceEstimationQuasiIdValues definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ - DeltaPresenceEstimationQuasiIdValues: { - // This is for documentation. Actual contents will be loaded by gRPC. - }, - - /** - * A DeltaPresenceEstimationHistogramBucket message with the following - * values: - * min_probability: 0.1 - * max_probability: 0.2 - * frequency: 42 - * means that there are 42 records for which δ is in [0.1, 0.2). An - * important particular case is when min_probability = max_probability = 1: - * then, every individual who shares this quasi-identifier combination is in - * the dataset. - * - * @property {number} minProbability - * Between 0 and 1. - * - * @property {number} maxProbability - * Always greater than or equal to min_probability. - * - * @property {number} bucketSize - * Number of records within these probability bounds. - * - * @property {Object[]} bucketValues - * Sample of quasi-identifier tuple values in this bucket. The total - * number of classes returned per bucket is capped at 20. - * - * This object should have the same structure as [DeltaPresenceEstimationQuasiIdValues]{@link google.privacy.dlp.v2.DeltaPresenceEstimationQuasiIdValues} - * - * @property {number} bucketValueCount - * Total number of distinct quasi-identifier tuple values in this bucket. - * - * @typedef DeltaPresenceEstimationHistogramBucket - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.DeltaPresenceEstimationResult.DeltaPresenceEstimationHistogramBucket definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ - DeltaPresenceEstimationHistogramBucket: { - // This is for documentation. Actual contents will be loaded by gRPC. - } - } -}; - -/** - * A value of a field, including its frequency. - * - * @property {Object} value - * A value contained in the field in question. - * - * This object should have the same structure as [Value]{@link google.privacy.dlp.v2.Value} - * - * @property {number} count - * How many times the value is contained in the field. - * - * @typedef ValueFrequency - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.ValueFrequency definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ -const ValueFrequency = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Set of primitive values supported by the system. - * Note that for the purposes of inspection or transformation, the number - * of bytes considered to comprise a 'Value' is based on its representation - * as a UTF-8 encoded string. For example, if 'integer_value' is set to - * 123456789, the number of bytes would be counted as 9, even though an - * int64 only holds up to 8 bytes of data. - * - * @property {number} integerValue - * integer - * - * @property {number} floatValue - * float - * - * @property {string} stringValue - * string - * - * @property {boolean} booleanValue - * boolean - * - * @property {Object} timestampValue - * timestamp - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * - * @property {Object} timeValue - * time of day - * - * This object should have the same structure as [TimeOfDay]{@link google.type.TimeOfDay} - * - * @property {Object} dateValue - * date - * - * This object should have the same structure as [Date]{@link google.type.Date} - * - * @property {number} dayOfWeekValue - * day of week - * - * The number should be among the values of [DayOfWeek]{@link google.type.DayOfWeek} - * - * @typedef Value - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.Value definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ -const Value = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Message for infoType-dependent details parsed from quote. - * - * @property {Object} dateTime - * The date time indicated by the quote. - * - * This object should have the same structure as [DateTime]{@link google.privacy.dlp.v2.DateTime} - * - * @typedef QuoteInfo - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.QuoteInfo definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ -const QuoteInfo = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Message for a date time object. - * e.g. 2018-01-01, 5th August. - * - * @property {Object} date - * One or more of the following must be set. - * Must be a valid date or time value. - * - * This object should have the same structure as [Date]{@link google.type.Date} - * - * @property {number} dayOfWeek - * Day of week - * - * The number should be among the values of [DayOfWeek]{@link google.type.DayOfWeek} - * - * @property {Object} time - * Time of day - * - * This object should have the same structure as [TimeOfDay]{@link google.type.TimeOfDay} - * - * @property {Object} timeZone - * Time zone - * - * This object should have the same structure as [TimeZone]{@link google.privacy.dlp.v2.TimeZone} - * - * @typedef DateTime - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.DateTime definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ -const DateTime = { - // This is for documentation. Actual contents will be loaded by gRPC. - - /** - * Time zone of the date time object. - * - * @property {number} offsetMinutes - * Set only if the offset can be determined. Positive for time ahead of UTC. - * E.g. For "UTC-9", this value is -540. - * - * @typedef TimeZone - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.DateTime.TimeZone definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ - TimeZone: { - // This is for documentation. Actual contents will be loaded by gRPC. - } -}; - -/** - * The configuration that controls how the data will change. - * - * @property {Object} infoTypeTransformations - * Treat the dataset as free-form text and apply the same free text - * transformation everywhere. - * - * This object should have the same structure as [InfoTypeTransformations]{@link google.privacy.dlp.v2.InfoTypeTransformations} - * - * @property {Object} recordTransformations - * Treat the dataset as structured. Transformations can be applied to - * specific locations within structured datasets, such as transforming - * a column within a table. - * - * This object should have the same structure as [RecordTransformations]{@link google.privacy.dlp.v2.RecordTransformations} - * - * @typedef DeidentifyConfig - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.DeidentifyConfig definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ -const DeidentifyConfig = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * A rule for transforming a value. - * - * @property {Object} replaceConfig - * Replace - * - * This object should have the same structure as [ReplaceValueConfig]{@link google.privacy.dlp.v2.ReplaceValueConfig} - * - * @property {Object} redactConfig - * Redact - * - * This object should have the same structure as [RedactConfig]{@link google.privacy.dlp.v2.RedactConfig} - * - * @property {Object} characterMaskConfig - * Mask - * - * This object should have the same structure as [CharacterMaskConfig]{@link google.privacy.dlp.v2.CharacterMaskConfig} - * - * @property {Object} cryptoReplaceFfxFpeConfig - * Ffx-Fpe - * - * This object should have the same structure as [CryptoReplaceFfxFpeConfig]{@link google.privacy.dlp.v2.CryptoReplaceFfxFpeConfig} - * - * @property {Object} fixedSizeBucketingConfig - * Fixed size bucketing - * - * This object should have the same structure as [FixedSizeBucketingConfig]{@link google.privacy.dlp.v2.FixedSizeBucketingConfig} - * - * @property {Object} bucketingConfig - * Bucketing - * - * This object should have the same structure as [BucketingConfig]{@link google.privacy.dlp.v2.BucketingConfig} - * - * @property {Object} replaceWithInfoTypeConfig - * Replace with infotype - * - * This object should have the same structure as [ReplaceWithInfoTypeConfig]{@link google.privacy.dlp.v2.ReplaceWithInfoTypeConfig} - * - * @property {Object} timePartConfig - * Time extraction - * - * This object should have the same structure as [TimePartConfig]{@link google.privacy.dlp.v2.TimePartConfig} - * - * @property {Object} cryptoHashConfig - * Crypto - * - * This object should have the same structure as [CryptoHashConfig]{@link google.privacy.dlp.v2.CryptoHashConfig} - * - * @property {Object} dateShiftConfig - * Date Shift - * - * This object should have the same structure as [DateShiftConfig]{@link google.privacy.dlp.v2.DateShiftConfig} - * - * @property {Object} cryptoDeterministicConfig - * Deterministic Crypto - * - * This object should have the same structure as [CryptoDeterministicConfig]{@link google.privacy.dlp.v2.CryptoDeterministicConfig} - * - * @typedef PrimitiveTransformation - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.PrimitiveTransformation definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ -const PrimitiveTransformation = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * For use with `Date`, `Timestamp`, and `TimeOfDay`, extract or preserve a - * portion of the value. - * - * @property {number} partToExtract - * The part of the time to keep. - * - * The number should be among the values of [TimePart]{@link google.privacy.dlp.v2.TimePart} - * - * @typedef TimePartConfig - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.TimePartConfig definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ -const TimePartConfig = { - // This is for documentation. Actual contents will be loaded by gRPC. - - /** - * Components that make up time. - * - * @enum {number} - * @memberof google.privacy.dlp.v2 - */ - TimePart: { - - /** - * Unused - */ - TIME_PART_UNSPECIFIED: 0, - - /** - * [0-9999] - */ - YEAR: 1, - - /** - * [1-12] - */ - MONTH: 2, - - /** - * [1-31] - */ - DAY_OF_MONTH: 3, - - /** - * [1-7] - */ - DAY_OF_WEEK: 4, - - /** - * [1-53] - */ - WEEK_OF_YEAR: 5, - - /** - * [0-23] - */ - HOUR_OF_DAY: 6 - } -}; - -/** - * Pseudonymization method that generates surrogates via cryptographic hashing. - * Uses SHA-256. - * The key size must be either 32 or 64 bytes. - * Outputs a base64 encoded representation of the hashed output - * (for example, L7k0BHmF1ha5U3NfGykjro4xWi1MPVQPjhMAZbSV9mM=). - * Currently, only string and integer values can be hashed. - * See https://cloud.google.com/dlp/docs/pseudonymization to learn more. - * - * @property {Object} cryptoKey - * The key used by the hash function. - * - * This object should have the same structure as [CryptoKey]{@link google.privacy.dlp.v2.CryptoKey} - * - * @typedef CryptoHashConfig - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.CryptoHashConfig definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ -const CryptoHashConfig = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Pseudonymization method that generates deterministic encryption for the given - * input. Outputs a base64 encoded representation of the encrypted output. - * Uses AES-SIV based on the RFC https://tools.ietf.org/html/rfc5297. - * - * @property {Object} cryptoKey - * The key used by the encryption function. - * - * This object should have the same structure as [CryptoKey]{@link google.privacy.dlp.v2.CryptoKey} - * - * @property {Object} surrogateInfoType - * The custom info type to annotate the surrogate with. - * This annotation will be applied to the surrogate by prefixing it with - * the name of the custom info type followed by the number of - * characters comprising the surrogate. The following scheme defines the - * format: {info type name}({surrogate character count}):{surrogate} - * - * For example, if the name of custom info type is 'MY_TOKEN_INFO_TYPE' and - * the surrogate is 'abc', the full replacement value - * will be: 'MY_TOKEN_INFO_TYPE(3):abc' - * - * This annotation identifies the surrogate when inspecting content using the - * custom info type 'Surrogate'. This facilitates reversal of the - * surrogate when it occurs in free text. - * - * Note: For record transformations where the entire cell in a table is being - * transformed, surrogates are not mandatory. Surrogates are used to denote - * the location of the token and are necessary for re-identification in free - * form text. - * - * In order for inspection to work properly, the name of this info type must - * not occur naturally anywhere in your data; otherwise, inspection may either - * - * - reverse a surrogate that does not correspond to an actual identifier - * - be unable to parse the surrogate and result in an error - * - * Therefore, choose your custom info type name carefully after considering - * what your data looks like. One way to select a name that has a high chance - * of yielding reliable detection is to include one or more unicode characters - * that are highly improbable to exist in your data. - * For example, assuming your data is entered from a regular ASCII keyboard, - * the symbol with the hex code point 29DD might be used like so: - * ⧝MY_TOKEN_TYPE. - * - * This object should have the same structure as [InfoType]{@link google.privacy.dlp.v2.InfoType} - * - * @property {Object} context - * A context may be used for higher security and maintaining - * referential integrity such that the same identifier in two different - * contexts will be given a distinct surrogate. The context is appended to - * plaintext value being encrypted. On decryption the provided context is - * validated against the value used during encryption. If a context was - * provided during encryption, same context must be provided during decryption - * as well. - * - * If the context is not set, plaintext would be used as is for encryption. - * If the context is set but: - * - * 1. there is no record present when transforming a given value or - * 2. the field is not present when transforming a given value, - * - * plaintext would be used as is for encryption. - * - * Note that case (1) is expected when an `InfoTypeTransformation` is - * applied to both structured and non-structured `ContentItem`s. - * - * This object should have the same structure as [FieldId]{@link google.privacy.dlp.v2.FieldId} - * - * @typedef CryptoDeterministicConfig - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.CryptoDeterministicConfig definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ -const CryptoDeterministicConfig = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Replace each input value with a given `Value`. - * - * @property {Object} newValue - * Value to replace it with. - * - * This object should have the same structure as [Value]{@link google.privacy.dlp.v2.Value} - * - * @typedef ReplaceValueConfig - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.ReplaceValueConfig definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ -const ReplaceValueConfig = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Replace each matching finding with the name of the info_type. - * @typedef ReplaceWithInfoTypeConfig - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.ReplaceWithInfoTypeConfig definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ -const ReplaceWithInfoTypeConfig = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Redact a given value. For example, if used with an `InfoTypeTransformation` - * transforming PHONE_NUMBER, and input 'My phone number is 206-555-0123', the - * output would be 'My phone number is '. - * @typedef RedactConfig - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.RedactConfig definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ -const RedactConfig = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Characters to skip when doing deidentification of a value. These will be left - * alone and skipped. - * - * @property {string} charactersToSkip - * Characters to not transform when masking. - * - * @property {number} commonCharactersToIgnore - * Common characters to not transform when masking. Useful to avoid removing - * punctuation. - * - * The number should be among the values of [CommonCharsToIgnore]{@link google.privacy.dlp.v2.CommonCharsToIgnore} - * - * @typedef CharsToIgnore - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.CharsToIgnore definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ -const CharsToIgnore = { - // This is for documentation. Actual contents will be loaded by gRPC. - - /** - * Convenience enum for indication common characters to not transform. - * - * @enum {number} - * @memberof google.privacy.dlp.v2 - */ - CommonCharsToIgnore: { - - /** - * Unused. - */ - COMMON_CHARS_TO_IGNORE_UNSPECIFIED: 0, - - /** - * 0-9 - */ - NUMERIC: 1, - - /** - * A-Z - */ - ALPHA_UPPER_CASE: 2, - - /** - * a-z - */ - ALPHA_LOWER_CASE: 3, - - /** - * US Punctuation, one of !"#$%&'()*+,-./:;<=>?@[\]^_`{|}~ - */ - PUNCTUATION: 4, - - /** - * Whitespace character, one of [ \t\n\x0B\f\r] - */ - WHITESPACE: 5 - } -}; - -/** - * Partially mask a string by replacing a given number of characters with a - * fixed character. Masking can start from the beginning or end of the string. - * This can be used on data of any type (numbers, longs, and so on) and when - * de-identifying structured data we'll attempt to preserve the original data's - * type. (This allows you to take a long like 123 and modify it to a string like - * **3. - * - * @property {string} maskingCharacter - * Character to use to mask the sensitive values—for example, `*` for an - * alphabetic string such as a name, or `0` for a numeric string such as ZIP - * code or credit card number. This string must have a length of 1. If not - * supplied, this value defaults to `*` for strings, and `0` for digits. - * - * @property {number} numberToMask - * Number of characters to mask. If not set, all matching chars will be - * masked. Skipped characters do not count towards this tally. - * - * @property {boolean} reverseOrder - * Mask characters in reverse order. For example, if `masking_character` is - * `0`, `number_to_mask` is `14`, and `reverse_order` is `false`, then the - * input string `1234-5678-9012-3456` is masked as `00000000000000-3456`. - * If `masking_character` is `*`, `number_to_mask` is `3`, and `reverse_order` - * is `true`, then the string `12345` is masked as `12***`. - * - * @property {Object[]} charactersToIgnore - * When masking a string, items in this list will be skipped when replacing - * characters. For example, if the input string is `555-555-5555` and you - * instruct Cloud DLP to skip `-` and mask 5 characters with `*`, Cloud DLP - * returns `***-**5-5555`. - * - * This object should have the same structure as [CharsToIgnore]{@link google.privacy.dlp.v2.CharsToIgnore} - * - * @typedef CharacterMaskConfig - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.CharacterMaskConfig definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ -const CharacterMaskConfig = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Buckets values based on fixed size ranges. The - * Bucketing transformation can provide all of this functionality, - * but requires more configuration. This message is provided as a convenience to - * the user for simple bucketing strategies. - * - * The transformed value will be a hyphenated string of - * {lower_bound}-{upper_bound}, i.e if lower_bound = 10 and upper_bound = 20 - * all values that are within this bucket will be replaced with "10-20". - * - * This can be used on data of type: double, long. - * - * If the bound Value type differs from the type of data - * being transformed, we will first attempt converting the type of the data to - * be transformed to match the type of the bound before comparing. - * - * See https://cloud.google.com/dlp/docs/concepts-bucketing to learn more. - * - * @property {Object} lowerBound - * Required. Lower bound value of buckets. All values less than `lower_bound` are - * grouped together into a single bucket; for example if `lower_bound` = 10, - * then all values less than 10 are replaced with the value “-10”. - * - * This object should have the same structure as [Value]{@link google.privacy.dlp.v2.Value} - * - * @property {Object} upperBound - * Required. Upper bound value of buckets. All values greater than upper_bound are - * grouped together into a single bucket; for example if `upper_bound` = 89, - * then all values greater than 89 are replaced with the value “89+”. - * - * This object should have the same structure as [Value]{@link google.privacy.dlp.v2.Value} - * - * @property {number} bucketSize - * Required. Size of each bucket (except for minimum and maximum buckets). So if - * `lower_bound` = 10, `upper_bound` = 89, and `bucket_size` = 10, then the - * following buckets would be used: -10, 10-20, 20-30, 30-40, 40-50, 50-60, - * 60-70, 70-80, 80-89, 89+. Precision up to 2 decimals works. - * - * @typedef FixedSizeBucketingConfig - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.FixedSizeBucketingConfig definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ -const FixedSizeBucketingConfig = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Generalization function that buckets values based on ranges. The ranges and - * replacement values are dynamically provided by the user for custom behavior, - * such as 1-30 -> LOW 31-65 -> MEDIUM 66-100 -> HIGH - * This can be used on - * data of type: number, long, string, timestamp. - * If the bound `Value` type differs from the type of data being transformed, we - * will first attempt converting the type of the data to be transformed to match - * the type of the bound before comparing. - * See https://cloud.google.com/dlp/docs/concepts-bucketing to learn more. - * - * @property {Object[]} buckets - * Set of buckets. Ranges must be non-overlapping. - * - * This object should have the same structure as [Bucket]{@link google.privacy.dlp.v2.Bucket} - * - * @typedef BucketingConfig - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.BucketingConfig definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ -const BucketingConfig = { - // This is for documentation. Actual contents will be loaded by gRPC. - - /** - * Bucket is represented as a range, along with replacement values. - * - * @property {Object} min - * Lower bound of the range, inclusive. Type should be the same as max if - * used. - * - * This object should have the same structure as [Value]{@link google.privacy.dlp.v2.Value} - * - * @property {Object} max - * Upper bound of the range, exclusive; type must match min. - * - * This object should have the same structure as [Value]{@link google.privacy.dlp.v2.Value} - * - * @property {Object} replacementValue - * Replacement value for this bucket. If not provided - * the default behavior will be to hyphenate the min-max range. - * - * This object should have the same structure as [Value]{@link google.privacy.dlp.v2.Value} - * - * @typedef Bucket - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.BucketingConfig.Bucket definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ - Bucket: { - // This is for documentation. Actual contents will be loaded by gRPC. - } -}; - -/** - * Replaces an identifier with a surrogate using Format Preserving Encryption - * (FPE) with the FFX mode of operation; however when used in the - * `ReidentifyContent` API method, it serves the opposite function by reversing - * the surrogate back into the original identifier. The identifier must be - * encoded as ASCII. For a given crypto key and context, the same identifier - * will be replaced with the same surrogate. Identifiers must be at least two - * characters long. In the case that the identifier is the empty string, it will - * be skipped. See https://cloud.google.com/dlp/docs/pseudonymization to learn - * more. - * - * Note: We recommend using CryptoDeterministicConfig for all use cases which - * do not require preserving the input alphabet space and size, plus warrant - * referential integrity. - * - * @property {Object} cryptoKey - * Required. The key used by the encryption algorithm. - * - * This object should have the same structure as [CryptoKey]{@link google.privacy.dlp.v2.CryptoKey} - * - * @property {Object} context - * The 'tweak', a context may be used for higher security since the same - * identifier in two different contexts won't be given the same surrogate. If - * the context is not set, a default tweak will be used. - * - * If the context is set but: - * - * 1. there is no record present when transforming a given value or - * 1. the field is not present when transforming a given value, - * - * a default tweak will be used. - * - * Note that case (1) is expected when an `InfoTypeTransformation` is - * applied to both structured and non-structured `ContentItem`s. - * Currently, the referenced field may be of value type integer or string. - * - * The tweak is constructed as a sequence of bytes in big endian byte order - * such that: - * - * - a 64 bit integer is encoded followed by a single byte of value 1 - * - a string is encoded in UTF-8 format followed by a single byte of value 2 - * - * This object should have the same structure as [FieldId]{@link google.privacy.dlp.v2.FieldId} - * - * @property {number} commonAlphabet - * Common alphabets. - * - * The number should be among the values of [FfxCommonNativeAlphabet]{@link google.privacy.dlp.v2.FfxCommonNativeAlphabet} - * - * @property {string} customAlphabet - * This is supported by mapping these to the alphanumeric characters - * that the FFX mode natively supports. This happens before/after - * encryption/decryption. - * Each character listed must appear only once. - * Number of characters must be in the range [2, 95]. - * This must be encoded as ASCII. - * The order of characters does not matter. - * - * @property {number} radix - * The native way to select the alphabet. Must be in the range [2, 95]. - * - * @property {Object} surrogateInfoType - * The custom infoType to annotate the surrogate with. - * This annotation will be applied to the surrogate by prefixing it with - * the name of the custom infoType followed by the number of - * characters comprising the surrogate. The following scheme defines the - * format: info_type_name(surrogate_character_count):surrogate - * - * For example, if the name of custom infoType is 'MY_TOKEN_INFO_TYPE' and - * the surrogate is 'abc', the full replacement value - * will be: 'MY_TOKEN_INFO_TYPE(3):abc' - * - * This annotation identifies the surrogate when inspecting content using the - * custom infoType - * [`SurrogateType`](https://cloud.google.com/dlp/docs/reference/rest/v2/InspectConfig#surrogatetype). - * This facilitates reversal of the surrogate when it occurs in free text. - * - * In order for inspection to work properly, the name of this infoType must - * not occur naturally anywhere in your data; otherwise, inspection may - * find a surrogate that does not correspond to an actual identifier. - * Therefore, choose your custom infoType name carefully after considering - * what your data looks like. One way to select a name that has a high chance - * of yielding reliable detection is to include one or more unicode characters - * that are highly improbable to exist in your data. - * For example, assuming your data is entered from a regular ASCII keyboard, - * the symbol with the hex code point 29DD might be used like so: - * ⧝MY_TOKEN_TYPE - * - * This object should have the same structure as [InfoType]{@link google.privacy.dlp.v2.InfoType} - * - * @typedef CryptoReplaceFfxFpeConfig - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.CryptoReplaceFfxFpeConfig definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ -const CryptoReplaceFfxFpeConfig = { - // This is for documentation. Actual contents will be loaded by gRPC. - - /** - * These are commonly used subsets of the alphabet that the FFX mode - * natively supports. In the algorithm, the alphabet is selected using - * the "radix". Therefore each corresponds to particular radix. - * - * @enum {number} - * @memberof google.privacy.dlp.v2 - */ - FfxCommonNativeAlphabet: { - - /** - * Unused. - */ - FFX_COMMON_NATIVE_ALPHABET_UNSPECIFIED: 0, - - /** - * [0-9] (radix of 10) - */ - NUMERIC: 1, - - /** - * [0-9A-F] (radix of 16) - */ - HEXADECIMAL: 2, - - /** - * [0-9A-Z] (radix of 36) - */ - UPPER_CASE_ALPHA_NUMERIC: 3, - - /** - * [0-9A-Za-z] (radix of 62) - */ - ALPHA_NUMERIC: 4 - } -}; - -/** - * This is a data encryption key (DEK) (as opposed to - * a key encryption key (KEK) stored by KMS). - * When using KMS to wrap/unwrap DEKs, be sure to set an appropriate - * IAM policy on the KMS CryptoKey (KEK) to ensure an attacker cannot - * unwrap the data crypto key. - * - * @property {Object} transient - * Transient crypto key - * - * This object should have the same structure as [TransientCryptoKey]{@link google.privacy.dlp.v2.TransientCryptoKey} - * - * @property {Object} unwrapped - * Unwrapped crypto key - * - * This object should have the same structure as [UnwrappedCryptoKey]{@link google.privacy.dlp.v2.UnwrappedCryptoKey} - * - * @property {Object} kmsWrapped - * Kms wrapped key - * - * This object should have the same structure as [KmsWrappedCryptoKey]{@link google.privacy.dlp.v2.KmsWrappedCryptoKey} - * - * @typedef CryptoKey - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.CryptoKey definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ -const CryptoKey = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Use this to have a random data crypto key generated. - * It will be discarded after the request finishes. - * - * @property {string} name - * Required. Name of the key. - * This is an arbitrary string used to differentiate different keys. - * A unique key is generated per name: two separate `TransientCryptoKey` - * protos share the same generated key if their names are the same. - * When the data crypto key is generated, this name is not used in any way - * (repeating the api call will result in a different key being generated). - * - * @typedef TransientCryptoKey - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.TransientCryptoKey definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ -const TransientCryptoKey = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Using raw keys is prone to security risks due to accidentally - * leaking the key. Choose another type of key if possible. - * - * @property {Buffer} key - * Required. A 128/192/256 bit key. - * - * @typedef UnwrappedCryptoKey - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.UnwrappedCryptoKey definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ -const UnwrappedCryptoKey = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Include to use an existing data crypto key wrapped by KMS. - * The wrapped key must be a 128/192/256 bit key. - * Authorization requires the following IAM permissions when sending a request - * to perform a crypto transformation using a kms-wrapped crypto key: - * dlp.kms.encrypt - * - * @property {Buffer} wrappedKey - * Required. The wrapped data crypto key. - * - * @property {string} cryptoKeyName - * Required. The resource name of the KMS CryptoKey to use for unwrapping. - * - * @typedef KmsWrappedCryptoKey - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.KmsWrappedCryptoKey definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ -const KmsWrappedCryptoKey = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Shifts dates by random number of days, with option to be consistent for the - * same context. See https://cloud.google.com/dlp/docs/concepts-date-shifting - * to learn more. - * - * @property {number} upperBoundDays - * Required. Range of shift in days. Actual shift will be selected at random within this - * range (inclusive ends). Negative means shift to earlier in time. Must not - * be more than 365250 days (1000 years) each direction. - * - * For example, 3 means shift date to at most 3 days into the future. - * - * @property {number} lowerBoundDays - * Required. For example, -5 means shift date to at most 5 days back in the past. - * - * @property {Object} context - * Points to the field that contains the context, for example, an entity id. - * If set, must also set cryptoKey. If set, shift will be consistent for the - * given context. - * - * This object should have the same structure as [FieldId]{@link google.privacy.dlp.v2.FieldId} - * - * @property {Object} cryptoKey - * Causes the shift to be computed based on this key and the context. This - * results in the same shift for the same context and crypto_key. If - * set, must also set context. Can only be applied to table items. - * - * This object should have the same structure as [CryptoKey]{@link google.privacy.dlp.v2.CryptoKey} - * - * @typedef DateShiftConfig - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.DateShiftConfig definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ -const DateShiftConfig = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * A type of transformation that will scan unstructured text and - * apply various `PrimitiveTransformation`s to each finding, where the - * transformation is applied to only values that were identified as a specific - * info_type. - * - * @property {Object[]} transformations - * Required. Transformation for each infoType. Cannot specify more than one - * for a given infoType. - * - * This object should have the same structure as [InfoTypeTransformation]{@link google.privacy.dlp.v2.InfoTypeTransformation} - * - * @typedef InfoTypeTransformations - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.InfoTypeTransformations definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ -const InfoTypeTransformations = { - // This is for documentation. Actual contents will be loaded by gRPC. - - /** - * A transformation to apply to text that is identified as a specific - * info_type. - * - * @property {Object[]} infoTypes - * InfoTypes to apply the transformation to. An empty list will cause - * this transformation to apply to all findings that correspond to - * infoTypes that were requested in `InspectConfig`. - * - * This object should have the same structure as [InfoType]{@link google.privacy.dlp.v2.InfoType} - * - * @property {Object} primitiveTransformation - * Required. Primitive transformation to apply to the infoType. - * - * This object should have the same structure as [PrimitiveTransformation]{@link google.privacy.dlp.v2.PrimitiveTransformation} - * - * @typedef InfoTypeTransformation - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.InfoTypeTransformations.InfoTypeTransformation definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ - InfoTypeTransformation: { - // This is for documentation. Actual contents will be loaded by gRPC. - } -}; - -/** - * The transformation to apply to the field. - * - * @property {Object[]} fields - * Required. Input field(s) to apply the transformation to. - * - * This object should have the same structure as [FieldId]{@link google.privacy.dlp.v2.FieldId} - * - * @property {Object} condition - * Only apply the transformation if the condition evaluates to true for the - * given `RecordCondition`. The conditions are allowed to reference fields - * that are not used in the actual transformation. - * - * Example Use Cases: - * - * - Apply a different bucket transformation to an age column if the zip code - * column for the same record is within a specific range. - * - Redact a field if the date of birth field is greater than 85. - * - * This object should have the same structure as [RecordCondition]{@link google.privacy.dlp.v2.RecordCondition} - * - * @property {Object} primitiveTransformation - * Apply the transformation to the entire field. - * - * This object should have the same structure as [PrimitiveTransformation]{@link google.privacy.dlp.v2.PrimitiveTransformation} - * - * @property {Object} infoTypeTransformations - * Treat the contents of the field as free text, and selectively - * transform content that matches an `InfoType`. - * - * This object should have the same structure as [InfoTypeTransformations]{@link google.privacy.dlp.v2.InfoTypeTransformations} - * - * @typedef FieldTransformation - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.FieldTransformation definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ -const FieldTransformation = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * A type of transformation that is applied over structured data such as a - * table. - * - * @property {Object[]} fieldTransformations - * Transform the record by applying various field transformations. - * - * This object should have the same structure as [FieldTransformation]{@link google.privacy.dlp.v2.FieldTransformation} - * - * @property {Object[]} recordSuppressions - * Configuration defining which records get suppressed entirely. Records that - * match any suppression rule are omitted from the output. - * - * This object should have the same structure as [RecordSuppression]{@link google.privacy.dlp.v2.RecordSuppression} - * - * @typedef RecordTransformations - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.RecordTransformations definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ -const RecordTransformations = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Configuration to suppress records whose suppression conditions evaluate to - * true. - * - * @property {Object} condition - * A condition that when it evaluates to true will result in the record being - * evaluated to be suppressed from the transformed content. - * - * This object should have the same structure as [RecordCondition]{@link google.privacy.dlp.v2.RecordCondition} - * - * @typedef RecordSuppression - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.RecordSuppression definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ -const RecordSuppression = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * A condition for determining whether a transformation should be applied to - * a field. - * - * @property {Object} expressions - * An expression. - * - * This object should have the same structure as [Expressions]{@link google.privacy.dlp.v2.Expressions} - * - * @typedef RecordCondition - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.RecordCondition definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ -const RecordCondition = { - // This is for documentation. Actual contents will be loaded by gRPC. - - /** - * The field type of `value` and `field` do not need to match to be - * considered equal, but not all comparisons are possible. - * EQUAL_TO and NOT_EQUAL_TO attempt to compare even with incompatible types, - * but all other comparisons are invalid with incompatible types. - * A `value` of type: - * - * - `string` can be compared against all other types - * - `boolean` can only be compared against other booleans - * - `integer` can be compared against doubles or a string if the string value - * can be parsed as an integer. - * - `double` can be compared against integers or a string if the string can - * be parsed as a double. - * - `Timestamp` can be compared against strings in RFC 3339 date string - * format. - * - `TimeOfDay` can be compared against timestamps and strings in the format - * of 'HH:mm:ss'. - * - * If we fail to compare do to type mismatch, a warning will be given and - * the condition will evaluate to false. - * - * @property {Object} field - * Required. Field within the record this condition is evaluated against. - * - * This object should have the same structure as [FieldId]{@link google.privacy.dlp.v2.FieldId} - * - * @property {number} operator - * Required. Operator used to compare the field or infoType to the value. - * - * The number should be among the values of [RelationalOperator]{@link google.privacy.dlp.v2.RelationalOperator} - * - * @property {Object} value - * Value to compare against. [Mandatory, except for `EXISTS` tests.] - * - * This object should have the same structure as [Value]{@link google.privacy.dlp.v2.Value} - * - * @typedef Condition - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.RecordCondition.Condition definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ - Condition: { - // This is for documentation. Actual contents will be loaded by gRPC. - }, - - /** - * A collection of conditions. - * - * @property {Object[]} conditions - * A collection of conditions. - * - * This object should have the same structure as [Condition]{@link google.privacy.dlp.v2.Condition} - * - * @typedef Conditions - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.RecordCondition.Conditions definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ - Conditions: { - // This is for documentation. Actual contents will be loaded by gRPC. - }, - - /** - * An expression, consisting or an operator and conditions. - * - * @property {number} logicalOperator - * The operator to apply to the result of conditions. Default and currently - * only supported value is `AND`. - * - * The number should be among the values of [LogicalOperator]{@link google.privacy.dlp.v2.LogicalOperator} - * - * @property {Object} conditions - * Conditions to apply to the expression. - * - * This object should have the same structure as [Conditions]{@link google.privacy.dlp.v2.Conditions} - * - * @typedef Expressions - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.RecordCondition.Expressions definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ - Expressions: { - // This is for documentation. Actual contents will be loaded by gRPC. - - /** - * Logical operators for conditional checks. - * - * @enum {number} - * @memberof google.privacy.dlp.v2 - */ - LogicalOperator: { - - /** - * Unused - */ - LOGICAL_OPERATOR_UNSPECIFIED: 0, - - /** - * Conditional AND - */ - AND: 1 - } - } -}; - -/** - * Overview of the modifications that occurred. - * - * @property {number} transformedBytes - * Total size in bytes that were transformed in some way. - * - * @property {Object[]} transformationSummaries - * Transformations applied to the dataset. - * - * This object should have the same structure as [TransformationSummary]{@link google.privacy.dlp.v2.TransformationSummary} - * - * @typedef TransformationOverview - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.TransformationOverview definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ -const TransformationOverview = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Summary of a single transformation. - * Only one of 'transformation', 'field_transformation', or 'record_suppress' - * will be set. - * - * @property {Object} infoType - * Set if the transformation was limited to a specific InfoType. - * - * This object should have the same structure as [InfoType]{@link google.privacy.dlp.v2.InfoType} - * - * @property {Object} field - * Set if the transformation was limited to a specific FieldId. - * - * This object should have the same structure as [FieldId]{@link google.privacy.dlp.v2.FieldId} - * - * @property {Object} transformation - * The specific transformation these stats apply to. - * - * This object should have the same structure as [PrimitiveTransformation]{@link google.privacy.dlp.v2.PrimitiveTransformation} - * - * @property {Object[]} fieldTransformations - * The field transformation that was applied. - * If multiple field transformations are requested for a single field, - * this list will contain all of them; otherwise, only one is supplied. - * - * This object should have the same structure as [FieldTransformation]{@link google.privacy.dlp.v2.FieldTransformation} - * - * @property {Object} recordSuppress - * The specific suppression option these stats apply to. - * - * This object should have the same structure as [RecordSuppression]{@link google.privacy.dlp.v2.RecordSuppression} - * - * @property {Object[]} results - * Collection of all transformations that took place or had an error. - * - * This object should have the same structure as [SummaryResult]{@link google.privacy.dlp.v2.SummaryResult} - * - * @property {number} transformedBytes - * Total size in bytes that were transformed in some way. - * - * @typedef TransformationSummary - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.TransformationSummary definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ -const TransformationSummary = { - // This is for documentation. Actual contents will be loaded by gRPC. - - /** - * A collection that informs the user the number of times a particular - * `TransformationResultCode` and error details occurred. - * - * @property {number} count - * Number of transformations counted by this result. - * - * @property {number} code - * Outcome of the transformation. - * - * The number should be among the values of [TransformationResultCode]{@link google.privacy.dlp.v2.TransformationResultCode} - * - * @property {string} details - * A place for warnings or errors to show up if a transformation didn't - * work as expected. - * - * @typedef SummaryResult - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.TransformationSummary.SummaryResult definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ - SummaryResult: { - // This is for documentation. Actual contents will be loaded by gRPC. - }, - - /** - * Possible outcomes of transformations. - * - * @enum {number} - * @memberof google.privacy.dlp.v2 - */ - TransformationResultCode: { - - /** - * Unused - */ - TRANSFORMATION_RESULT_CODE_UNSPECIFIED: 0, - - /** - * Transformation completed without an error. - */ - SUCCESS: 1, - - /** - * Transformation had an error. - */ - ERROR: 2 - } -}; - -/** - * Schedule for triggeredJobs. - * - * @property {Object} recurrencePeriodDuration - * With this option a job is started a regular periodic basis. For - * example: every day (86400 seconds). - * - * A scheduled start time will be skipped if the previous - * execution has not ended when its scheduled time occurs. - * - * This value must be set to a time duration greater than or equal - * to 1 day and can be no longer than 60 days. - * - * This object should have the same structure as [Duration]{@link google.protobuf.Duration} - * - * @typedef Schedule - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.Schedule definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ -const Schedule = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * The inspectTemplate contains a configuration (set of types of sensitive data - * to be detected) to be used anywhere you otherwise would normally specify - * InspectConfig. See https://cloud.google.com/dlp/docs/concepts-templates - * to learn more. - * - * @property {string} name - * Output only. The template name. - * - * The template will have one of the following formats: - * `projects/PROJECT_ID/inspectTemplates/TEMPLATE_ID` OR - * `organizations/ORGANIZATION_ID/inspectTemplates/TEMPLATE_ID`; - * - * @property {string} displayName - * Display name (max 256 chars). - * - * @property {string} description - * Short description (max 256 chars). - * - * @property {Object} createTime - * Output only. The creation timestamp of an inspectTemplate. - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * - * @property {Object} updateTime - * Output only. The last update timestamp of an inspectTemplate. - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * - * @property {Object} inspectConfig - * The core content of the template. Configuration of the scanning process. - * - * This object should have the same structure as [InspectConfig]{@link google.privacy.dlp.v2.InspectConfig} - * - * @typedef InspectTemplate - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.InspectTemplate definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ -const InspectTemplate = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * DeidentifyTemplates contains instructions on how to de-identify content. - * See https://cloud.google.com/dlp/docs/concepts-templates to learn more. - * - * @property {string} name - * Output only. The template name. - * - * The template will have one of the following formats: - * `projects/PROJECT_ID/deidentifyTemplates/TEMPLATE_ID` OR - * `organizations/ORGANIZATION_ID/deidentifyTemplates/TEMPLATE_ID` - * - * @property {string} displayName - * Display name (max 256 chars). - * - * @property {string} description - * Short description (max 256 chars). - * - * @property {Object} createTime - * Output only. The creation timestamp of an inspectTemplate. - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * - * @property {Object} updateTime - * Output only. The last update timestamp of an inspectTemplate. - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * - * @property {Object} deidentifyConfig - * ///////////// // The core content of the template // /////////////// - * - * This object should have the same structure as [DeidentifyConfig]{@link google.privacy.dlp.v2.DeidentifyConfig} - * - * @typedef DeidentifyTemplate - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.DeidentifyTemplate definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ -const DeidentifyTemplate = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Details information about an error encountered during job execution or - * the results of an unsuccessful activation of the JobTrigger. - * - * @property {Object} details - * Detailed error codes and messages. - * - * This object should have the same structure as [Status]{@link google.rpc.Status} - * - * @property {Object[]} timestamps - * The times the error occurred. - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * - * @typedef Error - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.Error definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ -const Error = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Contains a configuration to make dlp api calls on a repeating basis. - * See https://cloud.google.com/dlp/docs/concepts-job-triggers to learn more. - * - * @property {string} name - * Unique resource name for the triggeredJob, assigned by the service when the - * triggeredJob is created, for example - * `projects/dlp-test-project/jobTriggers/53234423`. - * - * @property {string} displayName - * Display name (max 100 chars) - * - * @property {string} description - * User provided description (max 256 chars) - * - * @property {Object} inspectJob - * For inspect jobs, a snapshot of the configuration. - * - * This object should have the same structure as [InspectJobConfig]{@link google.privacy.dlp.v2.InspectJobConfig} - * - * @property {Object[]} triggers - * A list of triggers which will be OR'ed together. Only one in the list - * needs to trigger for a job to be started. The list may contain only - * a single Schedule trigger and must have at least one object. - * - * This object should have the same structure as [Trigger]{@link google.privacy.dlp.v2.Trigger} - * - * @property {Object[]} errors - * Output only. A stream of errors encountered when the trigger was activated. Repeated - * errors may result in the JobTrigger automatically being paused. - * Will return the last 100 errors. Whenever the JobTrigger is modified - * this list will be cleared. - * - * This object should have the same structure as [Error]{@link google.privacy.dlp.v2.Error} - * - * @property {Object} createTime - * Output only. The creation timestamp of a triggeredJob. - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * - * @property {Object} updateTime - * Output only. The last update timestamp of a triggeredJob. - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * - * @property {Object} lastRunTime - * Output only. The timestamp of the last time this trigger executed. - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * - * @property {number} status - * Required. A status for this trigger. - * - * The number should be among the values of [Status]{@link google.privacy.dlp.v2.Status} - * - * @typedef JobTrigger - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.JobTrigger definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ -const JobTrigger = { - // This is for documentation. Actual contents will be loaded by gRPC. - - /** - * What event needs to occur for a new job to be started. - * - * @property {Object} schedule - * Create a job on a repeating basis based on the elapse of time. - * - * This object should have the same structure as [Schedule]{@link google.privacy.dlp.v2.Schedule} - * - * @typedef Trigger - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.JobTrigger.Trigger definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ - Trigger: { - // This is for documentation. Actual contents will be loaded by gRPC. - }, - - /** - * Whether the trigger is currently active. If PAUSED or CANCELLED, no jobs - * will be created with this configuration. The service may automatically - * pause triggers experiencing frequent errors. To restart a job, set the - * status to HEALTHY after correcting user errors. - * - * @enum {number} - * @memberof google.privacy.dlp.v2 - */ - Status: { - - /** - * Unused. - */ - STATUS_UNSPECIFIED: 0, - - /** - * Trigger is healthy. - */ - HEALTHY: 1, - - /** - * Trigger is temporarily paused. - */ - PAUSED: 2, - - /** - * Trigger is cancelled and can not be resumed. - */ - CANCELLED: 3 - } -}; - -/** - * A task to execute on the completion of a job. - * See https://cloud.google.com/dlp/docs/concepts-actions to learn more. - * - * @property {Object} saveFindings - * Save resulting findings in a provided location. - * - * This object should have the same structure as [SaveFindings]{@link google.privacy.dlp.v2.SaveFindings} - * - * @property {Object} pubSub - * Publish a notification to a pubsub topic. - * - * This object should have the same structure as [PublishToPubSub]{@link google.privacy.dlp.v2.PublishToPubSub} - * - * @property {Object} publishSummaryToCscc - * Publish summary to Cloud Security Command Center (Alpha). - * - * This object should have the same structure as [PublishSummaryToCscc]{@link google.privacy.dlp.v2.PublishSummaryToCscc} - * - * @property {Object} publishFindingsToCloudDataCatalog - * Publish findings to Cloud Datahub. - * - * This object should have the same structure as [PublishFindingsToCloudDataCatalog]{@link google.privacy.dlp.v2.PublishFindingsToCloudDataCatalog} - * - * @property {Object} jobNotificationEmails - * Enable email notification for project owners and editors on job's - * completion/failure. - * - * This object should have the same structure as [JobNotificationEmails]{@link google.privacy.dlp.v2.JobNotificationEmails} - * - * @property {Object} publishToStackdriver - * Enable Stackdriver metric dlp.googleapis.com/finding_count. - * - * This object should have the same structure as [PublishToStackdriver]{@link google.privacy.dlp.v2.PublishToStackdriver} - * - * @typedef Action - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.Action definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ -const Action = { - // This is for documentation. Actual contents will be loaded by gRPC. - - /** - * If set, the detailed findings will be persisted to the specified - * OutputStorageConfig. Only a single instance of this action can be - * specified. - * Compatible with: Inspect, Risk - * - * @property {Object} outputConfig - * Location to store findings outside of DLP. - * - * This object should have the same structure as [OutputStorageConfig]{@link google.privacy.dlp.v2.OutputStorageConfig} - * - * @typedef SaveFindings - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.Action.SaveFindings definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ - SaveFindings: { - // This is for documentation. Actual contents will be loaded by gRPC. - }, - - /** - * Publish a message into given Pub/Sub topic when DlpJob has completed. The - * message contains a single field, `DlpJobName`, which is equal to the - * finished job's - * [`DlpJob.name`](https://cloud.google.com/dlp/docs/reference/rest/v2/projects.dlpJobs#DlpJob). - * Compatible with: Inspect, Risk - * - * @property {string} topic - * Cloud Pub/Sub topic to send notifications to. The topic must have given - * publishing access rights to the DLP API service account executing - * the long running DlpJob sending the notifications. - * Format is projects/{project}/topics/{topic}. - * - * @typedef PublishToPubSub - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.Action.PublishToPubSub definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ - PublishToPubSub: { - // This is for documentation. Actual contents will be loaded by gRPC. - }, - - /** - * Publish the result summary of a DlpJob to the Cloud Security - * Command Center (CSCC Alpha). - * This action is only available for projects which are parts of - * an organization and whitelisted for the alpha Cloud Security Command - * Center. - * The action will publish count of finding instances and their info types. - * The summary of findings will be persisted in CSCC and are governed by CSCC - * service-specific policy, see https://cloud.google.com/terms/service-terms - * Only a single instance of this action can be specified. - * Compatible with: Inspect - * @typedef PublishSummaryToCscc - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.Action.PublishSummaryToCscc definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ - PublishSummaryToCscc: { - // This is for documentation. Actual contents will be loaded by gRPC. - }, - - /** - * Publish findings of a DlpJob to Cloud Data Catalog. Labels summarizing the - * results of the DlpJob will be applied to the entry for the resource scanned - * in Cloud Data Catalog. Any labels previously written by another DlpJob will - * be deleted. InfoType naming patterns are strictly enforced when using this - * feature. Note that the findings will be persisted in Cloud Data Catalog - * storage and are governed by Data Catalog service-specific policy, see - * https://cloud.google.com/terms/service-terms - * Only a single instance of this action can be specified and only allowed if - * all resources being scanned are BigQuery tables. - * Compatible with: Inspect - * @typedef PublishFindingsToCloudDataCatalog - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.Action.PublishFindingsToCloudDataCatalog definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ - PublishFindingsToCloudDataCatalog: { - // This is for documentation. Actual contents will be loaded by gRPC. - }, - - /** - * Enable email notification to project owners and editors on jobs's - * completion/failure. - * @typedef JobNotificationEmails - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.Action.JobNotificationEmails definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ - JobNotificationEmails: { - // This is for documentation. Actual contents will be loaded by gRPC. - }, - - /** - * Enable Stackdriver metric dlp.googleapis.com/finding_count. This - * will publish a metric to stack driver on each infotype requested and - * how many findings were found for it. CustomDetectors will be bucketed - * as 'Custom' under the Stackdriver label 'info_type'. - * @typedef PublishToStackdriver - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.Action.PublishToStackdriver definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ - PublishToStackdriver: { - // This is for documentation. Actual contents will be loaded by gRPC. - } -}; - -/** - * Request message for CreateInspectTemplate. - * - * @property {string} parent - * Required. The parent resource name, for example projects/my-project-id or - * organizations/my-org-id. - * - * @property {Object} inspectTemplate - * Required. The InspectTemplate to create. - * - * This object should have the same structure as [InspectTemplate]{@link google.privacy.dlp.v2.InspectTemplate} - * - * @property {string} templateId - * 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. - * - * @property {string} locationId - * The geographic location to store the inspection template. Reserved for - * future extensions. - * - * @typedef CreateInspectTemplateRequest - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.CreateInspectTemplateRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ -const CreateInspectTemplateRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Request message for UpdateInspectTemplate. - * - * @property {string} name - * Required. Resource name of organization and inspectTemplate to be updated, for - * example `organizations/433245324/inspectTemplates/432452342` or - * projects/project-id/inspectTemplates/432452342. - * - * @property {Object} inspectTemplate - * New InspectTemplate value. - * - * This object should have the same structure as [InspectTemplate]{@link google.privacy.dlp.v2.InspectTemplate} - * - * @property {Object} updateMask - * Mask to control which fields get updated. - * - * This object should have the same structure as [FieldMask]{@link google.protobuf.FieldMask} - * - * @typedef UpdateInspectTemplateRequest - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.UpdateInspectTemplateRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ -const UpdateInspectTemplateRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Request message for GetInspectTemplate. - * - * @property {string} name - * Required. Resource name of the organization and inspectTemplate to be read, for - * example `organizations/433245324/inspectTemplates/432452342` or - * projects/project-id/inspectTemplates/432452342. - * - * @typedef GetInspectTemplateRequest - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.GetInspectTemplateRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ -const GetInspectTemplateRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Request message for ListInspectTemplates. - * - * @property {string} parent - * Required. The parent resource name, for example projects/my-project-id or - * organizations/my-org-id. - * - * @property {string} pageToken - * Page token to continue retrieval. Comes from previous call - * to `ListInspectTemplates`. - * - * @property {number} pageSize - * Size of the page, can be limited by server. If zero server returns - * a page of max size 100. - * - * @property {string} orderBy - * 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. - * - * @property {string} locationId - * The geographic location where inspection templates will be retrieved from. - * Use `-` for all locations. Reserved for future extensions. - * - * @typedef ListInspectTemplatesRequest - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.ListInspectTemplatesRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ -const ListInspectTemplatesRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Response message for ListInspectTemplates. - * - * @property {Object[]} inspectTemplates - * List of inspectTemplates, up to page_size in ListInspectTemplatesRequest. - * - * This object should have the same structure as [InspectTemplate]{@link google.privacy.dlp.v2.InspectTemplate} - * - * @property {string} nextPageToken - * If the next page is available then the next page token to be used - * in following ListInspectTemplates request. - * - * @typedef ListInspectTemplatesResponse - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.ListInspectTemplatesResponse definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ -const ListInspectTemplatesResponse = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Request message for DeleteInspectTemplate. - * - * @property {string} name - * Required. Resource name of the organization and inspectTemplate to be deleted, for - * example `organizations/433245324/inspectTemplates/432452342` or - * projects/project-id/inspectTemplates/432452342. - * - * @typedef DeleteInspectTemplateRequest - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.DeleteInspectTemplateRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ -const DeleteInspectTemplateRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Request message for CreateJobTrigger. - * - * @property {string} parent - * Required. The parent resource name, for example projects/my-project-id. - * - * @property {Object} jobTrigger - * Required. The JobTrigger to create. - * - * This object should have the same structure as [JobTrigger]{@link google.privacy.dlp.v2.JobTrigger} - * - * @property {string} triggerId - * 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. - * - * @property {string} locationId - * The geographic location to store the job trigger. Reserved for - * future extensions. - * - * @typedef CreateJobTriggerRequest - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.CreateJobTriggerRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ -const CreateJobTriggerRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Request message for ActivateJobTrigger. - * - * @property {string} name - * Required. Resource name of the trigger to activate, for example - * `projects/dlp-test-project/jobTriggers/53234423`. - * - * @typedef ActivateJobTriggerRequest - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.ActivateJobTriggerRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ -const ActivateJobTriggerRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Request message for UpdateJobTrigger. - * - * @property {string} name - * Required. Resource name of the project and the triggeredJob, for example - * `projects/dlp-test-project/jobTriggers/53234423`. - * - * @property {Object} jobTrigger - * New JobTrigger value. - * - * This object should have the same structure as [JobTrigger]{@link google.privacy.dlp.v2.JobTrigger} - * - * @property {Object} updateMask - * Mask to control which fields get updated. - * - * This object should have the same structure as [FieldMask]{@link google.protobuf.FieldMask} - * - * @typedef UpdateJobTriggerRequest - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.UpdateJobTriggerRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ -const UpdateJobTriggerRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Request message for GetJobTrigger. - * - * @property {string} name - * Required. Resource name of the project and the triggeredJob, for example - * `projects/dlp-test-project/jobTriggers/53234423`. - * - * @typedef GetJobTriggerRequest - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.GetJobTriggerRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ -const GetJobTriggerRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Request message for CreateDlpJobRequest. Used to initiate long running - * jobs such as calculating risk metrics or inspecting Google Cloud - * Storage. - * - * @property {string} parent - * Required. The parent resource name, for example projects/my-project-id. - * - * @property {Object} inspectJob - * Set to control what and how to inspect. - * - * This object should have the same structure as [InspectJobConfig]{@link google.privacy.dlp.v2.InspectJobConfig} - * - * @property {Object} riskJob - * Set to choose what metric to calculate. - * - * This object should have the same structure as [RiskAnalysisJobConfig]{@link google.privacy.dlp.v2.RiskAnalysisJobConfig} - * - * @property {string} jobId - * 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. - * - * @property {string} locationId - * The geographic location to store and process the job. Reserved for - * future extensions. - * - * @typedef CreateDlpJobRequest - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.CreateDlpJobRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ -const CreateDlpJobRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Request message for ListJobTriggers. - * - * @property {string} parent - * Required. The parent resource name, for example `projects/my-project-id`. - * - * @property {string} pageToken - * Page token to continue retrieval. Comes from previous call - * to ListJobTriggers. `order_by` field must not - * change for subsequent calls. - * - * @property {number} pageSize - * Size of the page, can be limited by a server. - * - * @property {string} orderBy - * 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. - * - * @property {string} filter - * 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. - * - * @property {string} locationId - * The geographic location where job triggers will be retrieved from. - * Use `-` for all locations. Reserved for future extensions. - * - * @typedef ListJobTriggersRequest - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.ListJobTriggersRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ -const ListJobTriggersRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Response message for ListJobTriggers. - * - * @property {Object[]} jobTriggers - * List of triggeredJobs, up to page_size in ListJobTriggersRequest. - * - * This object should have the same structure as [JobTrigger]{@link google.privacy.dlp.v2.JobTrigger} - * - * @property {string} nextPageToken - * If the next page is available then the next page token to be used - * in following ListJobTriggers request. - * - * @typedef ListJobTriggersResponse - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.ListJobTriggersResponse definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ -const ListJobTriggersResponse = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Request message for DeleteJobTrigger. - * - * @property {string} name - * Required. Resource name of the project and the triggeredJob, for example - * `projects/dlp-test-project/jobTriggers/53234423`. - * - * @typedef DeleteJobTriggerRequest - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.DeleteJobTriggerRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ -const DeleteJobTriggerRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Controls what and how to inspect for findings. - * - * @property {Object} storageConfig - * The data to scan. - * - * This object should have the same structure as [StorageConfig]{@link google.privacy.dlp.v2.StorageConfig} - * - * @property {Object} inspectConfig - * How and what to scan for. - * - * This object should have the same structure as [InspectConfig]{@link google.privacy.dlp.v2.InspectConfig} - * - * @property {string} inspectTemplateName - * If provided, will be used as the default for all values in InspectConfig. - * `inspect_config` will be merged into the values persisted as part of the - * template. - * - * @property {Object[]} actions - * Actions to execute at the completion of the job. - * - * This object should have the same structure as [Action]{@link google.privacy.dlp.v2.Action} - * - * @typedef InspectJobConfig - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.InspectJobConfig definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ -const InspectJobConfig = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Combines all of the information about a DLP job. - * - * @property {string} name - * The server-assigned name. - * - * @property {number} type - * The type of job. - * - * The number should be among the values of [DlpJobType]{@link google.privacy.dlp.v2.DlpJobType} - * - * @property {number} state - * State of a job. - * - * The number should be among the values of [JobState]{@link google.privacy.dlp.v2.JobState} - * - * @property {Object} riskDetails - * Results from analyzing risk of a data source. - * - * This object should have the same structure as [AnalyzeDataSourceRiskDetails]{@link google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails} - * - * @property {Object} inspectDetails - * Results from inspecting a data source. - * - * This object should have the same structure as [InspectDataSourceDetails]{@link google.privacy.dlp.v2.InspectDataSourceDetails} - * - * @property {Object} createTime - * Time when the job was created. - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * - * @property {Object} startTime - * Time when the job started. - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * - * @property {Object} endTime - * Time when the job finished. - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * - * @property {string} jobTriggerName - * If created by a job trigger, the resource name of the trigger that - * instantiated the job. - * - * @property {Object[]} errors - * A stream of errors encountered running the job. - * - * This object should have the same structure as [Error]{@link google.privacy.dlp.v2.Error} - * - * @typedef DlpJob - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.DlpJob definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ -const DlpJob = { - // This is for documentation. Actual contents will be loaded by gRPC. - - /** - * Possible states of a job. - * - * @enum {number} - * @memberof google.privacy.dlp.v2 - */ - JobState: { - - /** - * Unused. - */ - JOB_STATE_UNSPECIFIED: 0, - - /** - * The job has not yet started. - */ - PENDING: 1, - - /** - * The job is currently running. - */ - RUNNING: 2, - - /** - * The job is no longer running. - */ - DONE: 3, - - /** - * The job was canceled before it could complete. - */ - CANCELED: 4, - - /** - * The job had an error and did not complete. - */ - FAILED: 5 - } -}; - -/** - * The request message for DlpJobs.GetDlpJob. - * - * @property {string} name - * Required. The name of the DlpJob resource. - * - * @typedef GetDlpJobRequest - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.GetDlpJobRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ -const GetDlpJobRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * The request message for listing DLP jobs. - * - * @property {string} parent - * Required. The parent resource name, for example projects/my-project-id. - * - * @property {string} filter - * 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. - * - * @property {number} pageSize - * The standard list page size. - * - * @property {string} pageToken - * The standard list page token. - * - * @property {number} type - * The type of job. Defaults to `DlpJobType.INSPECT` - * - * The number should be among the values of [DlpJobType]{@link google.privacy.dlp.v2.DlpJobType} - * - * @property {string} orderBy - * 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` - * - * @property {string} locationId - * The geographic location where jobs will be retrieved from. - * Use `-` for all locations. Reserved for future extensions. - * - * @typedef ListDlpJobsRequest - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.ListDlpJobsRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ -const ListDlpJobsRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * The response message for listing DLP jobs. - * - * @property {Object[]} jobs - * A list of DlpJobs that matches the specified filter in the request. - * - * This object should have the same structure as [DlpJob]{@link google.privacy.dlp.v2.DlpJob} - * - * @property {string} nextPageToken - * The standard List next-page token. - * - * @typedef ListDlpJobsResponse - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.ListDlpJobsResponse definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ -const ListDlpJobsResponse = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * The request message for canceling a DLP job. - * - * @property {string} name - * Required. The name of the DlpJob resource to be cancelled. - * - * @typedef CancelDlpJobRequest - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.CancelDlpJobRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ -const CancelDlpJobRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * The request message for deleting a DLP job. - * - * @property {string} name - * Required. The name of the DlpJob resource to be deleted. - * - * @typedef DeleteDlpJobRequest - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.DeleteDlpJobRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ -const DeleteDlpJobRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Request message for CreateDeidentifyTemplate. - * - * @property {string} parent - * Required. The parent resource name, for example projects/my-project-id or - * organizations/my-org-id. - * - * @property {Object} deidentifyTemplate - * Required. The DeidentifyTemplate to create. - * - * This object should have the same structure as [DeidentifyTemplate]{@link google.privacy.dlp.v2.DeidentifyTemplate} - * - * @property {string} templateId - * 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. - * - * @property {string} locationId - * The geographic location to store the deidentification template. Reserved - * for future extensions. - * - * @typedef CreateDeidentifyTemplateRequest - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.CreateDeidentifyTemplateRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ -const CreateDeidentifyTemplateRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Request message for UpdateDeidentifyTemplate. - * - * @property {string} name - * Required. Resource name of organization and deidentify template to be updated, for - * example `organizations/433245324/deidentifyTemplates/432452342` or - * projects/project-id/deidentifyTemplates/432452342. - * - * @property {Object} deidentifyTemplate - * New DeidentifyTemplate value. - * - * This object should have the same structure as [DeidentifyTemplate]{@link google.privacy.dlp.v2.DeidentifyTemplate} - * - * @property {Object} updateMask - * Mask to control which fields get updated. - * - * This object should have the same structure as [FieldMask]{@link google.protobuf.FieldMask} - * - * @typedef UpdateDeidentifyTemplateRequest - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.UpdateDeidentifyTemplateRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ -const UpdateDeidentifyTemplateRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Request message for GetDeidentifyTemplate. - * - * @property {string} name - * Required. Resource name of the organization and deidentify template to be read, for - * example `organizations/433245324/deidentifyTemplates/432452342` or - * projects/project-id/deidentifyTemplates/432452342. - * - * @typedef GetDeidentifyTemplateRequest - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.GetDeidentifyTemplateRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ -const GetDeidentifyTemplateRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Request message for ListDeidentifyTemplates. - * - * @property {string} parent - * Required. The parent resource name, for example projects/my-project-id or - * organizations/my-org-id. - * - * @property {string} pageToken - * Page token to continue retrieval. Comes from previous call - * to `ListDeidentifyTemplates`. - * - * @property {number} pageSize - * Size of the page, can be limited by server. If zero server returns - * a page of max size 100. - * - * @property {string} orderBy - * 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. - * - * @property {string} locationId - * The geographic location where deidentifications templates will be retrieved - * from. Use `-` for all locations. Reserved for future extensions. - * - * @typedef ListDeidentifyTemplatesRequest - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.ListDeidentifyTemplatesRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ -const ListDeidentifyTemplatesRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Response message for ListDeidentifyTemplates. - * - * @property {Object[]} deidentifyTemplates - * List of deidentify templates, up to page_size in - * ListDeidentifyTemplatesRequest. - * - * This object should have the same structure as [DeidentifyTemplate]{@link google.privacy.dlp.v2.DeidentifyTemplate} - * - * @property {string} nextPageToken - * If the next page is available then the next page token to be used - * in following ListDeidentifyTemplates request. - * - * @typedef ListDeidentifyTemplatesResponse - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.ListDeidentifyTemplatesResponse definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ -const ListDeidentifyTemplatesResponse = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Request message for DeleteDeidentifyTemplate. - * - * @property {string} name - * Required. Resource name of the organization and deidentify template to be deleted, - * for example `organizations/433245324/deidentifyTemplates/432452342` or - * projects/project-id/deidentifyTemplates/432452342. - * - * @typedef DeleteDeidentifyTemplateRequest - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.DeleteDeidentifyTemplateRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ -const DeleteDeidentifyTemplateRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Configuration for a custom dictionary created from a data source of any size - * up to the maximum size defined in the - * [limits](https://cloud.google.com/dlp/limits) page. The artifacts of - * dictionary creation are stored in the specified Google Cloud Storage - * location. Consider using `CustomInfoType.Dictionary` for smaller dictionaries - * that satisfy the size requirements. - * - * @property {Object} outputPath - * Location to store dictionary artifacts in Google Cloud Storage. These files - * will only be accessible by project owners and the DLP API. If any of these - * artifacts are modified, the dictionary is considered invalid and can no - * longer be used. - * - * This object should have the same structure as [CloudStoragePath]{@link google.privacy.dlp.v2.CloudStoragePath} - * - * @property {Object} cloudStorageFileSet - * Set of files containing newline-delimited lists of dictionary phrases. - * - * This object should have the same structure as [CloudStorageFileSet]{@link google.privacy.dlp.v2.CloudStorageFileSet} - * - * @property {Object} bigQueryField - * Field in a BigQuery table where each cell represents a dictionary phrase. - * - * This object should have the same structure as [BigQueryField]{@link google.privacy.dlp.v2.BigQueryField} - * - * @typedef LargeCustomDictionaryConfig - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.LargeCustomDictionaryConfig definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ -const LargeCustomDictionaryConfig = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Summary statistics of a custom dictionary. - * - * @property {number} approxNumPhrases - * Approximate number of distinct phrases in the dictionary. - * - * @typedef LargeCustomDictionaryStats - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.LargeCustomDictionaryStats definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ -const LargeCustomDictionaryStats = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Configuration for stored infoTypes. All fields and subfield are provided - * by the user. For more information, see - * https://cloud.google.com/dlp/docs/creating-custom-infotypes. - * - * @property {string} displayName - * Display name of the StoredInfoType (max 256 characters). - * - * @property {string} description - * Description of the StoredInfoType (max 256 characters). - * - * @property {Object} largeCustomDictionary - * StoredInfoType where findings are defined by a dictionary of phrases. - * - * This object should have the same structure as [LargeCustomDictionaryConfig]{@link google.privacy.dlp.v2.LargeCustomDictionaryConfig} - * - * @typedef StoredInfoTypeConfig - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.StoredInfoTypeConfig definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ -const StoredInfoTypeConfig = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Statistics for a StoredInfoType. - * - * @property {Object} largeCustomDictionary - * StoredInfoType where findings are defined by a dictionary of phrases. - * - * This object should have the same structure as [LargeCustomDictionaryStats]{@link google.privacy.dlp.v2.LargeCustomDictionaryStats} - * - * @typedef StoredInfoTypeStats - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.StoredInfoTypeStats definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ -const StoredInfoTypeStats = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Version of a StoredInfoType, including the configuration used to build it, - * create timestamp, and current state. - * - * @property {Object} config - * StoredInfoType configuration. - * - * This object should have the same structure as [StoredInfoTypeConfig]{@link google.privacy.dlp.v2.StoredInfoTypeConfig} - * - * @property {Object} createTime - * Create timestamp of the version. Read-only, determined by the system - * when the version is created. - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * - * @property {number} state - * Stored info type version state. Read-only, updated by the system - * during dictionary creation. - * - * The number should be among the values of [StoredInfoTypeState]{@link google.privacy.dlp.v2.StoredInfoTypeState} - * - * @property {Object[]} errors - * Errors that occurred when creating this storedInfoType version, or - * anomalies detected in the storedInfoType data that render it unusable. Only - * the five most recent errors will be displayed, with the most recent error - * appearing first. - * - * For example, some of the data for stored custom dictionaries is put in - * the user's Google Cloud Storage bucket, and if this data is modified or - * deleted by the user or another system, the dictionary becomes invalid. - * - * If any errors occur, fix the problem indicated by the error message and - * use the UpdateStoredInfoType API method to create another version of the - * storedInfoType to continue using it, reusing the same `config` if it was - * not the source of the error. - * - * This object should have the same structure as [Error]{@link google.privacy.dlp.v2.Error} - * - * @property {Object} stats - * Statistics about this storedInfoType version. - * - * This object should have the same structure as [StoredInfoTypeStats]{@link google.privacy.dlp.v2.StoredInfoTypeStats} - * - * @typedef StoredInfoTypeVersion - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.StoredInfoTypeVersion definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ -const StoredInfoTypeVersion = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * StoredInfoType resource message that contains information about the current - * version and any pending updates. - * - * @property {string} name - * Resource name. - * - * @property {Object} currentVersion - * Current version of the stored info type. - * - * This object should have the same structure as [StoredInfoTypeVersion]{@link google.privacy.dlp.v2.StoredInfoTypeVersion} - * - * @property {Object[]} pendingVersions - * Pending versions of the stored info type. Empty if no versions are - * pending. - * - * This object should have the same structure as [StoredInfoTypeVersion]{@link google.privacy.dlp.v2.StoredInfoTypeVersion} - * - * @typedef StoredInfoType - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.StoredInfoType definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ -const StoredInfoType = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Request message for CreateStoredInfoType. - * - * @property {string} parent - * Required. The parent resource name, for example projects/my-project-id or - * organizations/my-org-id. - * - * @property {Object} config - * Required. Configuration of the storedInfoType to create. - * - * This object should have the same structure as [StoredInfoTypeConfig]{@link google.privacy.dlp.v2.StoredInfoTypeConfig} - * - * @property {string} storedInfoTypeId - * 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. - * - * @property {string} locationId - * The geographic location to store the stored infoType. Reserved for - * future extensions. - * - * @typedef CreateStoredInfoTypeRequest - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.CreateStoredInfoTypeRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ -const CreateStoredInfoTypeRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Request message for UpdateStoredInfoType. - * - * @property {string} name - * Required. Resource name of organization and storedInfoType to be updated, for - * example `organizations/433245324/storedInfoTypes/432452342` or - * projects/project-id/storedInfoTypes/432452342. - * - * @property {Object} config - * 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]{@link google.privacy.dlp.v2.StoredInfoTypeConfig} - * - * @property {Object} updateMask - * Mask to control which fields get updated. - * - * This object should have the same structure as [FieldMask]{@link google.protobuf.FieldMask} - * - * @typedef UpdateStoredInfoTypeRequest - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.UpdateStoredInfoTypeRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ -const UpdateStoredInfoTypeRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Request message for GetStoredInfoType. - * - * @property {string} name - * Required. Resource name of the organization and storedInfoType to be read, for - * example `organizations/433245324/storedInfoTypes/432452342` or - * projects/project-id/storedInfoTypes/432452342. - * - * @typedef GetStoredInfoTypeRequest - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.GetStoredInfoTypeRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ -const GetStoredInfoTypeRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Request message for ListStoredInfoTypes. - * - * @property {string} parent - * Required. The parent resource name, for example projects/my-project-id or - * organizations/my-org-id. - * - * @property {string} pageToken - * Page token to continue retrieval. Comes from previous call - * to `ListStoredInfoTypes`. - * - * @property {number} pageSize - * Size of the page, can be limited by server. If zero server returns - * a page of max size 100. - * - * @property {string} orderBy - * 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. - * - * @property {string} locationId - * The geographic location where stored infoTypes will be retrieved from. - * Use `-` for all locations. Reserved for future extensions. - * - * @typedef ListStoredInfoTypesRequest - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.ListStoredInfoTypesRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ -const ListStoredInfoTypesRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Response message for ListStoredInfoTypes. - * - * @property {Object[]} storedInfoTypes - * List of storedInfoTypes, up to page_size in ListStoredInfoTypesRequest. - * - * This object should have the same structure as [StoredInfoType]{@link google.privacy.dlp.v2.StoredInfoType} - * - * @property {string} nextPageToken - * If the next page is available then the next page token to be used - * in following ListStoredInfoTypes request. - * - * @typedef ListStoredInfoTypesResponse - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.ListStoredInfoTypesResponse definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ -const ListStoredInfoTypesResponse = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Request message for DeleteStoredInfoType. - * - * @property {string} name - * Required. Resource name of the organization and storedInfoType to be deleted, for - * example `organizations/433245324/storedInfoTypes/432452342` or - * projects/project-id/storedInfoTypes/432452342. - * - * @typedef DeleteStoredInfoTypeRequest - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.DeleteStoredInfoTypeRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} - */ -const DeleteStoredInfoTypeRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Options describing which parts of the provided content should be scanned. - * - * @enum {number} - * @memberof google.privacy.dlp.v2 - */ -const ContentOption = { - - /** - * Includes entire content of a file or a data stream. - */ - CONTENT_UNSPECIFIED: 0, - - /** - * Text content within the data, excluding any metadata. - */ - CONTENT_TEXT: 1, - - /** - * Images found in the data. - */ - CONTENT_IMAGE: 2 -}; - -/** - * An enum to represent the various types of DLP jobs. - * - * @enum {number} - * @memberof google.privacy.dlp.v2 - */ -const DlpJobType = { - - /** - * Unused - */ - DLP_JOB_TYPE_UNSPECIFIED: 0, - - /** - * The job inspected Google Cloud for sensitive data. - */ - INSPECT_JOB: 1, - - /** - * The job executed a Risk Analysis computation. - */ - RISK_ANALYSIS_JOB: 2 -}; - -/** - * Parts of the APIs which use certain infoTypes. - * - * @enum {number} - * @memberof google.privacy.dlp.v2 - */ -const InfoTypeSupportedBy = { - - /** - * Unused. - */ - ENUM_TYPE_UNSPECIFIED: 0, - - /** - * Supported by the inspect operations. - */ - INSPECT: 1, - - /** - * Supported by the risk analysis operations. - */ - RISK_ANALYSIS: 2 -}; - -/** - * Type of the match which can be applied to different ways of matching, like - * Dictionary, regular expression and intersecting with findings of another - * info type. - * - * @enum {number} - * @memberof google.privacy.dlp.v2 - */ -const MatchingType = { - - /** - * Invalid. - */ - MATCHING_TYPE_UNSPECIFIED: 0, - - /** - * Full match. - * - * - Dictionary: join of Dictionary results matched complete finding quote - * - Regex: all regex matches fill a finding quote start to end - * - Exclude info type: completely inside affecting info types findings - */ - MATCHING_TYPE_FULL_MATCH: 1, - - /** - * Partial match. - * - * - Dictionary: at least one of the tokens in the finding matches - * - Regex: substring of the finding matches - * - Exclude info type: intersects with affecting info types findings - */ - MATCHING_TYPE_PARTIAL_MATCH: 2, - - /** - * Inverse match. - * - * - Dictionary: no tokens in the finding match the dictionary - * - Regex: finding doesn't match the regex - * - Exclude info type: no intersection with affecting info types findings - */ - MATCHING_TYPE_INVERSE_MATCH: 3 -}; - -/** - * Operators available for comparing the value of fields. - * - * @enum {number} - * @memberof google.privacy.dlp.v2 - */ -const RelationalOperator = { - - /** - * Unused - */ - RELATIONAL_OPERATOR_UNSPECIFIED: 0, - - /** - * Equal. Attempts to match even with incompatible types. - */ - EQUAL_TO: 1, - - /** - * Not equal to. Attempts to match even with incompatible types. - */ - NOT_EQUAL_TO: 2, - - /** - * Greater than. - */ - GREATER_THAN: 3, - - /** - * Less than. - */ - LESS_THAN: 4, - - /** - * Greater than or equals. - */ - GREATER_THAN_OR_EQUALS: 5, - - /** - * Less than or equals. - */ - LESS_THAN_OR_EQUALS: 6, - - /** - * Exists - */ - EXISTS: 7 -}; - -/** - * State of a StoredInfoType version. - * - * @enum {number} - * @memberof google.privacy.dlp.v2 - */ -const StoredInfoTypeState = { - - /** - * Unused - */ - STORED_INFO_TYPE_STATE_UNSPECIFIED: 0, - - /** - * StoredInfoType version is being created. - */ - PENDING: 1, - - /** - * StoredInfoType version is ready for use. - */ - READY: 2, - - /** - * StoredInfoType creation failed. All relevant error messages are returned in - * the `StoredInfoTypeVersion` message. - */ - FAILED: 3, - - /** - * StoredInfoType is no longer valid because artifacts stored in - * user-controlled storage were modified. To fix an invalid StoredInfoType, - * use the `UpdateStoredInfoType` method to create a new version. - */ - INVALID: 4 -}; \ No newline at end of file diff --git a/packages/google-privacy-dlp/src/v2/doc/google/privacy/dlp/v2/doc_storage.js b/packages/google-privacy-dlp/src/v2/doc/google/privacy/dlp/v2/doc_storage.js deleted file mode 100644 index 7369f69848e..00000000000 --- a/packages/google-privacy-dlp/src/v2/doc/google/privacy/dlp/v2/doc_storage.js +++ /dev/null @@ -1,1000 +0,0 @@ -// Copyright 2020 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * Type of information detected by the API. - * - * @property {string} name - * Name of the information type. Either a name of your choosing when - * creating a CustomInfoType, or one of the names listed - * at https://cloud.google.com/dlp/docs/infotypes-reference when specifying - * a built-in type. InfoType names should conform to the pattern - * [a-zA-Z0-9_]{1,64}. - * - * @typedef InfoType - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.InfoType definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/storage.proto} - */ -const InfoType = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * A reference to a StoredInfoType to use with scanning. - * - * @property {string} name - * Resource name of the requested `StoredInfoType`, for example - * `organizations/433245324/storedInfoTypes/432452342` or - * `projects/project-id/storedInfoTypes/432452342`. - * - * @property {Object} createTime - * Timestamp indicating when the version of the `StoredInfoType` used for - * inspection was created. Output-only field, populated by the system. - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * - * @typedef StoredType - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.StoredType definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/storage.proto} - */ -const StoredType = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Custom information type provided by the user. Used to find domain-specific - * sensitive information configurable to the data in question. - * - * @property {Object} infoType - * CustomInfoType can either be a new infoType, or an extension of built-in - * infoType, when the name matches one of existing infoTypes and that infoType - * is specified in `InspectContent.info_types` field. Specifying the latter - * adds findings to the one detected by the system. If built-in info type is - * not specified in `InspectContent.info_types` list then the name is treated - * as a custom info type. - * - * This object should have the same structure as [InfoType]{@link google.privacy.dlp.v2.InfoType} - * - * @property {number} likelihood - * Likelihood to return for this CustomInfoType. This base value can be - * altered by a detection rule if the finding meets the criteria specified by - * the rule. Defaults to `VERY_LIKELY` if not specified. - * - * The number should be among the values of [Likelihood]{@link google.privacy.dlp.v2.Likelihood} - * - * @property {Object} dictionary - * A list of phrases to detect as a CustomInfoType. - * - * This object should have the same structure as [Dictionary]{@link google.privacy.dlp.v2.Dictionary} - * - * @property {Object} regex - * Regular expression based CustomInfoType. - * - * This object should have the same structure as [Regex]{@link google.privacy.dlp.v2.Regex} - * - * @property {Object} surrogateType - * Message for detecting output from deidentification transformations that - * support reversing. - * - * This object should have the same structure as [SurrogateType]{@link google.privacy.dlp.v2.SurrogateType} - * - * @property {Object} storedType - * Load an existing `StoredInfoType` resource for use in - * `InspectDataSource`. Not currently supported in `InspectContent`. - * - * This object should have the same structure as [StoredType]{@link google.privacy.dlp.v2.StoredType} - * - * @property {Object[]} detectionRules - * Set of detection rules to apply to all findings of this CustomInfoType. - * Rules are applied in order that they are specified. Not supported for the - * `surrogate_type` CustomInfoType. - * - * This object should have the same structure as [DetectionRule]{@link google.privacy.dlp.v2.DetectionRule} - * - * @property {number} exclusionType - * If set to EXCLUSION_TYPE_EXCLUDE this infoType will not cause a finding - * to be returned. It still can be used for rules matching. - * - * The number should be among the values of [ExclusionType]{@link google.privacy.dlp.v2.ExclusionType} - * - * @typedef CustomInfoType - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.CustomInfoType definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/storage.proto} - */ -const CustomInfoType = { - // This is for documentation. Actual contents will be loaded by gRPC. - - /** - * Custom information type based on a dictionary of words or phrases. This can - * be used to match sensitive information specific to the data, such as a list - * of employee IDs or job titles. - * - * Dictionary words are case-insensitive and all characters other than letters - * and digits in the unicode [Basic Multilingual - * Plane](https://en.wikipedia.org/wiki/Plane_%28Unicode%29#Basic_Multilingual_Plane) - * will be replaced with whitespace when scanning for matches, so the - * dictionary phrase "Sam Johnson" will match all three phrases "sam johnson", - * "Sam, Johnson", and "Sam (Johnson)". Additionally, the characters - * surrounding any match must be of a different type than the adjacent - * characters within the word, so letters must be next to non-letters and - * digits next to non-digits. For example, the dictionary word "jen" will - * match the first three letters of the text "jen123" but will return no - * matches for "jennifer". - * - * Dictionary words containing a large number of characters that are not - * letters or digits may result in unexpected findings because such characters - * are treated as whitespace. The - * [limits](https://cloud.google.com/dlp/limits) page contains details about - * the size limits of dictionaries. For dictionaries that do not fit within - * these constraints, consider using `LargeCustomDictionaryConfig` in the - * `StoredInfoType` API. - * - * @property {Object} wordList - * List of words or phrases to search for. - * - * This object should have the same structure as [WordList]{@link google.privacy.dlp.v2.WordList} - * - * @property {Object} cloudStoragePath - * Newline-delimited file of words in Cloud Storage. Only a single file - * is accepted. - * - * This object should have the same structure as [CloudStoragePath]{@link google.privacy.dlp.v2.CloudStoragePath} - * - * @typedef Dictionary - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.CustomInfoType.Dictionary definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/storage.proto} - */ - Dictionary: { - // This is for documentation. Actual contents will be loaded by gRPC. - - /** - * Message defining a list of words or phrases to search for in the data. - * - * @property {string[]} words - * Words or phrases defining the dictionary. The dictionary must contain - * at least one phrase and every phrase must contain at least 2 characters - * that are letters or digits. [required] - * - * @typedef WordList - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.CustomInfoType.Dictionary.WordList definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/storage.proto} - */ - WordList: { - // This is for documentation. Actual contents will be loaded by gRPC. - } - }, - - /** - * Message defining a custom regular expression. - * - * @property {string} pattern - * Pattern defining the regular expression. Its syntax - * (https://github.com/google/re2/wiki/Syntax) can be found under the - * google/re2 repository on GitHub. - * - * @property {number[]} groupIndexes - * The index of the submatch to extract as findings. When not - * specified, the entire match is returned. No more than 3 may be included. - * - * @typedef Regex - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.CustomInfoType.Regex definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/storage.proto} - */ - Regex: { - // This is for documentation. Actual contents will be loaded by gRPC. - }, - - /** - * Message for detecting output from deidentification transformations - * such as - * [`CryptoReplaceFfxFpeConfig`](https://cloud.google.com/dlp/docs/reference/rest/v2/organizations.deidentifyTemplates#cryptoreplaceffxfpeconfig). - * These types of transformations are - * those that perform pseudonymization, thereby producing a "surrogate" as - * output. This should be used in conjunction with a field on the - * transformation such as `surrogate_info_type`. This CustomInfoType does - * not support the use of `detection_rules`. - * @typedef SurrogateType - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.CustomInfoType.SurrogateType definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/storage.proto} - */ - SurrogateType: { - // This is for documentation. Actual contents will be loaded by gRPC. - }, - - /** - * Deprecated; use `InspectionRuleSet` instead. Rule for modifying a - * `CustomInfoType` to alter behavior under certain circumstances, depending - * on the specific details of the rule. Not supported for the `surrogate_type` - * custom infoType. - * - * @property {Object} hotwordRule - * Hotword-based detection rule. - * - * This object should have the same structure as [HotwordRule]{@link google.privacy.dlp.v2.HotwordRule} - * - * @typedef DetectionRule - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.CustomInfoType.DetectionRule definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/storage.proto} - */ - DetectionRule: { - // This is for documentation. Actual contents will be loaded by gRPC. - - /** - * Message for specifying a window around a finding to apply a detection - * rule. - * - * @property {number} windowBefore - * Number of characters before the finding to consider. - * - * @property {number} windowAfter - * Number of characters after the finding to consider. - * - * @typedef Proximity - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.CustomInfoType.DetectionRule.Proximity definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/storage.proto} - */ - Proximity: { - // This is for documentation. Actual contents will be loaded by gRPC. - }, - - /** - * Message for specifying an adjustment to the likelihood of a finding as - * part of a detection rule. - * - * @property {number} fixedLikelihood - * Set the likelihood of a finding to a fixed value. - * - * The number should be among the values of [Likelihood]{@link google.privacy.dlp.v2.Likelihood} - * - * @property {number} relativeLikelihood - * Increase or decrease the likelihood by the specified number of - * levels. For example, if a finding would be `POSSIBLE` without the - * detection rule and `relative_likelihood` is 1, then it is upgraded to - * `LIKELY`, while a value of -1 would downgrade it to `UNLIKELY`. - * Likelihood may never drop below `VERY_UNLIKELY` or exceed - * `VERY_LIKELY`, so applying an adjustment of 1 followed by an - * adjustment of -1 when base likelihood is `VERY_LIKELY` will result in - * a final likelihood of `LIKELY`. - * - * @typedef LikelihoodAdjustment - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.CustomInfoType.DetectionRule.LikelihoodAdjustment definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/storage.proto} - */ - LikelihoodAdjustment: { - // This is for documentation. Actual contents will be loaded by gRPC. - }, - - /** - * The rule that adjusts the likelihood of findings within a certain - * proximity of hotwords. - * - * @property {Object} hotwordRegex - * Regular expression pattern defining what qualifies as a hotword. - * - * This object should have the same structure as [Regex]{@link google.privacy.dlp.v2.Regex} - * - * @property {Object} proximity - * Proximity of the finding within which the entire hotword must reside. - * The total length of the window cannot exceed 1000 characters. Note that - * the finding itself will be included in the window, so that hotwords may - * be used to match substrings of the finding itself. For example, the - * certainty of a phone number regex "\(\d{3}\) \d{3}-\d{4}" could be - * adjusted upwards if the area code is known to be the local area code of - * a company office using the hotword regex "\(xxx\)", where "xxx" - * is the area code in question. - * - * This object should have the same structure as [Proximity]{@link google.privacy.dlp.v2.Proximity} - * - * @property {Object} likelihoodAdjustment - * Likelihood adjustment to apply to all matching findings. - * - * This object should have the same structure as [LikelihoodAdjustment]{@link google.privacy.dlp.v2.LikelihoodAdjustment} - * - * @typedef HotwordRule - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.CustomInfoType.DetectionRule.HotwordRule definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/storage.proto} - */ - HotwordRule: { - // This is for documentation. Actual contents will be loaded by gRPC. - } - }, - - /** - * @enum {number} - * @memberof google.privacy.dlp.v2 - */ - ExclusionType: { - - /** - * A finding of this custom info type will not be excluded from results. - */ - EXCLUSION_TYPE_UNSPECIFIED: 0, - - /** - * A finding of this custom info type will be excluded from final results, - * but can still affect rule execution. - */ - EXCLUSION_TYPE_EXCLUDE: 1 - } -}; - -/** - * General identifier of a data field in a storage service. - * - * @property {string} name - * Name describing the field. - * - * @typedef FieldId - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.FieldId definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/storage.proto} - */ -const FieldId = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Datastore partition ID. - * A partition ID identifies a grouping of entities. The grouping is always - * by project and namespace, however the namespace ID may be empty. - * - * A partition ID contains several dimensions: - * project ID and namespace ID. - * - * @property {string} projectId - * The ID of the project to which the entities belong. - * - * @property {string} namespaceId - * If not empty, the ID of the namespace to which the entities belong. - * - * @typedef PartitionId - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.PartitionId definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/storage.proto} - */ -const PartitionId = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * A representation of a Datastore kind. - * - * @property {string} name - * The name of the kind. - * - * @typedef KindExpression - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.KindExpression definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/storage.proto} - */ -const KindExpression = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Options defining a data set within Google Cloud Datastore. - * - * @property {Object} partitionId - * A partition ID identifies a grouping of entities. The grouping is always - * by project and namespace, however the namespace ID may be empty. - * - * This object should have the same structure as [PartitionId]{@link google.privacy.dlp.v2.PartitionId} - * - * @property {Object} kind - * The kind to process. - * - * This object should have the same structure as [KindExpression]{@link google.privacy.dlp.v2.KindExpression} - * - * @typedef DatastoreOptions - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.DatastoreOptions definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/storage.proto} - */ -const DatastoreOptions = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Message representing a set of files in a Cloud Storage bucket. Regular - * expressions are used to allow fine-grained control over which files in the - * bucket to include. - * - * Included files are those that match at least one item in `include_regex` and - * do not match any items in `exclude_regex`. Note that a file that matches - * items from both lists will _not_ be included. For a match to occur, the - * entire file path (i.e., everything in the url after the bucket name) must - * match the regular expression. - * - * For example, given the input `{bucket_name: "mybucket", include_regex: - * ["directory1/.*"], exclude_regex: - * ["directory1/excluded.*"]}`: - * - * * `gs://mybucket/directory1/myfile` will be included - * * `gs://mybucket/directory1/directory2/myfile` will be included (`.*` matches - * across `/`) - * * `gs://mybucket/directory0/directory1/myfile` will _not_ be included (the - * full path doesn't match any items in `include_regex`) - * * `gs://mybucket/directory1/excludedfile` will _not_ be included (the path - * matches an item in `exclude_regex`) - * - * If `include_regex` is left empty, it will match all files by default - * (this is equivalent to setting `include_regex: [".*"]`). - * - * Some other common use cases: - * - * * `{bucket_name: "mybucket", exclude_regex: [".*\.pdf"]}` will include all - * files in `mybucket` except for .pdf files - * * `{bucket_name: "mybucket", include_regex: ["directory/[^/]+"]}` will - * include all files directly under `gs://mybucket/directory/`, without matching - * across `/` - * - * @property {string} bucketName - * The name of a Cloud Storage bucket. Required. - * - * @property {string[]} includeRegex - * A list of regular expressions matching file paths to include. All files in - * the bucket that match at least one of these regular expressions will be - * included in the set of files, except for those that also match an item in - * `exclude_regex`. Leaving this field empty will match all files by default - * (this is equivalent to including `.*` in the list). - * - * Regular expressions use RE2 - * [syntax](https://github.com/google/re2/wiki/Syntax); a guide can be found - * under the google/re2 repository on GitHub. - * - * @property {string[]} excludeRegex - * A list of regular expressions matching file paths to exclude. All files in - * the bucket that match at least one of these regular expressions will be - * excluded from the scan. - * - * Regular expressions use RE2 - * [syntax](https://github.com/google/re2/wiki/Syntax); a guide can be found - * under the google/re2 repository on GitHub. - * - * @typedef CloudStorageRegexFileSet - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.CloudStorageRegexFileSet definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/storage.proto} - */ -const CloudStorageRegexFileSet = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Options defining a file or a set of files within a Google Cloud Storage - * bucket. - * - * @property {Object} fileSet - * The set of one or more files to scan. - * - * This object should have the same structure as [FileSet]{@link google.privacy.dlp.v2.FileSet} - * - * @property {number} bytesLimitPerFile - * Max number of bytes to scan from a file. If a scanned file's size is bigger - * than this value then the rest of the bytes are omitted. Only one - * of bytes_limit_per_file and bytes_limit_per_file_percent can be specified. - * - * @property {number} bytesLimitPerFilePercent - * Max percentage of bytes to scan from a file. The rest are omitted. The - * number of bytes scanned is rounded down. Must be between 0 and 100, - * inclusively. Both 0 and 100 means no limit. Defaults to 0. Only one - * of bytes_limit_per_file and bytes_limit_per_file_percent can be specified. - * - * @property {number[]} fileTypes - * List of file type groups to include in the scan. - * If empty, all files are scanned and available data format processors - * are applied. In addition, the binary content of the selected files - * is always scanned as well. - * - * The number should be among the values of [FileType]{@link google.privacy.dlp.v2.FileType} - * - * @property {number} sampleMethod - * The number should be among the values of [SampleMethod]{@link google.privacy.dlp.v2.SampleMethod} - * - * @property {number} filesLimitPercent - * Limits the number of files to scan to this percentage of the input FileSet. - * Number of files scanned is rounded down. Must be between 0 and 100, - * inclusively. Both 0 and 100 means no limit. Defaults to 0. - * - * @typedef CloudStorageOptions - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.CloudStorageOptions definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/storage.proto} - */ -const CloudStorageOptions = { - // This is for documentation. Actual contents will be loaded by gRPC. - - /** - * Set of files to scan. - * - * @property {string} url - * The Cloud Storage url of the file(s) to scan, in the format - * `gs:///`. Trailing wildcard in the path is allowed. - * - * If the url ends in a trailing slash, the bucket or directory represented - * by the url will be scanned non-recursively (content in sub-directories - * will not be scanned). This means that `gs://mybucket/` is equivalent to - * `gs://mybucket/*`, and `gs://mybucket/directory/` is equivalent to - * `gs://mybucket/directory/*`. - * - * Exactly one of `url` or `regex_file_set` must be set. - * - * @property {Object} regexFileSet - * The regex-filtered set of files to scan. Exactly one of `url` or - * `regex_file_set` must be set. - * - * This object should have the same structure as [CloudStorageRegexFileSet]{@link google.privacy.dlp.v2.CloudStorageRegexFileSet} - * - * @typedef FileSet - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.CloudStorageOptions.FileSet definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/storage.proto} - */ - FileSet: { - // This is for documentation. Actual contents will be loaded by gRPC. - }, - - /** - * How to sample bytes if not all bytes are scanned. Meaningful only when used - * in conjunction with bytes_limit_per_file. If not specified, scanning would - * start from the top. - * - * @enum {number} - * @memberof google.privacy.dlp.v2 - */ - SampleMethod: { - SAMPLE_METHOD_UNSPECIFIED: 0, - - /** - * Scan from the top (default). - */ - TOP: 1, - - /** - * For each file larger than bytes_limit_per_file, randomly pick the offset - * to start scanning. The scanned bytes are contiguous. - */ - RANDOM_START: 2 - } -}; - -/** - * Message representing a set of files in Cloud Storage. - * - * @property {string} url - * The url, in the format `gs:///`. Trailing wildcard in the - * path is allowed. - * - * @typedef CloudStorageFileSet - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.CloudStorageFileSet definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/storage.proto} - */ -const CloudStorageFileSet = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Message representing a single file or path in Cloud Storage. - * - * @property {string} path - * A url representing a file or path (no wildcards) in Cloud Storage. - * Example: gs://[BUCKET_NAME]/dictionary.txt - * - * @typedef CloudStoragePath - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.CloudStoragePath definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/storage.proto} - */ -const CloudStoragePath = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Options defining BigQuery table and row identifiers. - * - * @property {Object} tableReference - * Complete BigQuery table reference. - * - * This object should have the same structure as [BigQueryTable]{@link google.privacy.dlp.v2.BigQueryTable} - * - * @property {Object[]} identifyingFields - * References to fields uniquely identifying rows within the table. - * Nested fields in the format, like `person.birthdate.year`, are allowed. - * - * This object should have the same structure as [FieldId]{@link google.privacy.dlp.v2.FieldId} - * - * @property {number} rowsLimit - * Max number of rows to scan. If the table has more rows than this value, the - * rest of the rows are omitted. If not set, or if set to 0, all rows will be - * scanned. Only one of rows_limit and rows_limit_percent can be specified. - * Cannot be used in conjunction with TimespanConfig. - * - * @property {number} rowsLimitPercent - * Max percentage of rows to scan. The rest are omitted. The number of rows - * scanned is rounded down. Must be between 0 and 100, inclusively. Both 0 and - * 100 means no limit. Defaults to 0. Only one of rows_limit and - * rows_limit_percent can be specified. Cannot be used in conjunction with - * TimespanConfig. - * - * @property {number} sampleMethod - * The number should be among the values of [SampleMethod]{@link google.privacy.dlp.v2.SampleMethod} - * - * @property {Object[]} excludedFields - * References to fields excluded from scanning. This allows you to skip - * inspection of entire columns which you know have no findings. - * - * This object should have the same structure as [FieldId]{@link google.privacy.dlp.v2.FieldId} - * - * @typedef BigQueryOptions - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.BigQueryOptions definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/storage.proto} - */ -const BigQueryOptions = { - // This is for documentation. Actual contents will be loaded by gRPC. - - /** - * How to sample rows if not all rows are scanned. Meaningful only when used - * in conjunction with either rows_limit or rows_limit_percent. If not - * specified, scanning would start from the top. - * - * @enum {number} - * @memberof google.privacy.dlp.v2 - */ - SampleMethod: { - SAMPLE_METHOD_UNSPECIFIED: 0, - - /** - * Scan from the top (default). - */ - TOP: 1, - - /** - * Randomly pick the row to start scanning. The scanned rows are contiguous. - */ - RANDOM_START: 2 - } -}; - -/** - * Shared message indicating Cloud storage type. - * - * @property {Object} datastoreOptions - * Google Cloud Datastore options specification. - * - * This object should have the same structure as [DatastoreOptions]{@link google.privacy.dlp.v2.DatastoreOptions} - * - * @property {Object} cloudStorageOptions - * Google Cloud Storage options specification. - * - * This object should have the same structure as [CloudStorageOptions]{@link google.privacy.dlp.v2.CloudStorageOptions} - * - * @property {Object} bigQueryOptions - * BigQuery options specification. - * - * This object should have the same structure as [BigQueryOptions]{@link google.privacy.dlp.v2.BigQueryOptions} - * - * @property {Object} timespanConfig - * This object should have the same structure as [TimespanConfig]{@link google.privacy.dlp.v2.TimespanConfig} - * - * @typedef StorageConfig - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.StorageConfig definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/storage.proto} - */ -const StorageConfig = { - // This is for documentation. Actual contents will be loaded by gRPC. - - /** - * Configuration of the timespan of the items to include in scanning. - * Currently only supported when inspecting Google Cloud Storage and BigQuery. - * - * @property {Object} startTime - * Exclude files or rows older than this value. - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * - * @property {Object} endTime - * Exclude files or rows newer than this value. - * If set to zero, no upper time limit is applied. - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * - * @property {Object} timestampField - * Specification of the field containing the timestamp of scanned items. - * Used for data sources like Datastore and BigQuery. - * - * For BigQuery: - * Required to filter out rows based on the given start and - * end times. If not specified and the table was modified between the given - * start and end times, the entire table will be scanned. - * The valid data types of the timestamp field are: `INTEGER`, `DATE`, - * `TIMESTAMP`, or `DATETIME` BigQuery column. - * - * For Datastore. - * Valid data types of the timestamp field are: `TIMESTAMP`. - * Datastore entity will be scanned if the timestamp property does not - * exist or its value is empty or invalid. - * - * This object should have the same structure as [FieldId]{@link google.privacy.dlp.v2.FieldId} - * - * @property {boolean} enableAutoPopulationOfTimespanConfig - * When the job is started by a JobTrigger we will automatically figure out - * a valid start_time to avoid scanning files that have not been modified - * since the last time the JobTrigger executed. This will be based on the - * time of the execution of the last run of the JobTrigger. - * - * @typedef TimespanConfig - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.StorageConfig.TimespanConfig definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/storage.proto} - */ - TimespanConfig: { - // This is for documentation. Actual contents will be loaded by gRPC. - } -}; - -/** - * Row key for identifying a record in BigQuery table. - * - * @property {Object} tableReference - * Complete BigQuery table reference. - * - * This object should have the same structure as [BigQueryTable]{@link google.privacy.dlp.v2.BigQueryTable} - * - * @property {number} rowNumber - * Absolute number of the row from the beginning of the table at the time - * of scanning. - * - * @typedef BigQueryKey - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.BigQueryKey definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/storage.proto} - */ -const BigQueryKey = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Record key for a finding in Cloud Datastore. - * - * @property {Object} entityKey - * Datastore entity key. - * - * This object should have the same structure as [Key]{@link google.privacy.dlp.v2.Key} - * - * @typedef DatastoreKey - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.DatastoreKey definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/storage.proto} - */ -const DatastoreKey = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * A unique identifier for a Datastore entity. - * If a key's partition ID or any of its path kinds or names are - * reserved/read-only, the key is reserved/read-only. - * A reserved/read-only key is forbidden in certain documented contexts. - * - * @property {Object} partitionId - * Entities are partitioned into subsets, currently identified by a project - * ID and namespace ID. - * Queries are scoped to a single partition. - * - * This object should have the same structure as [PartitionId]{@link google.privacy.dlp.v2.PartitionId} - * - * @property {Object[]} path - * The entity path. - * An entity path consists of one or more elements composed of a kind and a - * string or numerical identifier, which identify entities. The first - * element identifies a _root entity_, the second element identifies - * a _child_ of the root entity, the third element identifies a child of the - * second entity, and so forth. The entities identified by all prefixes of - * the path are called the element's _ancestors_. - * - * A path can never be empty, and a path can have at most 100 elements. - * - * This object should have the same structure as [PathElement]{@link google.privacy.dlp.v2.PathElement} - * - * @typedef Key - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.Key definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/storage.proto} - */ -const Key = { - // This is for documentation. Actual contents will be loaded by gRPC. - - /** - * A (kind, ID/name) pair used to construct a key path. - * - * If either name or ID is set, the element is complete. - * If neither is set, the element is incomplete. - * - * @property {string} kind - * The kind of the entity. - * A kind matching regex `__.*__` is reserved/read-only. - * A kind must not contain more than 1500 bytes when UTF-8 encoded. - * Cannot be `""`. - * - * @property {number} id - * The auto-allocated ID of the entity. - * Never equal to zero. Values less than zero are discouraged and may not - * be supported in the future. - * - * @property {string} name - * The name of the entity. - * A name matching regex `__.*__` is reserved/read-only. - * A name must not be more than 1500 bytes when UTF-8 encoded. - * Cannot be `""`. - * - * @typedef PathElement - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.Key.PathElement definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/storage.proto} - */ - PathElement: { - // This is for documentation. Actual contents will be loaded by gRPC. - } -}; - -/** - * Message for a unique key indicating a record that contains a finding. - * - * @property {Object} datastoreKey - * This object should have the same structure as [DatastoreKey]{@link google.privacy.dlp.v2.DatastoreKey} - * - * @property {Object} bigQueryKey - * This object should have the same structure as [BigQueryKey]{@link google.privacy.dlp.v2.BigQueryKey} - * - * @property {string[]} idValues - * Values of identifying columns in the given row. Order of values matches - * the order of field identifiers specified in the scanning request. - * - * @typedef RecordKey - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.RecordKey definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/storage.proto} - */ -const RecordKey = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Message defining the location of a BigQuery table. A table is uniquely - * identified by its project_id, dataset_id, and table_name. Within a query - * a table is often referenced with a string in the format of: - * `:.` or - * `..`. - * - * @property {string} projectId - * The Google Cloud Platform project ID of the project containing the table. - * If omitted, project ID is inferred from the API call. - * - * @property {string} datasetId - * Dataset ID of the table. - * - * @property {string} tableId - * Name of the table. - * - * @typedef BigQueryTable - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.BigQueryTable definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/storage.proto} - */ -const BigQueryTable = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Message defining a field of a BigQuery table. - * - * @property {Object} table - * Source table of the field. - * - * This object should have the same structure as [BigQueryTable]{@link google.privacy.dlp.v2.BigQueryTable} - * - * @property {Object} field - * Designated field in the BigQuery table. - * - * This object should have the same structure as [FieldId]{@link google.privacy.dlp.v2.FieldId} - * - * @typedef BigQueryField - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.BigQueryField definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/storage.proto} - */ -const BigQueryField = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * An entity in a dataset is a field or set of fields that correspond to a - * single person. For example, in medical records the `EntityId` might be a - * patient identifier, or for financial records it might be an account - * identifier. This message is used when generalizations or analysis must take - * into account that multiple rows correspond to the same entity. - * - * @property {Object} field - * Composite key indicating which field contains the entity identifier. - * - * This object should have the same structure as [FieldId]{@link google.privacy.dlp.v2.FieldId} - * - * @typedef EntityId - * @memberof google.privacy.dlp.v2 - * @see [google.privacy.dlp.v2.EntityId definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/storage.proto} - */ -const EntityId = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Definitions of file type groups to scan. - * - * @enum {number} - * @memberof google.privacy.dlp.v2 - */ -const FileType = { - - /** - * Includes all files. - */ - FILE_TYPE_UNSPECIFIED: 0, - - /** - * Includes all file extensions not covered by text file types. - */ - BINARY_FILE: 1, - - /** - * Included file extensions: - * asc, brf, c, cc, cpp, csv, cxx, c++, cs, css, dart, eml, go, h, hh, hpp, - * hxx, h++, hs, html, htm, shtml, shtm, xhtml, lhs, ini, java, js, json, - * ocaml, md, mkd, markdown, m, ml, mli, pl, pm, php, phtml, pht, py, pyw, - * rb, rbw, rs, rc, scala, sh, sql, tex, txt, text, tsv, vcard, vcs, wml, - * xml, xsl, xsd, yml, yaml. - */ - TEXT_FILE: 2, - - /** - * Included file extensions: - * bmp, gif, jpg, jpeg, jpe, png. - * bytes_limit_per_file has no effect on image files. - */ - IMAGE: 3, - - /** - * Included file extensions: - * avro - */ - AVRO: 7 -}; - -/** - * Categorization of results based on how likely they are to represent a match, - * based on the number of elements they contain which imply a match. - * - * @enum {number} - * @memberof google.privacy.dlp.v2 - */ -const Likelihood = { - - /** - * Default value; same as POSSIBLE. - */ - LIKELIHOOD_UNSPECIFIED: 0, - - /** - * Few matching elements. - */ - VERY_UNLIKELY: 1, - UNLIKELY: 2, - - /** - * Some matching elements. - */ - POSSIBLE: 3, - LIKELY: 4, - - /** - * Many matching elements. - */ - VERY_LIKELY: 5 -}; \ No newline at end of file diff --git a/packages/google-privacy-dlp/src/v2/doc/google/protobuf/doc_any.js b/packages/google-privacy-dlp/src/v2/doc/google/protobuf/doc_any.js deleted file mode 100644 index 813682aa336..00000000000 --- a/packages/google-privacy-dlp/src/v2/doc/google/protobuf/doc_any.js +++ /dev/null @@ -1,137 +0,0 @@ -// Copyright 2020 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * `Any` contains an arbitrary serialized protocol buffer message along with a - * URL that describes the type of the serialized message. - * - * Protobuf library provides support to pack/unpack Any values in the form - * of utility functions or additional generated methods of the Any type. - * - * Example 1: Pack and unpack a message in C++. - * - * Foo foo = ...; - * Any any; - * any.PackFrom(foo); - * ... - * if (any.UnpackTo(&foo)) { - * ... - * } - * - * Example 2: Pack and unpack a message in Java. - * - * Foo foo = ...; - * Any any = Any.pack(foo); - * ... - * if (any.is(Foo.class)) { - * foo = any.unpack(Foo.class); - * } - * - * Example 3: Pack and unpack a message in Python. - * - * foo = Foo(...) - * any = Any() - * any.Pack(foo) - * ... - * if any.Is(Foo.DESCRIPTOR): - * any.Unpack(foo) - * ... - * - * Example 4: Pack and unpack a message in Go - * - * foo := &pb.Foo{...} - * any, err := ptypes.MarshalAny(foo) - * ... - * foo := &pb.Foo{} - * if err := ptypes.UnmarshalAny(any, foo); err != nil { - * ... - * } - * - * The pack methods provided by protobuf library will by default use - * 'type.googleapis.com/full.type.name' as the type URL and the unpack - * methods only use the fully qualified type name after the last '/' - * in the type URL, for example "foo.bar.com/x/y.z" will yield type - * name "y.z". - * - * - * # JSON - * - * The JSON representation of an `Any` value uses the regular - * representation of the deserialized, embedded message, with an - * additional field `@type` which contains the type URL. Example: - * - * package google.profile; - * message Person { - * string first_name = 1; - * string last_name = 2; - * } - * - * { - * "@type": "type.googleapis.com/google.profile.Person", - * "firstName": , - * "lastName": - * } - * - * If the embedded message type is well-known and has a custom JSON - * representation, that representation will be embedded adding a field - * `value` which holds the custom JSON in addition to the `@type` - * field. Example (for message google.protobuf.Duration): - * - * { - * "@type": "type.googleapis.com/google.protobuf.Duration", - * "value": "1.212s" - * } - * - * @property {string} typeUrl - * A URL/resource name that uniquely identifies the type of the serialized - * protocol buffer message. This string must contain at least - * one "/" character. The last segment of the URL's path must represent - * the fully qualified name of the type (as in - * `path/google.protobuf.Duration`). The name should be in a canonical form - * (e.g., leading "." is not accepted). - * - * In practice, teams usually precompile into the binary all types that they - * expect it to use in the context of Any. However, for URLs which use the - * scheme `http`, `https`, or no scheme, one can optionally set up a type - * server that maps type URLs to message definitions as follows: - * - * * If no scheme is provided, `https` is assumed. - * * An HTTP GET on the URL must yield a google.protobuf.Type - * value in binary format, or produce an error. - * * Applications are allowed to cache lookup results based on the - * URL, or have them precompiled into a binary to avoid any - * lookup. Therefore, binary compatibility needs to be preserved - * on changes to types. (Use versioned type names to manage - * breaking changes.) - * - * Note: this functionality is not currently available in the official - * protobuf release, and it is not used for type URLs beginning with - * type.googleapis.com. - * - * Schemes other than `http`, `https` (or the empty scheme) might be - * used with implementation specific semantics. - * - * @property {Buffer} value - * Must be a valid serialized protocol buffer of the above specified type. - * - * @typedef Any - * @memberof google.protobuf - * @see [google.protobuf.Any definition in proto format]{@link https://github.com/google/protobuf/blob/master/src/google/protobuf/any.proto} - */ -const Any = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; \ No newline at end of file diff --git a/packages/google-privacy-dlp/src/v2/doc/google/protobuf/doc_duration.js b/packages/google-privacy-dlp/src/v2/doc/google/protobuf/doc_duration.js deleted file mode 100644 index bd4b4ee6067..00000000000 --- a/packages/google-privacy-dlp/src/v2/doc/google/protobuf/doc_duration.js +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright 2020 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * A Duration represents a signed, fixed-length span of time represented - * as a count of seconds and fractions of seconds at nanosecond - * resolution. It is independent of any calendar and concepts like "day" - * or "month". It is related to Timestamp in that the difference between - * two Timestamp values is a Duration and it can be added or subtracted - * from a Timestamp. Range is approximately +-10,000 years. - * - * # Examples - * - * Example 1: Compute Duration from two Timestamps in pseudo code. - * - * Timestamp start = ...; - * Timestamp end = ...; - * Duration duration = ...; - * - * duration.seconds = end.seconds - start.seconds; - * duration.nanos = end.nanos - start.nanos; - * - * if (duration.seconds < 0 && duration.nanos > 0) { - * duration.seconds += 1; - * duration.nanos -= 1000000000; - * } else if (durations.seconds > 0 && duration.nanos < 0) { - * duration.seconds -= 1; - * duration.nanos += 1000000000; - * } - * - * Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. - * - * Timestamp start = ...; - * Duration duration = ...; - * Timestamp end = ...; - * - * end.seconds = start.seconds + duration.seconds; - * end.nanos = start.nanos + duration.nanos; - * - * if (end.nanos < 0) { - * end.seconds -= 1; - * end.nanos += 1000000000; - * } else if (end.nanos >= 1000000000) { - * end.seconds += 1; - * end.nanos -= 1000000000; - * } - * - * Example 3: Compute Duration from datetime.timedelta in Python. - * - * td = datetime.timedelta(days=3, minutes=10) - * duration = Duration() - * duration.FromTimedelta(td) - * - * # JSON Mapping - * - * In JSON format, the Duration type is encoded as a string rather than an - * object, where the string ends in the suffix "s" (indicating seconds) and - * is preceded by the number of seconds, with nanoseconds expressed as - * fractional seconds. For example, 3 seconds with 0 nanoseconds should be - * encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should - * be expressed in JSON format as "3.000000001s", and 3 seconds and 1 - * microsecond should be expressed in JSON format as "3.000001s". - * - * @property {number} seconds - * Signed seconds of the span of time. Must be from -315,576,000,000 - * to +315,576,000,000 inclusive. Note: these bounds are computed from: - * 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years - * - * @property {number} nanos - * Signed fractions of a second at nanosecond resolution of the span - * of time. Durations less than one second are represented with a 0 - * `seconds` field and a positive or negative `nanos` field. For durations - * of one second or more, a non-zero value for the `nanos` field must be - * of the same sign as the `seconds` field. Must be from -999,999,999 - * to +999,999,999 inclusive. - * - * @typedef Duration - * @memberof google.protobuf - * @see [google.protobuf.Duration definition in proto format]{@link https://github.com/google/protobuf/blob/master/src/google/protobuf/duration.proto} - */ -const Duration = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; \ No newline at end of file diff --git a/packages/google-privacy-dlp/src/v2/doc/google/protobuf/doc_empty.js b/packages/google-privacy-dlp/src/v2/doc/google/protobuf/doc_empty.js deleted file mode 100644 index 1e3961d6609..00000000000 --- a/packages/google-privacy-dlp/src/v2/doc/google/protobuf/doc_empty.js +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright 2020 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * A generic empty message that you can re-use to avoid defining duplicated - * empty messages in your APIs. A typical example is to use it as the request - * or the response type of an API method. For instance: - * - * service Foo { - * rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); - * } - * - * The JSON representation for `Empty` is empty JSON object `{}`. - * @typedef Empty - * @memberof google.protobuf - * @see [google.protobuf.Empty definition in proto format]{@link https://github.com/google/protobuf/blob/master/src/google/protobuf/empty.proto} - */ -const Empty = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; \ No newline at end of file diff --git a/packages/google-privacy-dlp/src/v2/doc/google/protobuf/doc_field_mask.js b/packages/google-privacy-dlp/src/v2/doc/google/protobuf/doc_field_mask.js deleted file mode 100644 index 59e745f36c2..00000000000 --- a/packages/google-privacy-dlp/src/v2/doc/google/protobuf/doc_field_mask.js +++ /dev/null @@ -1,228 +0,0 @@ -// Copyright 2020 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * `FieldMask` represents a set of symbolic field paths, for example: - * - * paths: "f.a" - * paths: "f.b.d" - * - * Here `f` represents a field in some root message, `a` and `b` - * fields in the message found in `f`, and `d` a field found in the - * message in `f.b`. - * - * Field masks are used to specify a subset of fields that should be - * returned by a get operation or modified by an update operation. - * Field masks also have a custom JSON encoding (see below). - * - * # Field Masks in Projections - * - * When used in the context of a projection, a response message or - * sub-message is filtered by the API to only contain those fields as - * specified in the mask. For example, if the mask in the previous - * example is applied to a response message as follows: - * - * f { - * a : 22 - * b { - * d : 1 - * x : 2 - * } - * y : 13 - * } - * z: 8 - * - * The result will not contain specific values for fields x,y and z - * (their value will be set to the default, and omitted in proto text - * output): - * - * - * f { - * a : 22 - * b { - * d : 1 - * } - * } - * - * A repeated field is not allowed except at the last position of a - * paths string. - * - * If a FieldMask object is not present in a get operation, the - * operation applies to all fields (as if a FieldMask of all fields - * had been specified). - * - * Note that a field mask does not necessarily apply to the - * top-level response message. In case of a REST get operation, the - * field mask applies directly to the response, but in case of a REST - * list operation, the mask instead applies to each individual message - * in the returned resource list. In case of a REST custom method, - * other definitions may be used. Where the mask applies will be - * clearly documented together with its declaration in the API. In - * any case, the effect on the returned resource/resources is required - * behavior for APIs. - * - * # Field Masks in Update Operations - * - * A field mask in update operations specifies which fields of the - * targeted resource are going to be updated. The API is required - * to only change the values of the fields as specified in the mask - * and leave the others untouched. If a resource is passed in to - * describe the updated values, the API ignores the values of all - * fields not covered by the mask. - * - * If a repeated field is specified for an update operation, new values will - * be appended to the existing repeated field in the target resource. Note that - * a repeated field is only allowed in the last position of a `paths` string. - * - * If a sub-message is specified in the last position of the field mask for an - * update operation, then new value will be merged into the existing sub-message - * in the target resource. - * - * For example, given the target message: - * - * f { - * b { - * d: 1 - * x: 2 - * } - * c: [1] - * } - * - * And an update message: - * - * f { - * b { - * d: 10 - * } - * c: [2] - * } - * - * then if the field mask is: - * - * paths: ["f.b", "f.c"] - * - * then the result will be: - * - * f { - * b { - * d: 10 - * x: 2 - * } - * c: [1, 2] - * } - * - * An implementation may provide options to override this default behavior for - * repeated and message fields. - * - * In order to reset a field's value to the default, the field must - * be in the mask and set to the default value in the provided resource. - * Hence, in order to reset all fields of a resource, provide a default - * instance of the resource and set all fields in the mask, or do - * not provide a mask as described below. - * - * If a field mask is not present on update, the operation applies to - * all fields (as if a field mask of all fields has been specified). - * Note that in the presence of schema evolution, this may mean that - * fields the client does not know and has therefore not filled into - * the request will be reset to their default. If this is unwanted - * behavior, a specific service may require a client to always specify - * a field mask, producing an error if not. - * - * As with get operations, the location of the resource which - * describes the updated values in the request message depends on the - * operation kind. In any case, the effect of the field mask is - * required to be honored by the API. - * - * ## Considerations for HTTP REST - * - * The HTTP kind of an update operation which uses a field mask must - * be set to PATCH instead of PUT in order to satisfy HTTP semantics - * (PUT must only be used for full updates). - * - * # JSON Encoding of Field Masks - * - * In JSON, a field mask is encoded as a single string where paths are - * separated by a comma. Fields name in each path are converted - * to/from lower-camel naming conventions. - * - * As an example, consider the following message declarations: - * - * message Profile { - * User user = 1; - * Photo photo = 2; - * } - * message User { - * string display_name = 1; - * string address = 2; - * } - * - * In proto a field mask for `Profile` may look as such: - * - * mask { - * paths: "user.display_name" - * paths: "photo" - * } - * - * In JSON, the same mask is represented as below: - * - * { - * mask: "user.displayName,photo" - * } - * - * # Field Masks and Oneof Fields - * - * Field masks treat fields in oneofs just as regular fields. Consider the - * following message: - * - * message SampleMessage { - * oneof test_oneof { - * string name = 4; - * SubMessage sub_message = 9; - * } - * } - * - * The field mask can be: - * - * mask { - * paths: "name" - * } - * - * Or: - * - * mask { - * paths: "sub_message" - * } - * - * Note that oneof type names ("test_oneof" in this case) cannot be used in - * paths. - * - * ## Field Mask Verification - * - * The implementation of any API method which has a FieldMask type field in the - * request should verify the included field paths, and return an - * `INVALID_ARGUMENT` error if any path is duplicated or unmappable. - * - * @property {string[]} paths - * The set of field mask paths. - * - * @typedef FieldMask - * @memberof google.protobuf - * @see [google.protobuf.FieldMask definition in proto format]{@link https://github.com/google/protobuf/blob/master/src/google/protobuf/field_mask.proto} - */ -const FieldMask = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; \ No newline at end of file diff --git a/packages/google-privacy-dlp/src/v2/doc/google/protobuf/doc_timestamp.js b/packages/google-privacy-dlp/src/v2/doc/google/protobuf/doc_timestamp.js deleted file mode 100644 index ad801cc9a10..00000000000 --- a/packages/google-privacy-dlp/src/v2/doc/google/protobuf/doc_timestamp.js +++ /dev/null @@ -1,117 +0,0 @@ -// Copyright 2020 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * A Timestamp represents a point in time independent of any time zone or local - * calendar, encoded as a count of seconds and fractions of seconds at - * nanosecond resolution. The count is relative to an epoch at UTC midnight on - * January 1, 1970, in the proleptic Gregorian calendar which extends the - * Gregorian calendar backwards to year one. - * - * All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - * second table is needed for interpretation, using a [24-hour linear - * smear](https://developers.google.com/time/smear). - * - * The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - * restricting to that range, we ensure that we can convert to and from [RFC - * 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - * - * # Examples - * - * Example 1: Compute Timestamp from POSIX `time()`. - * - * Timestamp timestamp; - * timestamp.set_seconds(time(NULL)); - * timestamp.set_nanos(0); - * - * Example 2: Compute Timestamp from POSIX `gettimeofday()`. - * - * struct timeval tv; - * gettimeofday(&tv, NULL); - * - * Timestamp timestamp; - * timestamp.set_seconds(tv.tv_sec); - * timestamp.set_nanos(tv.tv_usec * 1000); - * - * Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - * - * FILETIME ft; - * GetSystemTimeAsFileTime(&ft); - * UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - * - * // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - * // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - * Timestamp timestamp; - * timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - * timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - * - * Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - * - * long millis = System.currentTimeMillis(); - * - * Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - * .setNanos((int) ((millis % 1000) * 1000000)).build(); - * - * - * Example 5: Compute Timestamp from current time in Python. - * - * timestamp = Timestamp() - * timestamp.GetCurrentTime() - * - * # JSON Mapping - * - * In JSON format, the Timestamp type is encoded as a string in the - * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the - * format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" - * where {year} is always expressed using four digits while {month}, {day}, - * {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional - * seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), - * are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone - * is required. A proto3 JSON serializer should always use UTC (as indicated by - * "Z") when printing the Timestamp type and a proto3 JSON parser should be - * able to accept both UTC and other timezones (as indicated by an offset). - * - * For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past - * 01:30 UTC on January 15, 2017. - * - * In JavaScript, one can convert a Date object to this format using the - * standard - * [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - * method. In Python, a standard `datetime.datetime` object can be converted - * to this format using - * [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with - * the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use - * the Joda Time's [`ISODateTimeFormat.dateTime()`](https://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D) to obtain a formatter capable of generating timestamps in this format. - * - * @property {number} seconds - * Represents seconds of UTC time since Unix epoch - * 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to - * 9999-12-31T23:59:59Z inclusive. - * - * @property {number} nanos - * Non-negative fractions of a second at nanosecond resolution. Negative - * second values with fractions must still have non-negative nanos values - * that count forward in time. Must be from 0 to 999,999,999 - * inclusive. - * - * @typedef Timestamp - * @memberof google.protobuf - * @see [google.protobuf.Timestamp definition in proto format]{@link https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto} - */ -const Timestamp = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; \ No newline at end of file diff --git a/packages/google-privacy-dlp/src/v2/doc/google/rpc/doc_status.js b/packages/google-privacy-dlp/src/v2/doc/google/rpc/doc_status.js deleted file mode 100644 index 750e0af7689..00000000000 --- a/packages/google-privacy-dlp/src/v2/doc/google/rpc/doc_status.js +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright 2020 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * The `Status` type defines a logical error model that is suitable for - * different programming environments, including REST APIs and RPC APIs. It is - * used by [gRPC](https://github.com/grpc). Each `Status` message contains - * three pieces of data: error code, error message, and error details. - * - * You can find out more about this error model and how to work with it in the - * [API Design Guide](https://cloud.google.com/apis/design/errors). - * - * @property {number} code - * The status code, which should be an enum value of google.rpc.Code. - * - * @property {string} message - * A developer-facing error message, which should be in English. Any - * user-facing error message should be localized and sent in the - * google.rpc.Status.details field, or localized by the client. - * - * @property {Object[]} details - * A list of messages that carry the error details. There is a common set of - * message types for APIs to use. - * - * This object should have the same structure as [Any]{@link google.protobuf.Any} - * - * @typedef Status - * @memberof google.rpc - * @see [google.rpc.Status definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/rpc/status.proto} - */ -const Status = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; \ No newline at end of file diff --git a/packages/google-privacy-dlp/src/v2/doc/google/type/doc_date.js b/packages/google-privacy-dlp/src/v2/doc/google/type/doc_date.js deleted file mode 100644 index 03cf97b4ece..00000000000 --- a/packages/google-privacy-dlp/src/v2/doc/google/type/doc_date.js +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright 2020 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * Represents a whole or partial calendar date, e.g. a birthday. The time of day - * and time zone are either specified elsewhere or are not significant. The date - * is relative to the Proleptic Gregorian Calendar. This can represent: - * - * * A full date, with non-zero year, month and day values - * * A month and day value, with a zero year, e.g. an anniversary - * * A year on its own, with zero month and day values - * * A year and month value, with a zero day, e.g. a credit card expiration date - * - * Related types are google.type.TimeOfDay and `google.protobuf.Timestamp`. - * - * @property {number} year - * Year of date. Must be from 1 to 9999, or 0 if specifying a date without - * a year. - * - * @property {number} month - * Month of year. Must be from 1 to 12, or 0 if specifying a year without a - * month and day. - * - * @property {number} day - * Day of month. Must be from 1 to 31 and valid for the year and month, or 0 - * if specifying a year by itself or a year and month where the day is not - * significant. - * - * @typedef Date - * @memberof google.type - * @see [google.type.Date definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/type/date.proto} - */ -const Date = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; \ No newline at end of file diff --git a/packages/google-privacy-dlp/src/v2/doc/google/type/doc_timeofday.js b/packages/google-privacy-dlp/src/v2/doc/google/type/doc_timeofday.js deleted file mode 100644 index 63583391fca..00000000000 --- a/packages/google-privacy-dlp/src/v2/doc/google/type/doc_timeofday.js +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2020 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * Represents a time of day. The date and time zone are either not significant - * or are specified elsewhere. An API may choose to allow leap seconds. Related - * types are google.type.Date and `google.protobuf.Timestamp`. - * - * @property {number} hours - * Hours of day in 24 hour format. Should be from 0 to 23. An API may choose - * to allow the value "24:00:00" for scenarios like business closing time. - * - * @property {number} minutes - * Minutes of hour of day. Must be from 0 to 59. - * - * @property {number} seconds - * Seconds of minutes of the time. Must normally be from 0 to 59. An API may - * allow the value 60 if it allows leap-seconds. - * - * @property {number} nanos - * Fractions of seconds in nanoseconds. Must be from 0 to 999,999,999. - * - * @typedef TimeOfDay - * @memberof google.type - * @see [google.type.TimeOfDay definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/type/timeofday.proto} - */ -const TimeOfDay = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; \ No newline at end of file diff --git a/packages/google-privacy-dlp/src/browser.js b/packages/google-privacy-dlp/src/v2/index.ts similarity index 69% rename from packages/google-privacy-dlp/src/browser.js rename to packages/google-privacy-dlp/src/v2/index.ts index 68dc62d25d6..d1ccdeeb5af 100644 --- a/packages/google-privacy-dlp/src/browser.js +++ b/packages/google-privacy-dlp/src/v2/index.ts @@ -11,11 +11,9 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** -'use strict'; - -// Set a flag that we are running in a browser bundle. -global.isBrowser = true; - -// Re-export all exports from ./index.js. -module.exports = require('./index'); +export {DlpServiceClient} from './dlp_service_client'; diff --git a/packages/google-privacy-dlp/synth.metadata b/packages/google-privacy-dlp/synth.metadata index 365b41b63e5..8cfb472b8ed 100644 --- a/packages/google-privacy-dlp/synth.metadata +++ b/packages/google-privacy-dlp/synth.metadata @@ -1,19 +1,12 @@ { - "updateTime": "2020-01-24T12:18:33.657445Z", + "updateTime": "2020-01-28T01:12:36.738540Z", "sources": [ - { - "generator": { - "name": "artman", - "version": "0.44.1", - "dockerImage": "googleapis/artman@sha256:5599b61e56a372d21b671969ee915fbca0f6c3a0daaeb898d01f8f685f1bbc8b" - } - }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "e26cab8afd19d396b929039dac5d874cf0b5336c", - "internalRef": "291240093" + "sha": "8e981acfd9b97ea2f312f11bbaa7b6c16e412dea", + "internalRef": "291821782" } }, { @@ -30,9 +23,8 @@ "source": "googleapis", "apiName": "dlp", "apiVersion": "v2", - "language": "nodejs", - "generator": "gapic", - "config": "google/privacy/dlp/artman_dlp_v2.yaml" + "language": "typescript", + "generator": "gapic-generator-typescript" } } ], @@ -58,15 +50,9 @@ { "path": ".github/release-please.yml" }, - { - "path": ".gitignore" - }, { "path": ".jsdoc.js" }, - { - "path": ".kokoro/.gitattributes" - }, { "path": ".kokoro/common.cfg" }, @@ -178,15 +164,6 @@ { "path": ".prettierrc" }, - { - "path": ".readme-partials.yml" - }, - { - "path": ".repo-metadata.json" - }, - { - "path": "CHANGELOG.md" - }, { "path": "CODE_OF_CONDUCT.md" }, @@ -206,7 +183,7 @@ "path": "linkinator.config.json" }, { - "path": "package.json" + "path": "protos/google/cloud/common_resources.proto" }, { "path": "protos/google/privacy/dlp/v2/dlp.proto" @@ -214,119 +191,14 @@ { "path": "protos/google/privacy/dlp/v2/storage.proto" }, - { - "path": "protos/protos.d.ts" - }, - { - "path": "protos/protos.js" - }, - { - "path": "protos/protos.json" - }, { "path": "renovate.json" }, - { - "path": "samples/.eslintrc.yml" - }, - { - "path": "samples/.gitignore" - }, { "path": "samples/README.md" }, { - "path": "samples/deid.js" - }, - { - "path": "samples/inspect.js" - }, - { - "path": "samples/jobs.js" - }, - { - "path": "samples/metadata.js" - }, - { - "path": "samples/package.json" - }, - { - "path": "samples/quickstart.js" - }, - { - "path": "samples/redact.js" - }, - { - "path": "samples/resources/accounts.txt" - }, - { - "path": "samples/resources/dates.csv" - }, - { - "path": "samples/resources/harmless.txt" - }, - { - "path": "samples/resources/test.png" - }, - { - "path": "samples/resources/test.txt" - }, - { - "path": "samples/risk.js" - }, - { - "path": "samples/system-test/deid.test.js" - }, - { - "path": "samples/system-test/inspect.test.js" - }, - { - "path": "samples/system-test/jobs.test.js" - }, - { - "path": "samples/system-test/metadata.test.js" - }, - { - "path": "samples/system-test/quickstart.test.js" - }, - { - "path": "samples/system-test/redact.test.js" - }, - { - "path": "samples/system-test/resources/date-shift-context.expected.csv" - }, - { - "path": "samples/system-test/resources/redact-multiple-types.expected.png" - }, - { - "path": "samples/system-test/resources/redact-single-type.expected.png" - }, - { - "path": "samples/system-test/risk.test.js" - }, - { - "path": "samples/system-test/templates.test.js" - }, - { - "path": "samples/system-test/triggers.test.js" - }, - { - "path": "samples/templates.js" - }, - { - "path": "samples/triggers.js" - }, - { - "path": "src/browser.js" - }, - { - "path": "src/index.js" - }, - { - "path": "src/service_proto_list.json" - }, - { - "path": "src/v2/dlp_service_client.js" + "path": "src/v2/dlp_service_client.ts" }, { "path": "src/v2/dlp_service_client_config.json" @@ -335,52 +207,25 @@ "path": "src/v2/dlp_service_proto_list.json" }, { - "path": "src/v2/doc/google/privacy/dlp/v2/doc_dlp.js" - }, - { - "path": "src/v2/doc/google/privacy/dlp/v2/doc_storage.js" - }, - { - "path": "src/v2/doc/google/protobuf/doc_any.js" - }, - { - "path": "src/v2/doc/google/protobuf/doc_duration.js" - }, - { - "path": "src/v2/doc/google/protobuf/doc_empty.js" - }, - { - "path": "src/v2/doc/google/protobuf/doc_field_mask.js" - }, - { - "path": "src/v2/doc/google/protobuf/doc_timestamp.js" - }, - { - "path": "src/v2/doc/google/rpc/doc_status.js" - }, - { - "path": "src/v2/doc/google/type/doc_date.js" - }, - { - "path": "src/v2/doc/google/type/doc_timeofday.js" + "path": "src/v2/index.ts" }, { - "path": "src/v2/index.js" + "path": "system-test/fixtures/sample/src/index.js" }, { - "path": "synth.py" + "path": "system-test/fixtures/sample/src/index.ts" }, { - "path": "system-test/.eslintrc.yml" + "path": "system-test/install.ts" }, { - "path": "system-test/dlp_service_smoke_test.js" + "path": "test/gapic-dlp_service-v2.ts" }, { - "path": "test/gapic-v2.js" + "path": "tsconfig.json" }, { - "path": "test/mocha.opts" + "path": "tslint.json" }, { "path": "webpack.config.js" diff --git a/packages/google-privacy-dlp/synth.py b/packages/google-privacy-dlp/synth.py index 555853e0969..03bffc98baf 100644 --- a/packages/google-privacy-dlp/synth.py +++ b/packages/google-privacy-dlp/synth.py @@ -19,15 +19,22 @@ import subprocess # Run the gapic generator -gapic = gcp.GAPICGenerator() +gapic = gcp.GAPICMicrogenerator() version = 'v2' -library = gapic.node_library( - 'dlp', version, config_path='/google/privacy/dlp/artman_dlp_v2.yaml') -s.copy(library, excludes=['src/index.js', 'README.md', 'package.json']) +library = gapic.typescript_library( + 'dlp', version, + generator_args={ + "grpc-service-config": f"google/privacy/dlp/{version}/dlp_grpc_service_config.json", + "package-name": f"@google-cloud/dlp" + }, + proto_path=f'/google/privacy/dlp/{version}', + extra_proto_files=['google/cloud/common_resources.proto'], + ) +s.copy(library, excludes=['src/index.ts', 'README.md', 'package.json']) # Copy common templates common_templates = gcp.CommonTemplates() -templates = common_templates.node_library() +templates = common_templates.node_library(source_location='build/src') s.copy(templates) # [START fix-dead-link] @@ -43,3 +50,4 @@ # Node.js specific cleanup subprocess.run(['npm', 'install']) subprocess.run(['npm', 'run', 'fix']) +subprocess.run(['npm', 'compileProtos', 'run']) diff --git a/packages/google-privacy-dlp/system-test/.eslintrc.yml b/packages/google-privacy-dlp/system-test/.eslintrc.yml deleted file mode 100644 index 5adab99ca15..00000000000 --- a/packages/google-privacy-dlp/system-test/.eslintrc.yml +++ /dev/null @@ -1,4 +0,0 @@ ---- -rules: - node/no-unpublished-require: off - no-console: off diff --git a/packages/google-privacy-dlp/system-test/dlp_service_smoke_test.js b/packages/google-privacy-dlp/system-test/dlp_service_smoke_test.ts similarity index 86% rename from packages/google-privacy-dlp/system-test/dlp_service_smoke_test.js rename to packages/google-privacy-dlp/system-test/dlp_service_smoke_test.ts index 5137cb14c24..b05a66fc808 100644 --- a/packages/google-privacy-dlp/system-test/dlp_service_smoke_test.js +++ b/packages/google-privacy-dlp/system-test/dlp_service_smoke_test.ts @@ -1,4 +1,4 @@ -// Copyright 2017 Google LLC +// Copyright 2020 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -12,9 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -'use strict'; - -const {describe, it} = require('mocha'); +import {describe, it} from 'mocha'; describe('DlpServiceSmokeTest', () => { it('successfully makes a call to the service', done => { @@ -30,17 +28,17 @@ describe('DlpServiceSmokeTest', () => { const type = 'text/plain'; const value = 'my phone number is 215-512-1212'; const item = { - type: type, - value: value, + type, + value, }; const request = { - inspectConfig: inspectConfig, - item: item, + inspectConfig, + item, parent: client.projectPath(projectId), }; client .inspectContent(request) - .then(responses => { + .then((responses: [{}]) => { const response = responses[0]; console.log(response); }) diff --git a/packages/google-privacy-dlp/system-test/fixtures/sample/src/index.js b/packages/google-privacy-dlp/system-test/fixtures/sample/src/index.js new file mode 100644 index 00000000000..3d28ccd56e6 --- /dev/null +++ b/packages/google-privacy-dlp/system-test/fixtures/sample/src/index.js @@ -0,0 +1,27 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + +/* eslint-disable node/no-missing-require, no-unused-vars */ +const dlp = require('@google-cloud/dlp'); + +function main() { + const dlpServiceClient = new dlp.DlpServiceClient(); +} + +main(); diff --git a/packages/google-privacy-dlp/src/v2/index.js b/packages/google-privacy-dlp/system-test/fixtures/sample/src/index.ts similarity index 64% rename from packages/google-privacy-dlp/src/v2/index.js rename to packages/google-privacy-dlp/system-test/fixtures/sample/src/index.ts index 1a31d870474..b3f26313aea 100644 --- a/packages/google-privacy-dlp/src/v2/index.js +++ b/packages/google-privacy-dlp/system-test/fixtures/sample/src/index.ts @@ -11,9 +11,15 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** -'use strict'; +import {DlpServiceClient} from '@google-cloud/dlp'; -const DlpServiceClient = require('./dlp_service_client'); +function main() { + const dlpServiceClient = new DlpServiceClient(); +} -module.exports.DlpServiceClient = DlpServiceClient; +main(); diff --git a/packages/google-privacy-dlp/system-test/install.ts b/packages/google-privacy-dlp/system-test/install.ts new file mode 100644 index 00000000000..c4d80e9c0c8 --- /dev/null +++ b/packages/google-privacy-dlp/system-test/install.ts @@ -0,0 +1,51 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import {packNTest} from 'pack-n-play'; +import {readFileSync} from 'fs'; +import {describe, it} from 'mocha'; + +describe('typescript consumer tests', () => { + it('should have correct type signature for typescript users', async function() { + this.timeout(300000); + const options = { + packageDir: process.cwd(), // path to your module. + sample: { + description: 'typescript based user can use the type definitions', + ts: readFileSync( + './system-test/fixtures/sample/src/index.ts' + ).toString(), + }, + }; + await packNTest(options); // will throw upon error. + }); + + it('should have correct type signature for javascript users', async function() { + this.timeout(300000); + const options = { + packageDir: process.cwd(), // path to your module. + sample: { + description: 'typescript based user can use the type definitions', + ts: readFileSync( + './system-test/fixtures/sample/src/index.js' + ).toString(), + }, + }; + await packNTest(options); // will throw upon error. + }); +}); diff --git a/packages/google-privacy-dlp/test/gapic-v2.js b/packages/google-privacy-dlp/test/gapic-dlp_service-v2.ts similarity index 50% rename from packages/google-privacy-dlp/test/gapic-v2.js rename to packages/google-privacy-dlp/test/gapic-dlp_service-v2.ts index 6bd4effd0cc..f5d45d7c3a3 100644 --- a/packages/google-privacy-dlp/test/gapic-v2.js +++ b/packages/google-privacy-dlp/test/gapic-dlp_service-v2.ts @@ -11,68 +11,93 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** -'use strict'; - -const assert = require('assert'); -const {describe, it} = require('mocha'); - -const dlpModule = require('../src'); +import * as protosTypes from '../protos/protos'; +import * as assert from 'assert'; +import {describe, it} from 'mocha'; +const dlpserviceModule = require('../src'); const FAKE_STATUS_CODE = 1; -const error = new Error(); -error.code = FAKE_STATUS_CODE; +class FakeError { + name: string; + message: string; + code: number; + constructor(n: number) { + this.name = 'fakeName'; + this.message = 'fake message'; + this.code = n; + } +} +const error = new FakeError(FAKE_STATUS_CODE); +export interface Callback { + (err: FakeError | null, response?: {} | null): void; +} -describe('DlpServiceClient', () => { +export class Operation { + constructor() {} + promise() {} +} +function mockSimpleGrpcMethod( + expectedRequest: {}, + response: {} | null, + error: FakeError | null +) { + return (actualRequest: {}, options: {}, callback: Callback) => { + assert.deepStrictEqual(actualRequest, expectedRequest); + if (error) { + callback(error); + } else if (response) { + callback(null, response); + } else { + callback(null); + } + }; +} +describe('v2.DlpServiceClient', () => { it('has servicePath', () => { - const servicePath = dlpModule.v2.DlpServiceClient.servicePath; + const servicePath = dlpserviceModule.v2.DlpServiceClient.servicePath; assert(servicePath); }); - it('has apiEndpoint', () => { - const apiEndpoint = dlpModule.v2.DlpServiceClient.apiEndpoint; + const apiEndpoint = dlpserviceModule.v2.DlpServiceClient.apiEndpoint; assert(apiEndpoint); }); - it('has port', () => { - const port = dlpModule.v2.DlpServiceClient.port; + const port = dlpserviceModule.v2.DlpServiceClient.port; assert(port); assert(typeof port === 'number'); }); - - it('should create a client with no options', () => { - const client = new dlpModule.v2.DlpServiceClient(); + it('should create a client with no option', () => { + const client = new dlpserviceModule.v2.DlpServiceClient(); assert(client); }); - it('should create a client with gRPC fallback', () => { - const client = new dlpModule.v2.DlpServiceClient({fallback: true}); + const client = new dlpserviceModule.v2.DlpServiceClient({ + fallback: true, + }); assert(client); }); - describe('inspectContent', () => { it('invokes inspectContent without error', done => { - const client = new dlpModule.v2.DlpServiceClient({ + const client = new dlpserviceModule.v2.DlpServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); - // Mock request - const formattedParent = client.projectPath('[PROJECT]'); - const request = { - parent: formattedParent, - }; - + const request: protosTypes.google.privacy.dlp.v2.IInspectContentRequest = {}; // Mock response const expectedResponse = {}; - - // Mock Grpc layer + // Mock gRPC layer client._innerApiCalls.inspectContent = mockSimpleGrpcMethod( request, - expectedResponse + expectedResponse, + null ); - - client.inspectContent(request, (err, response) => { + client.inspectContent(request, (err: {}, response: {}) => { assert.ifError(err); assert.deepStrictEqual(response, expectedResponse); done(); @@ -80,61 +105,45 @@ describe('DlpServiceClient', () => { }); it('invokes inspectContent with error', done => { - const client = new dlpModule.v2.DlpServiceClient({ + const client = new dlpserviceModule.v2.DlpServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); - // Mock request - const formattedParent = client.projectPath('[PROJECT]'); - const request = { - parent: formattedParent, - }; - - // Mock Grpc layer + const request: protosTypes.google.privacy.dlp.v2.IInspectContentRequest = {}; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer client._innerApiCalls.inspectContent = mockSimpleGrpcMethod( request, null, error ); - - client.inspectContent(request, (err, response) => { - assert(err instanceof Error); + client.inspectContent(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); assert.strictEqual(err.code, FAKE_STATUS_CODE); assert(typeof response === 'undefined'); done(); }); }); }); - describe('redactImage', () => { it('invokes redactImage without error', done => { - const client = new dlpModule.v2.DlpServiceClient({ + const client = new dlpserviceModule.v2.DlpServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); - // Mock request - const formattedParent = client.projectPath('[PROJECT]'); - const request = { - parent: formattedParent, - }; - + const request: protosTypes.google.privacy.dlp.v2.IRedactImageRequest = {}; // Mock response - const redactedImage = '28'; - const extractedText = 'extractedText998260012'; - const expectedResponse = { - redactedImage: redactedImage, - extractedText: extractedText, - }; - - // Mock Grpc layer + const expectedResponse = {}; + // Mock gRPC layer client._innerApiCalls.redactImage = mockSimpleGrpcMethod( request, - expectedResponse + expectedResponse, + null ); - - client.redactImage(request, (err, response) => { + client.redactImage(request, (err: {}, response: {}) => { assert.ifError(err); assert.deepStrictEqual(response, expectedResponse); done(); @@ -142,56 +151,45 @@ describe('DlpServiceClient', () => { }); it('invokes redactImage with error', done => { - const client = new dlpModule.v2.DlpServiceClient({ + const client = new dlpserviceModule.v2.DlpServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); - // Mock request - const formattedParent = client.projectPath('[PROJECT]'); - const request = { - parent: formattedParent, - }; - - // Mock Grpc layer + const request: protosTypes.google.privacy.dlp.v2.IRedactImageRequest = {}; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer client._innerApiCalls.redactImage = mockSimpleGrpcMethod( request, null, error ); - - client.redactImage(request, (err, response) => { - assert(err instanceof Error); + client.redactImage(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); assert.strictEqual(err.code, FAKE_STATUS_CODE); assert(typeof response === 'undefined'); done(); }); }); }); - describe('deidentifyContent', () => { it('invokes deidentifyContent without error', done => { - const client = new dlpModule.v2.DlpServiceClient({ + const client = new dlpserviceModule.v2.DlpServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); - // Mock request - const formattedParent = client.projectPath('[PROJECT]'); - const request = { - parent: formattedParent, - }; - + const request: protosTypes.google.privacy.dlp.v2.IDeidentifyContentRequest = {}; // Mock response const expectedResponse = {}; - - // Mock Grpc layer + // Mock gRPC layer client._innerApiCalls.deidentifyContent = mockSimpleGrpcMethod( request, - expectedResponse + expectedResponse, + null ); - - client.deidentifyContent(request, (err, response) => { + client.deidentifyContent(request, (err: {}, response: {}) => { assert.ifError(err); assert.deepStrictEqual(response, expectedResponse); done(); @@ -199,56 +197,45 @@ describe('DlpServiceClient', () => { }); it('invokes deidentifyContent with error', done => { - const client = new dlpModule.v2.DlpServiceClient({ + const client = new dlpserviceModule.v2.DlpServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); - // Mock request - const formattedParent = client.projectPath('[PROJECT]'); - const request = { - parent: formattedParent, - }; - - // Mock Grpc layer + const request: protosTypes.google.privacy.dlp.v2.IDeidentifyContentRequest = {}; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer client._innerApiCalls.deidentifyContent = mockSimpleGrpcMethod( request, null, error ); - - client.deidentifyContent(request, (err, response) => { - assert(err instanceof Error); + client.deidentifyContent(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); assert.strictEqual(err.code, FAKE_STATUS_CODE); assert(typeof response === 'undefined'); done(); }); }); }); - describe('reidentifyContent', () => { it('invokes reidentifyContent without error', done => { - const client = new dlpModule.v2.DlpServiceClient({ + const client = new dlpserviceModule.v2.DlpServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); - // Mock request - const formattedParent = client.projectPath('[PROJECT]'); - const request = { - parent: formattedParent, - }; - + const request: protosTypes.google.privacy.dlp.v2.IReidentifyContentRequest = {}; // Mock response const expectedResponse = {}; - - // Mock Grpc layer + // Mock gRPC layer client._innerApiCalls.reidentifyContent = mockSimpleGrpcMethod( request, - expectedResponse + expectedResponse, + null ); - - client.reidentifyContent(request, (err, response) => { + client.reidentifyContent(request, (err: {}, response: {}) => { assert.ifError(err); assert.deepStrictEqual(response, expectedResponse); done(); @@ -256,53 +243,45 @@ describe('DlpServiceClient', () => { }); it('invokes reidentifyContent with error', done => { - const client = new dlpModule.v2.DlpServiceClient({ + const client = new dlpserviceModule.v2.DlpServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); - // Mock request - const formattedParent = client.projectPath('[PROJECT]'); - const request = { - parent: formattedParent, - }; - - // Mock Grpc layer + const request: protosTypes.google.privacy.dlp.v2.IReidentifyContentRequest = {}; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer client._innerApiCalls.reidentifyContent = mockSimpleGrpcMethod( request, null, error ); - - client.reidentifyContent(request, (err, response) => { - assert(err instanceof Error); + client.reidentifyContent(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); assert.strictEqual(err.code, FAKE_STATUS_CODE); assert(typeof response === 'undefined'); done(); }); }); }); - describe('listInfoTypes', () => { it('invokes listInfoTypes without error', done => { - const client = new dlpModule.v2.DlpServiceClient({ + const client = new dlpserviceModule.v2.DlpServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); - // Mock request - const request = {}; - + const request: protosTypes.google.privacy.dlp.v2.IListInfoTypesRequest = {}; // Mock response const expectedResponse = {}; - - // Mock Grpc layer + // Mock gRPC layer client._innerApiCalls.listInfoTypes = mockSimpleGrpcMethod( request, - expectedResponse + expectedResponse, + null ); - - client.listInfoTypes(request, (err, response) => { + client.listInfoTypes(request, (err: {}, response: {}) => { assert.ifError(err); assert.deepStrictEqual(response, expectedResponse); done(); @@ -310,60 +289,45 @@ describe('DlpServiceClient', () => { }); it('invokes listInfoTypes with error', done => { - const client = new dlpModule.v2.DlpServiceClient({ + const client = new dlpserviceModule.v2.DlpServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); - // Mock request - const request = {}; - - // Mock Grpc layer + const request: protosTypes.google.privacy.dlp.v2.IListInfoTypesRequest = {}; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer client._innerApiCalls.listInfoTypes = mockSimpleGrpcMethod( request, null, error ); - - client.listInfoTypes(request, (err, response) => { - assert(err instanceof Error); + client.listInfoTypes(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); assert.strictEqual(err.code, FAKE_STATUS_CODE); assert(typeof response === 'undefined'); done(); }); }); }); - describe('createInspectTemplate', () => { it('invokes createInspectTemplate without error', done => { - const client = new dlpModule.v2.DlpServiceClient({ + const client = new dlpserviceModule.v2.DlpServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); - // Mock request - const formattedParent = client.organizationPath('[ORGANIZATION]'); - const request = { - parent: formattedParent, - }; - + const request: protosTypes.google.privacy.dlp.v2.ICreateInspectTemplateRequest = {}; // Mock response - const name = 'name3373707'; - const displayName = 'displayName1615086568'; - const description = 'description-1724546052'; - const expectedResponse = { - name: name, - displayName: displayName, - description: description, - }; - - // Mock Grpc layer + const expectedResponse = {}; + // Mock gRPC layer client._innerApiCalls.createInspectTemplate = mockSimpleGrpcMethod( request, - expectedResponse + expectedResponse, + null ); - - client.createInspectTemplate(request, (err, response) => { + client.createInspectTemplate(request, (err: {}, response: {}) => { assert.ifError(err); assert.deepStrictEqual(response, expectedResponse); done(); @@ -371,66 +335,45 @@ describe('DlpServiceClient', () => { }); it('invokes createInspectTemplate with error', done => { - const client = new dlpModule.v2.DlpServiceClient({ + const client = new dlpserviceModule.v2.DlpServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); - // Mock request - const formattedParent = client.organizationPath('[ORGANIZATION]'); - const request = { - parent: formattedParent, - }; - - // Mock Grpc layer + const request: protosTypes.google.privacy.dlp.v2.ICreateInspectTemplateRequest = {}; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer client._innerApiCalls.createInspectTemplate = mockSimpleGrpcMethod( request, null, error ); - - client.createInspectTemplate(request, (err, response) => { - assert(err instanceof Error); + client.createInspectTemplate(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); assert.strictEqual(err.code, FAKE_STATUS_CODE); assert(typeof response === 'undefined'); done(); }); }); }); - describe('updateInspectTemplate', () => { it('invokes updateInspectTemplate without error', done => { - const client = new dlpModule.v2.DlpServiceClient({ + const client = new dlpserviceModule.v2.DlpServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); - // Mock request - const formattedName = client.organizationInspectTemplatePath( - '[ORGANIZATION]', - '[INSPECT_TEMPLATE]' - ); - const request = { - name: formattedName, - }; - + const request: protosTypes.google.privacy.dlp.v2.IUpdateInspectTemplateRequest = {}; // Mock response - const name2 = 'name2-1052831874'; - const displayName = 'displayName1615086568'; - const description = 'description-1724546052'; - const expectedResponse = { - name: name2, - displayName: displayName, - description: description, - }; - - // Mock Grpc layer + const expectedResponse = {}; + // Mock gRPC layer client._innerApiCalls.updateInspectTemplate = mockSimpleGrpcMethod( request, - expectedResponse + expectedResponse, + null ); - - client.updateInspectTemplate(request, (err, response) => { + client.updateInspectTemplate(request, (err: {}, response: {}) => { assert.ifError(err); assert.deepStrictEqual(response, expectedResponse); done(); @@ -438,63 +381,45 @@ describe('DlpServiceClient', () => { }); it('invokes updateInspectTemplate with error', done => { - const client = new dlpModule.v2.DlpServiceClient({ + const client = new dlpserviceModule.v2.DlpServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); - // Mock request - const formattedName = client.organizationInspectTemplatePath( - '[ORGANIZATION]', - '[INSPECT_TEMPLATE]' - ); - const request = { - name: formattedName, - }; - - // Mock Grpc layer + const request: protosTypes.google.privacy.dlp.v2.IUpdateInspectTemplateRequest = {}; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer client._innerApiCalls.updateInspectTemplate = mockSimpleGrpcMethod( request, null, error ); - - client.updateInspectTemplate(request, (err, response) => { - assert(err instanceof Error); + client.updateInspectTemplate(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); assert.strictEqual(err.code, FAKE_STATUS_CODE); assert(typeof response === 'undefined'); done(); }); }); }); - describe('getInspectTemplate', () => { it('invokes getInspectTemplate without error', done => { - const client = new dlpModule.v2.DlpServiceClient({ + const client = new dlpserviceModule.v2.DlpServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); - // Mock request - const request = {}; - + const request: protosTypes.google.privacy.dlp.v2.IGetInspectTemplateRequest = {}; // Mock response - const name = 'name3373707'; - const displayName = 'displayName1615086568'; - const description = 'description-1724546052'; - const expectedResponse = { - name: name, - displayName: displayName, - description: description, - }; - - // Mock Grpc layer + const expectedResponse = {}; + // Mock gRPC layer client._innerApiCalls.getInspectTemplate = mockSimpleGrpcMethod( request, - expectedResponse + expectedResponse, + null ); - - client.getInspectTemplate(request, (err, response) => { + client.getInspectTemplate(request, (err: {}, response: {}) => { assert.ifError(err); assert.deepStrictEqual(response, expectedResponse); done(); @@ -502,184 +427,91 @@ describe('DlpServiceClient', () => { }); it('invokes getInspectTemplate with error', done => { - const client = new dlpModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const request = {}; - - // Mock Grpc layer - client._innerApiCalls.getInspectTemplate = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.getInspectTemplate(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('listInspectTemplates', () => { - it('invokes listInspectTemplates without error', done => { - const client = new dlpModule.v2.DlpServiceClient({ + const client = new dlpserviceModule.v2.DlpServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); - // Mock request - const formattedParent = client.organizationPath('[ORGANIZATION]'); - const request = { - parent: formattedParent, - }; - + const request: protosTypes.google.privacy.dlp.v2.IGetInspectTemplateRequest = {}; // Mock response - const nextPageToken = ''; - const inspectTemplatesElement = {}; - const inspectTemplates = [inspectTemplatesElement]; - const expectedResponse = { - nextPageToken: nextPageToken, - inspectTemplates: inspectTemplates, - }; - - // Mock Grpc layer - client._innerApiCalls.listInspectTemplates = ( - actualRequest, - options, - callback - ) => { - assert.deepStrictEqual(actualRequest, request); - callback(null, expectedResponse.inspectTemplates); - }; - - client.listInspectTemplates(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse.inspectTemplates); - done(); - }); - }); - - it('invokes listInspectTemplates with error', done => { - const client = new dlpModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedParent = client.organizationPath('[ORGANIZATION]'); - const request = { - parent: formattedParent, - }; - - // Mock Grpc layer - client._innerApiCalls.listInspectTemplates = mockSimpleGrpcMethod( + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.getInspectTemplate = mockSimpleGrpcMethod( request, null, error ); - - client.listInspectTemplates(request, (err, response) => { - assert(err instanceof Error); + client.getInspectTemplate(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); assert.strictEqual(err.code, FAKE_STATUS_CODE); assert(typeof response === 'undefined'); done(); }); }); }); - describe('deleteInspectTemplate', () => { it('invokes deleteInspectTemplate without error', done => { - const client = new dlpModule.v2.DlpServiceClient({ + const client = new dlpserviceModule.v2.DlpServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); - // Mock request - const formattedName = client.organizationInspectTemplatePath( - '[ORGANIZATION]', - '[INSPECT_TEMPLATE]' - ); - const request = { - name: formattedName, - }; - - // Mock Grpc layer + const request: protosTypes.google.privacy.dlp.v2.IDeleteInspectTemplateRequest = {}; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer client._innerApiCalls.deleteInspectTemplate = mockSimpleGrpcMethod( - request + request, + expectedResponse, + null ); - - client.deleteInspectTemplate(request, err => { + client.deleteInspectTemplate(request, (err: {}, response: {}) => { assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); done(); }); }); it('invokes deleteInspectTemplate with error', done => { - const client = new dlpModule.v2.DlpServiceClient({ + const client = new dlpserviceModule.v2.DlpServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); - // Mock request - const formattedName = client.organizationInspectTemplatePath( - '[ORGANIZATION]', - '[INSPECT_TEMPLATE]' - ); - const request = { - name: formattedName, - }; - - // Mock Grpc layer + const request: protosTypes.google.privacy.dlp.v2.IDeleteInspectTemplateRequest = {}; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer client._innerApiCalls.deleteInspectTemplate = mockSimpleGrpcMethod( request, null, error ); - - client.deleteInspectTemplate(request, err => { - assert(err instanceof Error); + client.deleteInspectTemplate(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); done(); }); }); }); - describe('createDeidentifyTemplate', () => { it('invokes createDeidentifyTemplate without error', done => { - const client = new dlpModule.v2.DlpServiceClient({ + const client = new dlpserviceModule.v2.DlpServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); - // Mock request - const formattedParent = client.organizationPath('[ORGANIZATION]'); - const request = { - parent: formattedParent, - }; - + const request: protosTypes.google.privacy.dlp.v2.ICreateDeidentifyTemplateRequest = {}; // Mock response - const name = 'name3373707'; - const displayName = 'displayName1615086568'; - const description = 'description-1724546052'; - const expectedResponse = { - name: name, - displayName: displayName, - description: description, - }; - - // Mock Grpc layer + const expectedResponse = {}; + // Mock gRPC layer client._innerApiCalls.createDeidentifyTemplate = mockSimpleGrpcMethod( request, - expectedResponse + expectedResponse, + null ); - - client.createDeidentifyTemplate(request, (err, response) => { + client.createDeidentifyTemplate(request, (err: {}, response: {}) => { assert.ifError(err); assert.deepStrictEqual(response, expectedResponse); done(); @@ -687,66 +519,48 @@ describe('DlpServiceClient', () => { }); it('invokes createDeidentifyTemplate with error', done => { - const client = new dlpModule.v2.DlpServiceClient({ + const client = new dlpserviceModule.v2.DlpServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); - // Mock request - const formattedParent = client.organizationPath('[ORGANIZATION]'); - const request = { - parent: formattedParent, - }; - - // Mock Grpc layer + const request: protosTypes.google.privacy.dlp.v2.ICreateDeidentifyTemplateRequest = {}; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer client._innerApiCalls.createDeidentifyTemplate = mockSimpleGrpcMethod( request, null, error ); - - client.createDeidentifyTemplate(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); + client.createDeidentifyTemplate( + request, + (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + } + ); }); }); - describe('updateDeidentifyTemplate', () => { it('invokes updateDeidentifyTemplate without error', done => { - const client = new dlpModule.v2.DlpServiceClient({ + const client = new dlpserviceModule.v2.DlpServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); - // Mock request - const formattedName = client.organizationDeidentifyTemplatePath( - '[ORGANIZATION]', - '[DEIDENTIFY_TEMPLATE]' - ); - const request = { - name: formattedName, - }; - + const request: protosTypes.google.privacy.dlp.v2.IUpdateDeidentifyTemplateRequest = {}; // Mock response - const name2 = 'name2-1052831874'; - const displayName = 'displayName1615086568'; - const description = 'description-1724546052'; - const expectedResponse = { - name: name2, - displayName: displayName, - description: description, - }; - - // Mock Grpc layer + const expectedResponse = {}; + // Mock gRPC layer client._innerApiCalls.updateDeidentifyTemplate = mockSimpleGrpcMethod( request, - expectedResponse + expectedResponse, + null ); - - client.updateDeidentifyTemplate(request, (err, response) => { + client.updateDeidentifyTemplate(request, (err: {}, response: {}) => { assert.ifError(err); assert.deepStrictEqual(response, expectedResponse); done(); @@ -754,69 +568,48 @@ describe('DlpServiceClient', () => { }); it('invokes updateDeidentifyTemplate with error', done => { - const client = new dlpModule.v2.DlpServiceClient({ + const client = new dlpserviceModule.v2.DlpServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); - // Mock request - const formattedName = client.organizationDeidentifyTemplatePath( - '[ORGANIZATION]', - '[DEIDENTIFY_TEMPLATE]' - ); - const request = { - name: formattedName, - }; - - // Mock Grpc layer + const request: protosTypes.google.privacy.dlp.v2.IUpdateDeidentifyTemplateRequest = {}; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer client._innerApiCalls.updateDeidentifyTemplate = mockSimpleGrpcMethod( request, null, error ); - - client.updateDeidentifyTemplate(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); + client.updateDeidentifyTemplate( + request, + (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + } + ); }); }); - describe('getDeidentifyTemplate', () => { it('invokes getDeidentifyTemplate without error', done => { - const client = new dlpModule.v2.DlpServiceClient({ + const client = new dlpserviceModule.v2.DlpServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); - // Mock request - const formattedName = client.organizationDeidentifyTemplatePath( - '[ORGANIZATION]', - '[DEIDENTIFY_TEMPLATE]' - ); - const request = { - name: formattedName, - }; - + const request: protosTypes.google.privacy.dlp.v2.IGetDeidentifyTemplateRequest = {}; // Mock response - const name2 = 'name2-1052831874'; - const displayName = 'displayName1615086568'; - const description = 'description-1724546052'; - const expectedResponse = { - name: name2, - displayName: displayName, - description: description, - }; - - // Mock Grpc layer + const expectedResponse = {}; + // Mock gRPC layer client._innerApiCalls.getDeidentifyTemplate = mockSimpleGrpcMethod( request, - expectedResponse + expectedResponse, + null ); - - client.getDeidentifyTemplate(request, (err, response) => { + client.getDeidentifyTemplate(request, (err: {}, response: {}) => { assert.ifError(err); assert.deepStrictEqual(response, expectedResponse); done(); @@ -824,1095 +617,961 @@ describe('DlpServiceClient', () => { }); it('invokes getDeidentifyTemplate with error', done => { - const client = new dlpModule.v2.DlpServiceClient({ + const client = new dlpserviceModule.v2.DlpServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); - // Mock request - const formattedName = client.organizationDeidentifyTemplatePath( - '[ORGANIZATION]', - '[DEIDENTIFY_TEMPLATE]' - ); - const request = { - name: formattedName, - }; - - // Mock Grpc layer + const request: protosTypes.google.privacy.dlp.v2.IGetDeidentifyTemplateRequest = {}; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer client._innerApiCalls.getDeidentifyTemplate = mockSimpleGrpcMethod( request, null, error ); - - client.getDeidentifyTemplate(request, (err, response) => { - assert(err instanceof Error); + client.getDeidentifyTemplate(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); assert.strictEqual(err.code, FAKE_STATUS_CODE); assert(typeof response === 'undefined'); done(); }); }); }); - - describe('listDeidentifyTemplates', () => { - it('invokes listDeidentifyTemplates without error', done => { - const client = new dlpModule.v2.DlpServiceClient({ + describe('deleteDeidentifyTemplate', () => { + it('invokes deleteDeidentifyTemplate without error', done => { + const client = new dlpserviceModule.v2.DlpServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); - // Mock request - const formattedParent = client.organizationPath('[ORGANIZATION]'); - const request = { - parent: formattedParent, - }; - + const request: protosTypes.google.privacy.dlp.v2.IDeleteDeidentifyTemplateRequest = {}; // Mock response - const nextPageToken = ''; - const deidentifyTemplatesElement = {}; - const deidentifyTemplates = [deidentifyTemplatesElement]; - const expectedResponse = { - nextPageToken: nextPageToken, - deidentifyTemplates: deidentifyTemplates, - }; - - // Mock Grpc layer - client._innerApiCalls.listDeidentifyTemplates = ( - actualRequest, - options, - callback - ) => { - assert.deepStrictEqual(actualRequest, request); - callback(null, expectedResponse.deidentifyTemplates); - }; - - client.listDeidentifyTemplates(request, (err, response) => { + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.deleteDeidentifyTemplate = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.deleteDeidentifyTemplate(request, (err: {}, response: {}) => { assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse.deidentifyTemplates); + assert.deepStrictEqual(response, expectedResponse); done(); }); }); - it('invokes listDeidentifyTemplates with error', done => { - const client = new dlpModule.v2.DlpServiceClient({ + it('invokes deleteDeidentifyTemplate with error', done => { + const client = new dlpserviceModule.v2.DlpServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); - // Mock request - const formattedParent = client.organizationPath('[ORGANIZATION]'); - const request = { - parent: formattedParent, - }; - - // Mock Grpc layer - client._innerApiCalls.listDeidentifyTemplates = mockSimpleGrpcMethod( + const request: protosTypes.google.privacy.dlp.v2.IDeleteDeidentifyTemplateRequest = {}; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.deleteDeidentifyTemplate = mockSimpleGrpcMethod( request, null, error ); - - client.listDeidentifyTemplates(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); + client.deleteDeidentifyTemplate( + request, + (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + } + ); }); }); - - describe('deleteDeidentifyTemplate', () => { - it('invokes deleteDeidentifyTemplate without error', done => { - const client = new dlpModule.v2.DlpServiceClient({ + describe('createJobTrigger', () => { + it('invokes createJobTrigger without error', done => { + const client = new dlpserviceModule.v2.DlpServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); - // Mock request - const formattedName = client.organizationDeidentifyTemplatePath( - '[ORGANIZATION]', - '[DEIDENTIFY_TEMPLATE]' - ); - const request = { - name: formattedName, - }; - - // Mock Grpc layer - client._innerApiCalls.deleteDeidentifyTemplate = mockSimpleGrpcMethod( - request + const request: protosTypes.google.privacy.dlp.v2.ICreateJobTriggerRequest = {}; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.createJobTrigger = mockSimpleGrpcMethod( + request, + expectedResponse, + null ); - - client.deleteDeidentifyTemplate(request, err => { + client.createJobTrigger(request, (err: {}, response: {}) => { assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); done(); }); }); - it('invokes deleteDeidentifyTemplate with error', done => { - const client = new dlpModule.v2.DlpServiceClient({ + it('invokes createJobTrigger with error', done => { + const client = new dlpserviceModule.v2.DlpServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); - // Mock request - const formattedName = client.organizationDeidentifyTemplatePath( - '[ORGANIZATION]', - '[DEIDENTIFY_TEMPLATE]' - ); - const request = { - name: formattedName, - }; - - // Mock Grpc layer - client._innerApiCalls.deleteDeidentifyTemplate = mockSimpleGrpcMethod( + const request: protosTypes.google.privacy.dlp.v2.ICreateJobTriggerRequest = {}; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.createJobTrigger = mockSimpleGrpcMethod( request, null, error ); - - client.deleteDeidentifyTemplate(request, err => { - assert(err instanceof Error); + client.createJobTrigger(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); done(); }); }); }); - - describe('createDlpJob', () => { - it('invokes createDlpJob without error', done => { - const client = new dlpModule.v2.DlpServiceClient({ + describe('updateJobTrigger', () => { + it('invokes updateJobTrigger without error', done => { + const client = new dlpserviceModule.v2.DlpServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); - // Mock request - const formattedParent = client.projectPath('[PROJECT]'); - const request = { - parent: formattedParent, - }; - + const request: protosTypes.google.privacy.dlp.v2.IUpdateJobTriggerRequest = {}; // Mock response - const name = 'name3373707'; - const jobTriggerName = 'jobTriggerName1819490804'; - const expectedResponse = { - name: name, - jobTriggerName: jobTriggerName, - }; - - // Mock Grpc layer - client._innerApiCalls.createDlpJob = mockSimpleGrpcMethod( + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.updateJobTrigger = mockSimpleGrpcMethod( request, - expectedResponse + expectedResponse, + null ); - - client.createDlpJob(request, (err, response) => { + client.updateJobTrigger(request, (err: {}, response: {}) => { assert.ifError(err); assert.deepStrictEqual(response, expectedResponse); done(); }); }); - it('invokes createDlpJob with error', done => { - const client = new dlpModule.v2.DlpServiceClient({ + it('invokes updateJobTrigger with error', done => { + const client = new dlpserviceModule.v2.DlpServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); - // Mock request - const formattedParent = client.projectPath('[PROJECT]'); - const request = { - parent: formattedParent, - }; - - // Mock Grpc layer - client._innerApiCalls.createDlpJob = mockSimpleGrpcMethod( + const request: protosTypes.google.privacy.dlp.v2.IUpdateJobTriggerRequest = {}; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.updateJobTrigger = mockSimpleGrpcMethod( request, null, error ); - - client.createDlpJob(request, (err, response) => { - assert(err instanceof Error); + client.updateJobTrigger(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); assert.strictEqual(err.code, FAKE_STATUS_CODE); assert(typeof response === 'undefined'); done(); }); }); }); - - describe('listDlpJobs', () => { - it('invokes listDlpJobs without error', done => { - const client = new dlpModule.v2.DlpServiceClient({ + describe('getJobTrigger', () => { + it('invokes getJobTrigger without error', done => { + const client = new dlpserviceModule.v2.DlpServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); - // Mock request - const formattedParent = client.projectPath('[PROJECT]'); - const request = { - parent: formattedParent, - }; - + const request: protosTypes.google.privacy.dlp.v2.IGetJobTriggerRequest = {}; // Mock response - const nextPageToken = ''; - const jobsElement = {}; - const jobs = [jobsElement]; - const expectedResponse = { - nextPageToken: nextPageToken, - jobs: jobs, - }; - - // Mock Grpc layer - client._innerApiCalls.listDlpJobs = ( - actualRequest, - options, - callback - ) => { - assert.deepStrictEqual(actualRequest, request); - callback(null, expectedResponse.jobs); - }; - - client.listDlpJobs(request, (err, response) => { + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.getJobTrigger = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.getJobTrigger(request, (err: {}, response: {}) => { assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse.jobs); + assert.deepStrictEqual(response, expectedResponse); done(); }); }); - it('invokes listDlpJobs with error', done => { - const client = new dlpModule.v2.DlpServiceClient({ + it('invokes getJobTrigger with error', done => { + const client = new dlpserviceModule.v2.DlpServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); - // Mock request - const formattedParent = client.projectPath('[PROJECT]'); - const request = { - parent: formattedParent, - }; - - // Mock Grpc layer - client._innerApiCalls.listDlpJobs = mockSimpleGrpcMethod( + const request: protosTypes.google.privacy.dlp.v2.IGetJobTriggerRequest = {}; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.getJobTrigger = mockSimpleGrpcMethod( request, null, error ); - - client.listDlpJobs(request, (err, response) => { - assert(err instanceof Error); + client.getJobTrigger(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); assert.strictEqual(err.code, FAKE_STATUS_CODE); assert(typeof response === 'undefined'); done(); }); }); }); - - describe('getDlpJob', () => { - it('invokes getDlpJob without error', done => { - const client = new dlpModule.v2.DlpServiceClient({ + describe('deleteJobTrigger', () => { + it('invokes deleteJobTrigger without error', done => { + const client = new dlpserviceModule.v2.DlpServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); - // Mock request - const formattedName = client.dlpJobPath('[PROJECT]', '[DLP_JOB]'); - const request = { - name: formattedName, - }; - + const request: protosTypes.google.privacy.dlp.v2.IDeleteJobTriggerRequest = {}; // Mock response - const name2 = 'name2-1052831874'; - const jobTriggerName = 'jobTriggerName1819490804'; - const expectedResponse = { - name: name2, - jobTriggerName: jobTriggerName, - }; - - // Mock Grpc layer - client._innerApiCalls.getDlpJob = mockSimpleGrpcMethod( + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.deleteJobTrigger = mockSimpleGrpcMethod( request, - expectedResponse + expectedResponse, + null ); - - client.getDlpJob(request, (err, response) => { + client.deleteJobTrigger(request, (err: {}, response: {}) => { assert.ifError(err); assert.deepStrictEqual(response, expectedResponse); done(); }); }); - it('invokes getDlpJob with error', done => { - const client = new dlpModule.v2.DlpServiceClient({ + it('invokes deleteJobTrigger with error', done => { + const client = new dlpserviceModule.v2.DlpServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); - // Mock request - const formattedName = client.dlpJobPath('[PROJECT]', '[DLP_JOB]'); - const request = { - name: formattedName, - }; - - // Mock Grpc layer - client._innerApiCalls.getDlpJob = mockSimpleGrpcMethod( + const request: protosTypes.google.privacy.dlp.v2.IDeleteJobTriggerRequest = {}; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.deleteJobTrigger = mockSimpleGrpcMethod( request, null, error ); - - client.getDlpJob(request, (err, response) => { - assert(err instanceof Error); + client.deleteJobTrigger(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); assert.strictEqual(err.code, FAKE_STATUS_CODE); assert(typeof response === 'undefined'); done(); }); }); }); - - describe('deleteDlpJob', () => { - it('invokes deleteDlpJob without error', done => { - const client = new dlpModule.v2.DlpServiceClient({ + describe('activateJobTrigger', () => { + it('invokes activateJobTrigger without error', done => { + const client = new dlpserviceModule.v2.DlpServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); - // Mock request - const formattedName = client.dlpJobPath('[PROJECT]', '[DLP_JOB]'); - const request = { - name: formattedName, - }; - - // Mock Grpc layer - client._innerApiCalls.deleteDlpJob = mockSimpleGrpcMethod(request); - - client.deleteDlpJob(request, err => { + const request: protosTypes.google.privacy.dlp.v2.IActivateJobTriggerRequest = {}; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.activateJobTrigger = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.activateJobTrigger(request, (err: {}, response: {}) => { assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); done(); }); }); - it('invokes deleteDlpJob with error', done => { - const client = new dlpModule.v2.DlpServiceClient({ + it('invokes activateJobTrigger with error', done => { + const client = new dlpserviceModule.v2.DlpServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); - // Mock request - const formattedName = client.dlpJobPath('[PROJECT]', '[DLP_JOB]'); - const request = { - name: formattedName, - }; - - // Mock Grpc layer - client._innerApiCalls.deleteDlpJob = mockSimpleGrpcMethod( + const request: protosTypes.google.privacy.dlp.v2.IActivateJobTriggerRequest = {}; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.activateJobTrigger = mockSimpleGrpcMethod( request, null, error ); - - client.deleteDlpJob(request, err => { - assert(err instanceof Error); + client.activateJobTrigger(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); done(); }); }); }); - - describe('cancelDlpJob', () => { - it('invokes cancelDlpJob without error', done => { - const client = new dlpModule.v2.DlpServiceClient({ + describe('createDlpJob', () => { + it('invokes createDlpJob without error', done => { + const client = new dlpserviceModule.v2.DlpServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); - // Mock request - const formattedName = client.dlpJobPath('[PROJECT]', '[DLP_JOB]'); - const request = { - name: formattedName, - }; - - // Mock Grpc layer - client._innerApiCalls.cancelDlpJob = mockSimpleGrpcMethod(request); - - client.cancelDlpJob(request, err => { + const request: protosTypes.google.privacy.dlp.v2.ICreateDlpJobRequest = {}; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.createDlpJob = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.createDlpJob(request, (err: {}, response: {}) => { assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); done(); }); }); - it('invokes cancelDlpJob with error', done => { - const client = new dlpModule.v2.DlpServiceClient({ + it('invokes createDlpJob with error', done => { + const client = new dlpserviceModule.v2.DlpServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); - // Mock request - const formattedName = client.dlpJobPath('[PROJECT]', '[DLP_JOB]'); - const request = { - name: formattedName, - }; - - // Mock Grpc layer - client._innerApiCalls.cancelDlpJob = mockSimpleGrpcMethod( + const request: protosTypes.google.privacy.dlp.v2.ICreateDlpJobRequest = {}; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.createDlpJob = mockSimpleGrpcMethod( request, null, error ); - - client.cancelDlpJob(request, err => { - assert(err instanceof Error); + client.createDlpJob(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); done(); }); }); }); - - describe('listJobTriggers', () => { - it('invokes listJobTriggers without error', done => { - const client = new dlpModule.v2.DlpServiceClient({ + describe('getDlpJob', () => { + it('invokes getDlpJob without error', done => { + const client = new dlpserviceModule.v2.DlpServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); - // Mock request - const formattedParent = client.projectPath('[PROJECT]'); - const request = { - parent: formattedParent, - }; - + const request: protosTypes.google.privacy.dlp.v2.IGetDlpJobRequest = {}; // Mock response - const nextPageToken = ''; - const jobTriggersElement = {}; - const jobTriggers = [jobTriggersElement]; - const expectedResponse = { - nextPageToken: nextPageToken, - jobTriggers: jobTriggers, - }; - - // Mock Grpc layer - client._innerApiCalls.listJobTriggers = ( - actualRequest, - options, - callback - ) => { - assert.deepStrictEqual(actualRequest, request); - callback(null, expectedResponse.jobTriggers); - }; - - client.listJobTriggers(request, (err, response) => { + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.getDlpJob = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.getDlpJob(request, (err: {}, response: {}) => { assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse.jobTriggers); + assert.deepStrictEqual(response, expectedResponse); done(); }); }); - it('invokes listJobTriggers with error', done => { - const client = new dlpModule.v2.DlpServiceClient({ + it('invokes getDlpJob with error', done => { + const client = new dlpserviceModule.v2.DlpServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); - // Mock request - const formattedParent = client.projectPath('[PROJECT]'); - const request = { - parent: formattedParent, - }; - - // Mock Grpc layer - client._innerApiCalls.listJobTriggers = mockSimpleGrpcMethod( + const request: protosTypes.google.privacy.dlp.v2.IGetDlpJobRequest = {}; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.getDlpJob = mockSimpleGrpcMethod( request, null, error ); - - client.listJobTriggers(request, (err, response) => { - assert(err instanceof Error); + client.getDlpJob(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); assert.strictEqual(err.code, FAKE_STATUS_CODE); assert(typeof response === 'undefined'); done(); }); }); }); - - describe('getJobTrigger', () => { - it('invokes getJobTrigger without error', done => { - const client = new dlpModule.v2.DlpServiceClient({ + describe('deleteDlpJob', () => { + it('invokes deleteDlpJob without error', done => { + const client = new dlpserviceModule.v2.DlpServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); - // Mock request - const formattedName = client.projectJobTriggerPath( - '[PROJECT]', - '[JOB_TRIGGER]' - ); - const request = { - name: formattedName, - }; - + const request: protosTypes.google.privacy.dlp.v2.IDeleteDlpJobRequest = {}; // Mock response - const name2 = 'name2-1052831874'; - const displayName = 'displayName1615086568'; - const description = 'description-1724546052'; - const expectedResponse = { - name: name2, - displayName: displayName, - description: description, - }; - - // Mock Grpc layer - client._innerApiCalls.getJobTrigger = mockSimpleGrpcMethod( + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.deleteDlpJob = mockSimpleGrpcMethod( request, - expectedResponse + expectedResponse, + null ); - - client.getJobTrigger(request, (err, response) => { + client.deleteDlpJob(request, (err: {}, response: {}) => { assert.ifError(err); assert.deepStrictEqual(response, expectedResponse); done(); }); }); - it('invokes getJobTrigger with error', done => { - const client = new dlpModule.v2.DlpServiceClient({ + it('invokes deleteDlpJob with error', done => { + const client = new dlpserviceModule.v2.DlpServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); - // Mock request - const formattedName = client.projectJobTriggerPath( - '[PROJECT]', - '[JOB_TRIGGER]' - ); - const request = { - name: formattedName, - }; - - // Mock Grpc layer - client._innerApiCalls.getJobTrigger = mockSimpleGrpcMethod( + const request: protosTypes.google.privacy.dlp.v2.IDeleteDlpJobRequest = {}; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.deleteDlpJob = mockSimpleGrpcMethod( request, null, error ); - - client.getJobTrigger(request, (err, response) => { - assert(err instanceof Error); + client.deleteDlpJob(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); assert.strictEqual(err.code, FAKE_STATUS_CODE); assert(typeof response === 'undefined'); done(); }); }); }); - - describe('deleteJobTrigger', () => { - it('invokes deleteJobTrigger without error', done => { - const client = new dlpModule.v2.DlpServiceClient({ + describe('cancelDlpJob', () => { + it('invokes cancelDlpJob without error', done => { + const client = new dlpserviceModule.v2.DlpServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); - // Mock request - const name = 'name3373707'; - const request = { - name: name, - }; - - // Mock Grpc layer - client._innerApiCalls.deleteJobTrigger = mockSimpleGrpcMethod(request); - - client.deleteJobTrigger(request, err => { + const request: protosTypes.google.privacy.dlp.v2.ICancelDlpJobRequest = {}; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.cancelDlpJob = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.cancelDlpJob(request, (err: {}, response: {}) => { assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); done(); }); }); - it('invokes deleteJobTrigger with error', done => { - const client = new dlpModule.v2.DlpServiceClient({ + it('invokes cancelDlpJob with error', done => { + const client = new dlpserviceModule.v2.DlpServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); - // Mock request - const name = 'name3373707'; - const request = { - name: name, - }; - - // Mock Grpc layer - client._innerApiCalls.deleteJobTrigger = mockSimpleGrpcMethod( + const request: protosTypes.google.privacy.dlp.v2.ICancelDlpJobRequest = {}; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.cancelDlpJob = mockSimpleGrpcMethod( request, null, error ); - - client.deleteJobTrigger(request, err => { - assert(err instanceof Error); + client.cancelDlpJob(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); done(); }); }); }); - - describe('updateJobTrigger', () => { - it('invokes updateJobTrigger without error', done => { - const client = new dlpModule.v2.DlpServiceClient({ + describe('createStoredInfoType', () => { + it('invokes createStoredInfoType without error', done => { + const client = new dlpserviceModule.v2.DlpServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); - // Mock request - const formattedName = client.projectJobTriggerPath( - '[PROJECT]', - '[JOB_TRIGGER]' - ); - const request = { - name: formattedName, - }; - + const request: protosTypes.google.privacy.dlp.v2.ICreateStoredInfoTypeRequest = {}; // Mock response - const name2 = 'name2-1052831874'; - const displayName = 'displayName1615086568'; - const description = 'description-1724546052'; - const expectedResponse = { - name: name2, - displayName: displayName, - description: description, - }; - - // Mock Grpc layer - client._innerApiCalls.updateJobTrigger = mockSimpleGrpcMethod( + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.createStoredInfoType = mockSimpleGrpcMethod( request, - expectedResponse + expectedResponse, + null ); - - client.updateJobTrigger(request, (err, response) => { + client.createStoredInfoType(request, (err: {}, response: {}) => { assert.ifError(err); assert.deepStrictEqual(response, expectedResponse); done(); }); }); - it('invokes updateJobTrigger with error', done => { - const client = new dlpModule.v2.DlpServiceClient({ + it('invokes createStoredInfoType with error', done => { + const client = new dlpserviceModule.v2.DlpServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); - // Mock request - const formattedName = client.projectJobTriggerPath( - '[PROJECT]', - '[JOB_TRIGGER]' - ); - const request = { - name: formattedName, - }; - - // Mock Grpc layer - client._innerApiCalls.updateJobTrigger = mockSimpleGrpcMethod( + const request: protosTypes.google.privacy.dlp.v2.ICreateStoredInfoTypeRequest = {}; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.createStoredInfoType = mockSimpleGrpcMethod( request, null, error ); - - client.updateJobTrigger(request, (err, response) => { - assert(err instanceof Error); + client.createStoredInfoType(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); assert.strictEqual(err.code, FAKE_STATUS_CODE); assert(typeof response === 'undefined'); done(); }); }); }); - - describe('createJobTrigger', () => { - it('invokes createJobTrigger without error', done => { - const client = new dlpModule.v2.DlpServiceClient({ + describe('updateStoredInfoType', () => { + it('invokes updateStoredInfoType without error', done => { + const client = new dlpserviceModule.v2.DlpServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); - // Mock request - const formattedParent = client.projectPath('[PROJECT]'); - const request = { - parent: formattedParent, - }; - + const request: protosTypes.google.privacy.dlp.v2.IUpdateStoredInfoTypeRequest = {}; // Mock response - const name = 'name3373707'; - const displayName = 'displayName1615086568'; - const description = 'description-1724546052'; - const expectedResponse = { - name: name, - displayName: displayName, - description: description, - }; - - // Mock Grpc layer - client._innerApiCalls.createJobTrigger = mockSimpleGrpcMethod( + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.updateStoredInfoType = mockSimpleGrpcMethod( request, - expectedResponse + expectedResponse, + null ); - - client.createJobTrigger(request, (err, response) => { + client.updateStoredInfoType(request, (err: {}, response: {}) => { assert.ifError(err); assert.deepStrictEqual(response, expectedResponse); done(); }); }); - it('invokes createJobTrigger with error', done => { - const client = new dlpModule.v2.DlpServiceClient({ + it('invokes updateStoredInfoType with error', done => { + const client = new dlpserviceModule.v2.DlpServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); - // Mock request - const formattedParent = client.projectPath('[PROJECT]'); - const request = { - parent: formattedParent, - }; - - // Mock Grpc layer - client._innerApiCalls.createJobTrigger = mockSimpleGrpcMethod( + const request: protosTypes.google.privacy.dlp.v2.IUpdateStoredInfoTypeRequest = {}; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.updateStoredInfoType = mockSimpleGrpcMethod( request, null, error ); - - client.createJobTrigger(request, (err, response) => { - assert(err instanceof Error); + client.updateStoredInfoType(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); assert.strictEqual(err.code, FAKE_STATUS_CODE); assert(typeof response === 'undefined'); done(); }); }); }); - - describe('createStoredInfoType', () => { - it('invokes createStoredInfoType without error', done => { - const client = new dlpModule.v2.DlpServiceClient({ + describe('getStoredInfoType', () => { + it('invokes getStoredInfoType without error', done => { + const client = new dlpserviceModule.v2.DlpServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); - // Mock request - const formattedParent = client.organizationPath('[ORGANIZATION]'); - const request = { - parent: formattedParent, - }; - + const request: protosTypes.google.privacy.dlp.v2.IGetStoredInfoTypeRequest = {}; // Mock response - const name = 'name3373707'; - const expectedResponse = { - name: name, - }; - - // Mock Grpc layer - client._innerApiCalls.createStoredInfoType = mockSimpleGrpcMethod( + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.getStoredInfoType = mockSimpleGrpcMethod( request, - expectedResponse + expectedResponse, + null ); - - client.createStoredInfoType(request, (err, response) => { + client.getStoredInfoType(request, (err: {}, response: {}) => { assert.ifError(err); assert.deepStrictEqual(response, expectedResponse); done(); }); }); - it('invokes createStoredInfoType with error', done => { - const client = new dlpModule.v2.DlpServiceClient({ + it('invokes getStoredInfoType with error', done => { + const client = new dlpserviceModule.v2.DlpServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); - // Mock request - const formattedParent = client.organizationPath('[ORGANIZATION]'); - const request = { - parent: formattedParent, - }; - - // Mock Grpc layer - client._innerApiCalls.createStoredInfoType = mockSimpleGrpcMethod( + const request: protosTypes.google.privacy.dlp.v2.IGetStoredInfoTypeRequest = {}; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.getStoredInfoType = mockSimpleGrpcMethod( request, null, error ); - - client.createStoredInfoType(request, (err, response) => { - assert(err instanceof Error); + client.getStoredInfoType(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); assert.strictEqual(err.code, FAKE_STATUS_CODE); assert(typeof response === 'undefined'); done(); }); }); }); - - describe('updateStoredInfoType', () => { - it('invokes updateStoredInfoType without error', done => { - const client = new dlpModule.v2.DlpServiceClient({ + describe('deleteStoredInfoType', () => { + it('invokes deleteStoredInfoType without error', done => { + const client = new dlpserviceModule.v2.DlpServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); - // Mock request - const formattedName = client.organizationStoredInfoTypePath( - '[ORGANIZATION]', - '[STORED_INFO_TYPE]' - ); - const request = { - name: formattedName, - }; - + const request: protosTypes.google.privacy.dlp.v2.IDeleteStoredInfoTypeRequest = {}; // Mock response - const name2 = 'name2-1052831874'; - const expectedResponse = { - name: name2, - }; - - // Mock Grpc layer - client._innerApiCalls.updateStoredInfoType = mockSimpleGrpcMethod( + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.deleteStoredInfoType = mockSimpleGrpcMethod( request, - expectedResponse + expectedResponse, + null ); - - client.updateStoredInfoType(request, (err, response) => { + client.deleteStoredInfoType(request, (err: {}, response: {}) => { assert.ifError(err); assert.deepStrictEqual(response, expectedResponse); done(); }); }); - it('invokes updateStoredInfoType with error', done => { - const client = new dlpModule.v2.DlpServiceClient({ + it('invokes deleteStoredInfoType with error', done => { + const client = new dlpserviceModule.v2.DlpServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); - // Mock request - const formattedName = client.organizationStoredInfoTypePath( - '[ORGANIZATION]', - '[STORED_INFO_TYPE]' - ); - const request = { - name: formattedName, - }; - - // Mock Grpc layer - client._innerApiCalls.updateStoredInfoType = mockSimpleGrpcMethod( + const request: protosTypes.google.privacy.dlp.v2.IDeleteStoredInfoTypeRequest = {}; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.deleteStoredInfoType = mockSimpleGrpcMethod( request, null, error ); - - client.updateStoredInfoType(request, (err, response) => { - assert(err instanceof Error); + client.deleteStoredInfoType(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); assert.strictEqual(err.code, FAKE_STATUS_CODE); assert(typeof response === 'undefined'); done(); }); }); }); - - describe('getStoredInfoType', () => { - it('invokes getStoredInfoType without error', done => { - const client = new dlpModule.v2.DlpServiceClient({ + describe('listInspectTemplates', () => { + it('invokes listInspectTemplates without error', done => { + const client = new dlpserviceModule.v2.DlpServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); - // Mock request - const formattedName = client.organizationStoredInfoTypePath( - '[ORGANIZATION]', - '[STORED_INFO_TYPE]' - ); - const request = { - name: formattedName, - }; - + const request: protosTypes.google.privacy.dlp.v2.IListInspectTemplatesRequest = {}; // Mock response - const name2 = 'name2-1052831874'; - const expectedResponse = { - name: name2, - }; - + const expectedResponse = {}; // Mock Grpc layer - client._innerApiCalls.getStoredInfoType = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.getStoredInfoType(request, (err, response) => { + client._innerApiCalls.listInspectTemplates = ( + actualRequest: {}, + options: {}, + callback: Callback + ) => { + assert.deepStrictEqual(actualRequest, request); + callback(null, expectedResponse); + }; + client.listInspectTemplates(request, (err: FakeError, response: {}) => { assert.ifError(err); assert.deepStrictEqual(response, expectedResponse); done(); }); }); - - it('invokes getStoredInfoType with error', done => { - const client = new dlpModule.v2.DlpServiceClient({ + }); + describe('listInspectTemplatesStream', () => { + it('invokes listInspectTemplatesStream without error', done => { + const client = new dlpserviceModule.v2.DlpServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); - // Mock request - const formattedName = client.organizationStoredInfoTypePath( - '[ORGANIZATION]', - '[STORED_INFO_TYPE]' - ); - const request = { - name: formattedName, - }; - + const request: protosTypes.google.privacy.dlp.v2.IListInspectTemplatesRequest = {}; + // Mock response + const expectedResponse = {}; // Mock Grpc layer - client._innerApiCalls.getStoredInfoType = mockSimpleGrpcMethod( + client._innerApiCalls.listInspectTemplates = ( + actualRequest: {}, + options: {}, + callback: Callback + ) => { + assert.deepStrictEqual(actualRequest, request); + callback(null, expectedResponse); + }; + const stream = client + .listInspectTemplatesStream(request, {}) + .on('data', (response: {}) => { + assert.deepStrictEqual(response, expectedResponse); + done(); + }) + .on('error', (err: FakeError) => { + done(err); + }); + stream.write(request); + }); + }); + describe('listDeidentifyTemplates', () => { + it('invokes listDeidentifyTemplates without error', done => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.privacy.dlp.v2.IListDeidentifyTemplatesRequest = {}; + // Mock response + const expectedResponse = {}; + // Mock Grpc layer + client._innerApiCalls.listDeidentifyTemplates = ( + actualRequest: {}, + options: {}, + callback: Callback + ) => { + assert.deepStrictEqual(actualRequest, request); + callback(null, expectedResponse); + }; + client.listDeidentifyTemplates( request, - null, - error + (err: FakeError, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + } ); - - client.getStoredInfoType(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); + }); + }); + describe('listDeidentifyTemplatesStream', () => { + it('invokes listDeidentifyTemplatesStream without error', done => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', }); + // Mock request + const request: protosTypes.google.privacy.dlp.v2.IListDeidentifyTemplatesRequest = {}; + // Mock response + const expectedResponse = {}; + // Mock Grpc layer + client._innerApiCalls.listDeidentifyTemplates = ( + actualRequest: {}, + options: {}, + callback: Callback + ) => { + assert.deepStrictEqual(actualRequest, request); + callback(null, expectedResponse); + }; + const stream = client + .listDeidentifyTemplatesStream(request, {}) + .on('data', (response: {}) => { + assert.deepStrictEqual(response, expectedResponse); + done(); + }) + .on('error', (err: FakeError) => { + done(err); + }); + stream.write(request); }); }); - - describe('listStoredInfoTypes', () => { - it('invokes listStoredInfoTypes without error', done => { - const client = new dlpModule.v2.DlpServiceClient({ + describe('listJobTriggers', () => { + it('invokes listJobTriggers without error', done => { + const client = new dlpserviceModule.v2.DlpServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); - // Mock request - const formattedParent = client.organizationPath('[ORGANIZATION]'); - const request = { - parent: formattedParent, - }; - + const request: protosTypes.google.privacy.dlp.v2.IListJobTriggersRequest = {}; // Mock response - const nextPageToken = ''; - const storedInfoTypesElement = {}; - const storedInfoTypes = [storedInfoTypesElement]; - const expectedResponse = { - nextPageToken: nextPageToken, - storedInfoTypes: storedInfoTypes, - }; - + const expectedResponse = {}; // Mock Grpc layer - client._innerApiCalls.listStoredInfoTypes = ( - actualRequest, - options, - callback + client._innerApiCalls.listJobTriggers = ( + actualRequest: {}, + options: {}, + callback: Callback ) => { assert.deepStrictEqual(actualRequest, request); - callback(null, expectedResponse.storedInfoTypes); + callback(null, expectedResponse); }; - - client.listStoredInfoTypes(request, (err, response) => { + client.listJobTriggers(request, (err: FakeError, response: {}) => { assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse.storedInfoTypes); + assert.deepStrictEqual(response, expectedResponse); done(); }); }); - - it('invokes listStoredInfoTypes with error', done => { - const client = new dlpModule.v2.DlpServiceClient({ + }); + describe('listJobTriggersStream', () => { + it('invokes listJobTriggersStream without error', done => { + const client = new dlpserviceModule.v2.DlpServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); - // Mock request - const formattedParent = client.organizationPath('[ORGANIZATION]'); - const request = { - parent: formattedParent, - }; - + const request: protosTypes.google.privacy.dlp.v2.IListJobTriggersRequest = {}; + // Mock response + const expectedResponse = {}; // Mock Grpc layer - client._innerApiCalls.listStoredInfoTypes = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.listStoredInfoTypes(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); + client._innerApiCalls.listJobTriggers = ( + actualRequest: {}, + options: {}, + callback: Callback + ) => { + assert.deepStrictEqual(actualRequest, request); + callback(null, expectedResponse); + }; + const stream = client + .listJobTriggersStream(request, {}) + .on('data', (response: {}) => { + assert.deepStrictEqual(response, expectedResponse); + done(); + }) + .on('error', (err: FakeError) => { + done(err); + }); + stream.write(request); }); }); - - describe('deleteStoredInfoType', () => { - it('invokes deleteStoredInfoType without error', done => { - const client = new dlpModule.v2.DlpServiceClient({ + describe('listDlpJobs', () => { + it('invokes listDlpJobs without error', done => { + const client = new dlpserviceModule.v2.DlpServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); - // Mock request - const formattedName = client.organizationStoredInfoTypePath( - '[ORGANIZATION]', - '[STORED_INFO_TYPE]' - ); - const request = { - name: formattedName, - }; - + const request: protosTypes.google.privacy.dlp.v2.IListDlpJobsRequest = {}; + // Mock response + const expectedResponse = {}; // Mock Grpc layer - client._innerApiCalls.deleteStoredInfoType = mockSimpleGrpcMethod( - request - ); - - client.deleteStoredInfoType(request, err => { + client._innerApiCalls.listDlpJobs = ( + actualRequest: {}, + options: {}, + callback: Callback + ) => { + assert.deepStrictEqual(actualRequest, request); + callback(null, expectedResponse); + }; + client.listDlpJobs(request, (err: FakeError, response: {}) => { assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); done(); }); }); - - it('invokes deleteStoredInfoType with error', done => { - const client = new dlpModule.v2.DlpServiceClient({ + }); + describe('listDlpJobsStream', () => { + it('invokes listDlpJobsStream without error', done => { + const client = new dlpserviceModule.v2.DlpServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); - // Mock request - const formattedName = client.organizationStoredInfoTypePath( - '[ORGANIZATION]', - '[STORED_INFO_TYPE]' - ); - const request = { - name: formattedName, - }; - + const request: protosTypes.google.privacy.dlp.v2.IListDlpJobsRequest = {}; + // Mock response + const expectedResponse = {}; // Mock Grpc layer - client._innerApiCalls.deleteStoredInfoType = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.deleteStoredInfoType(request, err => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); + client._innerApiCalls.listDlpJobs = ( + actualRequest: {}, + options: {}, + callback: Callback + ) => { + assert.deepStrictEqual(actualRequest, request); + callback(null, expectedResponse); + }; + const stream = client + .listDlpJobsStream(request, {}) + .on('data', (response: {}) => { + assert.deepStrictEqual(response, expectedResponse); + done(); + }) + .on('error', (err: FakeError) => { + done(err); + }); + stream.write(request); + }); + }); + describe('listStoredInfoTypes', () => { + it('invokes listStoredInfoTypes without error', done => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.privacy.dlp.v2.IListStoredInfoTypesRequest = {}; + // Mock response + const expectedResponse = {}; + // Mock Grpc layer + client._innerApiCalls.listStoredInfoTypes = ( + actualRequest: {}, + options: {}, + callback: Callback + ) => { + assert.deepStrictEqual(actualRequest, request); + callback(null, expectedResponse); + }; + client.listStoredInfoTypes(request, (err: FakeError, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); done(); }); }); }); + describe('listStoredInfoTypesStream', () => { + it('invokes listStoredInfoTypesStream without error', done => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.privacy.dlp.v2.IListStoredInfoTypesRequest = {}; + // Mock response + const expectedResponse = {}; + // Mock Grpc layer + client._innerApiCalls.listStoredInfoTypes = ( + actualRequest: {}, + options: {}, + callback: Callback + ) => { + assert.deepStrictEqual(actualRequest, request); + callback(null, expectedResponse); + }; + const stream = client + .listStoredInfoTypesStream(request, {}) + .on('data', (response: {}) => { + assert.deepStrictEqual(response, expectedResponse); + done(); + }) + .on('error', (err: FakeError) => { + done(err); + }); + stream.write(request); + }); + }); }); - -function mockSimpleGrpcMethod(expectedRequest, response, error) { - return function(actualRequest, options, callback) { - assert.deepStrictEqual(actualRequest, expectedRequest); - if (error) { - callback(error); - } else if (response) { - callback(null, response); - } else { - callback(null); - } - }; -} diff --git a/packages/google-privacy-dlp/test/mocha.opts b/packages/google-privacy-dlp/test/mocha.opts deleted file mode 100644 index 8751e7bae37..00000000000 --- a/packages/google-privacy-dlp/test/mocha.opts +++ /dev/null @@ -1,3 +0,0 @@ ---require intelli-espower-loader ---timeout 10000 ---throw-deprecation diff --git a/packages/google-privacy-dlp/tsconfig.json b/packages/google-privacy-dlp/tsconfig.json new file mode 100644 index 00000000000..613d35597b5 --- /dev/null +++ b/packages/google-privacy-dlp/tsconfig.json @@ -0,0 +1,19 @@ +{ + "extends": "./node_modules/gts/tsconfig-google.json", + "compilerOptions": { + "rootDir": ".", + "outDir": "build", + "resolveJsonModule": true, + "lib": [ + "es2016", + "dom" + ] + }, + "include": [ + "src/*.ts", + "src/**/*.ts", + "test/*.ts", + "test/**/*.ts", + "system-test/*.ts" + ] +} diff --git a/packages/google-privacy-dlp/tslint.json b/packages/google-privacy-dlp/tslint.json new file mode 100644 index 00000000000..617dc975bae --- /dev/null +++ b/packages/google-privacy-dlp/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "gts/tslint.json" +} diff --git a/packages/google-privacy-dlp/webpack.config.js b/packages/google-privacy-dlp/webpack.config.js index 7223d80bad0..859b426fa0c 100644 --- a/packages/google-privacy-dlp/webpack.config.js +++ b/packages/google-privacy-dlp/webpack.config.js @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2019 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -12,11 +12,13 @@ // See the License for the specific language governing permissions and // limitations under the License. +const path = require('path'); + module.exports = { - entry: './src/browser.js', + entry: './src/index.ts', output: { - library: 'dlp', - filename: './dlp.js', + library: 'DlpService', + filename: './dlp-service.js', }, node: { child_process: 'empty', @@ -24,21 +26,37 @@ module.exports = { crypto: 'empty', }, resolve: { - extensions: ['.js', '.json'], + alias: { + '../../../package.json': path.resolve(__dirname, 'package.json'), + }, + extensions: ['.js', '.json', '.ts'], }, module: { rules: [ { - test: /node_modules[\\/]retry-request[\\/]/, - use: 'null-loader', + test: /\.tsx?$/, + use: 'ts-loader', + exclude: /node_modules/ + }, + { + test: /node_modules[\\/]@grpc[\\/]grpc-js/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]grpc/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]retry-request/, + use: 'null-loader' }, { - test: /node_modules[\\/]https-proxy-agent[\\/]/, - use: 'null-loader', + test: /node_modules[\\/]https?-proxy-agent/, + use: 'null-loader' }, { - test: /node_modules[\\/]gtoken[\\/]/, - use: 'null-loader', + test: /node_modules[\\/]gtoken/, + use: 'null-loader' }, ], },