From e363094169410fbd93682f33fef74300af4d1f39 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Fri, 25 Mar 2022 17:48:14 +0000 Subject: [PATCH 1/2] feat: new Bytes and File types: POWERPOINT and EXCEL PiperOrigin-RevId: 437260831 Source-Link: https://github.com/googleapis/googleapis/commit/3c34a4075b81b318b68d1a100a13fd0f8db55c87 Source-Link: https://github.com/googleapis/googleapis-gen/commit/a4035213e686b96afc3ed66d0d04328e4ffbd4d1 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYTQwMzUyMTNlNjg2Yjk2YWZjM2VkNjZkMGQwNDMyOGU0ZmZiZDRkMSJ9 --- owl-bot-staging/v2/.eslintignore | 7 + owl-bot-staging/v2/.eslintrc.json | 3 + owl-bot-staging/v2/.gitignore | 14 + owl-bot-staging/v2/.jsdoc.js | 55 + owl-bot-staging/v2/.mocharc.js | 33 + owl-bot-staging/v2/.prettierrc.js | 22 + owl-bot-staging/v2/README.md | 1 + owl-bot-staging/v2/linkinator.config.json | 16 + owl-bot-staging/v2/package.json | 64 + .../v2/protos/google/privacy/dlp/v2/dlp.proto | 4427 ++++++++++++++ .../google/privacy/dlp/v2/storage.proto | 755 +++ .../v2/dlp_service.activate_job_trigger.js | 59 + .../v2/dlp_service.cancel_dlp_job.js | 58 + .../dlp_service.create_deidentify_template.js | 85 + .../v2/dlp_service.create_dlp_job.js | 85 + .../v2/dlp_service.create_inspect_template.js | 85 + .../v2/dlp_service.create_job_trigger.js | 81 + .../v2/dlp_service.create_stored_info_type.js | 85 + .../v2/dlp_service.deidentify_content.js | 100 + .../dlp_service.delete_deidentify_template.js | 60 + .../v2/dlp_service.delete_dlp_job.js | 58 + .../v2/dlp_service.delete_inspect_template.js | 60 + .../v2/dlp_service.delete_job_trigger.js | 59 + .../v2/dlp_service.delete_stored_info_type.js | 60 + .../v2/dlp_service.finish_dlp_job.js | 58 + .../v2/dlp_service.get_deidentify_template.js | 60 + .../generated/v2/dlp_service.get_dlp_job.js | 58 + .../v2/dlp_service.get_inspect_template.js | 60 + .../v2/dlp_service.get_job_trigger.js | 59 + .../v2/dlp_service.get_stored_info_type.js | 60 + .../v2/dlp_service.hybrid_inspect_dlp_job.js | 63 + .../dlp_service.hybrid_inspect_job_trigger.js | 63 + .../v2/dlp_service.inspect_content.js | 85 + .../dlp_service.list_deidentify_templates.js | 98 + .../generated/v2/dlp_service.list_dlp_jobs.js | 122 + .../v2/dlp_service.list_info_types.js | 70 + .../v2/dlp_service.list_inspect_templates.js | 98 + .../v2/dlp_service.list_job_triggers.js | 122 + .../v2/dlp_service.list_stored_info_types.js | 99 + .../generated/v2/dlp_service.redact_image.js | 85 + .../v2/dlp_service.reidentify_content.js | 107 + .../dlp_service.update_deidentify_template.js | 68 + .../v2/dlp_service.update_inspect_template.js | 68 + .../v2/dlp_service.update_job_trigger.js | 67 + .../v2/dlp_service.update_stored_info_type.js | 70 + ...nippet_metadata.google.privacy.dlp.v2.json | 1671 ++++++ owl-bot-staging/v2/src/index.ts | 25 + .../v2/src/v2/dlp_service_client.ts | 5238 +++++++++++++++++ .../v2/src/v2/dlp_service_client_config.json | 196 + .../v2/src/v2/dlp_service_proto_list.json | 4 + owl-bot-staging/v2/src/v2/gapic_metadata.json | 383 ++ owl-bot-staging/v2/src/v2/index.ts | 19 + .../system-test/fixtures/sample/src/index.js | 27 + .../system-test/fixtures/sample/src/index.ts | 32 + owl-bot-staging/v2/system-test/install.ts | 49 + .../v2/test/gapic_dlp_service_v2.ts | 4921 ++++++++++++++++ owl-bot-staging/v2/tsconfig.json | 19 + owl-bot-staging/v2/webpack.config.js | 64 + 58 files changed, 20620 insertions(+) create mode 100644 owl-bot-staging/v2/.eslintignore create mode 100644 owl-bot-staging/v2/.eslintrc.json create mode 100644 owl-bot-staging/v2/.gitignore create mode 100644 owl-bot-staging/v2/.jsdoc.js create mode 100644 owl-bot-staging/v2/.mocharc.js create mode 100644 owl-bot-staging/v2/.prettierrc.js create mode 100644 owl-bot-staging/v2/README.md create mode 100644 owl-bot-staging/v2/linkinator.config.json create mode 100644 owl-bot-staging/v2/package.json create mode 100644 owl-bot-staging/v2/protos/google/privacy/dlp/v2/dlp.proto create mode 100644 owl-bot-staging/v2/protos/google/privacy/dlp/v2/storage.proto create mode 100644 owl-bot-staging/v2/samples/generated/v2/dlp_service.activate_job_trigger.js create mode 100644 owl-bot-staging/v2/samples/generated/v2/dlp_service.cancel_dlp_job.js create mode 100644 owl-bot-staging/v2/samples/generated/v2/dlp_service.create_deidentify_template.js create mode 100644 owl-bot-staging/v2/samples/generated/v2/dlp_service.create_dlp_job.js create mode 100644 owl-bot-staging/v2/samples/generated/v2/dlp_service.create_inspect_template.js create mode 100644 owl-bot-staging/v2/samples/generated/v2/dlp_service.create_job_trigger.js create mode 100644 owl-bot-staging/v2/samples/generated/v2/dlp_service.create_stored_info_type.js create mode 100644 owl-bot-staging/v2/samples/generated/v2/dlp_service.deidentify_content.js create mode 100644 owl-bot-staging/v2/samples/generated/v2/dlp_service.delete_deidentify_template.js create mode 100644 owl-bot-staging/v2/samples/generated/v2/dlp_service.delete_dlp_job.js create mode 100644 owl-bot-staging/v2/samples/generated/v2/dlp_service.delete_inspect_template.js create mode 100644 owl-bot-staging/v2/samples/generated/v2/dlp_service.delete_job_trigger.js create mode 100644 owl-bot-staging/v2/samples/generated/v2/dlp_service.delete_stored_info_type.js create mode 100644 owl-bot-staging/v2/samples/generated/v2/dlp_service.finish_dlp_job.js create mode 100644 owl-bot-staging/v2/samples/generated/v2/dlp_service.get_deidentify_template.js create mode 100644 owl-bot-staging/v2/samples/generated/v2/dlp_service.get_dlp_job.js create mode 100644 owl-bot-staging/v2/samples/generated/v2/dlp_service.get_inspect_template.js create mode 100644 owl-bot-staging/v2/samples/generated/v2/dlp_service.get_job_trigger.js create mode 100644 owl-bot-staging/v2/samples/generated/v2/dlp_service.get_stored_info_type.js create mode 100644 owl-bot-staging/v2/samples/generated/v2/dlp_service.hybrid_inspect_dlp_job.js create mode 100644 owl-bot-staging/v2/samples/generated/v2/dlp_service.hybrid_inspect_job_trigger.js create mode 100644 owl-bot-staging/v2/samples/generated/v2/dlp_service.inspect_content.js create mode 100644 owl-bot-staging/v2/samples/generated/v2/dlp_service.list_deidentify_templates.js create mode 100644 owl-bot-staging/v2/samples/generated/v2/dlp_service.list_dlp_jobs.js create mode 100644 owl-bot-staging/v2/samples/generated/v2/dlp_service.list_info_types.js create mode 100644 owl-bot-staging/v2/samples/generated/v2/dlp_service.list_inspect_templates.js create mode 100644 owl-bot-staging/v2/samples/generated/v2/dlp_service.list_job_triggers.js create mode 100644 owl-bot-staging/v2/samples/generated/v2/dlp_service.list_stored_info_types.js create mode 100644 owl-bot-staging/v2/samples/generated/v2/dlp_service.redact_image.js create mode 100644 owl-bot-staging/v2/samples/generated/v2/dlp_service.reidentify_content.js create mode 100644 owl-bot-staging/v2/samples/generated/v2/dlp_service.update_deidentify_template.js create mode 100644 owl-bot-staging/v2/samples/generated/v2/dlp_service.update_inspect_template.js create mode 100644 owl-bot-staging/v2/samples/generated/v2/dlp_service.update_job_trigger.js create mode 100644 owl-bot-staging/v2/samples/generated/v2/dlp_service.update_stored_info_type.js create mode 100644 owl-bot-staging/v2/samples/generated/v2/snippet_metadata.google.privacy.dlp.v2.json create mode 100644 owl-bot-staging/v2/src/index.ts create mode 100644 owl-bot-staging/v2/src/v2/dlp_service_client.ts create mode 100644 owl-bot-staging/v2/src/v2/dlp_service_client_config.json create mode 100644 owl-bot-staging/v2/src/v2/dlp_service_proto_list.json create mode 100644 owl-bot-staging/v2/src/v2/gapic_metadata.json create mode 100644 owl-bot-staging/v2/src/v2/index.ts create mode 100644 owl-bot-staging/v2/system-test/fixtures/sample/src/index.js create mode 100644 owl-bot-staging/v2/system-test/fixtures/sample/src/index.ts create mode 100644 owl-bot-staging/v2/system-test/install.ts create mode 100644 owl-bot-staging/v2/test/gapic_dlp_service_v2.ts create mode 100644 owl-bot-staging/v2/tsconfig.json create mode 100644 owl-bot-staging/v2/webpack.config.js diff --git a/owl-bot-staging/v2/.eslintignore b/owl-bot-staging/v2/.eslintignore new file mode 100644 index 00000000..cfc348ec --- /dev/null +++ b/owl-bot-staging/v2/.eslintignore @@ -0,0 +1,7 @@ +**/node_modules +**/.coverage +build/ +docs/ +protos/ +system-test/ +samples/generated/ diff --git a/owl-bot-staging/v2/.eslintrc.json b/owl-bot-staging/v2/.eslintrc.json new file mode 100644 index 00000000..78215349 --- /dev/null +++ b/owl-bot-staging/v2/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/gts" +} diff --git a/owl-bot-staging/v2/.gitignore b/owl-bot-staging/v2/.gitignore new file mode 100644 index 00000000..5d32b237 --- /dev/null +++ b/owl-bot-staging/v2/.gitignore @@ -0,0 +1,14 @@ +**/*.log +**/node_modules +.coverage +coverage +.nyc_output +docs/ +out/ +build/ +system-test/secrets.js +system-test/*key.json +*.lock +.DS_Store +package-lock.json +__pycache__ diff --git a/owl-bot-staging/v2/.jsdoc.js b/owl-bot-staging/v2/.jsdoc.js new file mode 100644 index 00000000..ebb722fc --- /dev/null +++ b/owl-bot-staging/v2/.jsdoc.js @@ -0,0 +1,55 @@ +// Copyright 2022 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. ** + +'use strict'; + +module.exports = { + opts: { + readme: './README.md', + package: './package.json', + template: './node_modules/jsdoc-fresh', + recurse: true, + verbose: true, + destination: './docs/' + }, + plugins: [ + 'plugins/markdown', + 'jsdoc-region-tag' + ], + source: { + excludePattern: '(^|\\/|\\\\)[._]', + include: [ + 'build/src', + 'protos' + ], + includePattern: '\\.js$' + }, + templates: { + copyright: 'Copyright 2022 Google LLC', + includeDate: false, + sourceFiles: false, + systemName: '@google-cloud/dlp', + theme: 'lumen', + default: { + outputSourceFiles: false + } + }, + markdown: { + idInHeadings: true + } +}; diff --git a/owl-bot-staging/v2/.mocharc.js b/owl-bot-staging/v2/.mocharc.js new file mode 100644 index 00000000..481c522b --- /dev/null +++ b/owl-bot-staging/v2/.mocharc.js @@ -0,0 +1,33 @@ +// Copyright 2022 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. ** + +const config = { + "enable-source-maps": true, + "throw-deprecation": true, + "timeout": 10000 +} +if (process.env.MOCHA_THROW_DEPRECATION === 'false') { + delete config['throw-deprecation']; +} +if (process.env.MOCHA_REPORTER) { + config.reporter = process.env.MOCHA_REPORTER; +} +if (process.env.MOCHA_REPORTER_OUTPUT) { + config['reporter-option'] = `output=${process.env.MOCHA_REPORTER_OUTPUT}`; +} +module.exports = config diff --git a/owl-bot-staging/v2/.prettierrc.js b/owl-bot-staging/v2/.prettierrc.js new file mode 100644 index 00000000..494e1478 --- /dev/null +++ b/owl-bot-staging/v2/.prettierrc.js @@ -0,0 +1,22 @@ +// Copyright 2022 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. ** + + +module.exports = { + ...require('gts/.prettierrc.json') +} diff --git a/owl-bot-staging/v2/README.md b/owl-bot-staging/v2/README.md new file mode 100644 index 00000000..cb63619c --- /dev/null +++ b/owl-bot-staging/v2/README.md @@ -0,0 +1 @@ +Dlp: Nodejs Client diff --git a/owl-bot-staging/v2/linkinator.config.json b/owl-bot-staging/v2/linkinator.config.json new file mode 100644 index 00000000..befd23c8 --- /dev/null +++ b/owl-bot-staging/v2/linkinator.config.json @@ -0,0 +1,16 @@ +{ + "recurse": true, + "skip": [ + "https://codecov.io/gh/googleapis/", + "www.googleapis.com", + "img.shields.io", + "https://console.cloud.google.com/cloudshell", + "https://support.google.com" + ], + "silent": true, + "concurrency": 5, + "retry": true, + "retryErrors": true, + "retryErrorsCount": 5, + "retryErrorsJitter": 3000 +} diff --git a/owl-bot-staging/v2/package.json b/owl-bot-staging/v2/package.json new file mode 100644 index 00000000..c6cc3851 --- /dev/null +++ b/owl-bot-staging/v2/package.json @@ -0,0 +1,64 @@ +{ + "name": "@google-cloud/dlp", + "version": "0.1.0", + "description": "Dlp client for Node.js", + "repository": "googleapis/nodejs-dlp", + "license": "Apache-2.0", + "author": "Google LLC", + "main": "build/src/index.js", + "files": [ + "build/src", + "build/protos" + ], + "keywords": [ + "google apis client", + "google api client", + "google apis", + "google api", + "google", + "google cloud platform", + "google cloud", + "cloud", + "google dlp", + "dlp", + "dlp service" + ], + "scripts": { + "clean": "gts clean", + "compile": "tsc -p . && cp -r protos build/", + "compile-protos": "compileProtos src", + "docs": "jsdoc -c .jsdoc.js", + "predocs-test": "npm run docs", + "docs-test": "linkinator docs", + "fix": "gts fix", + "lint": "gts check", + "prepare": "npm run compile-protos && npm run compile", + "system-test": "c8 mocha build/system-test", + "test": "c8 mocha build/test" + }, + "dependencies": { + "google-gax": "^2.29.4" + }, + "devDependencies": { + "@types/mocha": "^9.1.0", + "@types/node": "^16.0.0", + "@types/sinon": "^10.0.8", + "c8": "^7.11.0", + "gts": "^3.1.0", + "jsdoc": "^3.6.7", + "jsdoc-fresh": "^1.1.1", + "jsdoc-region-tag": "^1.3.1", + "linkinator": "^3.0.0", + "mocha": "^9.1.4", + "null-loader": "^4.0.1", + "pack-n-play": "^1.0.0-2", + "sinon": "^13.0.0", + "ts-loader": "^9.2.6", + "typescript": "^4.5.5", + "webpack": "^5.67.0", + "webpack-cli": "^4.9.1" + }, + "engines": { + "node": ">=v10.24.0" + } +} diff --git a/owl-bot-staging/v2/protos/google/privacy/dlp/v2/dlp.proto b/owl-bot-staging/v2/protos/google/privacy/dlp/v2/dlp.proto new file mode 100644 index 00000000..03776b0b --- /dev/null +++ b/owl-bot-staging/v2/protos/google/privacy/dlp/v2/dlp.proto @@ -0,0 +1,4427 @@ +// Copyright 2022 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. + +syntax = "proto3"; + +package google.privacy.dlp.v2; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/privacy/dlp/v2/storage.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; +import "google/rpc/status.proto"; +import "google/type/date.proto"; +import "google/type/dayofweek.proto"; +import "google/type/timeofday.proto"; + +option csharp_namespace = "Google.Cloud.Dlp.V2"; +option go_package = "google.golang.org/genproto/googleapis/privacy/dlp/v2;dlp"; +option java_multiple_files = true; +option java_outer_classname = "DlpProto"; +option java_package = "com.google.privacy.dlp.v2"; +option php_namespace = "Google\\Cloud\\Dlp\\V2"; +option ruby_package = "Google::Cloud::Dlp::V2"; +option (google.api.resource_definition) = { + type: "dlp.googleapis.com/DlpContent" + pattern: "projects/{project}/dlpContent" + pattern: "projects/{project}/locations/{location}/dlpContent" +}; +option (google.api.resource_definition) = { + type: "dlp.googleapis.com/OrganizationLocation" + pattern: "organizations/{organization}/locations/{location}" +}; + +// 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/. +service DlpService { + option (google.api.default_host) = "dlp.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // 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, + rpc InspectContent(InspectContentRequest) returns (InspectContentResponse) { + option (google.api.http) = { + post: "/v2/{parent=projects/*}/content:inspect" + body: "*" + additional_bindings { + post: "/v2/{parent=projects/*/locations/*}/content:inspect" + body: "*" + } + }; + } + + // 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. + rpc RedactImage(RedactImageRequest) returns (RedactImageResponse) { + option (google.api.http) = { + post: "/v2/{parent=projects/*}/image:redact" + body: "*" + additional_bindings { + post: "/v2/{parent=projects/*/locations/*}/image:redact" + body: "*" + } + }; + } + + // 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. + rpc DeidentifyContent(DeidentifyContentRequest) returns (DeidentifyContentResponse) { + option (google.api.http) = { + post: "/v2/{parent=projects/*}/content:deidentify" + body: "*" + additional_bindings { + post: "/v2/{parent=projects/*/locations/*}/content:deidentify" + body: "*" + } + }; + } + + // 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. + rpc ReidentifyContent(ReidentifyContentRequest) returns (ReidentifyContentResponse) { + option (google.api.http) = { + post: "/v2/{parent=projects/*}/content:reidentify" + body: "*" + additional_bindings { + post: "/v2/{parent=projects/*/locations/*}/content:reidentify" + body: "*" + } + }; + } + + // 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. + rpc ListInfoTypes(ListInfoTypesRequest) returns (ListInfoTypesResponse) { + option (google.api.http) = { + get: "/v2/infoTypes" + additional_bindings { + get: "/v2/{parent=locations/*}/infoTypes" + } + }; + option (google.api.method_signature) = "parent"; + } + + // 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. + rpc CreateInspectTemplate(CreateInspectTemplateRequest) returns (InspectTemplate) { + option (google.api.http) = { + post: "/v2/{parent=organizations/*}/inspectTemplates" + body: "*" + additional_bindings { + post: "/v2/{parent=organizations/*/locations/*}/inspectTemplates" + body: "*" + } + additional_bindings { + post: "/v2/{parent=projects/*}/inspectTemplates" + body: "*" + } + additional_bindings { + post: "/v2/{parent=projects/*/locations/*}/inspectTemplates" + body: "*" + } + }; + option (google.api.method_signature) = "parent,inspect_template"; + } + + // Updates the InspectTemplate. + // See https://cloud.google.com/dlp/docs/creating-templates to learn more. + rpc UpdateInspectTemplate(UpdateInspectTemplateRequest) returns (InspectTemplate) { + option (google.api.http) = { + patch: "/v2/{name=organizations/*/inspectTemplates/*}" + body: "*" + additional_bindings { + patch: "/v2/{name=organizations/*/locations/*/inspectTemplates/*}" + body: "*" + } + additional_bindings { + patch: "/v2/{name=projects/*/inspectTemplates/*}" + body: "*" + } + additional_bindings { + patch: "/v2/{name=projects/*/locations/*/inspectTemplates/*}" + body: "*" + } + }; + option (google.api.method_signature) = "name,inspect_template,update_mask"; + } + + // Gets an InspectTemplate. + // See https://cloud.google.com/dlp/docs/creating-templates to learn more. + rpc GetInspectTemplate(GetInspectTemplateRequest) returns (InspectTemplate) { + option (google.api.http) = { + get: "/v2/{name=organizations/*/inspectTemplates/*}" + additional_bindings { + get: "/v2/{name=organizations/*/locations/*/inspectTemplates/*}" + } + additional_bindings { + get: "/v2/{name=projects/*/inspectTemplates/*}" + } + additional_bindings { + get: "/v2/{name=projects/*/locations/*/inspectTemplates/*}" + } + }; + option (google.api.method_signature) = "name"; + } + + // Lists InspectTemplates. + // See https://cloud.google.com/dlp/docs/creating-templates to learn more. + rpc ListInspectTemplates(ListInspectTemplatesRequest) returns (ListInspectTemplatesResponse) { + option (google.api.http) = { + get: "/v2/{parent=organizations/*}/inspectTemplates" + additional_bindings { + get: "/v2/{parent=organizations/*/locations/*}/inspectTemplates" + } + additional_bindings { + get: "/v2/{parent=projects/*}/inspectTemplates" + } + additional_bindings { + get: "/v2/{parent=projects/*/locations/*}/inspectTemplates" + } + }; + option (google.api.method_signature) = "parent"; + } + + // Deletes an InspectTemplate. + // See https://cloud.google.com/dlp/docs/creating-templates to learn more. + rpc DeleteInspectTemplate(DeleteInspectTemplateRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v2/{name=organizations/*/inspectTemplates/*}" + additional_bindings { + delete: "/v2/{name=organizations/*/locations/*/inspectTemplates/*}" + } + additional_bindings { + delete: "/v2/{name=projects/*/inspectTemplates/*}" + } + additional_bindings { + delete: "/v2/{name=projects/*/locations/*/inspectTemplates/*}" + } + }; + option (google.api.method_signature) = "name"; + } + + // 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. + rpc CreateDeidentifyTemplate(CreateDeidentifyTemplateRequest) returns (DeidentifyTemplate) { + option (google.api.http) = { + post: "/v2/{parent=organizations/*}/deidentifyTemplates" + body: "*" + additional_bindings { + post: "/v2/{parent=organizations/*/locations/*}/deidentifyTemplates" + body: "*" + } + additional_bindings { + post: "/v2/{parent=projects/*}/deidentifyTemplates" + body: "*" + } + additional_bindings { + post: "/v2/{parent=projects/*/locations/*}/deidentifyTemplates" + body: "*" + } + }; + option (google.api.method_signature) = "parent,deidentify_template"; + } + + // Updates the DeidentifyTemplate. + // See https://cloud.google.com/dlp/docs/creating-templates-deid to learn + // more. + rpc UpdateDeidentifyTemplate(UpdateDeidentifyTemplateRequest) returns (DeidentifyTemplate) { + option (google.api.http) = { + patch: "/v2/{name=organizations/*/deidentifyTemplates/*}" + body: "*" + additional_bindings { + patch: "/v2/{name=organizations/*/locations/*/deidentifyTemplates/*}" + body: "*" + } + additional_bindings { + patch: "/v2/{name=projects/*/deidentifyTemplates/*}" + body: "*" + } + additional_bindings { + patch: "/v2/{name=projects/*/locations/*/deidentifyTemplates/*}" + body: "*" + } + }; + option (google.api.method_signature) = "name,deidentify_template,update_mask"; + } + + // Gets a DeidentifyTemplate. + // See https://cloud.google.com/dlp/docs/creating-templates-deid to learn + // more. + rpc GetDeidentifyTemplate(GetDeidentifyTemplateRequest) returns (DeidentifyTemplate) { + option (google.api.http) = { + get: "/v2/{name=organizations/*/deidentifyTemplates/*}" + additional_bindings { + get: "/v2/{name=organizations/*/locations/*/deidentifyTemplates/*}" + } + additional_bindings { + get: "/v2/{name=projects/*/deidentifyTemplates/*}" + } + additional_bindings { + get: "/v2/{name=projects/*/locations/*/deidentifyTemplates/*}" + } + }; + option (google.api.method_signature) = "name"; + } + + // Lists DeidentifyTemplates. + // See https://cloud.google.com/dlp/docs/creating-templates-deid to learn + // more. + rpc ListDeidentifyTemplates(ListDeidentifyTemplatesRequest) returns (ListDeidentifyTemplatesResponse) { + option (google.api.http) = { + get: "/v2/{parent=organizations/*}/deidentifyTemplates" + additional_bindings { + get: "/v2/{parent=organizations/*/locations/*}/deidentifyTemplates" + } + additional_bindings { + get: "/v2/{parent=projects/*}/deidentifyTemplates" + } + additional_bindings { + get: "/v2/{parent=projects/*/locations/*}/deidentifyTemplates" + } + }; + option (google.api.method_signature) = "parent"; + } + + // Deletes a DeidentifyTemplate. + // See https://cloud.google.com/dlp/docs/creating-templates-deid to learn + // more. + rpc DeleteDeidentifyTemplate(DeleteDeidentifyTemplateRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v2/{name=organizations/*/deidentifyTemplates/*}" + additional_bindings { + delete: "/v2/{name=organizations/*/locations/*/deidentifyTemplates/*}" + } + additional_bindings { + delete: "/v2/{name=projects/*/deidentifyTemplates/*}" + } + additional_bindings { + delete: "/v2/{name=projects/*/locations/*/deidentifyTemplates/*}" + } + }; + option (google.api.method_signature) = "name"; + } + + // 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. + rpc CreateJobTrigger(CreateJobTriggerRequest) returns (JobTrigger) { + option (google.api.http) = { + post: "/v2/{parent=projects/*}/jobTriggers" + body: "*" + additional_bindings { + post: "/v2/{parent=projects/*/locations/*}/jobTriggers" + body: "*" + } + additional_bindings { + post: "/v2/{parent=organizations/*/locations/*}/jobTriggers" + body: "*" + } + }; + option (google.api.method_signature) = "parent,job_trigger"; + } + + // Updates a job trigger. + // See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more. + rpc UpdateJobTrigger(UpdateJobTriggerRequest) returns (JobTrigger) { + option (google.api.http) = { + patch: "/v2/{name=projects/*/jobTriggers/*}" + body: "*" + additional_bindings { + patch: "/v2/{name=projects/*/locations/*/jobTriggers/*}" + body: "*" + } + additional_bindings { + patch: "/v2/{name=organizations/*/locations/*/jobTriggers/*}" + body: "*" + } + }; + option (google.api.method_signature) = "name,job_trigger,update_mask"; + } + + // Inspect hybrid content and store findings to a trigger. The inspection + // will be processed asynchronously. To review the findings monitor the + // jobs within the trigger. + rpc HybridInspectJobTrigger(HybridInspectJobTriggerRequest) returns (HybridInspectResponse) { + option (google.api.http) = { + post: "/v2/{name=projects/*/locations/*/jobTriggers/*}:hybridInspect" + body: "*" + }; + option (google.api.method_signature) = "name"; + } + + // Gets a job trigger. + // See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more. + rpc GetJobTrigger(GetJobTriggerRequest) returns (JobTrigger) { + option (google.api.http) = { + get: "/v2/{name=projects/*/jobTriggers/*}" + additional_bindings { + get: "/v2/{name=projects/*/locations/*/jobTriggers/*}" + } + additional_bindings { + get: "/v2/{name=organizations/*/locations/*/jobTriggers/*}" + } + }; + option (google.api.method_signature) = "name"; + } + + // Lists job triggers. + // See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more. + rpc ListJobTriggers(ListJobTriggersRequest) returns (ListJobTriggersResponse) { + option (google.api.http) = { + get: "/v2/{parent=projects/*}/jobTriggers" + additional_bindings { + get: "/v2/{parent=projects/*/locations/*}/jobTriggers" + } + additional_bindings { + get: "/v2/{parent=organizations/*/locations/*}/jobTriggers" + } + }; + option (google.api.method_signature) = "parent"; + } + + // Deletes a job trigger. + // See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more. + rpc DeleteJobTrigger(DeleteJobTriggerRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v2/{name=projects/*/jobTriggers/*}" + additional_bindings { + delete: "/v2/{name=projects/*/locations/*/jobTriggers/*}" + } + additional_bindings { + delete: "/v2/{name=organizations/*/locations/*/jobTriggers/*}" + } + }; + option (google.api.method_signature) = "name"; + } + + // Activate a job trigger. Causes the immediate execute of a trigger + // instead of waiting on the trigger event to occur. + rpc ActivateJobTrigger(ActivateJobTriggerRequest) returns (DlpJob) { + option (google.api.http) = { + post: "/v2/{name=projects/*/jobTriggers/*}:activate" + body: "*" + additional_bindings { + post: "/v2/{name=projects/*/locations/*/jobTriggers/*}:activate" + body: "*" + } + }; + } + + // 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. + rpc CreateDlpJob(CreateDlpJobRequest) returns (DlpJob) { + option (google.api.http) = { + post: "/v2/{parent=projects/*}/dlpJobs" + body: "*" + additional_bindings { + post: "/v2/{parent=projects/*/locations/*}/dlpJobs" + body: "*" + } + }; + option (google.api.method_signature) = "parent,inspect_job"; + option (google.api.method_signature) = "parent,risk_job"; + } + + // 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. + rpc ListDlpJobs(ListDlpJobsRequest) returns (ListDlpJobsResponse) { + option (google.api.http) = { + get: "/v2/{parent=projects/*}/dlpJobs" + additional_bindings { + get: "/v2/{parent=projects/*/locations/*}/dlpJobs" + } + additional_bindings { + get: "/v2/{parent=organizations/*/locations/*}/dlpJobs" + } + }; + option (google.api.method_signature) = "parent"; + } + + // 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. + rpc GetDlpJob(GetDlpJobRequest) returns (DlpJob) { + option (google.api.http) = { + get: "/v2/{name=projects/*/dlpJobs/*}" + additional_bindings { + get: "/v2/{name=projects/*/locations/*/dlpJobs/*}" + } + }; + option (google.api.method_signature) = "name"; + } + + // 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. + rpc DeleteDlpJob(DeleteDlpJobRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v2/{name=projects/*/dlpJobs/*}" + additional_bindings { + delete: "/v2/{name=projects/*/locations/*/dlpJobs/*}" + } + }; + option (google.api.method_signature) = "name"; + } + + // 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. + rpc CancelDlpJob(CancelDlpJobRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + post: "/v2/{name=projects/*/dlpJobs/*}:cancel" + body: "*" + additional_bindings { + post: "/v2/{name=projects/*/locations/*/dlpJobs/*}:cancel" + body: "*" + } + }; + } + + // Creates a pre-built stored infoType to be used for inspection. + // See https://cloud.google.com/dlp/docs/creating-stored-infotypes to + // learn more. + rpc CreateStoredInfoType(CreateStoredInfoTypeRequest) returns (StoredInfoType) { + option (google.api.http) = { + post: "/v2/{parent=organizations/*}/storedInfoTypes" + body: "*" + additional_bindings { + post: "/v2/{parent=organizations/*/locations/*}/storedInfoTypes" + body: "*" + } + additional_bindings { + post: "/v2/{parent=projects/*}/storedInfoTypes" + body: "*" + } + additional_bindings { + post: "/v2/{parent=projects/*/locations/*}/storedInfoTypes" + body: "*" + } + }; + option (google.api.method_signature) = "parent,config"; + } + + // 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. + rpc UpdateStoredInfoType(UpdateStoredInfoTypeRequest) returns (StoredInfoType) { + option (google.api.http) = { + patch: "/v2/{name=organizations/*/storedInfoTypes/*}" + body: "*" + additional_bindings { + patch: "/v2/{name=organizations/*/locations/*/storedInfoTypes/*}" + body: "*" + } + additional_bindings { + patch: "/v2/{name=projects/*/storedInfoTypes/*}" + body: "*" + } + additional_bindings { + patch: "/v2/{name=projects/*/locations/*/storedInfoTypes/*}" + body: "*" + } + }; + option (google.api.method_signature) = "name,config,update_mask"; + } + + // Gets a stored infoType. + // See https://cloud.google.com/dlp/docs/creating-stored-infotypes to + // learn more. + rpc GetStoredInfoType(GetStoredInfoTypeRequest) returns (StoredInfoType) { + option (google.api.http) = { + get: "/v2/{name=organizations/*/storedInfoTypes/*}" + additional_bindings { + get: "/v2/{name=organizations/*/locations/*/storedInfoTypes/*}" + } + additional_bindings { + get: "/v2/{name=projects/*/storedInfoTypes/*}" + } + additional_bindings { + get: "/v2/{name=projects/*/locations/*/storedInfoTypes/*}" + } + }; + option (google.api.method_signature) = "name"; + } + + // Lists stored infoTypes. + // See https://cloud.google.com/dlp/docs/creating-stored-infotypes to + // learn more. + rpc ListStoredInfoTypes(ListStoredInfoTypesRequest) returns (ListStoredInfoTypesResponse) { + option (google.api.http) = { + get: "/v2/{parent=organizations/*}/storedInfoTypes" + additional_bindings { + get: "/v2/{parent=organizations/*/locations/*}/storedInfoTypes" + } + additional_bindings { + get: "/v2/{parent=projects/*}/storedInfoTypes" + } + additional_bindings { + get: "/v2/{parent=projects/*/locations/*}/storedInfoTypes" + } + }; + option (google.api.method_signature) = "parent"; + } + + // Deletes a stored infoType. + // See https://cloud.google.com/dlp/docs/creating-stored-infotypes to + // learn more. + rpc DeleteStoredInfoType(DeleteStoredInfoTypeRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v2/{name=organizations/*/storedInfoTypes/*}" + additional_bindings { + delete: "/v2/{name=organizations/*/locations/*/storedInfoTypes/*}" + } + additional_bindings { + delete: "/v2/{name=projects/*/storedInfoTypes/*}" + } + additional_bindings { + delete: "/v2/{name=projects/*/locations/*/storedInfoTypes/*}" + } + }; + option (google.api.method_signature) = "name"; + } + + // Inspect hybrid content and store findings to a job. + // To review the findings, inspect the job. Inspection will occur + // asynchronously. + rpc HybridInspectDlpJob(HybridInspectDlpJobRequest) returns (HybridInspectResponse) { + option (google.api.http) = { + post: "/v2/{name=projects/*/locations/*/dlpJobs/*}:hybridInspect" + body: "*" + }; + option (google.api.method_signature) = "name"; + } + + // Finish a running hybrid DlpJob. Triggers the finalization steps and running + // of any enabled actions that have not yet run. + rpc FinishDlpJob(FinishDlpJobRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + post: "/v2/{name=projects/*/locations/*/dlpJobs/*}:finish" + body: "*" + }; + } +} + +// List of exclude infoTypes. +message ExcludeInfoTypes { + // 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. + repeated InfoType info_types = 1; +} + +// The rule that specifies conditions when findings of infoTypes specified in +// `InspectionRuleSet` are removed from results. +message ExclusionRule { + // Exclusion rule types. + oneof type { + // Dictionary which defines the rule. + CustomInfoType.Dictionary dictionary = 1; + + // Regular expression which defines the rule. + CustomInfoType.Regex regex = 2; + + // Set of infoTypes for which findings would affect this rule. + ExcludeInfoTypes exclude_info_types = 3; + } + + // How the rule is applied, see MatchingType documentation for details. + MatchingType matching_type = 4; +} + +// A single inspection rule to be applied to infoTypes, specified in +// `InspectionRuleSet`. +message InspectionRule { + // Inspection rule types. + oneof type { + // Hotword-based detection rule. + CustomInfoType.DetectionRule.HotwordRule hotword_rule = 1; + + // Exclusion rule. + ExclusionRule exclusion_rule = 2; + } +} + +// 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. +message InspectionRuleSet { + // List of infoTypes this rule set is applied to. + repeated InfoType info_types = 1; + + // Set of rules to be applied to infoTypes. The rules are applied in order. + repeated InspectionRule rules = 2; +} + +// Configuration description of the scanning process. +// When used with redactContent only info_types and min_likelihood are currently +// used. +message InspectConfig { + // Configuration to control the number of findings returned for inspection. + // This is not used for de-identification or data profiling. + message FindingLimits { + // Max findings configuration per infoType, per content item or long + // running DlpJob. + message InfoTypeLimit { + // 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. + InfoType info_type = 1; + + // Max findings limit for the given infoType. + int32 max_findings = 2; + } + + // Max number of findings that will be returned for each item scanned. + // When set within `InspectJobConfig`, + // the maximum returned is 2000 regardless if this is set higher. + // When set within `InspectContentRequest`, this field is ignored. + int32 max_findings_per_item = 1; + + // 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. + int32 max_findings_per_request = 2; + + // Configuration of findings limit given for specified infoTypes. + repeated InfoTypeLimit max_findings_per_info_type = 3; + } + + // 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. + repeated InfoType info_types = 1; + + // Only returns findings equal or above this threshold. The default is + // POSSIBLE. + // See https://cloud.google.com/dlp/docs/likelihood to learn more. + Likelihood min_likelihood = 2; + + // Configuration to control the number of findings returned. + // This is not used for data profiling. + FindingLimits limits = 3; + + // When true, a contextual quote from the data that triggered a finding is + // included in the response; see Finding.quote. + // This is not used for data profiling. + bool include_quote = 4; + + // When true, excludes type information of the findings. + // This is not used for data profiling. + bool exclude_info_types = 5; + + // CustomInfoTypes provided by the user. See + // https://cloud.google.com/dlp/docs/creating-custom-infotypes to learn more. + repeated CustomInfoType custom_info_types = 6; + + // Deprecated and unused. + repeated ContentOption content_options = 8; + + // 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. + repeated InspectionRuleSet rule_set = 10; +} + +// Container for bytes to inspect or redact. +message ByteContentItem { + // The type of data being sent for inspection. To learn more, see + // [Supported file + // types](https://cloud.google.com/dlp/docs/supported-file-types). + enum 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; + + // docx, docm, dotx, dotm + WORD_DOCUMENT = 7; + + // pdf + PDF = 8; + + // pptx, pptm, potx, potm, pot + POWERPOINT_DOCUMENT = 9; + + // xlsx, xlsm, xltx, xltm + EXCEL_DOCUMENT = 10; + + // avro + AVRO = 11; + + // csv + CSV = 12; + + // tsv + TSV = 13; + } + + // The type of data stored in the bytes string. Default will be TEXT_UTF8. + BytesType type = 1; + + // Content data to inspect or redact. + bytes data = 2; +} + +// Container structure for the content to inspect. +message ContentItem { + // Data of the item either in the byte array or UTF-8 string form, or table. + oneof data_item { + // String data to inspect or redact. + string value = 3; + + // Structured content for inspection. See + // https://cloud.google.com/dlp/docs/inspecting-text#inspecting_a_table to + // learn more. + Table table = 4; + + // Content data to inspect or redact. Replaces `type` and `data`. + ByteContentItem byte_item = 5; + } +} + +// Structured content to inspect. Up to 50,000 `Value`s per request allowed. See +// https://cloud.google.com/dlp/docs/inspecting-structured-text#inspecting_a_table +// to learn more. +message Table { + // Values of the row. + message Row { + // Individual cells. + repeated Value values = 1; + } + + // Headers of the table. + repeated FieldId headers = 1; + + // Rows of the table. + repeated Row rows = 2; +} + +// All the findings for a single scanned item. +message InspectResult { + // List of findings for an item. + repeated Finding findings = 1; + + // 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. + bool findings_truncated = 2; +} + +// Represents a piece of potentially sensitive content. +message Finding { + option (google.api.resource) = { + type: "dlp.googleapis.com/Finding" + pattern: "projects/{project}/locations/{location}/findings/{finding}" + }; + + // Resource name in format + // projects/{project}/locations/{location}/findings/{finding} Populated only + // when viewing persisted findings. + string name = 14; + + // 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. + string quote = 1; + + // The type of content that might have been found. + // Provided if `excluded_types` is false. + InfoType info_type = 2; + + // Confidence of how likely it is that the `info_type` is correct. + Likelihood likelihood = 3; + + // Where the content was found. + Location location = 4; + + // Timestamp when finding was detected. + google.protobuf.Timestamp create_time = 6; + + // 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. + QuoteInfo quote_info = 7; + + // The job that stored the finding. + string resource_name = 8 [(google.api.resource_reference) = { + type: "dlp.googleapis.com/DlpJob" + }]; + + // Job trigger name, if applicable, for this finding. + string trigger_name = 9 [(google.api.resource_reference) = { + type: "dlp.googleapis.com/JobTrigger" + }]; + + // The labels associated with this `Finding`. + // + // Label keys must be between 1 and 63 characters long and must conform + // to the following regular expression: `[a-z]([-a-z0-9]*[a-z0-9])?`. + // + // Label values must be between 0 and 63 characters long and must conform + // to the regular expression `([a-z]([-a-z0-9]*[a-z0-9])?)?`. + // + // No more than 10 labels can be associated with a given finding. + // + // Examples: + // * `"environment" : "production"` + // * `"pipeline" : "etl"` + map labels = 10; + + // Time the job started that produced this finding. + google.protobuf.Timestamp job_create_time = 11; + + // The job that stored the finding. + string job_name = 13 [(google.api.resource_reference) = { + type: "dlp.googleapis.com/DlpJob" + }]; + + // The unique finding id. + string finding_id = 15; +} + +// Specifies the location of the finding. +message Location { + // 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. + Range byte_range = 1; + + // Unicode character offsets delimiting the finding. + // These are relative to the finding's containing element. + // Provided when the content is text. + Range codepoint_range = 2; + + // List of nested objects pointing to the precise location of the finding + // within the file or record. + repeated ContentLocation content_locations = 7; + + // Information about the container where this finding occurred, if available. + Container container = 8; +} + +// Precise location of the finding within a document, record, image, or metadata +// container. +message ContentLocation { + // 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). + string container_name = 1; + + // Type of the container within the file with location of the finding. + oneof location { + // Location within a row or record of a database table. + RecordLocation record_location = 2; + + // Location within an image's pixels. + ImageLocation image_location = 3; + + // Location data for document files. + DocumentLocation document_location = 5; + + // Location within the metadata for inspected content. + MetadataLocation metadata_location = 8; + } + + // 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. + google.protobuf.Timestamp container_timestamp = 6; + + // Findings container version, if available + // ("generation" for Google Cloud Storage). + string container_version = 7; +} + +// Metadata Location +message MetadataLocation { + // Type of metadata containing the finding. + MetadataType type = 1; + + // Label of the piece of metadata containing the finding, for example - + // latitude, author, caption. + oneof label { + // Storage metadata. + StorageMetadataLabel storage_label = 3; + } +} + +// Storage metadata label to indicate which metadata entry contains findings. +message StorageMetadataLabel { + string key = 1; +} + +// Location of a finding within a document. +message DocumentLocation { + // Offset of the line, from the beginning of the file, where the finding + // is located. + int64 file_offset = 1; +} + +// Location of a finding within a row or record. +message RecordLocation { + // Key of the finding. + RecordKey record_key = 1; + + // Field id of the field containing the finding. + FieldId field_id = 2; + + // Location within a `ContentItem.Table`. + TableLocation table_location = 3; +} + +// Location of a finding within a table. +message TableLocation { + // The zero-based index of the row where the finding is located. Only + // populated for resources that have a natural ordering, not BigQuery. In + // BigQuery, to identify the row a finding came from, populate + // BigQueryOptions.identifying_fields with your primary key column names and + // when you store the findings the value of those columns will be stored + // inside of Finding. + int64 row_index = 1; +} + +// Represents a container that may contain DLP findings. +// Examples of a container include a file, table, or database record. +message Container { + // Container type, for example BigQuery or Google Cloud Storage. + string type = 1; + + // Project where the finding was found. + // Can be different from the project that owns the finding. + string project_id = 2; + + // A string representation of the full container name. + // Examples: + // - BigQuery: 'Project:DataSetId.TableId' + // - Google Cloud Storage: 'gs://Bucket/folders/filename.txt' + string full_path = 3; + + // The root of the container. + // Examples: + // - For BigQuery table `project_id:dataset_id.table_id`, the root is + // `dataset_id` + // - For Google Cloud Storage file `gs://bucket/folder/filename.txt`, the root + // is `gs://bucket` + string root_path = 4; + + // The rest of the path after the root. + // Examples: + // - For BigQuery table `project_id:dataset_id.table_id`, the relative path is + // `table_id` + // - Google Cloud Storage file `gs://bucket/folder/filename.txt`, the relative + // path is `folder/filename.txt` + string relative_path = 5; + + // 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. + google.protobuf.Timestamp update_time = 6; + + // Findings container version, if available + // ("generation" for Google Cloud Storage). + string version = 7; +} + +// Generic half-open interval [start, end) +message Range { + // Index of the first character of the range (inclusive). + int64 start = 1; + + // Index of the last character of the range (exclusive). + int64 end = 2; +} + +// Location of the finding within an image. +message ImageLocation { + // Bounding boxes locating the pixels within the image containing the finding. + repeated BoundingBox bounding_boxes = 1; +} + +// Bounding box encompassing detected text within an image. +message BoundingBox { + // Top coordinate of the bounding box. (0,0) is upper left. + int32 top = 1; + + // Left coordinate of the bounding box. (0,0) is upper left. + int32 left = 2; + + // Width of the bounding box in pixels. + int32 width = 3; + + // Height of the bounding box in pixels. + int32 height = 4; +} + +// Request to search for potentially sensitive info in an image and redact it +// by covering it with a colored rectangle. +message RedactImageRequest { + // Configuration for determining how redaction of images should occur. + message ImageRedactionConfig { + // Type of information to redact from images. + oneof target { + // 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. + InfoType info_type = 1; + + // If true, all text found in the image, regardless whether it matches an + // info_type, is redacted. Only one should be provided. + bool redact_all_text = 2; + } + + // The color to use when redacting content from an image. If not specified, + // the default is black. + Color redaction_color = 3; + } + + // Parent resource name. + // + // The format of this value varies depending on whether you have [specified a + // processing + // location](https://cloud.google.com/dlp/docs/specifying-location): + // + // + Projects scope, location specified:
+ // `projects/`PROJECT_ID`/locations/`LOCATION_ID + // + Projects scope, no location specified (defaults to global):
+ // `projects/`PROJECT_ID + // + // The following example `parent` string specifies a parent project with the + // identifier `example-project`, and specifies the `europe-west3` location + // for processing data: + // + // parent=projects/example-project/locations/europe-west3 + string parent = 1 [(google.api.resource_reference) = { + child_type: "dlp.googleapis.com/DlpContent" + }]; + + // Deprecated. This field has no effect. + string location_id = 8; + + // Configuration for the inspector. + InspectConfig inspect_config = 2; + + // The configuration for specifying what content to redact from images. + repeated ImageRedactionConfig image_redaction_configs = 5; + + // Whether the response should include findings along with the redacted + // image. + bool include_findings = 6; + + // The content must be PNG, JPEG, SVG or BMP. + ByteContentItem byte_item = 7; +} + +// Represents a color in the RGB color space. +message Color { + // The amount of red in the color as a value in the interval [0, 1]. + float red = 1; + + // The amount of green in the color as a value in the interval [0, 1]. + float green = 2; + + // The amount of blue in the color as a value in the interval [0, 1]. + float blue = 3; +} + +// Results of redacting an image. +message RedactImageResponse { + // The redacted image. The type will be the same as the original image. + bytes redacted_image = 1; + + // 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. + string extracted_text = 2; + + // The findings. Populated when include_findings in the request is true. + InspectResult inspect_result = 3; +} + +// Request to de-identify a list of items. +message DeidentifyContentRequest { + // Parent resource name. + // + // The format of this value varies depending on whether you have [specified a + // processing + // location](https://cloud.google.com/dlp/docs/specifying-location): + // + // + Projects scope, location specified:
+ // `projects/`PROJECT_ID`/locations/`LOCATION_ID + // + Projects scope, no location specified (defaults to global):
+ // `projects/`PROJECT_ID + // + // The following example `parent` string specifies a parent project with the + // identifier `example-project`, and specifies the `europe-west3` location + // for processing data: + // + // parent=projects/example-project/locations/europe-west3 + string parent = 1 [(google.api.resource_reference) = { + child_type: "dlp.googleapis.com/DlpContent" + }]; + + // Configuration for the de-identification of the content item. + // Items specified here will override the template referenced by the + // deidentify_template_name argument. + DeidentifyConfig deidentify_config = 2; + + // Configuration for the inspector. + // Items specified here will override the template referenced by the + // inspect_template_name argument. + InspectConfig inspect_config = 3; + + // The item to de-identify. Will be treated as text. + ContentItem item = 4; + + // 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. + string inspect_template_name = 5; + + // 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. + string deidentify_template_name = 6; + + // Deprecated. This field has no effect. + string location_id = 7; +} + +// Results of de-identifying a ContentItem. +message DeidentifyContentResponse { + // The de-identified item. + ContentItem item = 1; + + // An overview of the changes that were made on the `item`. + TransformationOverview overview = 2; +} + +// Request to re-identify an item. +message ReidentifyContentRequest { + // Required. Parent resource name. + // + // The format of this value varies depending on whether you have [specified a + // processing + // location](https://cloud.google.com/dlp/docs/specifying-location): + // + // + Projects scope, location specified:
+ // `projects/`PROJECT_ID`/locations/`LOCATION_ID + // + Projects scope, no location specified (defaults to global):
+ // `projects/`PROJECT_ID + // + // The following example `parent` string specifies a parent project with the + // identifier `example-project`, and specifies the `europe-west3` location + // for processing data: + // + // parent=projects/example-project/locations/europe-west3 + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dlp.googleapis.com/DlpContent" + } + ]; + + // 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` + DeidentifyConfig reidentify_config = 2; + + // Configuration for the inspector. + InspectConfig inspect_config = 3; + + // The item to re-identify. Will be treated as text. + ContentItem item = 4; + + // 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. + string inspect_template_name = 5; + + // 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. The + // `DeidentifyTemplate` used must include only reversible transformations. + // 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. + string reidentify_template_name = 6; + + // Deprecated. This field has no effect. + string location_id = 7; +} + +// Results of re-identifying a item. +message ReidentifyContentResponse { + // The re-identified item. + ContentItem item = 1; + + // An overview of the changes that were made to the `item`. + TransformationOverview overview = 2; +} + +// Request to search for potentially sensitive info in a ContentItem. +message InspectContentRequest { + // Parent resource name. + // + // The format of this value varies depending on whether you have [specified a + // processing + // location](https://cloud.google.com/dlp/docs/specifying-location): + // + // + Projects scope, location specified:
+ // `projects/`PROJECT_ID`/locations/`LOCATION_ID + // + Projects scope, no location specified (defaults to global):
+ // `projects/`PROJECT_ID + // + // The following example `parent` string specifies a parent project with the + // identifier `example-project`, and specifies the `europe-west3` location + // for processing data: + // + // parent=projects/example-project/locations/europe-west3 + string parent = 1 [(google.api.resource_reference) = { + child_type: "dlp.googleapis.com/DlpContent" + }]; + + // Configuration for the inspector. What specified here will override + // the template referenced by the inspect_template_name argument. + InspectConfig inspect_config = 2; + + // The item to inspect. + ContentItem item = 3; + + // 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. + string inspect_template_name = 4; + + // Deprecated. This field has no effect. + string location_id = 5; +} + +// Results of inspecting an item. +message InspectContentResponse { + // The findings. + InspectResult result = 1; +} + +// Cloud repository for storing output. +message OutputStorageConfig { + // Predefined schemas for storing findings. + // Only for use with external storage. + enum 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; + } + + // Output storage types. + oneof type { + // 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. + BigQueryTable table = 1; + } + + // 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. + // Only for use with external storage. + OutputSchema output_schema = 3; +} + +// Statistics regarding a specific InfoType. +message InfoTypeStats { + // The type of finding this stat is for. + InfoType info_type = 1; + + // Number of findings for this infoType. + int64 count = 2; +} + +// The results of an inspect DataSource job. +message InspectDataSourceDetails { + // Snapshot of the inspection configuration. + message RequestedOptions { + // If run with an InspectTemplate, a snapshot of its state at the time of + // this run. + InspectTemplate snapshot_inspect_template = 1; + + // Inspect config. + InspectJobConfig job_config = 3; + } + + // All result fields mentioned below are updated while the job is processing. + message Result { + // Total size in bytes that were processed. + int64 processed_bytes = 1; + + // Estimate of the number of bytes to process. + int64 total_estimated_bytes = 2; + + // Statistics of how many instances of each info type were found during + // inspect job. + repeated InfoTypeStats info_type_stats = 3; + + // Statistics related to the processing of hybrid inspect. + HybridInspectStatistics hybrid_stats = 7; + } + + // The configuration used for this job. + RequestedOptions requested_options = 2; + + // A summary of the outcome of this inspection job. + Result result = 3; +} + +// Statistics related to processing hybrid inspect requests. +message HybridInspectStatistics { + // The number of hybrid inspection requests processed within this job. + int64 processed_count = 1; + + // The number of hybrid inspection requests aborted because the job ran + // out of quota or was ended before they could be processed. + int64 aborted_count = 2; + + // The number of hybrid requests currently being processed. Only populated + // when called via method `getDlpJob`. + // A burst of traffic may cause hybrid inspect requests to be enqueued. + // Processing will take place as quickly as possible, but resource limitations + // may impact how long a request is enqueued for. + int64 pending_count = 3; +} + +// InfoType description. +message InfoTypeDescription { + // Internal name of the infoType. + string name = 1; + + // Human readable form of the infoType name. + string display_name = 2; + + // Which parts of the API supports this InfoType. + repeated InfoTypeSupportedBy supported_by = 3; + + // Description of the infotype. Translated when language is provided in the + // request. + string description = 4; +} + +// Request for the list of infoTypes. +message ListInfoTypesRequest { + // The parent resource name. + // + // The format of this value is as follows: + // + // locations/LOCATION_ID + string parent = 4; + + // BCP-47 language code for localized infoType friendly + // names. If omitted, or if localized strings are not available, + // en-US strings will be returned. + string language_code = 1; + + // filter to only return infoTypes supported by certain parts of the + // API. Defaults to supported_by=INSPECT. + string filter = 2; + + // Deprecated. This field has no effect. + string location_id = 3; +} + +// Response to the ListInfoTypes request. +message ListInfoTypesResponse { + // Set of sensitive infoTypes. + repeated InfoTypeDescription info_types = 1; +} + +// Configuration for a risk analysis job. See +// https://cloud.google.com/dlp/docs/concepts-risk-analysis to learn more. +message RiskAnalysisJobConfig { + // Privacy metric to compute. + PrivacyMetric privacy_metric = 1; + + // Input dataset to compute metrics over. + BigQueryTable source_table = 2; + + // Actions to execute at the completion of the job. Are executed in the order + // provided. + repeated Action actions = 3; +} + +// A column with a semantic tag attached. +message QuasiId { + // Required. Identifies the column. + FieldId field = 1 [(google.api.field_behavior) = REQUIRED]; + + // Semantic tag that identifies what a column contains, to determine which + // statistical model to use to estimate the reidentifiability of each + // value. [required] + oneof tag { + // 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. + InfoType info_type = 2; + + // 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). + string custom_tag = 3; + + // If no semantic tag is indicated, we infer the statistical model from + // the distribution of values in the input data + google.protobuf.Empty inferred = 4; + } +} + +// 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). +message StatisticalTable { + // A quasi-identifier column has a custom_tag, used to know which column + // in the data corresponds to which column in the statistical model. + message QuasiIdentifierField { + // Identifies the column. + FieldId field = 1; + + // 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). + string custom_tag = 2; + } + + // Required. Auxiliary table location. + BigQueryTable table = 3 [(google.api.field_behavior) = REQUIRED]; + + // Required. Quasi-identifier columns. + repeated QuasiIdentifierField quasi_ids = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The relative frequency column must contain a floating-point number + // between 0 and 1 (inclusive). Null values are assumed to be zero. + FieldId relative_frequency = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Privacy metric to compute for reidentification risk analysis. +message PrivacyMetric { + // Compute numerical stats over an individual column, including + // min, max, and quantiles. + message NumericalStatsConfig { + // Field to compute numerical stats on. Supported types are + // integer, float, date, datetime, timestamp, time. + FieldId field = 1; + } + + // Compute numerical stats over an individual column, including + // number of distinct values and value count distribution. + message CategoricalStatsConfig { + // 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. + FieldId field = 1; + } + + // k-anonymity metric, used for analysis of reidentification risk. + message KAnonymityConfig { + // 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. + repeated FieldId quasi_ids = 1; + + // 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. + EntityId entity_id = 2; + } + + // l-diversity metric, used for analysis of reidentification risk. + message LDiversityConfig { + // 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. + repeated FieldId quasi_ids = 1; + + // Sensitive field for computing the l-value. + FieldId sensitive_attribute = 2; + } + + // 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. + message KMapEstimationConfig { + // A column with a semantic tag attached. + message TaggedField { + // Required. Identifies the column. + FieldId field = 1 [(google.api.field_behavior) = REQUIRED]; + + // Semantic tag that identifies what a column contains, to determine which + // statistical model to use to estimate the reidentifiability of each + // value. [required] + oneof tag { + // 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. + InfoType info_type = 2; + + // 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). + string custom_tag = 3; + + // If no semantic tag is indicated, we infer the statistical model from + // the distribution of values in the input data + google.protobuf.Empty inferred = 4; + } + } + + // 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). + message AuxiliaryTable { + // A quasi-identifier column has a custom_tag, used to know which column + // in the data corresponds to which column in the statistical model. + message QuasiIdField { + // Identifies the column. + FieldId field = 1; + + // A auxiliary field. + string custom_tag = 2; + } + + // Required. Auxiliary table location. + BigQueryTable table = 3 [(google.api.field_behavior) = REQUIRED]; + + // Required. Quasi-identifier columns. + repeated QuasiIdField quasi_ids = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The relative frequency column must contain a floating-point number + // between 0 and 1 (inclusive). Null values are assumed to be zero. + FieldId relative_frequency = 2 [(google.api.field_behavior) = REQUIRED]; + } + + // Required. Fields considered to be quasi-identifiers. No two columns can have the + // same tag. + repeated TaggedField quasi_ids = 1 [(google.api.field_behavior) = REQUIRED]; + + // 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. + string region_code = 2; + + // 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. + repeated AuxiliaryTable auxiliary_tables = 3; + } + + // δ-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. + message DeltaPresenceEstimationConfig { + // Required. Fields considered to be quasi-identifiers. No two fields can have the + // same tag. + repeated QuasiId quasi_ids = 1 [(google.api.field_behavior) = REQUIRED]; + + // 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. + string region_code = 2; + + // 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. + repeated StatisticalTable auxiliary_tables = 3; + } + + // Types of analysis. + oneof type { + // Numerical stats + NumericalStatsConfig numerical_stats_config = 1; + + // Categorical stats + CategoricalStatsConfig categorical_stats_config = 2; + + // K-anonymity + KAnonymityConfig k_anonymity_config = 3; + + // l-diversity + LDiversityConfig l_diversity_config = 4; + + // k-map + KMapEstimationConfig k_map_estimation_config = 5; + + // delta-presence + DeltaPresenceEstimationConfig delta_presence_estimation_config = 6; + } +} + +// Result of a risk analysis operation request. +message AnalyzeDataSourceRiskDetails { + // Result of the numerical stats computation. + message NumericalStatsResult { + // Minimum value appearing in the column. + Value min_value = 1; + + // Maximum value appearing in the column. + Value max_value = 2; + + // List of 99 values that partition the set of field values into 100 equal + // sized buckets. + repeated Value quantile_values = 4; + } + + // Result of the categorical stats computation. + message CategoricalStatsResult { + // Histogram of value frequencies in the column. + message CategoricalStatsHistogramBucket { + // Lower bound on the value frequency of the values in this bucket. + int64 value_frequency_lower_bound = 1; + + // Upper bound on the value frequency of the values in this bucket. + int64 value_frequency_upper_bound = 2; + + // Total number of values in this bucket. + int64 bucket_size = 3; + + // Sample of value frequencies in this bucket. The total number of + // values returned per bucket is capped at 20. + repeated ValueFrequency bucket_values = 4; + + // Total number of distinct values in this bucket. + int64 bucket_value_count = 5; + } + + // Histogram of value frequencies in the column. + repeated CategoricalStatsHistogramBucket value_frequency_histogram_buckets = 5; + } + + // Result of the k-anonymity computation. + message KAnonymityResult { + // The set of columns' values that share the same ldiversity value + message KAnonymityEquivalenceClass { + // 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. + repeated Value quasi_ids_values = 1; + + // Size of the equivalence class, for example number of rows with the + // above set of values. + int64 equivalence_class_size = 2; + } + + // Histogram of k-anonymity equivalence classes. + message KAnonymityHistogramBucket { + // Lower bound on the size of the equivalence classes in this bucket. + int64 equivalence_class_size_lower_bound = 1; + + // Upper bound on the size of the equivalence classes in this bucket. + int64 equivalence_class_size_upper_bound = 2; + + // Total number of equivalence classes in this bucket. + int64 bucket_size = 3; + + // Sample of equivalence classes in this bucket. The total number of + // classes returned per bucket is capped at 20. + repeated KAnonymityEquivalenceClass bucket_values = 4; + + // Total number of distinct equivalence classes in this bucket. + int64 bucket_value_count = 5; + } + + // Histogram of k-anonymity equivalence classes. + repeated KAnonymityHistogramBucket equivalence_class_histogram_buckets = 5; + } + + // Result of the l-diversity computation. + message LDiversityResult { + // The set of columns' values that share the same ldiversity value. + message LDiversityEquivalenceClass { + // Quasi-identifier values defining the k-anonymity equivalence + // class. The order is always the same as the original request. + repeated Value quasi_ids_values = 1; + + // Size of the k-anonymity equivalence class. + int64 equivalence_class_size = 2; + + // Number of distinct sensitive values in this equivalence class. + int64 num_distinct_sensitive_values = 3; + + // Estimated frequencies of top sensitive values. + repeated ValueFrequency top_sensitive_values = 4; + } + + // Histogram of l-diversity equivalence class sensitive value frequencies. + message LDiversityHistogramBucket { + // Lower bound on the sensitive value frequencies of the equivalence + // classes in this bucket. + int64 sensitive_value_frequency_lower_bound = 1; + + // Upper bound on the sensitive value frequencies of the equivalence + // classes in this bucket. + int64 sensitive_value_frequency_upper_bound = 2; + + // Total number of equivalence classes in this bucket. + int64 bucket_size = 3; + + // Sample of equivalence classes in this bucket. The total number of + // classes returned per bucket is capped at 20. + repeated LDiversityEquivalenceClass bucket_values = 4; + + // Total number of distinct equivalence classes in this bucket. + int64 bucket_value_count = 5; + } + + // Histogram of l-diversity equivalence class sensitive value frequencies. + repeated LDiversityHistogramBucket sensitive_value_frequency_histogram_buckets = 5; + } + + // Result of the reidentifiability analysis. Note that these results are an + // estimation, not exact values. + message KMapEstimationResult { + // A tuple of values for the quasi-identifier columns. + message KMapEstimationQuasiIdValues { + // The quasi-identifier values. + repeated Value quasi_ids_values = 1; + + // The estimated anonymity for these quasi-identifier values. + int64 estimated_anonymity = 2; + } + + // 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. + message KMapEstimationHistogramBucket { + // Always positive. + int64 min_anonymity = 1; + + // Always greater than or equal to min_anonymity. + int64 max_anonymity = 2; + + // Number of records within these anonymity bounds. + int64 bucket_size = 5; + + // Sample of quasi-identifier tuple values in this bucket. The total + // number of classes returned per bucket is capped at 20. + repeated KMapEstimationQuasiIdValues bucket_values = 6; + + // Total number of distinct quasi-identifier tuple values in this bucket. + int64 bucket_value_count = 7; + } + + // 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. + repeated KMapEstimationHistogramBucket k_map_estimation_histogram = 1; + } + + // Result of the δ-presence computation. Note that these results are an + // estimation, not exact values. + message DeltaPresenceEstimationResult { + // A tuple of values for the quasi-identifier columns. + message DeltaPresenceEstimationQuasiIdValues { + // The quasi-identifier values. + repeated Value quasi_ids_values = 1; + + // 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. + double estimated_probability = 2; + } + + // 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. + message DeltaPresenceEstimationHistogramBucket { + // Between 0 and 1. + double min_probability = 1; + + // Always greater than or equal to min_probability. + double max_probability = 2; + + // Number of records within these probability bounds. + int64 bucket_size = 5; + + // Sample of quasi-identifier tuple values in this bucket. The total + // number of classes returned per bucket is capped at 20. + repeated DeltaPresenceEstimationQuasiIdValues bucket_values = 6; + + // Total number of distinct quasi-identifier tuple values in this bucket. + int64 bucket_value_count = 7; + } + + // 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. + repeated DeltaPresenceEstimationHistogramBucket delta_presence_estimation_histogram = 1; + } + + // Risk analysis options. + message RequestedRiskAnalysisOptions { + // The job config for the risk job. + RiskAnalysisJobConfig job_config = 1; + } + + // Privacy metric to compute. + PrivacyMetric requested_privacy_metric = 1; + + // Input dataset to compute metrics over. + BigQueryTable requested_source_table = 2; + + // Values associated with this metric. + oneof result { + // Numerical stats result + NumericalStatsResult numerical_stats_result = 3; + + // Categorical stats result + CategoricalStatsResult categorical_stats_result = 4; + + // K-anonymity result + KAnonymityResult k_anonymity_result = 5; + + // L-divesity result + LDiversityResult l_diversity_result = 6; + + // K-map result + KMapEstimationResult k_map_estimation_result = 7; + + // Delta-presence result + DeltaPresenceEstimationResult delta_presence_estimation_result = 9; + } + + // The configuration used for this job. + RequestedRiskAnalysisOptions requested_options = 10; +} + +// A value of a field, including its frequency. +message ValueFrequency { + // A value contained in the field in question. + Value value = 1; + + // How many times the value is contained in the field. + int64 count = 2; +} + +// 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. +message Value { + // Value types + oneof type { + // integer + int64 integer_value = 1; + + // float + double float_value = 2; + + // string + string string_value = 3; + + // boolean + bool boolean_value = 4; + + // timestamp + google.protobuf.Timestamp timestamp_value = 5; + + // time of day + google.type.TimeOfDay time_value = 6; + + // date + google.type.Date date_value = 7; + + // day of week + google.type.DayOfWeek day_of_week_value = 8; + } +} + +// Message for infoType-dependent details parsed from quote. +message QuoteInfo { + // Object representation of the quote. + oneof parsed_quote { + // The date time indicated by the quote. + DateTime date_time = 2; + } +} + +// Message for a date time object. +// e.g. 2018-01-01, 5th August. +message DateTime { + // Time zone of the date time object. + message TimeZone { + // Set only if the offset can be determined. Positive for time ahead of UTC. + // E.g. For "UTC-9", this value is -540. + int32 offset_minutes = 1; + } + + // One or more of the following must be set. + // Must be a valid date or time value. + google.type.Date date = 1; + + // Day of week + google.type.DayOfWeek day_of_week = 2; + + // Time of day + google.type.TimeOfDay time = 3; + + // Time zone + TimeZone time_zone = 4; +} + +// The configuration that controls how the data will change. +message DeidentifyConfig { + oneof transformation { + // Treat the dataset as free-form text and apply the same free text + // transformation everywhere. + InfoTypeTransformations info_type_transformations = 1; + + // Treat the dataset as structured. Transformations can be applied to + // specific locations within structured datasets, such as transforming + // a column within a table. + RecordTransformations record_transformations = 2; + } + + // Mode for handling transformation errors. If left unspecified, the default + // mode is `TransformationErrorHandling.ThrowError`. + TransformationErrorHandling transformation_error_handling = 3; +} + +// How to handle transformation errors during de-identification. A +// transformation error occurs when the requested transformation is incompatible +// with the data. For example, trying to de-identify an IP address using a +// `DateShift` transformation would result in a transformation error, since date +// info cannot be extracted from an IP address. +// Information about any incompatible transformations, and how they were +// handled, is returned in the response as part of the +// `TransformationOverviews`. +message TransformationErrorHandling { + // Throw an error and fail the request when a transformation error occurs. + message ThrowError { + + } + + // Skips the data without modifying it if the requested transformation would + // cause an error. For example, if a `DateShift` transformation were applied + // an an IP address, this mode would leave the IP address unchanged in the + // response. + message LeaveUntransformed { + + } + + // How transformation errors should be handled. + oneof mode { + // Throw an error + ThrowError throw_error = 1; + + // Ignore errors + LeaveUntransformed leave_untransformed = 2; + } +} + +// A rule for transforming a value. +message PrimitiveTransformation { + oneof transformation { + // Replace with a specified value. + ReplaceValueConfig replace_config = 1; + + // Redact + RedactConfig redact_config = 2; + + // Mask + CharacterMaskConfig character_mask_config = 3; + + // Ffx-Fpe + CryptoReplaceFfxFpeConfig crypto_replace_ffx_fpe_config = 4; + + // Fixed size bucketing + FixedSizeBucketingConfig fixed_size_bucketing_config = 5; + + // Bucketing + BucketingConfig bucketing_config = 6; + + // Replace with infotype + ReplaceWithInfoTypeConfig replace_with_info_type_config = 7; + + // Time extraction + TimePartConfig time_part_config = 8; + + // Crypto + CryptoHashConfig crypto_hash_config = 9; + + // Date Shift + DateShiftConfig date_shift_config = 11; + + // Deterministic Crypto + CryptoDeterministicConfig crypto_deterministic_config = 12; + + // Replace with a value randomly drawn (with replacement) from a dictionary. + ReplaceDictionaryConfig replace_dictionary_config = 13; + } +} + +// For use with `Date`, `Timestamp`, and `TimeOfDay`, extract or preserve a +// portion of the value. +message TimePartConfig { + // Components that make up time. + enum 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; + } + + // The part of the time to keep. + TimePart part_to_extract = 1; +} + +// 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. +message CryptoHashConfig { + // The key used by the hash function. + CryptoKey crypto_key = 1; +} + +// 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. +message CryptoDeterministicConfig { + // The key used by the encryption function. For deterministic encryption + // using AES-SIV, the provided key is internally expanded to 64 bytes prior to + // use. + CryptoKey crypto_key = 1; + + // 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. + InfoType surrogate_info_type = 2; + + // 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. + FieldId context = 3; +} + +// Replace each input value with a given `Value`. +message ReplaceValueConfig { + // Value to replace it with. + Value new_value = 1; +} + +// Replace each input value with a value randomly selected from the dictionary. +message ReplaceDictionaryConfig { + oneof type { + // A list of words to select from for random replacement. The + // [limits](https://cloud.google.com/dlp/limits) page contains details about + // the size limits of dictionaries. + CustomInfoType.Dictionary.WordList word_list = 1; + } +} + +// Replace each matching finding with the name of the info_type. +message ReplaceWithInfoTypeConfig { + +} + +// 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 '. +message RedactConfig { + +} + +// Characters to skip when doing deidentification of a value. These will be left +// alone and skipped. +message CharsToIgnore { + // Convenience enum for indication common characters to not transform. + enum 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; + } + + oneof characters { + // Characters to not transform when masking. + string characters_to_skip = 1; + + // Common characters to not transform when masking. Useful to avoid removing + // punctuation. + CommonCharsToIgnore common_characters_to_ignore = 2; + } +} + +// 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. +message CharacterMaskConfig { + // 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. + string masking_character = 1; + + // Number of characters to mask. If not set, all matching chars will be + // masked. Skipped characters do not count towards this tally. + int32 number_to_mask = 2; + + // 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***`. + bool reverse_order = 3; + + // 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`. + repeated CharsToIgnore characters_to_ignore = 4; +} + +// 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}. For example, 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. +message FixedSizeBucketingConfig { + // 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". + Value lower_bound = 1 [(google.api.field_behavior) = REQUIRED]; + + // 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+". + Value upper_bound = 2 [(google.api.field_behavior) = REQUIRED]; + + // 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. + double bucket_size = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// 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. +message BucketingConfig { + // Bucket is represented as a range, along with replacement values. + message Bucket { + // Lower bound of the range, inclusive. Type should be the same as max if + // used. + Value min = 1; + + // Upper bound of the range, exclusive; type must match min. + Value max = 2; + + // Required. Replacement value for this bucket. + Value replacement_value = 3 [(google.api.field_behavior) = REQUIRED]; + } + + // Set of buckets. Ranges must be non-overlapping. + repeated Bucket buckets = 1; +} + +// 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. +message CryptoReplaceFfxFpeConfig { + // 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 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; + } + + // Required. The key used by the encryption algorithm. + CryptoKey crypto_key = 1 [(google.api.field_behavior) = REQUIRED]; + + // 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 + FieldId context = 2; + + // Choose an alphabet which the data being transformed will be made up of. + oneof alphabet { + // Common alphabets. + FfxCommonNativeAlphabet common_alphabet = 4; + + // 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. + // The full list of allowed characters is: + // 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz + // ~`!@#$%^&*()_-+={[}]|\:;"'<,>.?/ + string custom_alphabet = 5; + + // The native way to select the alphabet. Must be in the range [2, 95]. + int32 radix = 6; + } + + // 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 + InfoType surrogate_info_type = 8; +} + +// This is a data encryption key (DEK) (as opposed to +// a key encryption key (KEK) stored by Cloud Key Management Service +// (Cloud KMS). +// When using Cloud KMS to wrap or unwrap a DEK, be sure to set an appropriate +// IAM policy on the KEK to ensure an attacker cannot +// unwrap the DEK. +message CryptoKey { + // Sources of crypto keys. + oneof source { + // Transient crypto key + TransientCryptoKey transient = 1; + + // Unwrapped crypto key + UnwrappedCryptoKey unwrapped = 2; + + // Key wrapped using Cloud KMS + KmsWrappedCryptoKey kms_wrapped = 3; + } +} + +// Use this to have a random data crypto key generated. +// It will be discarded after the request finishes. +message TransientCryptoKey { + // 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). + string name = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// Using raw keys is prone to security risks due to accidentally +// leaking the key. Choose another type of key if possible. +message UnwrappedCryptoKey { + // Required. A 128/192/256 bit key. + bytes key = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// Include to use an existing data crypto key wrapped by KMS. +// The wrapped key must be a 128-, 192-, or 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 +// +// For more information, see [Creating a wrapped key] +// (https://cloud.google.com/dlp/docs/create-wrapped-key). +// +// Note: When you use Cloud KMS for cryptographic operations, +// [charges apply](https://cloud.google.com/kms/pricing). +message KmsWrappedCryptoKey { + // Required. The wrapped data crypto key. + bytes wrapped_key = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The resource name of the KMS CryptoKey to use for unwrapping. + string crypto_key_name = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// 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. +message DateShiftConfig { + // 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. + int32 upper_bound_days = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. For example, -5 means shift date to at most 5 days back in the past. + int32 lower_bound_days = 2 [(google.api.field_behavior) = REQUIRED]; + + // 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. + FieldId context = 3; + + // Method for calculating shift that takes context into consideration. If + // set, must also set context. Can only be applied to table items. + oneof method { + // 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. + CryptoKey crypto_key = 4; + } +} + +// 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. +message InfoTypeTransformations { + // A transformation to apply to text that is identified as a specific + // info_type. + message InfoTypeTransformation { + // 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`. + repeated InfoType info_types = 1; + + // Required. Primitive transformation to apply to the infoType. + PrimitiveTransformation primitive_transformation = 2 [(google.api.field_behavior) = REQUIRED]; + } + + // Required. Transformation for each infoType. Cannot specify more than one + // for a given infoType. + repeated InfoTypeTransformation transformations = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// The transformation to apply to the field. +message FieldTransformation { + // Required. Input field(s) to apply the transformation to. + // When you have columns that reference their position within a list, + // omit the index from the FieldId. FieldId name matching ignores the index. + // For example, instead of "contact.nums[0].type", use "contact.nums.type". + repeated FieldId fields = 1 [(google.api.field_behavior) = REQUIRED]; + + // 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. + RecordCondition condition = 3; + + // Transformation to apply. [required] + oneof transformation { + // Apply the transformation to the entire field. + PrimitiveTransformation primitive_transformation = 4; + + // Treat the contents of the field as free text, and selectively + // transform content that matches an `InfoType`. + InfoTypeTransformations info_type_transformations = 5; + } +} + +// A type of transformation that is applied over structured data such as a +// table. +message RecordTransformations { + // Transform the record by applying various field transformations. + repeated FieldTransformation field_transformations = 1; + + // Configuration defining which records get suppressed entirely. Records that + // match any suppression rule are omitted from the output. + repeated RecordSuppression record_suppressions = 2; +} + +// Configuration to suppress records whose suppression conditions evaluate to +// true. +message RecordSuppression { + // A condition that when it evaluates to true will result in the record being + // evaluated to be suppressed from the transformed content. + RecordCondition condition = 1; +} + +// A condition for determining whether a transformation should be applied to +// a field. +message RecordCondition { + // 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. + message Condition { + // Required. Field within the record this condition is evaluated against. + FieldId field = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Operator used to compare the field or infoType to the value. + RelationalOperator operator = 3 [(google.api.field_behavior) = REQUIRED]; + + // Value to compare against. [Mandatory, except for `EXISTS` tests.] + Value value = 4; + } + + // A collection of conditions. + message Conditions { + // A collection of conditions. + repeated Condition conditions = 1; + } + + // An expression, consisting or an operator and conditions. + message Expressions { + // Logical operators for conditional checks. + enum LogicalOperator { + // Unused + LOGICAL_OPERATOR_UNSPECIFIED = 0; + + // Conditional AND + AND = 1; + } + + // The operator to apply to the result of conditions. Default and currently + // only supported value is `AND`. + LogicalOperator logical_operator = 1; + + // Expression types. + oneof type { + // Conditions to apply to the expression. + Conditions conditions = 3; + } + } + + // An expression. + Expressions expressions = 3; +} + +// Overview of the modifications that occurred. +message TransformationOverview { + // Total size in bytes that were transformed in some way. + int64 transformed_bytes = 2; + + // Transformations applied to the dataset. + repeated TransformationSummary transformation_summaries = 3; +} + +// Summary of a single transformation. +// Only one of 'transformation', 'field_transformation', or 'record_suppress' +// will be set. +message TransformationSummary { + // Possible outcomes of transformations. + enum TransformationResultCode { + // Unused + TRANSFORMATION_RESULT_CODE_UNSPECIFIED = 0; + + // Transformation completed without an error. + SUCCESS = 1; + + // Transformation had an error. + ERROR = 2; + } + + // A collection that informs the user the number of times a particular + // `TransformationResultCode` and error details occurred. + message SummaryResult { + // Number of transformations counted by this result. + int64 count = 1; + + // Outcome of the transformation. + TransformationResultCode code = 2; + + // A place for warnings or errors to show up if a transformation didn't + // work as expected. + string details = 3; + } + + // Set if the transformation was limited to a specific InfoType. + InfoType info_type = 1; + + // Set if the transformation was limited to a specific FieldId. + FieldId field = 2; + + // The specific transformation these stats apply to. + PrimitiveTransformation transformation = 3; + + // 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. + repeated FieldTransformation field_transformations = 5; + + // The specific suppression option these stats apply to. + RecordSuppression record_suppress = 6; + + // Collection of all transformations that took place or had an error. + repeated SummaryResult results = 4; + + // Total size in bytes that were transformed in some way. + int64 transformed_bytes = 7; +} + +// Schedule for inspect job triggers. +message Schedule { + oneof option { + // 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. + google.protobuf.Duration recurrence_period_duration = 1; + } +} + +// Job trigger option for hybrid jobs. Jobs must be manually created +// and finished. +message Manual { + +} + +// 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. +message InspectTemplate { + option (google.api.resource) = { + type: "dlp.googleapis.com/InspectTemplate" + pattern: "organizations/{organization}/inspectTemplates/{inspect_template}" + pattern: "projects/{project}/inspectTemplates/{inspect_template}" + pattern: "organizations/{organization}/locations/{location}/inspectTemplates/{inspect_template}" + pattern: "projects/{project}/locations/{location}/inspectTemplates/{inspect_template}" + }; + + // 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`; + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Display name (max 256 chars). + string display_name = 2; + + // Short description (max 256 chars). + string description = 3; + + // Output only. The creation timestamp of an inspectTemplate. + google.protobuf.Timestamp create_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The last update timestamp of an inspectTemplate. + google.protobuf.Timestamp update_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The core content of the template. Configuration of the scanning process. + InspectConfig inspect_config = 6; +} + +// DeidentifyTemplates contains instructions on how to de-identify content. +// See https://cloud.google.com/dlp/docs/concepts-templates to learn more. +message DeidentifyTemplate { + option (google.api.resource) = { + type: "dlp.googleapis.com/DeidentifyTemplate" + pattern: "organizations/{organization}/deidentifyTemplates/{deidentify_template}" + pattern: "projects/{project}/deidentifyTemplates/{deidentify_template}" + pattern: "organizations/{organization}/locations/{location}/deidentifyTemplates/{deidentify_template}" + pattern: "projects/{project}/locations/{location}/deidentifyTemplates/{deidentify_template}" + }; + + // 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` + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Display name (max 256 chars). + string display_name = 2; + + // Short description (max 256 chars). + string description = 3; + + // Output only. The creation timestamp of an inspectTemplate. + google.protobuf.Timestamp create_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The last update timestamp of an inspectTemplate. + google.protobuf.Timestamp update_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The core content of the template. + DeidentifyConfig deidentify_config = 6; +} + +// Details information about an error encountered during job execution or +// the results of an unsuccessful activation of the JobTrigger. +message Error { + // Detailed error codes and messages. + google.rpc.Status details = 1; + + // The times the error occurred. + repeated google.protobuf.Timestamp timestamps = 2; +} + +// 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. +message JobTrigger { + option (google.api.resource) = { + type: "dlp.googleapis.com/JobTrigger" + pattern: "projects/{project}/jobTriggers/{job_trigger}" + pattern: "projects/{project}/locations/{location}/jobTriggers/{job_trigger}" + }; + + // What event needs to occur for a new job to be started. + message Trigger { + oneof trigger { + // Create a job on a repeating basis based on the elapse of time. + Schedule schedule = 1; + + // For use with hybrid jobs. Jobs must be manually created and finished. + Manual manual = 2; + } + } + + // 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 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; + } + + // Unique resource name for the triggeredJob, assigned by the service when the + // triggeredJob is created, for example + // `projects/dlp-test-project/jobTriggers/53234423`. + string name = 1; + + // Display name (max 100 chars) + string display_name = 2; + + // User provided description (max 256 chars) + string description = 3; + + // The configuration details for the specific type of job to run. + oneof job { + // For inspect jobs, a snapshot of the configuration. + InspectJobConfig inspect_job = 4; + } + + // 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. + repeated Trigger triggers = 5; + + // 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. + repeated Error errors = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The creation timestamp of a triggeredJob. + google.protobuf.Timestamp create_time = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The last update timestamp of a triggeredJob. + google.protobuf.Timestamp update_time = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The timestamp of the last time this trigger executed. + google.protobuf.Timestamp last_run_time = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. A status for this trigger. + Status status = 10 [(google.api.field_behavior) = REQUIRED]; +} + +// A task to execute on the completion of a job. +// See https://cloud.google.com/dlp/docs/concepts-actions to learn more. +message Action { + // 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 + message SaveFindings { + // Location to store findings outside of DLP. + OutputStorageConfig output_config = 1; + } + + // 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 + message PublishToPubSub { + // 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}. + string topic = 1; + } + + // 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 + message PublishSummaryToCscc { + + } + + // Publish findings of a DlpJob to Data Catalog. Labels summarizing the + // results of the DlpJob will be applied to the entry for the resource scanned + // in 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 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 + message PublishFindingsToCloudDataCatalog { + + } + + // Enable email notification to project owners and editors on jobs's + // completion/failure. + message JobNotificationEmails { + + } + + // 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'. + message PublishToStackdriver { + + } + + oneof action { + // Save resulting findings in a provided location. + SaveFindings save_findings = 1; + + // Publish a notification to a pubsub topic. + PublishToPubSub pub_sub = 2; + + // Publish summary to Cloud Security Command Center (Alpha). + PublishSummaryToCscc publish_summary_to_cscc = 3; + + // Publish findings to Cloud Datahub. + PublishFindingsToCloudDataCatalog publish_findings_to_cloud_data_catalog = 5; + + // Enable email notification for project owners and editors on job's + // completion/failure. + JobNotificationEmails job_notification_emails = 8; + + // Enable Stackdriver metric dlp.googleapis.com/finding_count. + PublishToStackdriver publish_to_stackdriver = 9; + } +} + +// Request message for CreateInspectTemplate. +message CreateInspectTemplateRequest { + // Required. Parent resource name. + // + // The format of this value varies depending on the scope of the request + // (project or organization) and whether you have [specified a processing + // location](https://cloud.google.com/dlp/docs/specifying-location): + // + // + Projects scope, location specified:
+ // `projects/`PROJECT_ID`/locations/`LOCATION_ID + // + Projects scope, no location specified (defaults to global):
+ // `projects/`PROJECT_ID + // + Organizations scope, location specified:
+ // `organizations/`ORG_ID`/locations/`LOCATION_ID + // + Organizations scope, no location specified (defaults to global):
+ // `organizations/`ORG_ID + // + // The following example `parent` string specifies a parent project with the + // identifier `example-project`, and specifies the `europe-west3` location + // for processing data: + // + // parent=projects/example-project/locations/europe-west3 + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dlp.googleapis.com/InspectTemplate" + } + ]; + + // Required. The InspectTemplate to create. + InspectTemplate inspect_template = 2 [(google.api.field_behavior) = REQUIRED]; + + // 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. + string template_id = 3; + + // Deprecated. This field has no effect. + string location_id = 4; +} + +// Request message for UpdateInspectTemplate. +message UpdateInspectTemplateRequest { + // Required. Resource name of organization and inspectTemplate to be updated, for + // example `organizations/433245324/inspectTemplates/432452342` or + // projects/project-id/inspectTemplates/432452342. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dlp.googleapis.com/InspectTemplate" + } + ]; + + // New InspectTemplate value. + InspectTemplate inspect_template = 2; + + // Mask to control which fields get updated. + google.protobuf.FieldMask update_mask = 3; +} + +// Request message for GetInspectTemplate. +message GetInspectTemplateRequest { + // Required. Resource name of the organization and inspectTemplate to be read, for + // example `organizations/433245324/inspectTemplates/432452342` or + // projects/project-id/inspectTemplates/432452342. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dlp.googleapis.com/InspectTemplate" + } + ]; +} + +// Request message for ListInspectTemplates. +message ListInspectTemplatesRequest { + // Required. Parent resource name. + // + // The format of this value varies depending on the scope of the request + // (project or organization) and whether you have [specified a processing + // location](https://cloud.google.com/dlp/docs/specifying-location): + // + // + Projects scope, location specified:
+ // `projects/`PROJECT_ID`/locations/`LOCATION_ID + // + Projects scope, no location specified (defaults to global):
+ // `projects/`PROJECT_ID + // + Organizations scope, location specified:
+ // `organizations/`ORG_ID`/locations/`LOCATION_ID + // + Organizations scope, no location specified (defaults to global):
+ // `organizations/`ORG_ID + // + // The following example `parent` string specifies a parent project with the + // identifier `example-project`, and specifies the `europe-west3` location + // for processing data: + // + // parent=projects/example-project/locations/europe-west3 + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dlp.googleapis.com/InspectTemplate" + } + ]; + + // Page token to continue retrieval. Comes from previous call + // to `ListInspectTemplates`. + string page_token = 2; + + // Size of the page, can be limited by server. If zero server returns + // a page of max size 100. + int32 page_size = 3; + + // 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. + string order_by = 4; + + // Deprecated. This field has no effect. + string location_id = 5; +} + +// Response message for ListInspectTemplates. +message ListInspectTemplatesResponse { + // List of inspectTemplates, up to page_size in ListInspectTemplatesRequest. + repeated InspectTemplate inspect_templates = 1; + + // If the next page is available then the next page token to be used + // in following ListInspectTemplates request. + string next_page_token = 2; +} + +// Request message for DeleteInspectTemplate. +message DeleteInspectTemplateRequest { + // Required. Resource name of the organization and inspectTemplate to be deleted, for + // example `organizations/433245324/inspectTemplates/432452342` or + // projects/project-id/inspectTemplates/432452342. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dlp.googleapis.com/InspectTemplate" + } + ]; +} + +// Request message for CreateJobTrigger. +message CreateJobTriggerRequest { + // Required. Parent resource name. + // + // The format of this value varies depending on whether you have [specified a + // processing + // location](https://cloud.google.com/dlp/docs/specifying-location): + // + // + Projects scope, location specified:
+ // `projects/`PROJECT_ID`/locations/`LOCATION_ID + // + Projects scope, no location specified (defaults to global):
+ // `projects/`PROJECT_ID + // + // The following example `parent` string specifies a parent project with the + // identifier `example-project`, and specifies the `europe-west3` location + // for processing data: + // + // parent=projects/example-project/locations/europe-west3 + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dlp.googleapis.com/JobTrigger" + } + ]; + + // Required. The JobTrigger to create. + JobTrigger job_trigger = 2 [(google.api.field_behavior) = REQUIRED]; + + // 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. + string trigger_id = 3; + + // Deprecated. This field has no effect. + string location_id = 4; +} + +// Request message for ActivateJobTrigger. +message ActivateJobTriggerRequest { + // Required. Resource name of the trigger to activate, for example + // `projects/dlp-test-project/jobTriggers/53234423`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dlp.googleapis.com/JobTrigger" + } + ]; +} + +// Request message for UpdateJobTrigger. +message UpdateJobTriggerRequest { + // Required. Resource name of the project and the triggeredJob, for example + // `projects/dlp-test-project/jobTriggers/53234423`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dlp.googleapis.com/JobTrigger" + } + ]; + + // New JobTrigger value. + JobTrigger job_trigger = 2; + + // Mask to control which fields get updated. + google.protobuf.FieldMask update_mask = 3; +} + +// Request message for GetJobTrigger. +message GetJobTriggerRequest { + // Required. Resource name of the project and the triggeredJob, for example + // `projects/dlp-test-project/jobTriggers/53234423`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dlp.googleapis.com/JobTrigger" + } + ]; +} + +// Request message for CreateDlpJobRequest. Used to initiate long running +// jobs such as calculating risk metrics or inspecting Google Cloud +// Storage. +message CreateDlpJobRequest { + // Required. Parent resource name. + // + // The format of this value varies depending on whether you have [specified a + // processing + // location](https://cloud.google.com/dlp/docs/specifying-location): + // + // + Projects scope, location specified:
+ // `projects/`PROJECT_ID`/locations/`LOCATION_ID + // + Projects scope, no location specified (defaults to global):
+ // `projects/`PROJECT_ID + // + // The following example `parent` string specifies a parent project with the + // identifier `example-project`, and specifies the `europe-west3` location + // for processing data: + // + // parent=projects/example-project/locations/europe-west3 + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dlp.googleapis.com/DlpJob" + } + ]; + + // The configuration details for the specific type of job to run. + oneof job { + // An inspection job scans a storage repository for InfoTypes. + InspectJobConfig inspect_job = 2; + + // A risk analysis job calculates re-identification risk metrics for a + // BigQuery table. + RiskAnalysisJobConfig risk_job = 3; + } + + // 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. + string job_id = 4; + + // Deprecated. This field has no effect. + string location_id = 5; +} + +// Request message for ListJobTriggers. +message ListJobTriggersRequest { + // Required. Parent resource name. + // + // The format of this value varies depending on whether you have [specified a + // processing + // location](https://cloud.google.com/dlp/docs/specifying-location): + // + // + Projects scope, location specified:
+ // `projects/`PROJECT_ID`/locations/`LOCATION_ID + // + Projects scope, no location specified (defaults to global):
+ // `projects/`PROJECT_ID + // + // The following example `parent` string specifies a parent project with the + // identifier `example-project`, and specifies the `europe-west3` location + // for processing data: + // + // parent=projects/example-project/locations/europe-west3 + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dlp.googleapis.com/JobTrigger" + } + ]; + + // Page token to continue retrieval. Comes from previous call + // to ListJobTriggers. `order_by` field must not + // change for subsequent calls. + string page_token = 2; + + // Size of the page, can be limited by a server. + int32 page_size = 3; + + // 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. + string order_by = 4; + + // 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 triggers: + // - `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. + string filter = 5; + + // The type of jobs. Will use `DlpJobType.INSPECT` if not set. + DlpJobType type = 6; + + // Deprecated. This field has no effect. + string location_id = 7; +} + +// Response message for ListJobTriggers. +message ListJobTriggersResponse { + // List of triggeredJobs, up to page_size in ListJobTriggersRequest. + repeated JobTrigger job_triggers = 1; + + // If the next page is available then the next page token to be used + // in following ListJobTriggers request. + string next_page_token = 2; +} + +// Request message for DeleteJobTrigger. +message DeleteJobTriggerRequest { + // Required. Resource name of the project and the triggeredJob, for example + // `projects/dlp-test-project/jobTriggers/53234423`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dlp.googleapis.com/JobTrigger" + } + ]; +} + +// Controls what and how to inspect for findings. +message InspectJobConfig { + // The data to scan. + StorageConfig storage_config = 1; + + // How and what to scan for. + InspectConfig inspect_config = 2; + + // 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. + string inspect_template_name = 3; + + // Actions to execute at the completion of the job. + repeated Action actions = 4; +} + +// Combines all of the information about a DLP job. +message DlpJob { + option (google.api.resource) = { + type: "dlp.googleapis.com/DlpJob" + pattern: "projects/{project}/dlpJobs/{dlp_job}" + pattern: "projects/{project}/locations/{location}/dlpJobs/{dlp_job}" + }; + + // Possible states of a job. New items may be added. + enum JobState { + // Unused. + JOB_STATE_UNSPECIFIED = 0; + + // The job has not yet started. + PENDING = 1; + + // The job is currently running. Once a job has finished it will transition + // to FAILED or DONE. + 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 job is currently accepting findings via hybridInspect. + // A hybrid job in ACTIVE state may continue to have findings added to it + // through calling of hybridInspect. After the job has finished no more + // calls to hybridInspect may be made. ACTIVE jobs can transition to DONE. + ACTIVE = 6; + } + + // The server-assigned name. + string name = 1; + + // The type of job. + DlpJobType type = 2; + + // State of a job. + JobState state = 3; + + oneof details { + // Results from analyzing risk of a data source. + AnalyzeDataSourceRiskDetails risk_details = 4; + + // Results from inspecting a data source. + InspectDataSourceDetails inspect_details = 5; + } + + // Time when the job was created. + google.protobuf.Timestamp create_time = 6; + + // Time when the job started. + google.protobuf.Timestamp start_time = 7; + + // Time when the job finished. + google.protobuf.Timestamp end_time = 8; + + // If created by a job trigger, the resource name of the trigger that + // instantiated the job. + string job_trigger_name = 10; + + // A stream of errors encountered running the job. + repeated Error errors = 11; +} + +// The request message for [DlpJobs.GetDlpJob][]. +message GetDlpJobRequest { + // Required. The name of the DlpJob resource. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dlp.googleapis.com/DlpJob" + } + ]; +} + +// The request message for listing DLP jobs. +message ListDlpJobsRequest { + // Required. Parent resource name. + // + // The format of this value varies depending on whether you have [specified a + // processing + // location](https://cloud.google.com/dlp/docs/specifying-location): + // + // + Projects scope, location specified:
+ // `projects/`PROJECT_ID`/locations/`LOCATION_ID + // + Projects scope, no location specified (defaults to global):
+ // `projects/`PROJECT_ID + // + // The following example `parent` string specifies a parent project with the + // identifier `example-project`, and specifies the `europe-west3` location + // for processing data: + // + // parent=projects/example-project/locations/europe-west3 + string parent = 4 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dlp.googleapis.com/DlpJob" + } + ]; + + // 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. + string filter = 1; + + // The standard list page size. + int32 page_size = 2; + + // The standard list page token. + string page_token = 3; + + // The type of job. Defaults to `DlpJobType.INSPECT` + DlpJobType type = 5; + + // 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` + string order_by = 6; + + // Deprecated. This field has no effect. + string location_id = 7; +} + +// The response message for listing DLP jobs. +message ListDlpJobsResponse { + // A list of DlpJobs that matches the specified filter in the request. + repeated DlpJob jobs = 1; + + // The standard List next-page token. + string next_page_token = 2; +} + +// The request message for canceling a DLP job. +message CancelDlpJobRequest { + // Required. The name of the DlpJob resource to be cancelled. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dlp.googleapis.com/DlpJob" + } + ]; +} + +// The request message for finishing a DLP hybrid job. +message FinishDlpJobRequest { + // Required. The name of the DlpJob resource to be cancelled. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dlp.googleapis.com/DlpJob" + } + ]; +} + +// The request message for deleting a DLP job. +message DeleteDlpJobRequest { + // Required. The name of the DlpJob resource to be deleted. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dlp.googleapis.com/DlpJob" + } + ]; +} + +// Request message for CreateDeidentifyTemplate. +message CreateDeidentifyTemplateRequest { + // Required. Parent resource name. + // + // The format of this value varies depending on the scope of the request + // (project or organization) and whether you have [specified a processing + // location](https://cloud.google.com/dlp/docs/specifying-location): + // + // + Projects scope, location specified:
+ // `projects/`PROJECT_ID`/locations/`LOCATION_ID + // + Projects scope, no location specified (defaults to global):
+ // `projects/`PROJECT_ID + // + Organizations scope, location specified:
+ // `organizations/`ORG_ID`/locations/`LOCATION_ID + // + Organizations scope, no location specified (defaults to global):
+ // `organizations/`ORG_ID + // + // The following example `parent` string specifies a parent project with the + // identifier `example-project`, and specifies the `europe-west3` location + // for processing data: + // + // parent=projects/example-project/locations/europe-west3 + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dlp.googleapis.com/DeidentifyTemplate" + } + ]; + + // Required. The DeidentifyTemplate to create. + DeidentifyTemplate deidentify_template = 2 [(google.api.field_behavior) = REQUIRED]; + + // 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. + string template_id = 3; + + // Deprecated. This field has no effect. + string location_id = 4; +} + +// Request message for UpdateDeidentifyTemplate. +message UpdateDeidentifyTemplateRequest { + // Required. Resource name of organization and deidentify template to be updated, for + // example `organizations/433245324/deidentifyTemplates/432452342` or + // projects/project-id/deidentifyTemplates/432452342. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dlp.googleapis.com/DeidentifyTemplate" + } + ]; + + // New DeidentifyTemplate value. + DeidentifyTemplate deidentify_template = 2; + + // Mask to control which fields get updated. + google.protobuf.FieldMask update_mask = 3; +} + +// Request message for GetDeidentifyTemplate. +message GetDeidentifyTemplateRequest { + // Required. Resource name of the organization and deidentify template to be read, for + // example `organizations/433245324/deidentifyTemplates/432452342` or + // projects/project-id/deidentifyTemplates/432452342. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dlp.googleapis.com/DeidentifyTemplate" + } + ]; +} + +// Request message for ListDeidentifyTemplates. +message ListDeidentifyTemplatesRequest { + // Required. Parent resource name. + // + // The format of this value varies depending on the scope of the request + // (project or organization) and whether you have [specified a processing + // location](https://cloud.google.com/dlp/docs/specifying-location): + // + // + Projects scope, location specified:
+ // `projects/`PROJECT_ID`/locations/`LOCATION_ID + // + Projects scope, no location specified (defaults to global):
+ // `projects/`PROJECT_ID + // + Organizations scope, location specified:
+ // `organizations/`ORG_ID`/locations/`LOCATION_ID + // + Organizations scope, no location specified (defaults to global):
+ // `organizations/`ORG_ID + // + // The following example `parent` string specifies a parent project with the + // identifier `example-project`, and specifies the `europe-west3` location + // for processing data: + // + // parent=projects/example-project/locations/europe-west3 + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dlp.googleapis.com/DeidentifyTemplate" + } + ]; + + // Page token to continue retrieval. Comes from previous call + // to `ListDeidentifyTemplates`. + string page_token = 2; + + // Size of the page, can be limited by server. If zero server returns + // a page of max size 100. + int32 page_size = 3; + + // 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. + string order_by = 4; + + // Deprecated. This field has no effect. + string location_id = 5; +} + +// Response message for ListDeidentifyTemplates. +message ListDeidentifyTemplatesResponse { + // List of deidentify templates, up to page_size in + // ListDeidentifyTemplatesRequest. + repeated DeidentifyTemplate deidentify_templates = 1; + + // If the next page is available then the next page token to be used + // in following ListDeidentifyTemplates request. + string next_page_token = 2; +} + +// Request message for DeleteDeidentifyTemplate. +message DeleteDeidentifyTemplateRequest { + // Required. Resource name of the organization and deidentify template to be deleted, + // for example `organizations/433245324/deidentifyTemplates/432452342` or + // projects/project-id/deidentifyTemplates/432452342. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dlp.googleapis.com/DeidentifyTemplate" + } + ]; +} + +// 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. +message LargeCustomDictionaryConfig { + // 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. + CloudStoragePath output_path = 1; + + oneof source { + // Set of files containing newline-delimited lists of dictionary phrases. + CloudStorageFileSet cloud_storage_file_set = 2; + + // Field in a BigQuery table where each cell represents a dictionary phrase. + BigQueryField big_query_field = 3; + } +} + +// Summary statistics of a custom dictionary. +message LargeCustomDictionaryStats { + // Approximate number of distinct phrases in the dictionary. + int64 approx_num_phrases = 1; +} + +// 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. +message StoredInfoTypeConfig { + // Display name of the StoredInfoType (max 256 characters). + string display_name = 1; + + // Description of the StoredInfoType (max 256 characters). + string description = 2; + + // Stored infotype types. + oneof type { + // StoredInfoType where findings are defined by a dictionary of phrases. + LargeCustomDictionaryConfig large_custom_dictionary = 3; + + // Store dictionary-based CustomInfoType. + CustomInfoType.Dictionary dictionary = 4; + + // Store regular expression-based StoredInfoType. + CustomInfoType.Regex regex = 5; + } +} + +// Statistics for a StoredInfoType. +message StoredInfoTypeStats { + // Stat types + oneof type { + // StoredInfoType where findings are defined by a dictionary of phrases. + LargeCustomDictionaryStats large_custom_dictionary = 1; + } +} + +// Version of a StoredInfoType, including the configuration used to build it, +// create timestamp, and current state. +message StoredInfoTypeVersion { + // StoredInfoType configuration. + StoredInfoTypeConfig config = 1; + + // Create timestamp of the version. Read-only, determined by the system + // when the version is created. + google.protobuf.Timestamp create_time = 2; + + // Stored info type version state. Read-only, updated by the system + // during dictionary creation. + StoredInfoTypeState state = 3; + + // 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. + repeated Error errors = 4; + + // Statistics about this storedInfoType version. + StoredInfoTypeStats stats = 5; +} + +// StoredInfoType resource message that contains information about the current +// version and any pending updates. +message StoredInfoType { + option (google.api.resource) = { + type: "dlp.googleapis.com/StoredInfoType" + pattern: "organizations/{organization}/storedInfoTypes/{stored_info_type}" + pattern: "projects/{project}/storedInfoTypes/{stored_info_type}" + pattern: "organizations/{organization}/locations/{location}/storedInfoTypes/{stored_info_type}" + pattern: "projects/{project}/locations/{location}/storedInfoTypes/{stored_info_type}" + }; + + // Resource name. + string name = 1; + + // Current version of the stored info type. + StoredInfoTypeVersion current_version = 2; + + // Pending versions of the stored info type. Empty if no versions are + // pending. + repeated StoredInfoTypeVersion pending_versions = 3; +} + +// Request message for CreateStoredInfoType. +message CreateStoredInfoTypeRequest { + // Required. Parent resource name. + // + // The format of this value varies depending on the scope of the request + // (project or organization) and whether you have [specified a processing + // location](https://cloud.google.com/dlp/docs/specifying-location): + // + // + Projects scope, location specified:
+ // `projects/`PROJECT_ID`/locations/`LOCATION_ID + // + Projects scope, no location specified (defaults to global):
+ // `projects/`PROJECT_ID + // + Organizations scope, location specified:
+ // `organizations/`ORG_ID`/locations/`LOCATION_ID + // + Organizations scope, no location specified (defaults to global):
+ // `organizations/`ORG_ID + // + // The following example `parent` string specifies a parent project with the + // identifier `example-project`, and specifies the `europe-west3` location + // for processing data: + // + // parent=projects/example-project/locations/europe-west3 + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dlp.googleapis.com/StoredInfoType" + } + ]; + + // Required. Configuration of the storedInfoType to create. + StoredInfoTypeConfig config = 2 [(google.api.field_behavior) = REQUIRED]; + + // 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. + string stored_info_type_id = 3; + + // Deprecated. This field has no effect. + string location_id = 4; +} + +// Request message for UpdateStoredInfoType. +message UpdateStoredInfoTypeRequest { + // Required. Resource name of organization and storedInfoType to be updated, for + // example `organizations/433245324/storedInfoTypes/432452342` or + // projects/project-id/storedInfoTypes/432452342. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dlp.googleapis.com/StoredInfoType" + } + ]; + + // Updated configuration for the storedInfoType. If not provided, a new + // version of the storedInfoType will be created with the existing + // configuration. + StoredInfoTypeConfig config = 2; + + // Mask to control which fields get updated. + google.protobuf.FieldMask update_mask = 3; +} + +// Request message for GetStoredInfoType. +message GetStoredInfoTypeRequest { + // Required. Resource name of the organization and storedInfoType to be read, for + // example `organizations/433245324/storedInfoTypes/432452342` or + // projects/project-id/storedInfoTypes/432452342. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dlp.googleapis.com/StoredInfoType" + } + ]; +} + +// Request message for ListStoredInfoTypes. +message ListStoredInfoTypesRequest { + // Required. Parent resource name. + // + // The format of this value varies depending on the scope of the request + // (project or organization) and whether you have [specified a processing + // location](https://cloud.google.com/dlp/docs/specifying-location): + // + // + Projects scope, location specified:
+ // `projects/`PROJECT_ID`/locations/`LOCATION_ID + // + Projects scope, no location specified (defaults to global):
+ // `projects/`PROJECT_ID + // + Organizations scope, location specified:
+ // `organizations/`ORG_ID`/locations/`LOCATION_ID + // + Organizations scope, no location specified (defaults to global):
+ // `organizations/`ORG_ID + // + // The following example `parent` string specifies a parent project with the + // identifier `example-project`, and specifies the `europe-west3` location + // for processing data: + // + // parent=projects/example-project/locations/europe-west3 + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dlp.googleapis.com/StoredInfoType" + } + ]; + + // Page token to continue retrieval. Comes from previous call + // to `ListStoredInfoTypes`. + string page_token = 2; + + // Size of the page, can be limited by server. If zero server returns + // a page of max size 100. + int32 page_size = 3; + + // 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. + string order_by = 4; + + // Deprecated. This field has no effect. + string location_id = 5; +} + +// Response message for ListStoredInfoTypes. +message ListStoredInfoTypesResponse { + // List of storedInfoTypes, up to page_size in ListStoredInfoTypesRequest. + repeated StoredInfoType stored_info_types = 1; + + // If the next page is available then the next page token to be used + // in following ListStoredInfoTypes request. + string next_page_token = 2; +} + +// Request message for DeleteStoredInfoType. +message DeleteStoredInfoTypeRequest { + // Required. Resource name of the organization and storedInfoType to be deleted, for + // example `organizations/433245324/storedInfoTypes/432452342` or + // projects/project-id/storedInfoTypes/432452342. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dlp.googleapis.com/StoredInfoType" + } + ]; +} + +// Request to search for potentially sensitive info in a custom location. +message HybridInspectJobTriggerRequest { + // Required. Resource name of the trigger to execute a hybrid inspect on, for example + // `projects/dlp-test-project/jobTriggers/53234423`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dlp.googleapis.com/JobTrigger" + } + ]; + + // The item to inspect. + HybridContentItem hybrid_item = 3; +} + +// Request to search for potentially sensitive info in a custom location. +message HybridInspectDlpJobRequest { + // Required. Resource name of the job to execute a hybrid inspect on, for example + // `projects/dlp-test-project/dlpJob/53234423`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dlp.googleapis.com/DlpJob" + } + ]; + + // The item to inspect. + HybridContentItem hybrid_item = 3; +} + +// An individual hybrid item to inspect. Will be stored temporarily during +// processing. +message HybridContentItem { + // The item to inspect. + ContentItem item = 1; + + // Supplementary information that will be added to each finding. + HybridFindingDetails finding_details = 2; +} + +// Populate to associate additional data with each finding. +message HybridFindingDetails { + // Details about the container where the content being inspected is from. + Container container_details = 1; + + // Offset in bytes of the line, from the beginning of the file, where the + // finding is located. Populate if the item being scanned is only part of a + // bigger item, such as a shard of a file and you want to track the absolute + // position of the finding. + int64 file_offset = 2; + + // Offset of the row for tables. Populate if the row(s) being scanned are + // part of a bigger dataset and you want to keep track of their absolute + // position. + int64 row_offset = 3; + + // If the container is a table, additional information to make findings + // meaningful such as the columns that are primary keys. If not known ahead + // of time, can also be set within each inspect hybrid call and the two + // will be merged. Note that identifying_fields will only be stored to + // BigQuery, and only if the BigQuery action has been included. + TableOptions table_options = 4; + + // Labels to represent user provided metadata about the data being inspected. + // If configured by the job, some key values may be required. + // The labels associated with `Finding`'s produced by hybrid + // inspection. + // + // Label keys must be between 1 and 63 characters long and must conform + // to the following regular expression: `[a-z]([-a-z0-9]*[a-z0-9])?`. + // + // Label values must be between 0 and 63 characters long and must conform + // to the regular expression `([a-z]([-a-z0-9]*[a-z0-9])?)?`. + // + // No more than 10 labels can be associated with a given finding. + // + // Examples: + // * `"environment" : "production"` + // * `"pipeline" : "etl"` + map labels = 5; +} + +// Quota exceeded errors will be thrown once quota has been met. +message HybridInspectResponse { + +} + +// Operators available for comparing the value of fields. +enum 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; +} + +// 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 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; +} + +// Deprecated and unused. +enum 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; +} + +// Type of metadata containing the finding. +enum MetadataType { + // Unused + METADATATYPE_UNSPECIFIED = 0; + + // General file metadata provided by Cloud Storage. + STORAGE_METADATA = 2; +} + +// Parts of the APIs which use certain infoTypes. +enum InfoTypeSupportedBy { + // Unused. + ENUM_TYPE_UNSPECIFIED = 0; + + // Supported by the inspect operations. + INSPECT = 1; + + // Supported by the risk analysis operations. + RISK_ANALYSIS = 2; +} + +// An enum to represent the various types of DLP jobs. +enum DlpJobType { + // Defaults to INSPECT_JOB. + 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; +} + +// State of a StoredInfoType version. +enum 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; +} diff --git a/owl-bot-staging/v2/protos/google/privacy/dlp/v2/storage.proto b/owl-bot-staging/v2/protos/google/privacy/dlp/v2/storage.proto new file mode 100644 index 00000000..5c338088 --- /dev/null +++ b/owl-bot-staging/v2/protos/google/privacy/dlp/v2/storage.proto @@ -0,0 +1,755 @@ +// Copyright 2022 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. + +syntax = "proto3"; + +package google.privacy.dlp.v2; + +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.Dlp.V2"; +option go_package = "google.golang.org/genproto/googleapis/privacy/dlp/v2;dlp"; +option java_multiple_files = true; +option java_outer_classname = "DlpStorage"; +option java_package = "com.google.privacy.dlp.v2"; +option php_namespace = "Google\\Cloud\\Dlp\\V2"; +option ruby_package = "Google::Cloud::Dlp::V2"; + +// Type of information detected by the API. +message InfoType { + // 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. When sending Cloud DLP results to Data Catalog, infoType + // names should conform to the pattern `[A-Za-z0-9$-_]{1,64}`. + string name = 1; + + // Optional version name for this InfoType. + string version = 2; +} + +// 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 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; +} + +// A reference to a StoredInfoType to use with scanning. +message StoredType { + // Resource name of the requested `StoredInfoType`, for example + // `organizations/433245324/storedInfoTypes/432452342` or + // `projects/project-id/storedInfoTypes/432452342`. + string name = 1; + + // Timestamp indicating when the version of the `StoredInfoType` used for + // inspection was created. Output-only field, populated by the system. + google.protobuf.Timestamp create_time = 2; +} + +// Custom information type provided by the user. Used to find domain-specific +// sensitive information configurable to the data in question. +message CustomInfoType { + // 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. + message Dictionary { + // Message defining a list of words or phrases to search for in the data. + message WordList { + // 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] + repeated string words = 1; + } + + oneof source { + // List of words or phrases to search for. + WordList word_list = 1; + + // Newline-delimited file of words in Cloud Storage. Only a single file + // is accepted. + CloudStoragePath cloud_storage_path = 3; + } + } + + // Message defining a custom regular expression. + message Regex { + // Pattern defining the regular expression. Its syntax + // (https://github.com/google/re2/wiki/Syntax) can be found under the + // google/re2 repository on GitHub. + string pattern = 1; + + // The index of the submatch to extract as findings. When not + // specified, the entire match is returned. No more than 3 may be included. + repeated int32 group_indexes = 2; + } + + // 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`. + message SurrogateType { + + } + + // 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. + message DetectionRule { + // Message for specifying a window around a finding to apply a detection + // rule. + message Proximity { + // Number of characters before the finding to consider. + int32 window_before = 1; + + // Number of characters after the finding to consider. + int32 window_after = 2; + } + + // Message for specifying an adjustment to the likelihood of a finding as + // part of a detection rule. + message LikelihoodAdjustment { + oneof adjustment { + // Set the likelihood of a finding to a fixed value. + Likelihood fixed_likelihood = 1; + + // 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`. + int32 relative_likelihood = 2; + } + } + + // The rule that adjusts the likelihood of findings within a certain + // proximity of hotwords. + message HotwordRule { + // Regular expression pattern defining what qualifies as a hotword. + Regex hotword_regex = 1; + + // 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. + Proximity proximity = 2; + + // Likelihood adjustment to apply to all matching findings. + LikelihoodAdjustment likelihood_adjustment = 3; + } + + oneof type { + // Hotword-based detection rule. + HotwordRule hotword_rule = 1; + } + } + + enum 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; + } + + // 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. + InfoType info_type = 1; + + // 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. + Likelihood likelihood = 6; + + oneof type { + // A list of phrases to detect as a CustomInfoType. + Dictionary dictionary = 2; + + // Regular expression based CustomInfoType. + Regex regex = 3; + + // Message for detecting output from deidentification transformations that + // support reversing. + SurrogateType surrogate_type = 4; + + // Load an existing `StoredInfoType` resource for use in + // `InspectDataSource`. Not currently supported in `InspectContent`. + StoredType stored_type = 5; + } + + // 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. + repeated DetectionRule detection_rules = 7; + + // If set to EXCLUSION_TYPE_EXCLUDE this infoType will not cause a finding + // to be returned. It still can be used for rules matching. + ExclusionType exclusion_type = 8; +} + +// General identifier of a data field in a storage service. +message FieldId { + // Name describing the field. + string name = 1; +} + +// 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. +message PartitionId { + // The ID of the project to which the entities belong. + string project_id = 2; + + // If not empty, the ID of the namespace to which the entities belong. + string namespace_id = 4; +} + +// A representation of a Datastore kind. +message KindExpression { + // The name of the kind. + string name = 1; +} + +// Options defining a data set within Google Cloud Datastore. +message DatastoreOptions { + // A partition ID identifies a grouping of entities. The grouping is always + // by project and namespace, however the namespace ID may be empty. + PartitionId partition_id = 1; + + // The kind to process. + KindExpression kind = 2; +} + +// Definitions of file type groups to scan. New types will be added to this +// list. +enum FileType { + // Includes all files. + FILE_TYPE_UNSPECIFIED = 0; + + // Includes all file extensions not covered by another entry. Binary + // scanning attempts to convert the content of the file to utf_8 to scan + // the file. + // If you wish to avoid this fall back, specify one or more of the other + // FileType's in your storage scan. + BINARY_FILE = 1; + + // Included file extensions: + // asc,asp, aspx, brf, c, cc,cfm, cgi, cpp, csv, cxx, c++, cs, css, dart, + // dat, dot, eml,, epbub, ged, go, h, hh, hpp, hxx, h++, hs, html, htm, + // mkd, markdown, m, ml, mli, perl, pl, plist, pm, php, phtml, pht, + // properties, py, pyw, rb, rbw, rs, rss, rc, scala, sh, sql, swift, tex, + // shtml, shtm, xhtml, lhs, ics, ini, java, js, json, kix, kml, ocaml, md, + // txt, text, tsv, vb, vcard, vcs, wml, xcodeproj, 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 inspection is restricted to 'global', 'us', 'asia', and 'europe'. + IMAGE = 3; + + // Word files >30 MB will be scanned as binary files. + // Included file extensions: + // docx, dotx, docm, dotm + WORD = 5; + + // PDF files >30 MB will be scanned as binary files. + // Included file extensions: + // pdf + PDF = 6; + + // Included file extensions: + // avro + AVRO = 7; + + // Included file extensions: + // csv + CSV = 8; + + // Included file extensions: + // tsv + TSV = 9; + + // Powerpoint files >30 MB will be scanned as binary files. + // Included file extensions: + // pptx, pptm, potx, potm, pot + POWERPOINT = 11; + + // Excel files >30 MB will be scanned as binary files. + // Included file extensions: + // xlsx, xlsm, xltx, xltm + EXCEL = 12; +} + +// 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 `/` +message CloudStorageRegexFileSet { + // The name of a Cloud Storage bucket. Required. + string bucket_name = 1; + + // 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. + repeated string include_regex = 2; + + // 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. + repeated string exclude_regex = 3; +} + +// Options defining a file or a set of files within a Google Cloud Storage +// bucket. +message CloudStorageOptions { + // Set of files to scan. + message FileSet { + // 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. + string url = 1; + + // The regex-filtered set of files to scan. Exactly one of `url` or + // `regex_file_set` must be set. + CloudStorageRegexFileSet regex_file_set = 2; + } + + // 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 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; + } + + // The set of one or more files to scan. + FileSet file_set = 1; + + // 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. + // Cannot be set if de-identification is requested. + int64 bytes_limit_per_file = 4; + + // 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. + // Cannot be set if de-identification is requested. + int32 bytes_limit_per_file_percent = 8; + + // 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. + // Images are scanned only as binary if the specified region + // does not support image inspection and no file_types were specified. + // Image inspection is restricted to 'global', 'us', 'asia', and 'europe'. + repeated FileType file_types = 5; + + SampleMethod sample_method = 6; + + // 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. + int32 files_limit_percent = 7; +} + +// Message representing a set of files in Cloud Storage. +message CloudStorageFileSet { + // The url, in the format `gs:///`. Trailing wildcard in the + // path is allowed. + string url = 1; +} + +// Message representing a single file or path in Cloud Storage. +message CloudStoragePath { + // A url representing a file or path (no wildcards) in Cloud Storage. + // Example: gs://[BUCKET_NAME]/dictionary.txt + string path = 1; +} + +// Options defining BigQuery table and row identifiers. +message BigQueryOptions { + // 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, rows are scanned in the order BigQuery reads them. + enum SampleMethod { + SAMPLE_METHOD_UNSPECIFIED = 0; + + // Scan groups of rows in the order BigQuery provides (default). Multiple + // groups of rows may be scanned in parallel, so results may not appear in + // the same order the rows are read. + TOP = 1; + + // Randomly pick groups of rows to scan. + RANDOM_START = 2; + } + + // Complete BigQuery table reference. + BigQueryTable table_reference = 1; + + // Table fields that may uniquely identify a row within the table. When + // `actions.saveFindings.outputConfig.table` is specified, the values of + // columns specified here are available in the output table under + // `location.content_locations.record_location.record_key.id_values`. Nested + // fields such as `person.birthdate.year` are allowed. + repeated FieldId identifying_fields = 2; + + // 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. + int64 rows_limit = 3; + + // 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. + int32 rows_limit_percent = 6; + + SampleMethod sample_method = 4; + + // References to fields excluded from scanning. This allows you to skip + // inspection of entire columns which you know have no findings. + repeated FieldId excluded_fields = 5; + + // Limit scanning only to these fields. + repeated FieldId included_fields = 7; +} + +// Shared message indicating Cloud storage type. +message StorageConfig { + // Configuration of the timespan of the items to include in scanning. + // Currently only supported when inspecting Google Cloud Storage and BigQuery. + message TimespanConfig { + // Exclude files, tables, or rows older than this value. + // If not set, no lower time limit is applied. + google.protobuf.Timestamp start_time = 1; + + // Exclude files, tables, or rows newer than this value. + // If not set, no upper time limit is applied. + google.protobuf.Timestamp end_time = 2; + + // Specification of the field containing the timestamp of scanned items. + // Used for data sources like Datastore and BigQuery. + // + // For BigQuery: + // If this value is not specified and the table was modified between the + // given start and end times, the entire table will be scanned. If this + // value is specified, then rows are filtered based on the given start and + // end times. Rows with a `NULL` value in the provided BigQuery column are + // skipped. + // Valid data types of the provided BigQuery column are: `INTEGER`, `DATE`, + // `TIMESTAMP`, and `DATETIME`. + // + // For Datastore: + // If this value is specified, then entities are filtered based on the given + // start and end times. If an entity does not contain the provided timestamp + // property or contains empty or invalid values, then it is included. + // Valid data types of the provided timestamp property are: `TIMESTAMP`. + FieldId timestamp_field = 3; + + // 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. + bool enable_auto_population_of_timespan_config = 4; + } + + oneof type { + // Google Cloud Datastore options. + DatastoreOptions datastore_options = 2; + + // Google Cloud Storage options. + CloudStorageOptions cloud_storage_options = 3; + + // BigQuery options. + BigQueryOptions big_query_options = 4; + + // Hybrid inspection options. + HybridOptions hybrid_options = 9; + } + + TimespanConfig timespan_config = 6; +} + +// Configuration to control jobs where the content being inspected is outside +// of Google Cloud Platform. +message HybridOptions { + // A short description of where the data is coming from. Will be stored once + // in the job. 256 max length. + string description = 1; + + // These are labels that each inspection request must include within their + // 'finding_labels' map. Request may contain others, but any missing one of + // these will be rejected. + // + // Label keys must be between 1 and 63 characters long and must conform + // to the following regular expression: `[a-z]([-a-z0-9]*[a-z0-9])?`. + // + // No more than 10 keys can be required. + repeated string required_finding_label_keys = 2; + + // To organize findings, these labels will be added to each finding. + // + // Label keys must be between 1 and 63 characters long and must conform + // to the following regular expression: `[a-z]([-a-z0-9]*[a-z0-9])?`. + // + // Label values must be between 0 and 63 characters long and must conform + // to the regular expression `([a-z]([-a-z0-9]*[a-z0-9])?)?`. + // + // No more than 10 labels can be associated with a given finding. + // + // Examples: + // * `"environment" : "production"` + // * `"pipeline" : "etl"` + map labels = 3; + + // If the container is a table, additional information to make findings + // meaningful such as the columns that are primary keys. + TableOptions table_options = 4; +} + +// Row key for identifying a record in BigQuery table. +message BigQueryKey { + // Complete BigQuery table reference. + BigQueryTable table_reference = 1; + + // Row number inferred at the time the table was scanned. This value is + // nondeterministic, cannot be queried, and may be null for inspection + // jobs. To locate findings within a table, specify + // `inspect_job.storage_config.big_query_options.identifying_fields` in + // `CreateDlpJobRequest`. + int64 row_number = 2; +} + +// Record key for a finding in Cloud Datastore. +message DatastoreKey { + // Datastore entity key. + Key entity_key = 1; +} + +// 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. +message Key { + // 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. + message PathElement { + // 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 `""`. + string kind = 1; + + // The type of ID. + oneof id_type { + // 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. + int64 id = 2; + + // 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 `""`. + string name = 3; + } + } + + // Entities are partitioned into subsets, currently identified by a project + // ID and namespace ID. + // Queries are scoped to a single partition. + PartitionId partition_id = 1; + + // 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. + repeated PathElement path = 2; +} + +// Message for a unique key indicating a record that contains a finding. +message RecordKey { + oneof type { + DatastoreKey datastore_key = 2; + + BigQueryKey big_query_key = 3; + } + + // Values of identifying columns in the given row. Order of values matches + // the order of `identifying_fields` specified in the scanning request. + repeated string id_values = 5; +} + +// 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 +// `..`. +message BigQueryTable { + // The Google Cloud Platform project ID of the project containing the table. + // If omitted, project ID is inferred from the API call. + string project_id = 1; + + // Dataset ID of the table. + string dataset_id = 2; + + // Name of the table. + string table_id = 3; +} + +// Message defining a field of a BigQuery table. +message BigQueryField { + // Source table of the field. + BigQueryTable table = 1; + + // Designated field in the BigQuery table. + FieldId field = 2; +} + +// 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. +message EntityId { + // Composite key indicating which field contains the entity identifier. + FieldId field = 1; +} + +// Instructions regarding the table content being inspected. +message TableOptions { + // The columns that are the primary keys for table objects included in + // ContentItem. A copy of this cell's value will stored alongside alongside + // each finding so that the finding can be traced to the specific row it came + // from. No more than 3 may be provided. + repeated FieldId identifying_fields = 1; +} diff --git a/owl-bot-staging/v2/samples/generated/v2/dlp_service.activate_job_trigger.js b/owl-bot-staging/v2/samples/generated/v2/dlp_service.activate_job_trigger.js new file mode 100644 index 00000000..1609743f --- /dev/null +++ b/owl-bot-staging/v2/samples/generated/v2/dlp_service.activate_job_trigger.js @@ -0,0 +1,59 @@ +// Copyright 2022 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. ** + + + +'use strict'; + +function main(name) { + // [START dlp_v2_generated_DlpService_ActivateJobTrigger_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Resource name of the trigger to activate, for example + * `projects/dlp-test-project/jobTriggers/53234423`. + */ + // const name = 'abc123' + + // Imports the Dlp library + const {DlpServiceClient} = require('@google-cloud/dlp').v2; + + // Instantiates a client + const dlpClient = new DlpServiceClient(); + + async function callActivateJobTrigger() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await dlpClient.activateJobTrigger(request); + console.log(response); + } + + callActivateJobTrigger(); + // [END dlp_v2_generated_DlpService_ActivateJobTrigger_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v2/samples/generated/v2/dlp_service.cancel_dlp_job.js b/owl-bot-staging/v2/samples/generated/v2/dlp_service.cancel_dlp_job.js new file mode 100644 index 00000000..b40ab6b7 --- /dev/null +++ b/owl-bot-staging/v2/samples/generated/v2/dlp_service.cancel_dlp_job.js @@ -0,0 +1,58 @@ +// Copyright 2022 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. ** + + + +'use strict'; + +function main(name) { + // [START dlp_v2_generated_DlpService_CancelDlpJob_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the DlpJob resource to be cancelled. + */ + // const name = 'abc123' + + // Imports the Dlp library + const {DlpServiceClient} = require('@google-cloud/dlp').v2; + + // Instantiates a client + const dlpClient = new DlpServiceClient(); + + async function callCancelDlpJob() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await dlpClient.cancelDlpJob(request); + console.log(response); + } + + callCancelDlpJob(); + // [END dlp_v2_generated_DlpService_CancelDlpJob_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v2/samples/generated/v2/dlp_service.create_deidentify_template.js b/owl-bot-staging/v2/samples/generated/v2/dlp_service.create_deidentify_template.js new file mode 100644 index 00000000..2e383d1e --- /dev/null +++ b/owl-bot-staging/v2/samples/generated/v2/dlp_service.create_deidentify_template.js @@ -0,0 +1,85 @@ +// Copyright 2022 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. ** + + + +'use strict'; + +function main(parent, deidentifyTemplate) { + // [START dlp_v2_generated_DlpService_CreateDeidentifyTemplate_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Parent resource name. + * The format of this value varies depending on the scope of the request + * (project or organization) and whether you have specified a processing + * location (https://cloud.google.com/dlp/docs/specifying-location): + * + Projects scope, location specified:
+ * `projects/`PROJECT_ID`/locations/`LOCATION_ID + * + Projects scope, no location specified (defaults to global):
+ * `projects/`PROJECT_ID + * + Organizations scope, location specified:
+ * `organizations/`ORG_ID`/locations/`LOCATION_ID + * + Organizations scope, no location specified (defaults to global):
+ * `organizations/`ORG_ID + * The following example `parent` string specifies a parent project with the + * identifier `example-project`, and specifies the `europe-west3` location + * for processing data: + * parent=projects/example-project/locations/europe-west3 + */ + // const parent = 'abc123' + /** + * Required. The DeidentifyTemplate to create. + */ + // const deidentifyTemplate = {} + /** + * The template id can contain uppercase and lowercase letters, + * numbers, and hyphens; that is, it must match the regular + * expression: `[a-zA-Z\d-_]+`. The maximum length is 100 + * characters. Can be empty to allow the system to generate one. + */ + // const templateId = 'abc123' + + // Imports the Dlp library + const {DlpServiceClient} = require('@google-cloud/dlp').v2; + + // Instantiates a client + const dlpClient = new DlpServiceClient(); + + async function callCreateDeidentifyTemplate() { + // Construct request + const request = { + parent, + deidentifyTemplate, + }; + + // Run request + const response = await dlpClient.createDeidentifyTemplate(request); + console.log(response); + } + + callCreateDeidentifyTemplate(); + // [END dlp_v2_generated_DlpService_CreateDeidentifyTemplate_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v2/samples/generated/v2/dlp_service.create_dlp_job.js b/owl-bot-staging/v2/samples/generated/v2/dlp_service.create_dlp_job.js new file mode 100644 index 00000000..38181d0f --- /dev/null +++ b/owl-bot-staging/v2/samples/generated/v2/dlp_service.create_dlp_job.js @@ -0,0 +1,85 @@ +// Copyright 2022 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. ** + + + +'use strict'; + +function main(parent) { + // [START dlp_v2_generated_DlpService_CreateDlpJob_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Parent resource name. + * The format of this value varies depending on whether you have specified a + * processing + * location (https://cloud.google.com/dlp/docs/specifying-location): + * + Projects scope, location specified:
+ * `projects/`PROJECT_ID`/locations/`LOCATION_ID + * + Projects scope, no location specified (defaults to global):
+ * `projects/`PROJECT_ID + * The following example `parent` string specifies a parent project with the + * identifier `example-project`, and specifies the `europe-west3` location + * for processing data: + * parent=projects/example-project/locations/europe-west3 + */ + // const parent = 'abc123' + /** + * An inspection job scans a storage repository for InfoTypes. + */ + // const inspectJob = {} + /** + * A risk analysis job calculates re-identification risk metrics for a + * BigQuery table. + */ + // const riskJob = {} + /** + * The job id can contain uppercase and lowercase letters, + * numbers, and hyphens; that is, it must match the regular + * expression: `[a-zA-Z\d-_]+`. The maximum length is 100 + * characters. Can be empty to allow the system to generate one. + */ + // const jobId = 'abc123' + + // Imports the Dlp library + const {DlpServiceClient} = require('@google-cloud/dlp').v2; + + // Instantiates a client + const dlpClient = new DlpServiceClient(); + + async function callCreateDlpJob() { + // Construct request + const request = { + parent, + }; + + // Run request + const response = await dlpClient.createDlpJob(request); + console.log(response); + } + + callCreateDlpJob(); + // [END dlp_v2_generated_DlpService_CreateDlpJob_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v2/samples/generated/v2/dlp_service.create_inspect_template.js b/owl-bot-staging/v2/samples/generated/v2/dlp_service.create_inspect_template.js new file mode 100644 index 00000000..e15f5f3f --- /dev/null +++ b/owl-bot-staging/v2/samples/generated/v2/dlp_service.create_inspect_template.js @@ -0,0 +1,85 @@ +// Copyright 2022 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. ** + + + +'use strict'; + +function main(parent, inspectTemplate) { + // [START dlp_v2_generated_DlpService_CreateInspectTemplate_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Parent resource name. + * The format of this value varies depending on the scope of the request + * (project or organization) and whether you have specified a processing + * location (https://cloud.google.com/dlp/docs/specifying-location): + * + Projects scope, location specified:
+ * `projects/`PROJECT_ID`/locations/`LOCATION_ID + * + Projects scope, no location specified (defaults to global):
+ * `projects/`PROJECT_ID + * + Organizations scope, location specified:
+ * `organizations/`ORG_ID`/locations/`LOCATION_ID + * + Organizations scope, no location specified (defaults to global):
+ * `organizations/`ORG_ID + * The following example `parent` string specifies a parent project with the + * identifier `example-project`, and specifies the `europe-west3` location + * for processing data: + * parent=projects/example-project/locations/europe-west3 + */ + // const parent = 'abc123' + /** + * Required. The InspectTemplate to create. + */ + // const inspectTemplate = {} + /** + * The template id can contain uppercase and lowercase letters, + * numbers, and hyphens; that is, it must match the regular + * expression: `[a-zA-Z\d-_]+`. The maximum length is 100 + * characters. Can be empty to allow the system to generate one. + */ + // const templateId = 'abc123' + + // Imports the Dlp library + const {DlpServiceClient} = require('@google-cloud/dlp').v2; + + // Instantiates a client + const dlpClient = new DlpServiceClient(); + + async function callCreateInspectTemplate() { + // Construct request + const request = { + parent, + inspectTemplate, + }; + + // Run request + const response = await dlpClient.createInspectTemplate(request); + console.log(response); + } + + callCreateInspectTemplate(); + // [END dlp_v2_generated_DlpService_CreateInspectTemplate_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v2/samples/generated/v2/dlp_service.create_job_trigger.js b/owl-bot-staging/v2/samples/generated/v2/dlp_service.create_job_trigger.js new file mode 100644 index 00000000..41a52f6c --- /dev/null +++ b/owl-bot-staging/v2/samples/generated/v2/dlp_service.create_job_trigger.js @@ -0,0 +1,81 @@ +// Copyright 2022 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. ** + + + +'use strict'; + +function main(parent, jobTrigger) { + // [START dlp_v2_generated_DlpService_CreateJobTrigger_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Parent resource name. + * The format of this value varies depending on whether you have specified a + * processing + * location (https://cloud.google.com/dlp/docs/specifying-location): + * + Projects scope, location specified:
+ * `projects/`PROJECT_ID`/locations/`LOCATION_ID + * + Projects scope, no location specified (defaults to global):
+ * `projects/`PROJECT_ID + * The following example `parent` string specifies a parent project with the + * identifier `example-project`, and specifies the `europe-west3` location + * for processing data: + * parent=projects/example-project/locations/europe-west3 + */ + // const parent = 'abc123' + /** + * Required. The JobTrigger to create. + */ + // const jobTrigger = {} + /** + * The trigger id can contain uppercase and lowercase letters, + * numbers, and hyphens; that is, it must match the regular + * expression: `[a-zA-Z\d-_]+`. The maximum length is 100 + * characters. Can be empty to allow the system to generate one. + */ + // const triggerId = 'abc123' + + // Imports the Dlp library + const {DlpServiceClient} = require('@google-cloud/dlp').v2; + + // Instantiates a client + const dlpClient = new DlpServiceClient(); + + async function callCreateJobTrigger() { + // Construct request + const request = { + parent, + jobTrigger, + }; + + // Run request + const response = await dlpClient.createJobTrigger(request); + console.log(response); + } + + callCreateJobTrigger(); + // [END dlp_v2_generated_DlpService_CreateJobTrigger_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v2/samples/generated/v2/dlp_service.create_stored_info_type.js b/owl-bot-staging/v2/samples/generated/v2/dlp_service.create_stored_info_type.js new file mode 100644 index 00000000..b6347744 --- /dev/null +++ b/owl-bot-staging/v2/samples/generated/v2/dlp_service.create_stored_info_type.js @@ -0,0 +1,85 @@ +// Copyright 2022 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. ** + + + +'use strict'; + +function main(parent, config) { + // [START dlp_v2_generated_DlpService_CreateStoredInfoType_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Parent resource name. + * The format of this value varies depending on the scope of the request + * (project or organization) and whether you have specified a processing + * location (https://cloud.google.com/dlp/docs/specifying-location): + * + Projects scope, location specified:
+ * `projects/`PROJECT_ID`/locations/`LOCATION_ID + * + Projects scope, no location specified (defaults to global):
+ * `projects/`PROJECT_ID + * + Organizations scope, location specified:
+ * `organizations/`ORG_ID`/locations/`LOCATION_ID + * + Organizations scope, no location specified (defaults to global):
+ * `organizations/`ORG_ID + * The following example `parent` string specifies a parent project with the + * identifier `example-project`, and specifies the `europe-west3` location + * for processing data: + * parent=projects/example-project/locations/europe-west3 + */ + // const parent = 'abc123' + /** + * Required. Configuration of the storedInfoType to create. + */ + // const config = {} + /** + * The storedInfoType ID can contain uppercase and lowercase letters, + * numbers, and hyphens; that is, it must match the regular + * expression: `[a-zA-Z\d-_]+`. The maximum length is 100 + * characters. Can be empty to allow the system to generate one. + */ + // const storedInfoTypeId = 'abc123' + + // Imports the Dlp library + const {DlpServiceClient} = require('@google-cloud/dlp').v2; + + // Instantiates a client + const dlpClient = new DlpServiceClient(); + + async function callCreateStoredInfoType() { + // Construct request + const request = { + parent, + config, + }; + + // Run request + const response = await dlpClient.createStoredInfoType(request); + console.log(response); + } + + callCreateStoredInfoType(); + // [END dlp_v2_generated_DlpService_CreateStoredInfoType_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v2/samples/generated/v2/dlp_service.deidentify_content.js b/owl-bot-staging/v2/samples/generated/v2/dlp_service.deidentify_content.js new file mode 100644 index 00000000..c74b1d6d --- /dev/null +++ b/owl-bot-staging/v2/samples/generated/v2/dlp_service.deidentify_content.js @@ -0,0 +1,100 @@ +// Copyright 2022 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. ** + + + +'use strict'; + +function main() { + // [START dlp_v2_generated_DlpService_DeidentifyContent_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Parent resource name. + * The format of this value varies depending on whether you have specified a + * processing + * location (https://cloud.google.com/dlp/docs/specifying-location): + * + Projects scope, location specified:
+ * `projects/`PROJECT_ID`/locations/`LOCATION_ID + * + Projects scope, no location specified (defaults to global):
+ * `projects/`PROJECT_ID + * The following example `parent` string specifies a parent project with the + * identifier `example-project`, and specifies the `europe-west3` location + * for processing data: + * parent=projects/example-project/locations/europe-west3 + */ + // const parent = 'abc123' + /** + * Configuration for the de-identification of the content item. + * Items specified here will override the template referenced by the + * deidentify_template_name argument. + */ + // const deidentifyConfig = {} + /** + * Configuration for the inspector. + * Items specified here will override the template referenced by the + * inspect_template_name argument. + */ + // const inspectConfig = {} + /** + * The item to de-identify. Will be treated as text. + */ + // const item = {} + /** + * Template to use. Any configuration directly specified in + * inspect_config will override those set in the template. Singular fields + * that are set in this request will replace their corresponding fields in the + * template. Repeated fields are appended. Singular sub-messages and groups + * are recursively merged. + */ + // const inspectTemplateName = 'abc123' + /** + * Template to use. Any configuration directly specified in + * deidentify_config will override those set in the template. Singular fields + * that are set in this request will replace their corresponding fields in the + * template. Repeated fields are appended. Singular sub-messages and groups + * are recursively merged. + */ + // const deidentifyTemplateName = 'abc123' + + // Imports the Dlp library + const {DlpServiceClient} = require('@google-cloud/dlp').v2; + + // Instantiates a client + const dlpClient = new DlpServiceClient(); + + async function callDeidentifyContent() { + // Construct request + const request = { + }; + + // Run request + const response = await dlpClient.deidentifyContent(request); + console.log(response); + } + + callDeidentifyContent(); + // [END dlp_v2_generated_DlpService_DeidentifyContent_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v2/samples/generated/v2/dlp_service.delete_deidentify_template.js b/owl-bot-staging/v2/samples/generated/v2/dlp_service.delete_deidentify_template.js new file mode 100644 index 00000000..a3cefacc --- /dev/null +++ b/owl-bot-staging/v2/samples/generated/v2/dlp_service.delete_deidentify_template.js @@ -0,0 +1,60 @@ +// Copyright 2022 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. ** + + + +'use strict'; + +function main(name) { + // [START dlp_v2_generated_DlpService_DeleteDeidentifyTemplate_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Resource name of the organization and deidentify template to be deleted, + * for example `organizations/433245324/deidentifyTemplates/432452342` or + * projects/project-id/deidentifyTemplates/432452342. + */ + // const name = 'abc123' + + // Imports the Dlp library + const {DlpServiceClient} = require('@google-cloud/dlp').v2; + + // Instantiates a client + const dlpClient = new DlpServiceClient(); + + async function callDeleteDeidentifyTemplate() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await dlpClient.deleteDeidentifyTemplate(request); + console.log(response); + } + + callDeleteDeidentifyTemplate(); + // [END dlp_v2_generated_DlpService_DeleteDeidentifyTemplate_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v2/samples/generated/v2/dlp_service.delete_dlp_job.js b/owl-bot-staging/v2/samples/generated/v2/dlp_service.delete_dlp_job.js new file mode 100644 index 00000000..95626de2 --- /dev/null +++ b/owl-bot-staging/v2/samples/generated/v2/dlp_service.delete_dlp_job.js @@ -0,0 +1,58 @@ +// Copyright 2022 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. ** + + + +'use strict'; + +function main(name) { + // [START dlp_v2_generated_DlpService_DeleteDlpJob_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the DlpJob resource to be deleted. + */ + // const name = 'abc123' + + // Imports the Dlp library + const {DlpServiceClient} = require('@google-cloud/dlp').v2; + + // Instantiates a client + const dlpClient = new DlpServiceClient(); + + async function callDeleteDlpJob() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await dlpClient.deleteDlpJob(request); + console.log(response); + } + + callDeleteDlpJob(); + // [END dlp_v2_generated_DlpService_DeleteDlpJob_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v2/samples/generated/v2/dlp_service.delete_inspect_template.js b/owl-bot-staging/v2/samples/generated/v2/dlp_service.delete_inspect_template.js new file mode 100644 index 00000000..32491b94 --- /dev/null +++ b/owl-bot-staging/v2/samples/generated/v2/dlp_service.delete_inspect_template.js @@ -0,0 +1,60 @@ +// Copyright 2022 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. ** + + + +'use strict'; + +function main(name) { + // [START dlp_v2_generated_DlpService_DeleteInspectTemplate_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Resource name of the organization and inspectTemplate to be deleted, for + * example `organizations/433245324/inspectTemplates/432452342` or + * projects/project-id/inspectTemplates/432452342. + */ + // const name = 'abc123' + + // Imports the Dlp library + const {DlpServiceClient} = require('@google-cloud/dlp').v2; + + // Instantiates a client + const dlpClient = new DlpServiceClient(); + + async function callDeleteInspectTemplate() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await dlpClient.deleteInspectTemplate(request); + console.log(response); + } + + callDeleteInspectTemplate(); + // [END dlp_v2_generated_DlpService_DeleteInspectTemplate_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v2/samples/generated/v2/dlp_service.delete_job_trigger.js b/owl-bot-staging/v2/samples/generated/v2/dlp_service.delete_job_trigger.js new file mode 100644 index 00000000..13bdcbcb --- /dev/null +++ b/owl-bot-staging/v2/samples/generated/v2/dlp_service.delete_job_trigger.js @@ -0,0 +1,59 @@ +// Copyright 2022 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. ** + + + +'use strict'; + +function main(name) { + // [START dlp_v2_generated_DlpService_DeleteJobTrigger_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Resource name of the project and the triggeredJob, for example + * `projects/dlp-test-project/jobTriggers/53234423`. + */ + // const name = 'abc123' + + // Imports the Dlp library + const {DlpServiceClient} = require('@google-cloud/dlp').v2; + + // Instantiates a client + const dlpClient = new DlpServiceClient(); + + async function callDeleteJobTrigger() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await dlpClient.deleteJobTrigger(request); + console.log(response); + } + + callDeleteJobTrigger(); + // [END dlp_v2_generated_DlpService_DeleteJobTrigger_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v2/samples/generated/v2/dlp_service.delete_stored_info_type.js b/owl-bot-staging/v2/samples/generated/v2/dlp_service.delete_stored_info_type.js new file mode 100644 index 00000000..896147e7 --- /dev/null +++ b/owl-bot-staging/v2/samples/generated/v2/dlp_service.delete_stored_info_type.js @@ -0,0 +1,60 @@ +// Copyright 2022 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. ** + + + +'use strict'; + +function main(name) { + // [START dlp_v2_generated_DlpService_DeleteStoredInfoType_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Resource name of the organization and storedInfoType to be deleted, for + * example `organizations/433245324/storedInfoTypes/432452342` or + * projects/project-id/storedInfoTypes/432452342. + */ + // const name = 'abc123' + + // Imports the Dlp library + const {DlpServiceClient} = require('@google-cloud/dlp').v2; + + // Instantiates a client + const dlpClient = new DlpServiceClient(); + + async function callDeleteStoredInfoType() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await dlpClient.deleteStoredInfoType(request); + console.log(response); + } + + callDeleteStoredInfoType(); + // [END dlp_v2_generated_DlpService_DeleteStoredInfoType_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v2/samples/generated/v2/dlp_service.finish_dlp_job.js b/owl-bot-staging/v2/samples/generated/v2/dlp_service.finish_dlp_job.js new file mode 100644 index 00000000..4575f5f8 --- /dev/null +++ b/owl-bot-staging/v2/samples/generated/v2/dlp_service.finish_dlp_job.js @@ -0,0 +1,58 @@ +// Copyright 2022 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. ** + + + +'use strict'; + +function main(name) { + // [START dlp_v2_generated_DlpService_FinishDlpJob_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the DlpJob resource to be cancelled. + */ + // const name = 'abc123' + + // Imports the Dlp library + const {DlpServiceClient} = require('@google-cloud/dlp').v2; + + // Instantiates a client + const dlpClient = new DlpServiceClient(); + + async function callFinishDlpJob() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await dlpClient.finishDlpJob(request); + console.log(response); + } + + callFinishDlpJob(); + // [END dlp_v2_generated_DlpService_FinishDlpJob_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v2/samples/generated/v2/dlp_service.get_deidentify_template.js b/owl-bot-staging/v2/samples/generated/v2/dlp_service.get_deidentify_template.js new file mode 100644 index 00000000..0319f743 --- /dev/null +++ b/owl-bot-staging/v2/samples/generated/v2/dlp_service.get_deidentify_template.js @@ -0,0 +1,60 @@ +// Copyright 2022 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. ** + + + +'use strict'; + +function main(name) { + // [START dlp_v2_generated_DlpService_GetDeidentifyTemplate_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Resource name of the organization and deidentify template to be read, for + * example `organizations/433245324/deidentifyTemplates/432452342` or + * projects/project-id/deidentifyTemplates/432452342. + */ + // const name = 'abc123' + + // Imports the Dlp library + const {DlpServiceClient} = require('@google-cloud/dlp').v2; + + // Instantiates a client + const dlpClient = new DlpServiceClient(); + + async function callGetDeidentifyTemplate() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await dlpClient.getDeidentifyTemplate(request); + console.log(response); + } + + callGetDeidentifyTemplate(); + // [END dlp_v2_generated_DlpService_GetDeidentifyTemplate_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v2/samples/generated/v2/dlp_service.get_dlp_job.js b/owl-bot-staging/v2/samples/generated/v2/dlp_service.get_dlp_job.js new file mode 100644 index 00000000..2b66d79c --- /dev/null +++ b/owl-bot-staging/v2/samples/generated/v2/dlp_service.get_dlp_job.js @@ -0,0 +1,58 @@ +// Copyright 2022 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. ** + + + +'use strict'; + +function main(name) { + // [START dlp_v2_generated_DlpService_GetDlpJob_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the DlpJob resource. + */ + // const name = 'abc123' + + // Imports the Dlp library + const {DlpServiceClient} = require('@google-cloud/dlp').v2; + + // Instantiates a client + const dlpClient = new DlpServiceClient(); + + async function callGetDlpJob() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await dlpClient.getDlpJob(request); + console.log(response); + } + + callGetDlpJob(); + // [END dlp_v2_generated_DlpService_GetDlpJob_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v2/samples/generated/v2/dlp_service.get_inspect_template.js b/owl-bot-staging/v2/samples/generated/v2/dlp_service.get_inspect_template.js new file mode 100644 index 00000000..4d227030 --- /dev/null +++ b/owl-bot-staging/v2/samples/generated/v2/dlp_service.get_inspect_template.js @@ -0,0 +1,60 @@ +// Copyright 2022 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. ** + + + +'use strict'; + +function main(name) { + // [START dlp_v2_generated_DlpService_GetInspectTemplate_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Resource name of the organization and inspectTemplate to be read, for + * example `organizations/433245324/inspectTemplates/432452342` or + * projects/project-id/inspectTemplates/432452342. + */ + // const name = 'abc123' + + // Imports the Dlp library + const {DlpServiceClient} = require('@google-cloud/dlp').v2; + + // Instantiates a client + const dlpClient = new DlpServiceClient(); + + async function callGetInspectTemplate() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await dlpClient.getInspectTemplate(request); + console.log(response); + } + + callGetInspectTemplate(); + // [END dlp_v2_generated_DlpService_GetInspectTemplate_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v2/samples/generated/v2/dlp_service.get_job_trigger.js b/owl-bot-staging/v2/samples/generated/v2/dlp_service.get_job_trigger.js new file mode 100644 index 00000000..c9ddadf4 --- /dev/null +++ b/owl-bot-staging/v2/samples/generated/v2/dlp_service.get_job_trigger.js @@ -0,0 +1,59 @@ +// Copyright 2022 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. ** + + + +'use strict'; + +function main(name) { + // [START dlp_v2_generated_DlpService_GetJobTrigger_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Resource name of the project and the triggeredJob, for example + * `projects/dlp-test-project/jobTriggers/53234423`. + */ + // const name = 'abc123' + + // Imports the Dlp library + const {DlpServiceClient} = require('@google-cloud/dlp').v2; + + // Instantiates a client + const dlpClient = new DlpServiceClient(); + + async function callGetJobTrigger() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await dlpClient.getJobTrigger(request); + console.log(response); + } + + callGetJobTrigger(); + // [END dlp_v2_generated_DlpService_GetJobTrigger_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v2/samples/generated/v2/dlp_service.get_stored_info_type.js b/owl-bot-staging/v2/samples/generated/v2/dlp_service.get_stored_info_type.js new file mode 100644 index 00000000..412c49d0 --- /dev/null +++ b/owl-bot-staging/v2/samples/generated/v2/dlp_service.get_stored_info_type.js @@ -0,0 +1,60 @@ +// Copyright 2022 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. ** + + + +'use strict'; + +function main(name) { + // [START dlp_v2_generated_DlpService_GetStoredInfoType_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Resource name of the organization and storedInfoType to be read, for + * example `organizations/433245324/storedInfoTypes/432452342` or + * projects/project-id/storedInfoTypes/432452342. + */ + // const name = 'abc123' + + // Imports the Dlp library + const {DlpServiceClient} = require('@google-cloud/dlp').v2; + + // Instantiates a client + const dlpClient = new DlpServiceClient(); + + async function callGetStoredInfoType() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await dlpClient.getStoredInfoType(request); + console.log(response); + } + + callGetStoredInfoType(); + // [END dlp_v2_generated_DlpService_GetStoredInfoType_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v2/samples/generated/v2/dlp_service.hybrid_inspect_dlp_job.js b/owl-bot-staging/v2/samples/generated/v2/dlp_service.hybrid_inspect_dlp_job.js new file mode 100644 index 00000000..6c1922f2 --- /dev/null +++ b/owl-bot-staging/v2/samples/generated/v2/dlp_service.hybrid_inspect_dlp_job.js @@ -0,0 +1,63 @@ +// Copyright 2022 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. ** + + + +'use strict'; + +function main(name) { + // [START dlp_v2_generated_DlpService_HybridInspectDlpJob_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Resource name of the job to execute a hybrid inspect on, for example + * `projects/dlp-test-project/dlpJob/53234423`. + */ + // const name = 'abc123' + /** + * The item to inspect. + */ + // const hybridItem = {} + + // Imports the Dlp library + const {DlpServiceClient} = require('@google-cloud/dlp').v2; + + // Instantiates a client + const dlpClient = new DlpServiceClient(); + + async function callHybridInspectDlpJob() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await dlpClient.hybridInspectDlpJob(request); + console.log(response); + } + + callHybridInspectDlpJob(); + // [END dlp_v2_generated_DlpService_HybridInspectDlpJob_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v2/samples/generated/v2/dlp_service.hybrid_inspect_job_trigger.js b/owl-bot-staging/v2/samples/generated/v2/dlp_service.hybrid_inspect_job_trigger.js new file mode 100644 index 00000000..b2c73438 --- /dev/null +++ b/owl-bot-staging/v2/samples/generated/v2/dlp_service.hybrid_inspect_job_trigger.js @@ -0,0 +1,63 @@ +// Copyright 2022 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. ** + + + +'use strict'; + +function main(name) { + // [START dlp_v2_generated_DlpService_HybridInspectJobTrigger_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Resource name of the trigger to execute a hybrid inspect on, for example + * `projects/dlp-test-project/jobTriggers/53234423`. + */ + // const name = 'abc123' + /** + * The item to inspect. + */ + // const hybridItem = {} + + // Imports the Dlp library + const {DlpServiceClient} = require('@google-cloud/dlp').v2; + + // Instantiates a client + const dlpClient = new DlpServiceClient(); + + async function callHybridInspectJobTrigger() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await dlpClient.hybridInspectJobTrigger(request); + console.log(response); + } + + callHybridInspectJobTrigger(); + // [END dlp_v2_generated_DlpService_HybridInspectJobTrigger_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v2/samples/generated/v2/dlp_service.inspect_content.js b/owl-bot-staging/v2/samples/generated/v2/dlp_service.inspect_content.js new file mode 100644 index 00000000..5d86ed26 --- /dev/null +++ b/owl-bot-staging/v2/samples/generated/v2/dlp_service.inspect_content.js @@ -0,0 +1,85 @@ +// Copyright 2022 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. ** + + + +'use strict'; + +function main() { + // [START dlp_v2_generated_DlpService_InspectContent_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Parent resource name. + * The format of this value varies depending on whether you have specified a + * processing + * location (https://cloud.google.com/dlp/docs/specifying-location): + * + Projects scope, location specified:
+ * `projects/`PROJECT_ID`/locations/`LOCATION_ID + * + Projects scope, no location specified (defaults to global):
+ * `projects/`PROJECT_ID + * The following example `parent` string specifies a parent project with the + * identifier `example-project`, and specifies the `europe-west3` location + * for processing data: + * parent=projects/example-project/locations/europe-west3 + */ + // const parent = 'abc123' + /** + * Configuration for the inspector. What specified here will override + * the template referenced by the inspect_template_name argument. + */ + // const inspectConfig = {} + /** + * The item to inspect. + */ + // const item = {} + /** + * Template to use. Any configuration directly specified in + * inspect_config will override those set in the template. Singular fields + * that are set in this request will replace their corresponding fields in the + * template. Repeated fields are appended. Singular sub-messages and groups + * are recursively merged. + */ + // const inspectTemplateName = 'abc123' + + // Imports the Dlp library + const {DlpServiceClient} = require('@google-cloud/dlp').v2; + + // Instantiates a client + const dlpClient = new DlpServiceClient(); + + async function callInspectContent() { + // Construct request + const request = { + }; + + // Run request + const response = await dlpClient.inspectContent(request); + console.log(response); + } + + callInspectContent(); + // [END dlp_v2_generated_DlpService_InspectContent_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v2/samples/generated/v2/dlp_service.list_deidentify_templates.js b/owl-bot-staging/v2/samples/generated/v2/dlp_service.list_deidentify_templates.js new file mode 100644 index 00000000..96f34d66 --- /dev/null +++ b/owl-bot-staging/v2/samples/generated/v2/dlp_service.list_deidentify_templates.js @@ -0,0 +1,98 @@ +// Copyright 2022 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. ** + + + +'use strict'; + +function main(parent) { + // [START dlp_v2_generated_DlpService_ListDeidentifyTemplates_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Parent resource name. + * The format of this value varies depending on the scope of the request + * (project or organization) and whether you have specified a processing + * location (https://cloud.google.com/dlp/docs/specifying-location): + * + Projects scope, location specified:
+ * `projects/`PROJECT_ID`/locations/`LOCATION_ID + * + Projects scope, no location specified (defaults to global):
+ * `projects/`PROJECT_ID + * + Organizations scope, location specified:
+ * `organizations/`ORG_ID`/locations/`LOCATION_ID + * + Organizations scope, no location specified (defaults to global):
+ * `organizations/`ORG_ID + * The following example `parent` string specifies a parent project with the + * identifier `example-project`, and specifies the `europe-west3` location + * for processing data: + * parent=projects/example-project/locations/europe-west3 + */ + // const parent = 'abc123' + /** + * Page token to continue retrieval. Comes from previous call + * to `ListDeidentifyTemplates`. + */ + // const pageToken = 'abc123' + /** + * Size of the page, can be limited by server. If zero server returns + * a page of max size 100. + */ + // const pageSize = 1234 + /** + * 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. + */ + // const orderBy = 'abc123' + + // Imports the Dlp library + const {DlpServiceClient} = require('@google-cloud/dlp').v2; + + // Instantiates a client + const dlpClient = new DlpServiceClient(); + + async function callListDeidentifyTemplates() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await dlpClient.listDeidentifyTemplatesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListDeidentifyTemplates(); + // [END dlp_v2_generated_DlpService_ListDeidentifyTemplates_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v2/samples/generated/v2/dlp_service.list_dlp_jobs.js b/owl-bot-staging/v2/samples/generated/v2/dlp_service.list_dlp_jobs.js new file mode 100644 index 00000000..b36ccbb1 --- /dev/null +++ b/owl-bot-staging/v2/samples/generated/v2/dlp_service.list_dlp_jobs.js @@ -0,0 +1,122 @@ +// Copyright 2022 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. ** + + + +'use strict'; + +function main(parent) { + // [START dlp_v2_generated_DlpService_ListDlpJobs_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Parent resource name. + * The format of this value varies depending on whether you have specified a + * processing + * location (https://cloud.google.com/dlp/docs/specifying-location): + * + Projects scope, location specified:
+ * `projects/`PROJECT_ID`/locations/`LOCATION_ID + * + Projects scope, no location specified (defaults to global):
+ * `projects/`PROJECT_ID + * The following example `parent` string specifies a parent project with the + * identifier `example-project`, and specifies the `europe-west3` location + * for processing data: + * parent=projects/example-project/locations/europe-west3 + */ + // const parent = 'abc123' + /** + * 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. + */ + // const filter = 'abc123' + /** + * The standard list page size. + */ + // const pageSize = 1234 + /** + * The standard list page token. + */ + // const pageToken = 'abc123' + /** + * The type of job. Defaults to `DlpJobType.INSPECT` + */ + // const type = {} + /** + * 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` + */ + // const orderBy = 'abc123' + + // Imports the Dlp library + const {DlpServiceClient} = require('@google-cloud/dlp').v2; + + // Instantiates a client + const dlpClient = new DlpServiceClient(); + + async function callListDlpJobs() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await dlpClient.listDlpJobsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListDlpJobs(); + // [END dlp_v2_generated_DlpService_ListDlpJobs_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v2/samples/generated/v2/dlp_service.list_info_types.js b/owl-bot-staging/v2/samples/generated/v2/dlp_service.list_info_types.js new file mode 100644 index 00000000..81ca34da --- /dev/null +++ b/owl-bot-staging/v2/samples/generated/v2/dlp_service.list_info_types.js @@ -0,0 +1,70 @@ +// Copyright 2022 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. ** + + + +'use strict'; + +function main() { + // [START dlp_v2_generated_DlpService_ListInfoTypes_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * The parent resource name. + * The format of this value is as follows: + * locations/LOCATION_ID + */ + // const parent = 'abc123' + /** + * BCP-47 language code for localized infoType friendly + * names. If omitted, or if localized strings are not available, + * en-US strings will be returned. + */ + // const languageCode = 'abc123' + /** + * filter to only return infoTypes supported by certain parts of the + * API. Defaults to supported_by=INSPECT. + */ + // const filter = 'abc123' + + // Imports the Dlp library + const {DlpServiceClient} = require('@google-cloud/dlp').v2; + + // Instantiates a client + const dlpClient = new DlpServiceClient(); + + async function callListInfoTypes() { + // Construct request + const request = { + }; + + // Run request + const response = await dlpClient.listInfoTypes(request); + console.log(response); + } + + callListInfoTypes(); + // [END dlp_v2_generated_DlpService_ListInfoTypes_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v2/samples/generated/v2/dlp_service.list_inspect_templates.js b/owl-bot-staging/v2/samples/generated/v2/dlp_service.list_inspect_templates.js new file mode 100644 index 00000000..7ce4eaae --- /dev/null +++ b/owl-bot-staging/v2/samples/generated/v2/dlp_service.list_inspect_templates.js @@ -0,0 +1,98 @@ +// Copyright 2022 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. ** + + + +'use strict'; + +function main(parent) { + // [START dlp_v2_generated_DlpService_ListInspectTemplates_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Parent resource name. + * The format of this value varies depending on the scope of the request + * (project or organization) and whether you have specified a processing + * location (https://cloud.google.com/dlp/docs/specifying-location): + * + Projects scope, location specified:
+ * `projects/`PROJECT_ID`/locations/`LOCATION_ID + * + Projects scope, no location specified (defaults to global):
+ * `projects/`PROJECT_ID + * + Organizations scope, location specified:
+ * `organizations/`ORG_ID`/locations/`LOCATION_ID + * + Organizations scope, no location specified (defaults to global):
+ * `organizations/`ORG_ID + * The following example `parent` string specifies a parent project with the + * identifier `example-project`, and specifies the `europe-west3` location + * for processing data: + * parent=projects/example-project/locations/europe-west3 + */ + // const parent = 'abc123' + /** + * Page token to continue retrieval. Comes from previous call + * to `ListInspectTemplates`. + */ + // const pageToken = 'abc123' + /** + * Size of the page, can be limited by server. If zero server returns + * a page of max size 100. + */ + // const pageSize = 1234 + /** + * 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. + */ + // const orderBy = 'abc123' + + // Imports the Dlp library + const {DlpServiceClient} = require('@google-cloud/dlp').v2; + + // Instantiates a client + const dlpClient = new DlpServiceClient(); + + async function callListInspectTemplates() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await dlpClient.listInspectTemplatesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListInspectTemplates(); + // [END dlp_v2_generated_DlpService_ListInspectTemplates_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v2/samples/generated/v2/dlp_service.list_job_triggers.js b/owl-bot-staging/v2/samples/generated/v2/dlp_service.list_job_triggers.js new file mode 100644 index 00000000..353618f6 --- /dev/null +++ b/owl-bot-staging/v2/samples/generated/v2/dlp_service.list_job_triggers.js @@ -0,0 +1,122 @@ +// Copyright 2022 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. ** + + + +'use strict'; + +function main(parent) { + // [START dlp_v2_generated_DlpService_ListJobTriggers_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Parent resource name. + * The format of this value varies depending on whether you have specified a + * processing + * location (https://cloud.google.com/dlp/docs/specifying-location): + * + Projects scope, location specified:
+ * `projects/`PROJECT_ID`/locations/`LOCATION_ID + * + Projects scope, no location specified (defaults to global):
+ * `projects/`PROJECT_ID + * The following example `parent` string specifies a parent project with the + * identifier `example-project`, and specifies the `europe-west3` location + * for processing data: + * parent=projects/example-project/locations/europe-west3 + */ + // const parent = 'abc123' + /** + * Page token to continue retrieval. Comes from previous call + * to ListJobTriggers. `order_by` field must not + * change for subsequent calls. + */ + // const pageToken = 'abc123' + /** + * Size of the page, can be limited by a server. + */ + // const pageSize = 1234 + /** + * 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. + */ + // const orderBy = 'abc123' + /** + * 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 triggers: + * - `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. + */ + // const filter = 'abc123' + /** + * The type of jobs. Will use `DlpJobType.INSPECT` if not set. + */ + // const type = {} + + // Imports the Dlp library + const {DlpServiceClient} = require('@google-cloud/dlp').v2; + + // Instantiates a client + const dlpClient = new DlpServiceClient(); + + async function callListJobTriggers() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await dlpClient.listJobTriggersAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListJobTriggers(); + // [END dlp_v2_generated_DlpService_ListJobTriggers_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v2/samples/generated/v2/dlp_service.list_stored_info_types.js b/owl-bot-staging/v2/samples/generated/v2/dlp_service.list_stored_info_types.js new file mode 100644 index 00000000..83719ffb --- /dev/null +++ b/owl-bot-staging/v2/samples/generated/v2/dlp_service.list_stored_info_types.js @@ -0,0 +1,99 @@ +// Copyright 2022 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. ** + + + +'use strict'; + +function main(parent) { + // [START dlp_v2_generated_DlpService_ListStoredInfoTypes_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Parent resource name. + * The format of this value varies depending on the scope of the request + * (project or organization) and whether you have specified a processing + * location (https://cloud.google.com/dlp/docs/specifying-location): + * + Projects scope, location specified:
+ * `projects/`PROJECT_ID`/locations/`LOCATION_ID + * + Projects scope, no location specified (defaults to global):
+ * `projects/`PROJECT_ID + * + Organizations scope, location specified:
+ * `organizations/`ORG_ID`/locations/`LOCATION_ID + * + Organizations scope, no location specified (defaults to global):
+ * `organizations/`ORG_ID + * The following example `parent` string specifies a parent project with the + * identifier `example-project`, and specifies the `europe-west3` location + * for processing data: + * parent=projects/example-project/locations/europe-west3 + */ + // const parent = 'abc123' + /** + * Page token to continue retrieval. Comes from previous call + * to `ListStoredInfoTypes`. + */ + // const pageToken = 'abc123' + /** + * Size of the page, can be limited by server. If zero server returns + * a page of max size 100. + */ + // const pageSize = 1234 + /** + * 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. + */ + // const orderBy = 'abc123' + + // Imports the Dlp library + const {DlpServiceClient} = require('@google-cloud/dlp').v2; + + // Instantiates a client + const dlpClient = new DlpServiceClient(); + + async function callListStoredInfoTypes() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await dlpClient.listStoredInfoTypesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListStoredInfoTypes(); + // [END dlp_v2_generated_DlpService_ListStoredInfoTypes_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v2/samples/generated/v2/dlp_service.redact_image.js b/owl-bot-staging/v2/samples/generated/v2/dlp_service.redact_image.js new file mode 100644 index 00000000..a52edf70 --- /dev/null +++ b/owl-bot-staging/v2/samples/generated/v2/dlp_service.redact_image.js @@ -0,0 +1,85 @@ +// Copyright 2022 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. ** + + + +'use strict'; + +function main() { + // [START dlp_v2_generated_DlpService_RedactImage_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Parent resource name. + * The format of this value varies depending on whether you have specified a + * processing + * location (https://cloud.google.com/dlp/docs/specifying-location): + * + Projects scope, location specified:
+ * `projects/`PROJECT_ID`/locations/`LOCATION_ID + * + Projects scope, no location specified (defaults to global):
+ * `projects/`PROJECT_ID + * The following example `parent` string specifies a parent project with the + * identifier `example-project`, and specifies the `europe-west3` location + * for processing data: + * parent=projects/example-project/locations/europe-west3 + */ + // const parent = 'abc123' + /** + * Configuration for the inspector. + */ + // const inspectConfig = {} + /** + * The configuration for specifying what content to redact from images. + */ + // const imageRedactionConfigs = 1234 + /** + * Whether the response should include findings along with the redacted + * image. + */ + // const includeFindings = true + /** + * The content must be PNG, JPEG, SVG or BMP. + */ + // const byteItem = {} + + // Imports the Dlp library + const {DlpServiceClient} = require('@google-cloud/dlp').v2; + + // Instantiates a client + const dlpClient = new DlpServiceClient(); + + async function callRedactImage() { + // Construct request + const request = { + }; + + // Run request + const response = await dlpClient.redactImage(request); + console.log(response); + } + + callRedactImage(); + // [END dlp_v2_generated_DlpService_RedactImage_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v2/samples/generated/v2/dlp_service.reidentify_content.js b/owl-bot-staging/v2/samples/generated/v2/dlp_service.reidentify_content.js new file mode 100644 index 00000000..a6889f0b --- /dev/null +++ b/owl-bot-staging/v2/samples/generated/v2/dlp_service.reidentify_content.js @@ -0,0 +1,107 @@ +// Copyright 2022 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. ** + + + +'use strict'; + +function main(parent) { + // [START dlp_v2_generated_DlpService_ReidentifyContent_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Parent resource name. + * The format of this value varies depending on whether you have specified a + * processing + * location (https://cloud.google.com/dlp/docs/specifying-location): + * + Projects scope, location specified:
+ * `projects/`PROJECT_ID`/locations/`LOCATION_ID + * + Projects scope, no location specified (defaults to global):
+ * `projects/`PROJECT_ID + * The following example `parent` string specifies a parent project with the + * identifier `example-project`, and specifies the `europe-west3` location + * for processing data: + * parent=projects/example-project/locations/europe-west3 + */ + // const parent = 'abc123' + /** + * Configuration for the 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` + */ + // const reidentifyConfig = {} + /** + * Configuration for the inspector. + */ + // const inspectConfig = {} + /** + * The item to re-identify. Will be treated as text. + */ + // const item = {} + /** + * Template to use. Any configuration directly specified in + * `inspect_config` will override those set in the template. Singular fields + * that are set in this request will replace their corresponding fields in the + * template. Repeated fields are appended. Singular sub-messages and groups + * are recursively merged. + */ + // const inspectTemplateName = 'abc123' + /** + * Template to use. References an instance of `DeidentifyTemplate`. + * Any configuration directly specified in `reidentify_config` or + * `inspect_config` will override those set in the template. The + * `DeidentifyTemplate` used must include only reversible transformations. + * Singular fields that are set in this request will replace their + * corresponding fields in the template. Repeated fields are appended. + * Singular sub-messages and groups are recursively merged. + */ + // const reidentifyTemplateName = 'abc123' + + // Imports the Dlp library + const {DlpServiceClient} = require('@google-cloud/dlp').v2; + + // Instantiates a client + const dlpClient = new DlpServiceClient(); + + async function callReidentifyContent() { + // Construct request + const request = { + parent, + }; + + // Run request + const response = await dlpClient.reidentifyContent(request); + console.log(response); + } + + callReidentifyContent(); + // [END dlp_v2_generated_DlpService_ReidentifyContent_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v2/samples/generated/v2/dlp_service.update_deidentify_template.js b/owl-bot-staging/v2/samples/generated/v2/dlp_service.update_deidentify_template.js new file mode 100644 index 00000000..a873150e --- /dev/null +++ b/owl-bot-staging/v2/samples/generated/v2/dlp_service.update_deidentify_template.js @@ -0,0 +1,68 @@ +// Copyright 2022 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. ** + + + +'use strict'; + +function main(name) { + // [START dlp_v2_generated_DlpService_UpdateDeidentifyTemplate_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Resource name of organization and deidentify template to be updated, for + * example `organizations/433245324/deidentifyTemplates/432452342` or + * projects/project-id/deidentifyTemplates/432452342. + */ + // const name = 'abc123' + /** + * New DeidentifyTemplate value. + */ + // const deidentifyTemplate = {} + /** + * Mask to control which fields get updated. + */ + // const updateMask = {} + + // Imports the Dlp library + const {DlpServiceClient} = require('@google-cloud/dlp').v2; + + // Instantiates a client + const dlpClient = new DlpServiceClient(); + + async function callUpdateDeidentifyTemplate() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await dlpClient.updateDeidentifyTemplate(request); + console.log(response); + } + + callUpdateDeidentifyTemplate(); + // [END dlp_v2_generated_DlpService_UpdateDeidentifyTemplate_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v2/samples/generated/v2/dlp_service.update_inspect_template.js b/owl-bot-staging/v2/samples/generated/v2/dlp_service.update_inspect_template.js new file mode 100644 index 00000000..c3ec03a7 --- /dev/null +++ b/owl-bot-staging/v2/samples/generated/v2/dlp_service.update_inspect_template.js @@ -0,0 +1,68 @@ +// Copyright 2022 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. ** + + + +'use strict'; + +function main(name) { + // [START dlp_v2_generated_DlpService_UpdateInspectTemplate_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Resource name of organization and inspectTemplate to be updated, for + * example `organizations/433245324/inspectTemplates/432452342` or + * projects/project-id/inspectTemplates/432452342. + */ + // const name = 'abc123' + /** + * New InspectTemplate value. + */ + // const inspectTemplate = {} + /** + * Mask to control which fields get updated. + */ + // const updateMask = {} + + // Imports the Dlp library + const {DlpServiceClient} = require('@google-cloud/dlp').v2; + + // Instantiates a client + const dlpClient = new DlpServiceClient(); + + async function callUpdateInspectTemplate() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await dlpClient.updateInspectTemplate(request); + console.log(response); + } + + callUpdateInspectTemplate(); + // [END dlp_v2_generated_DlpService_UpdateInspectTemplate_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v2/samples/generated/v2/dlp_service.update_job_trigger.js b/owl-bot-staging/v2/samples/generated/v2/dlp_service.update_job_trigger.js new file mode 100644 index 00000000..fc1a0a72 --- /dev/null +++ b/owl-bot-staging/v2/samples/generated/v2/dlp_service.update_job_trigger.js @@ -0,0 +1,67 @@ +// Copyright 2022 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. ** + + + +'use strict'; + +function main(name) { + // [START dlp_v2_generated_DlpService_UpdateJobTrigger_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Resource name of the project and the triggeredJob, for example + * `projects/dlp-test-project/jobTriggers/53234423`. + */ + // const name = 'abc123' + /** + * New JobTrigger value. + */ + // const jobTrigger = {} + /** + * Mask to control which fields get updated. + */ + // const updateMask = {} + + // Imports the Dlp library + const {DlpServiceClient} = require('@google-cloud/dlp').v2; + + // Instantiates a client + const dlpClient = new DlpServiceClient(); + + async function callUpdateJobTrigger() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await dlpClient.updateJobTrigger(request); + console.log(response); + } + + callUpdateJobTrigger(); + // [END dlp_v2_generated_DlpService_UpdateJobTrigger_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v2/samples/generated/v2/dlp_service.update_stored_info_type.js b/owl-bot-staging/v2/samples/generated/v2/dlp_service.update_stored_info_type.js new file mode 100644 index 00000000..fd011481 --- /dev/null +++ b/owl-bot-staging/v2/samples/generated/v2/dlp_service.update_stored_info_type.js @@ -0,0 +1,70 @@ +// Copyright 2022 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. ** + + + +'use strict'; + +function main(name) { + // [START dlp_v2_generated_DlpService_UpdateStoredInfoType_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Resource name of organization and storedInfoType to be updated, for + * example `organizations/433245324/storedInfoTypes/432452342` or + * projects/project-id/storedInfoTypes/432452342. + */ + // const name = 'abc123' + /** + * Updated configuration for the storedInfoType. If not provided, a new + * version of the storedInfoType will be created with the existing + * configuration. + */ + // const config = {} + /** + * Mask to control which fields get updated. + */ + // const updateMask = {} + + // Imports the Dlp library + const {DlpServiceClient} = require('@google-cloud/dlp').v2; + + // Instantiates a client + const dlpClient = new DlpServiceClient(); + + async function callUpdateStoredInfoType() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await dlpClient.updateStoredInfoType(request); + console.log(response); + } + + callUpdateStoredInfoType(); + // [END dlp_v2_generated_DlpService_UpdateStoredInfoType_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v2/samples/generated/v2/snippet_metadata.google.privacy.dlp.v2.json b/owl-bot-staging/v2/samples/generated/v2/snippet_metadata.google.privacy.dlp.v2.json new file mode 100644 index 00000000..ee897ad8 --- /dev/null +++ b/owl-bot-staging/v2/samples/generated/v2/snippet_metadata.google.privacy.dlp.v2.json @@ -0,0 +1,1671 @@ +{ + "clientLibrary": { + "name": "nodejs-dlp", + "version": "0.1.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.privacy.dlp.v2", + "version": "v2" + } + ] + }, + "snippets": [ + { + "regionTag": "dlp_v2_generated_DlpService_InspectContent_async", + "title": "DlpService inspectContent Sample", + "origin": "API_DEFINITION", + "description": " 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,", + "canonical": true, + "file": "dlp_service.inspect_content.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 77, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "InspectContent", + "fullName": "google.privacy.dlp.v2.DlpService.InspectContent", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "inspect_config", + "type": ".google.privacy.dlp.v2.InspectConfig" + }, + { + "name": "item", + "type": ".google.privacy.dlp.v2.ContentItem" + }, + { + "name": "inspect_template_name", + "type": "TYPE_STRING" + }, + { + "name": "location_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.privacy.dlp.v2.InspectContentResponse", + "client": { + "shortName": "DlpServiceClient", + "fullName": "google.privacy.dlp.v2.DlpServiceClient" + }, + "method": { + "shortName": "InspectContent", + "fullName": "google.privacy.dlp.v2.DlpService.InspectContent", + "service": { + "shortName": "DlpService", + "fullName": "google.privacy.dlp.v2.DlpService" + } + } + } + }, + { + "regionTag": "dlp_v2_generated_DlpService_RedactImage_async", + "title": "DlpService redactImage Sample", + "origin": "API_DEFINITION", + "description": " 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.", + "canonical": true, + "file": "dlp_service.redact_image.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 77, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "RedactImage", + "fullName": "google.privacy.dlp.v2.DlpService.RedactImage", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "location_id", + "type": "TYPE_STRING" + }, + { + "name": "inspect_config", + "type": ".google.privacy.dlp.v2.InspectConfig" + }, + { + "name": "image_redaction_configs", + "type": "TYPE_MESSAGE[]" + }, + { + "name": "include_findings", + "type": "TYPE_BOOL" + }, + { + "name": "byte_item", + "type": ".google.privacy.dlp.v2.ByteContentItem" + } + ], + "resultType": ".google.privacy.dlp.v2.RedactImageResponse", + "client": { + "shortName": "DlpServiceClient", + "fullName": "google.privacy.dlp.v2.DlpServiceClient" + }, + "method": { + "shortName": "RedactImage", + "fullName": "google.privacy.dlp.v2.DlpService.RedactImage", + "service": { + "shortName": "DlpService", + "fullName": "google.privacy.dlp.v2.DlpService" + } + } + } + }, + { + "regionTag": "dlp_v2_generated_DlpService_DeidentifyContent_async", + "title": "DlpService deidentifyContent Sample", + "origin": "API_DEFINITION", + "description": " 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.", + "canonical": true, + "file": "dlp_service.deidentify_content.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 92, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeidentifyContent", + "fullName": "google.privacy.dlp.v2.DlpService.DeidentifyContent", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "deidentify_config", + "type": ".google.privacy.dlp.v2.DeidentifyConfig" + }, + { + "name": "inspect_config", + "type": ".google.privacy.dlp.v2.InspectConfig" + }, + { + "name": "item", + "type": ".google.privacy.dlp.v2.ContentItem" + }, + { + "name": "inspect_template_name", + "type": "TYPE_STRING" + }, + { + "name": "deidentify_template_name", + "type": "TYPE_STRING" + }, + { + "name": "location_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.privacy.dlp.v2.DeidentifyContentResponse", + "client": { + "shortName": "DlpServiceClient", + "fullName": "google.privacy.dlp.v2.DlpServiceClient" + }, + "method": { + "shortName": "DeidentifyContent", + "fullName": "google.privacy.dlp.v2.DlpService.DeidentifyContent", + "service": { + "shortName": "DlpService", + "fullName": "google.privacy.dlp.v2.DlpService" + } + } + } + }, + { + "regionTag": "dlp_v2_generated_DlpService_ReidentifyContent_async", + "title": "DlpService reidentifyContent Sample", + "origin": "API_DEFINITION", + "description": " 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.", + "canonical": true, + "file": "dlp_service.reidentify_content.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 99, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ReidentifyContent", + "fullName": "google.privacy.dlp.v2.DlpService.ReidentifyContent", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "reidentify_config", + "type": ".google.privacy.dlp.v2.DeidentifyConfig" + }, + { + "name": "inspect_config", + "type": ".google.privacy.dlp.v2.InspectConfig" + }, + { + "name": "item", + "type": ".google.privacy.dlp.v2.ContentItem" + }, + { + "name": "inspect_template_name", + "type": "TYPE_STRING" + }, + { + "name": "reidentify_template_name", + "type": "TYPE_STRING" + }, + { + "name": "location_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.privacy.dlp.v2.ReidentifyContentResponse", + "client": { + "shortName": "DlpServiceClient", + "fullName": "google.privacy.dlp.v2.DlpServiceClient" + }, + "method": { + "shortName": "ReidentifyContent", + "fullName": "google.privacy.dlp.v2.DlpService.ReidentifyContent", + "service": { + "shortName": "DlpService", + "fullName": "google.privacy.dlp.v2.DlpService" + } + } + } + }, + { + "regionTag": "dlp_v2_generated_DlpService_ListInfoTypes_async", + "title": "DlpService listInfoTypes Sample", + "origin": "API_DEFINITION", + "description": " 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.", + "canonical": true, + "file": "dlp_service.list_info_types.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 62, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListInfoTypes", + "fullName": "google.privacy.dlp.v2.DlpService.ListInfoTypes", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "language_code", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "location_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.privacy.dlp.v2.ListInfoTypesResponse", + "client": { + "shortName": "DlpServiceClient", + "fullName": "google.privacy.dlp.v2.DlpServiceClient" + }, + "method": { + "shortName": "ListInfoTypes", + "fullName": "google.privacy.dlp.v2.DlpService.ListInfoTypes", + "service": { + "shortName": "DlpService", + "fullName": "google.privacy.dlp.v2.DlpService" + } + } + } + }, + { + "regionTag": "dlp_v2_generated_DlpService_CreateInspectTemplate_async", + "title": "DlpService createInspectTemplate Sample", + "origin": "API_DEFINITION", + "description": " 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.", + "canonical": true, + "file": "dlp_service.create_inspect_template.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 77, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateInspectTemplate", + "fullName": "google.privacy.dlp.v2.DlpService.CreateInspectTemplate", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "inspect_template", + "type": ".google.privacy.dlp.v2.InspectTemplate" + }, + { + "name": "template_id", + "type": "TYPE_STRING" + }, + { + "name": "location_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.privacy.dlp.v2.InspectTemplate", + "client": { + "shortName": "DlpServiceClient", + "fullName": "google.privacy.dlp.v2.DlpServiceClient" + }, + "method": { + "shortName": "CreateInspectTemplate", + "fullName": "google.privacy.dlp.v2.DlpService.CreateInspectTemplate", + "service": { + "shortName": "DlpService", + "fullName": "google.privacy.dlp.v2.DlpService" + } + } + } + }, + { + "regionTag": "dlp_v2_generated_DlpService_UpdateInspectTemplate_async", + "title": "DlpService updateInspectTemplate Sample", + "origin": "API_DEFINITION", + "description": " Updates the InspectTemplate. See https://cloud.google.com/dlp/docs/creating-templates to learn more.", + "canonical": true, + "file": "dlp_service.update_inspect_template.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 60, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateInspectTemplate", + "fullName": "google.privacy.dlp.v2.DlpService.UpdateInspectTemplate", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "inspect_template", + "type": ".google.privacy.dlp.v2.InspectTemplate" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.privacy.dlp.v2.InspectTemplate", + "client": { + "shortName": "DlpServiceClient", + "fullName": "google.privacy.dlp.v2.DlpServiceClient" + }, + "method": { + "shortName": "UpdateInspectTemplate", + "fullName": "google.privacy.dlp.v2.DlpService.UpdateInspectTemplate", + "service": { + "shortName": "DlpService", + "fullName": "google.privacy.dlp.v2.DlpService" + } + } + } + }, + { + "regionTag": "dlp_v2_generated_DlpService_GetInspectTemplate_async", + "title": "DlpService getInspectTemplate Sample", + "origin": "API_DEFINITION", + "description": " Gets an InspectTemplate. See https://cloud.google.com/dlp/docs/creating-templates to learn more.", + "canonical": true, + "file": "dlp_service.get_inspect_template.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 52, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetInspectTemplate", + "fullName": "google.privacy.dlp.v2.DlpService.GetInspectTemplate", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.privacy.dlp.v2.InspectTemplate", + "client": { + "shortName": "DlpServiceClient", + "fullName": "google.privacy.dlp.v2.DlpServiceClient" + }, + "method": { + "shortName": "GetInspectTemplate", + "fullName": "google.privacy.dlp.v2.DlpService.GetInspectTemplate", + "service": { + "shortName": "DlpService", + "fullName": "google.privacy.dlp.v2.DlpService" + } + } + } + }, + { + "regionTag": "dlp_v2_generated_DlpService_ListInspectTemplates_async", + "title": "DlpService listInspectTemplates Sample", + "origin": "API_DEFINITION", + "description": " Lists InspectTemplates. See https://cloud.google.com/dlp/docs/creating-templates to learn more.", + "canonical": true, + "file": "dlp_service.list_inspect_templates.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 90, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListInspectTemplates", + "fullName": "google.privacy.dlp.v2.DlpService.ListInspectTemplates", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + }, + { + "name": "location_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.privacy.dlp.v2.ListInspectTemplatesResponse", + "client": { + "shortName": "DlpServiceClient", + "fullName": "google.privacy.dlp.v2.DlpServiceClient" + }, + "method": { + "shortName": "ListInspectTemplates", + "fullName": "google.privacy.dlp.v2.DlpService.ListInspectTemplates", + "service": { + "shortName": "DlpService", + "fullName": "google.privacy.dlp.v2.DlpService" + } + } + } + }, + { + "regionTag": "dlp_v2_generated_DlpService_DeleteInspectTemplate_async", + "title": "DlpService deleteInspectTemplate Sample", + "origin": "API_DEFINITION", + "description": " Deletes an InspectTemplate. See https://cloud.google.com/dlp/docs/creating-templates to learn more.", + "canonical": true, + "file": "dlp_service.delete_inspect_template.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 52, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteInspectTemplate", + "fullName": "google.privacy.dlp.v2.DlpService.DeleteInspectTemplate", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "DlpServiceClient", + "fullName": "google.privacy.dlp.v2.DlpServiceClient" + }, + "method": { + "shortName": "DeleteInspectTemplate", + "fullName": "google.privacy.dlp.v2.DlpService.DeleteInspectTemplate", + "service": { + "shortName": "DlpService", + "fullName": "google.privacy.dlp.v2.DlpService" + } + } + } + }, + { + "regionTag": "dlp_v2_generated_DlpService_CreateDeidentifyTemplate_async", + "title": "DlpService createDeidentifyTemplate Sample", + "origin": "API_DEFINITION", + "description": " 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.", + "canonical": true, + "file": "dlp_service.create_deidentify_template.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 77, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateDeidentifyTemplate", + "fullName": "google.privacy.dlp.v2.DlpService.CreateDeidentifyTemplate", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "deidentify_template", + "type": ".google.privacy.dlp.v2.DeidentifyTemplate" + }, + { + "name": "template_id", + "type": "TYPE_STRING" + }, + { + "name": "location_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.privacy.dlp.v2.DeidentifyTemplate", + "client": { + "shortName": "DlpServiceClient", + "fullName": "google.privacy.dlp.v2.DlpServiceClient" + }, + "method": { + "shortName": "CreateDeidentifyTemplate", + "fullName": "google.privacy.dlp.v2.DlpService.CreateDeidentifyTemplate", + "service": { + "shortName": "DlpService", + "fullName": "google.privacy.dlp.v2.DlpService" + } + } + } + }, + { + "regionTag": "dlp_v2_generated_DlpService_UpdateDeidentifyTemplate_async", + "title": "DlpService updateDeidentifyTemplate Sample", + "origin": "API_DEFINITION", + "description": " Updates the DeidentifyTemplate. See https://cloud.google.com/dlp/docs/creating-templates-deid to learn more.", + "canonical": true, + "file": "dlp_service.update_deidentify_template.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 60, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateDeidentifyTemplate", + "fullName": "google.privacy.dlp.v2.DlpService.UpdateDeidentifyTemplate", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "deidentify_template", + "type": ".google.privacy.dlp.v2.DeidentifyTemplate" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.privacy.dlp.v2.DeidentifyTemplate", + "client": { + "shortName": "DlpServiceClient", + "fullName": "google.privacy.dlp.v2.DlpServiceClient" + }, + "method": { + "shortName": "UpdateDeidentifyTemplate", + "fullName": "google.privacy.dlp.v2.DlpService.UpdateDeidentifyTemplate", + "service": { + "shortName": "DlpService", + "fullName": "google.privacy.dlp.v2.DlpService" + } + } + } + }, + { + "regionTag": "dlp_v2_generated_DlpService_GetDeidentifyTemplate_async", + "title": "DlpService getDeidentifyTemplate Sample", + "origin": "API_DEFINITION", + "description": " Gets a DeidentifyTemplate. See https://cloud.google.com/dlp/docs/creating-templates-deid to learn more.", + "canonical": true, + "file": "dlp_service.get_deidentify_template.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 52, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetDeidentifyTemplate", + "fullName": "google.privacy.dlp.v2.DlpService.GetDeidentifyTemplate", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.privacy.dlp.v2.DeidentifyTemplate", + "client": { + "shortName": "DlpServiceClient", + "fullName": "google.privacy.dlp.v2.DlpServiceClient" + }, + "method": { + "shortName": "GetDeidentifyTemplate", + "fullName": "google.privacy.dlp.v2.DlpService.GetDeidentifyTemplate", + "service": { + "shortName": "DlpService", + "fullName": "google.privacy.dlp.v2.DlpService" + } + } + } + }, + { + "regionTag": "dlp_v2_generated_DlpService_ListDeidentifyTemplates_async", + "title": "DlpService listDeidentifyTemplates Sample", + "origin": "API_DEFINITION", + "description": " Lists DeidentifyTemplates. See https://cloud.google.com/dlp/docs/creating-templates-deid to learn more.", + "canonical": true, + "file": "dlp_service.list_deidentify_templates.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 90, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListDeidentifyTemplates", + "fullName": "google.privacy.dlp.v2.DlpService.ListDeidentifyTemplates", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + }, + { + "name": "location_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.privacy.dlp.v2.ListDeidentifyTemplatesResponse", + "client": { + "shortName": "DlpServiceClient", + "fullName": "google.privacy.dlp.v2.DlpServiceClient" + }, + "method": { + "shortName": "ListDeidentifyTemplates", + "fullName": "google.privacy.dlp.v2.DlpService.ListDeidentifyTemplates", + "service": { + "shortName": "DlpService", + "fullName": "google.privacy.dlp.v2.DlpService" + } + } + } + }, + { + "regionTag": "dlp_v2_generated_DlpService_DeleteDeidentifyTemplate_async", + "title": "DlpService deleteDeidentifyTemplate Sample", + "origin": "API_DEFINITION", + "description": " Deletes a DeidentifyTemplate. See https://cloud.google.com/dlp/docs/creating-templates-deid to learn more.", + "canonical": true, + "file": "dlp_service.delete_deidentify_template.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 52, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteDeidentifyTemplate", + "fullName": "google.privacy.dlp.v2.DlpService.DeleteDeidentifyTemplate", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "DlpServiceClient", + "fullName": "google.privacy.dlp.v2.DlpServiceClient" + }, + "method": { + "shortName": "DeleteDeidentifyTemplate", + "fullName": "google.privacy.dlp.v2.DlpService.DeleteDeidentifyTemplate", + "service": { + "shortName": "DlpService", + "fullName": "google.privacy.dlp.v2.DlpService" + } + } + } + }, + { + "regionTag": "dlp_v2_generated_DlpService_CreateJobTrigger_async", + "title": "DlpService createJobTrigger Sample", + "origin": "API_DEFINITION", + "description": " 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.", + "canonical": true, + "file": "dlp_service.create_job_trigger.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 73, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateJobTrigger", + "fullName": "google.privacy.dlp.v2.DlpService.CreateJobTrigger", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "job_trigger", + "type": ".google.privacy.dlp.v2.JobTrigger" + }, + { + "name": "trigger_id", + "type": "TYPE_STRING" + }, + { + "name": "location_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.privacy.dlp.v2.JobTrigger", + "client": { + "shortName": "DlpServiceClient", + "fullName": "google.privacy.dlp.v2.DlpServiceClient" + }, + "method": { + "shortName": "CreateJobTrigger", + "fullName": "google.privacy.dlp.v2.DlpService.CreateJobTrigger", + "service": { + "shortName": "DlpService", + "fullName": "google.privacy.dlp.v2.DlpService" + } + } + } + }, + { + "regionTag": "dlp_v2_generated_DlpService_UpdateJobTrigger_async", + "title": "DlpService updateJobTrigger Sample", + "origin": "API_DEFINITION", + "description": " Updates a job trigger. See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more.", + "canonical": true, + "file": "dlp_service.update_job_trigger.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateJobTrigger", + "fullName": "google.privacy.dlp.v2.DlpService.UpdateJobTrigger", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "job_trigger", + "type": ".google.privacy.dlp.v2.JobTrigger" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.privacy.dlp.v2.JobTrigger", + "client": { + "shortName": "DlpServiceClient", + "fullName": "google.privacy.dlp.v2.DlpServiceClient" + }, + "method": { + "shortName": "UpdateJobTrigger", + "fullName": "google.privacy.dlp.v2.DlpService.UpdateJobTrigger", + "service": { + "shortName": "DlpService", + "fullName": "google.privacy.dlp.v2.DlpService" + } + } + } + }, + { + "regionTag": "dlp_v2_generated_DlpService_HybridInspectJobTrigger_async", + "title": "DlpService hybridInspectJobTrigger Sample", + "origin": "API_DEFINITION", + "description": " Inspect hybrid content and store findings to a trigger. The inspection will be processed asynchronously. To review the findings monitor the jobs within the trigger.", + "canonical": true, + "file": "dlp_service.hybrid_inspect_job_trigger.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "HybridInspectJobTrigger", + "fullName": "google.privacy.dlp.v2.DlpService.HybridInspectJobTrigger", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "hybrid_item", + "type": ".google.privacy.dlp.v2.HybridContentItem" + } + ], + "resultType": ".google.privacy.dlp.v2.HybridInspectResponse", + "client": { + "shortName": "DlpServiceClient", + "fullName": "google.privacy.dlp.v2.DlpServiceClient" + }, + "method": { + "shortName": "HybridInspectJobTrigger", + "fullName": "google.privacy.dlp.v2.DlpService.HybridInspectJobTrigger", + "service": { + "shortName": "DlpService", + "fullName": "google.privacy.dlp.v2.DlpService" + } + } + } + }, + { + "regionTag": "dlp_v2_generated_DlpService_GetJobTrigger_async", + "title": "DlpService getJobTrigger Sample", + "origin": "API_DEFINITION", + "description": " Gets a job trigger. See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more.", + "canonical": true, + "file": "dlp_service.get_job_trigger.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 51, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetJobTrigger", + "fullName": "google.privacy.dlp.v2.DlpService.GetJobTrigger", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.privacy.dlp.v2.JobTrigger", + "client": { + "shortName": "DlpServiceClient", + "fullName": "google.privacy.dlp.v2.DlpServiceClient" + }, + "method": { + "shortName": "GetJobTrigger", + "fullName": "google.privacy.dlp.v2.DlpService.GetJobTrigger", + "service": { + "shortName": "DlpService", + "fullName": "google.privacy.dlp.v2.DlpService" + } + } + } + }, + { + "regionTag": "dlp_v2_generated_DlpService_ListJobTriggers_async", + "title": "DlpService listJobTriggers Sample", + "origin": "API_DEFINITION", + "description": " Lists job triggers. See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more.", + "canonical": true, + "file": "dlp_service.list_job_triggers.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 114, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListJobTriggers", + "fullName": "google.privacy.dlp.v2.DlpService.ListJobTriggers", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "type", + "type": ".google.privacy.dlp.v2.DlpJobType" + }, + { + "name": "location_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.privacy.dlp.v2.ListJobTriggersResponse", + "client": { + "shortName": "DlpServiceClient", + "fullName": "google.privacy.dlp.v2.DlpServiceClient" + }, + "method": { + "shortName": "ListJobTriggers", + "fullName": "google.privacy.dlp.v2.DlpService.ListJobTriggers", + "service": { + "shortName": "DlpService", + "fullName": "google.privacy.dlp.v2.DlpService" + } + } + } + }, + { + "regionTag": "dlp_v2_generated_DlpService_DeleteJobTrigger_async", + "title": "DlpService deleteJobTrigger Sample", + "origin": "API_DEFINITION", + "description": " Deletes a job trigger. See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more.", + "canonical": true, + "file": "dlp_service.delete_job_trigger.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 51, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteJobTrigger", + "fullName": "google.privacy.dlp.v2.DlpService.DeleteJobTrigger", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "DlpServiceClient", + "fullName": "google.privacy.dlp.v2.DlpServiceClient" + }, + "method": { + "shortName": "DeleteJobTrigger", + "fullName": "google.privacy.dlp.v2.DlpService.DeleteJobTrigger", + "service": { + "shortName": "DlpService", + "fullName": "google.privacy.dlp.v2.DlpService" + } + } + } + }, + { + "regionTag": "dlp_v2_generated_DlpService_ActivateJobTrigger_async", + "title": "DlpService activateJobTrigger Sample", + "origin": "API_DEFINITION", + "description": " Activate a job trigger. Causes the immediate execute of a trigger instead of waiting on the trigger event to occur.", + "canonical": true, + "file": "dlp_service.activate_job_trigger.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 51, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ActivateJobTrigger", + "fullName": "google.privacy.dlp.v2.DlpService.ActivateJobTrigger", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.privacy.dlp.v2.DlpJob", + "client": { + "shortName": "DlpServiceClient", + "fullName": "google.privacy.dlp.v2.DlpServiceClient" + }, + "method": { + "shortName": "ActivateJobTrigger", + "fullName": "google.privacy.dlp.v2.DlpService.ActivateJobTrigger", + "service": { + "shortName": "DlpService", + "fullName": "google.privacy.dlp.v2.DlpService" + } + } + } + }, + { + "regionTag": "dlp_v2_generated_DlpService_CreateDlpJob_async", + "title": "DlpService createDlpJob Sample", + "origin": "API_DEFINITION", + "description": " 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.", + "canonical": true, + "file": "dlp_service.create_dlp_job.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 77, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateDlpJob", + "fullName": "google.privacy.dlp.v2.DlpService.CreateDlpJob", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "inspect_job", + "type": ".google.privacy.dlp.v2.InspectJobConfig" + }, + { + "name": "risk_job", + "type": ".google.privacy.dlp.v2.RiskAnalysisJobConfig" + }, + { + "name": "job_id", + "type": "TYPE_STRING" + }, + { + "name": "location_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.privacy.dlp.v2.DlpJob", + "client": { + "shortName": "DlpServiceClient", + "fullName": "google.privacy.dlp.v2.DlpServiceClient" + }, + "method": { + "shortName": "CreateDlpJob", + "fullName": "google.privacy.dlp.v2.DlpService.CreateDlpJob", + "service": { + "shortName": "DlpService", + "fullName": "google.privacy.dlp.v2.DlpService" + } + } + } + }, + { + "regionTag": "dlp_v2_generated_DlpService_ListDlpJobs_async", + "title": "DlpService listDlpJobs Sample", + "origin": "API_DEFINITION", + "description": " 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.", + "canonical": true, + "file": "dlp_service.list_dlp_jobs.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 114, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListDlpJobs", + "fullName": "google.privacy.dlp.v2.DlpService.ListDlpJobs", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "type", + "type": ".google.privacy.dlp.v2.DlpJobType" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + }, + { + "name": "location_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.privacy.dlp.v2.ListDlpJobsResponse", + "client": { + "shortName": "DlpServiceClient", + "fullName": "google.privacy.dlp.v2.DlpServiceClient" + }, + "method": { + "shortName": "ListDlpJobs", + "fullName": "google.privacy.dlp.v2.DlpService.ListDlpJobs", + "service": { + "shortName": "DlpService", + "fullName": "google.privacy.dlp.v2.DlpService" + } + } + } + }, + { + "regionTag": "dlp_v2_generated_DlpService_GetDlpJob_async", + "title": "DlpService getDlpJob Sample", + "origin": "API_DEFINITION", + "description": " 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.", + "canonical": true, + "file": "dlp_service.get_dlp_job.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 50, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetDlpJob", + "fullName": "google.privacy.dlp.v2.DlpService.GetDlpJob", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.privacy.dlp.v2.DlpJob", + "client": { + "shortName": "DlpServiceClient", + "fullName": "google.privacy.dlp.v2.DlpServiceClient" + }, + "method": { + "shortName": "GetDlpJob", + "fullName": "google.privacy.dlp.v2.DlpService.GetDlpJob", + "service": { + "shortName": "DlpService", + "fullName": "google.privacy.dlp.v2.DlpService" + } + } + } + }, + { + "regionTag": "dlp_v2_generated_DlpService_DeleteDlpJob_async", + "title": "DlpService deleteDlpJob Sample", + "origin": "API_DEFINITION", + "description": " 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.", + "canonical": true, + "file": "dlp_service.delete_dlp_job.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 50, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteDlpJob", + "fullName": "google.privacy.dlp.v2.DlpService.DeleteDlpJob", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "DlpServiceClient", + "fullName": "google.privacy.dlp.v2.DlpServiceClient" + }, + "method": { + "shortName": "DeleteDlpJob", + "fullName": "google.privacy.dlp.v2.DlpService.DeleteDlpJob", + "service": { + "shortName": "DlpService", + "fullName": "google.privacy.dlp.v2.DlpService" + } + } + } + }, + { + "regionTag": "dlp_v2_generated_DlpService_CancelDlpJob_async", + "title": "DlpService cancelDlpJob Sample", + "origin": "API_DEFINITION", + "description": " 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.", + "canonical": true, + "file": "dlp_service.cancel_dlp_job.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 50, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CancelDlpJob", + "fullName": "google.privacy.dlp.v2.DlpService.CancelDlpJob", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "DlpServiceClient", + "fullName": "google.privacy.dlp.v2.DlpServiceClient" + }, + "method": { + "shortName": "CancelDlpJob", + "fullName": "google.privacy.dlp.v2.DlpService.CancelDlpJob", + "service": { + "shortName": "DlpService", + "fullName": "google.privacy.dlp.v2.DlpService" + } + } + } + }, + { + "regionTag": "dlp_v2_generated_DlpService_CreateStoredInfoType_async", + "title": "DlpService createStoredInfoType Sample", + "origin": "API_DEFINITION", + "description": " Creates a pre-built stored infoType to be used for inspection. See https://cloud.google.com/dlp/docs/creating-stored-infotypes to learn more.", + "canonical": true, + "file": "dlp_service.create_stored_info_type.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 77, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateStoredInfoType", + "fullName": "google.privacy.dlp.v2.DlpService.CreateStoredInfoType", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "config", + "type": ".google.privacy.dlp.v2.StoredInfoTypeConfig" + }, + { + "name": "stored_info_type_id", + "type": "TYPE_STRING" + }, + { + "name": "location_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.privacy.dlp.v2.StoredInfoType", + "client": { + "shortName": "DlpServiceClient", + "fullName": "google.privacy.dlp.v2.DlpServiceClient" + }, + "method": { + "shortName": "CreateStoredInfoType", + "fullName": "google.privacy.dlp.v2.DlpService.CreateStoredInfoType", + "service": { + "shortName": "DlpService", + "fullName": "google.privacy.dlp.v2.DlpService" + } + } + } + }, + { + "regionTag": "dlp_v2_generated_DlpService_UpdateStoredInfoType_async", + "title": "DlpService updateStoredInfoType Sample", + "origin": "API_DEFINITION", + "description": " 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.", + "canonical": true, + "file": "dlp_service.update_stored_info_type.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 62, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateStoredInfoType", + "fullName": "google.privacy.dlp.v2.DlpService.UpdateStoredInfoType", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "config", + "type": ".google.privacy.dlp.v2.StoredInfoTypeConfig" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.privacy.dlp.v2.StoredInfoType", + "client": { + "shortName": "DlpServiceClient", + "fullName": "google.privacy.dlp.v2.DlpServiceClient" + }, + "method": { + "shortName": "UpdateStoredInfoType", + "fullName": "google.privacy.dlp.v2.DlpService.UpdateStoredInfoType", + "service": { + "shortName": "DlpService", + "fullName": "google.privacy.dlp.v2.DlpService" + } + } + } + }, + { + "regionTag": "dlp_v2_generated_DlpService_GetStoredInfoType_async", + "title": "DlpService getStoredInfoType Sample", + "origin": "API_DEFINITION", + "description": " Gets a stored infoType. See https://cloud.google.com/dlp/docs/creating-stored-infotypes to learn more.", + "canonical": true, + "file": "dlp_service.get_stored_info_type.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 52, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetStoredInfoType", + "fullName": "google.privacy.dlp.v2.DlpService.GetStoredInfoType", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.privacy.dlp.v2.StoredInfoType", + "client": { + "shortName": "DlpServiceClient", + "fullName": "google.privacy.dlp.v2.DlpServiceClient" + }, + "method": { + "shortName": "GetStoredInfoType", + "fullName": "google.privacy.dlp.v2.DlpService.GetStoredInfoType", + "service": { + "shortName": "DlpService", + "fullName": "google.privacy.dlp.v2.DlpService" + } + } + } + }, + { + "regionTag": "dlp_v2_generated_DlpService_ListStoredInfoTypes_async", + "title": "DlpService listStoredInfoTypes Sample", + "origin": "API_DEFINITION", + "description": " Lists stored infoTypes. See https://cloud.google.com/dlp/docs/creating-stored-infotypes to learn more.", + "canonical": true, + "file": "dlp_service.list_stored_info_types.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 91, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListStoredInfoTypes", + "fullName": "google.privacy.dlp.v2.DlpService.ListStoredInfoTypes", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + }, + { + "name": "location_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.privacy.dlp.v2.ListStoredInfoTypesResponse", + "client": { + "shortName": "DlpServiceClient", + "fullName": "google.privacy.dlp.v2.DlpServiceClient" + }, + "method": { + "shortName": "ListStoredInfoTypes", + "fullName": "google.privacy.dlp.v2.DlpService.ListStoredInfoTypes", + "service": { + "shortName": "DlpService", + "fullName": "google.privacy.dlp.v2.DlpService" + } + } + } + }, + { + "regionTag": "dlp_v2_generated_DlpService_DeleteStoredInfoType_async", + "title": "DlpService deleteStoredInfoType Sample", + "origin": "API_DEFINITION", + "description": " Deletes a stored infoType. See https://cloud.google.com/dlp/docs/creating-stored-infotypes to learn more.", + "canonical": true, + "file": "dlp_service.delete_stored_info_type.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 52, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteStoredInfoType", + "fullName": "google.privacy.dlp.v2.DlpService.DeleteStoredInfoType", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "DlpServiceClient", + "fullName": "google.privacy.dlp.v2.DlpServiceClient" + }, + "method": { + "shortName": "DeleteStoredInfoType", + "fullName": "google.privacy.dlp.v2.DlpService.DeleteStoredInfoType", + "service": { + "shortName": "DlpService", + "fullName": "google.privacy.dlp.v2.DlpService" + } + } + } + }, + { + "regionTag": "dlp_v2_generated_DlpService_HybridInspectDlpJob_async", + "title": "DlpService hybridInspectDlpJob Sample", + "origin": "API_DEFINITION", + "description": " Inspect hybrid content and store findings to a job. To review the findings, inspect the job. Inspection will occur asynchronously.", + "canonical": true, + "file": "dlp_service.hybrid_inspect_dlp_job.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "HybridInspectDlpJob", + "fullName": "google.privacy.dlp.v2.DlpService.HybridInspectDlpJob", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "hybrid_item", + "type": ".google.privacy.dlp.v2.HybridContentItem" + } + ], + "resultType": ".google.privacy.dlp.v2.HybridInspectResponse", + "client": { + "shortName": "DlpServiceClient", + "fullName": "google.privacy.dlp.v2.DlpServiceClient" + }, + "method": { + "shortName": "HybridInspectDlpJob", + "fullName": "google.privacy.dlp.v2.DlpService.HybridInspectDlpJob", + "service": { + "shortName": "DlpService", + "fullName": "google.privacy.dlp.v2.DlpService" + } + } + } + }, + { + "regionTag": "dlp_v2_generated_DlpService_FinishDlpJob_async", + "title": "DlpService finishDlpJob Sample", + "origin": "API_DEFINITION", + "description": " Finish a running hybrid DlpJob. Triggers the finalization steps and running of any enabled actions that have not yet run.", + "canonical": true, + "file": "dlp_service.finish_dlp_job.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 50, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "FinishDlpJob", + "fullName": "google.privacy.dlp.v2.DlpService.FinishDlpJob", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "DlpServiceClient", + "fullName": "google.privacy.dlp.v2.DlpServiceClient" + }, + "method": { + "shortName": "FinishDlpJob", + "fullName": "google.privacy.dlp.v2.DlpService.FinishDlpJob", + "service": { + "shortName": "DlpService", + "fullName": "google.privacy.dlp.v2.DlpService" + } + } + } + } + ] +} diff --git a/owl-bot-staging/v2/src/index.ts b/owl-bot-staging/v2/src/index.ts new file mode 100644 index 00000000..3697ec51 --- /dev/null +++ b/owl-bot-staging/v2/src/index.ts @@ -0,0 +1,25 @@ +// Copyright 2022 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; +type DlpServiceClient = v2.DlpServiceClient; +export {v2, DlpServiceClient}; +export default {v2, DlpServiceClient}; +import * as protos from '../protos/protos'; +export {protos} diff --git a/owl-bot-staging/v2/src/v2/dlp_service_client.ts b/owl-bot-staging/v2/src/v2/dlp_service_client.ts new file mode 100644 index 00000000..daf346fe --- /dev/null +++ b/owl-bot-staging/v2/src/v2/dlp_service_client.ts @@ -0,0 +1,5238 @@ +// Copyright 2022 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. ** + +/* global window */ +import * as gax from 'google-gax'; +import {Callback, CallOptions, Descriptors, ClientOptions, PaginationCallback, GaxCall} from 'google-gax'; + +import { Transform } from 'stream'; +import { RequestType } from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v2/dlp_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +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 _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + dlpServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of DlpServiceClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance). + * The common options are: + * @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 {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP fallback mode. + * In fallback mode, a special browser-compatible transport implementation is used + * instead of gRPC transport. In browser context (if the `window` object is defined) + * the fallback mode is enabled automatically; set `options.fallback` to `false` + * if you need to override this behavior. + */ + constructor(opts?: ClientOptions) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof DlpServiceClient; + const servicePath = opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gax.fallback : gax; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [ + `gax/${this._gaxModule.version}`, + `gapic/${version}`, + ]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else if (opts.fallback === 'rest' ) { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + findingPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/findings/{finding}' + ), + organizationPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}' + ), + organizationDeidentifyTemplatePathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/deidentifyTemplates/{deidentify_template}' + ), + organizationInspectTemplatePathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/inspectTemplates/{inspect_template}' + ), + organizationLocationDeidentifyTemplatePathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/locations/{location}/deidentifyTemplates/{deidentify_template}' + ), + organizationLocationInspectTemplatePathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/locations/{location}/inspectTemplates/{inspect_template}' + ), + organizationLocationStoredInfoTypePathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/locations/{location}/storedInfoTypes/{stored_info_type}' + ), + organizationStoredInfoTypePathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/storedInfoTypes/{stored_info_type}' + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}' + ), + projectDeidentifyTemplatePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/deidentifyTemplates/{deidentify_template}' + ), + projectDlpContentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/dlpContent' + ), + projectDlpJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/dlpJobs/{dlp_job}' + ), + projectInspectTemplatePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/inspectTemplates/{inspect_template}' + ), + projectJobTriggerPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/jobTriggers/{job_trigger}' + ), + projectLocationDeidentifyTemplatePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/deidentifyTemplates/{deidentify_template}' + ), + projectLocationDlpJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/dlpJobs/{dlp_job}' + ), + projectLocationInspectTemplatePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/inspectTemplates/{inspect_template}' + ), + projectLocationJobTriggerPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/jobTriggers/{job_trigger}' + ), + projectLocationStoredInfoTypePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/storedInfoTypes/{stored_info_type}' + ), + projectStoredInfoTypePathTemplate: new this._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 this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'inspectTemplates'), + listDeidentifyTemplates: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'deidentifyTemplates'), + listJobTriggers: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'jobTriggers'), + listDlpJobs: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'jobs'), + listStoredInfoTypes: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'storedInfoTypes') + }; + + // Put together the default options sent with requests. + this._defaults = this._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 = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = gax.warn; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.dlpServiceStub) { + return this.dlpServiceStub; + } + + // Put together the "service stub" for + // google.privacy.dlp.v2.DlpService. + this.dlpServiceStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.privacy.dlp.v2.DlpService') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.privacy.dlp.v2.DlpService, + this._opts, this._providedCustomServicePath) 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', 'hybridInspectJobTrigger', 'getJobTrigger', 'listJobTriggers', 'deleteJobTrigger', 'activateJobTrigger', 'createDlpJob', 'listDlpJobs', 'getDlpJob', 'deleteDlpJob', 'cancelDlpJob', 'createStoredInfoType', 'updateStoredInfoType', 'getStoredInfoType', 'listStoredInfoTypes', 'deleteStoredInfoType', 'hybridInspectDlpJob', 'finishDlpJob']; + for (const methodName of dlpServiceStubMethods) { + const callPromise = this.dlpServiceStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error|null|undefined) => () => { + throw err; + }); + + const descriptor = + this.descriptors.page[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.dlpServiceStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'dlp.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + return 'dlp.googleapis.com'; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + 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. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId(callback?: Callback): + Promise|void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- 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 + * Parent resource name. + * + * The format of this value varies depending on whether you have [specified a + * processing + * location](https://cloud.google.com/dlp/docs/specifying-location): + * + * + Projects scope, location specified:
+ * `projects/`PROJECT_ID`/locations/`LOCATION_ID + * + Projects scope, no location specified (defaults to global):
+ * `projects/`PROJECT_ID + * + * The following example `parent` string specifies a parent project with the + * identifier `example-project`, and specifies the `europe-west3` location + * for processing data: + * + * parent=projects/example-project/locations/europe-west3 + * @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 + * Deprecated. This field has no effect. + * @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}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v2/dlp_service.inspect_content.js + * region_tag:dlp_v2_generated_DlpService_InspectContent_async + */ + inspectContent( + request?: protos.google.privacy.dlp.v2.IInspectContentRequest, + options?: CallOptions): + Promise<[ + protos.google.privacy.dlp.v2.IInspectContentResponse, + protos.google.privacy.dlp.v2.IInspectContentRequest|undefined, {}|undefined + ]>; + inspectContent( + request: protos.google.privacy.dlp.v2.IInspectContentRequest, + options: CallOptions, + callback: Callback< + protos.google.privacy.dlp.v2.IInspectContentResponse, + protos.google.privacy.dlp.v2.IInspectContentRequest|null|undefined, + {}|null|undefined>): void; + inspectContent( + request: protos.google.privacy.dlp.v2.IInspectContentRequest, + callback: Callback< + protos.google.privacy.dlp.v2.IInspectContentResponse, + protos.google.privacy.dlp.v2.IInspectContentRequest|null|undefined, + {}|null|undefined>): void; + inspectContent( + request?: protos.google.privacy.dlp.v2.IInspectContentRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.privacy.dlp.v2.IInspectContentResponse, + protos.google.privacy.dlp.v2.IInspectContentRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.privacy.dlp.v2.IInspectContentResponse, + protos.google.privacy.dlp.v2.IInspectContentRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.privacy.dlp.v2.IInspectContentResponse, + protos.google.privacy.dlp.v2.IInspectContentRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as 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 || '', + }); + this.initialize(); + 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 + * Parent resource name. + * + * The format of this value varies depending on whether you have [specified a + * processing + * location](https://cloud.google.com/dlp/docs/specifying-location): + * + * + Projects scope, location specified:
+ * `projects/`PROJECT_ID`/locations/`LOCATION_ID + * + Projects scope, no location specified (defaults to global):
+ * `projects/`PROJECT_ID + * + * The following example `parent` string specifies a parent project with the + * identifier `example-project`, and specifies the `europe-west3` location + * for processing data: + * + * parent=projects/example-project/locations/europe-west3 + * @param {string} request.locationId + * Deprecated. This field has no effect. + * @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}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v2/dlp_service.redact_image.js + * region_tag:dlp_v2_generated_DlpService_RedactImage_async + */ + redactImage( + request?: protos.google.privacy.dlp.v2.IRedactImageRequest, + options?: CallOptions): + Promise<[ + protos.google.privacy.dlp.v2.IRedactImageResponse, + protos.google.privacy.dlp.v2.IRedactImageRequest|undefined, {}|undefined + ]>; + redactImage( + request: protos.google.privacy.dlp.v2.IRedactImageRequest, + options: CallOptions, + callback: Callback< + protos.google.privacy.dlp.v2.IRedactImageResponse, + protos.google.privacy.dlp.v2.IRedactImageRequest|null|undefined, + {}|null|undefined>): void; + redactImage( + request: protos.google.privacy.dlp.v2.IRedactImageRequest, + callback: Callback< + protos.google.privacy.dlp.v2.IRedactImageResponse, + protos.google.privacy.dlp.v2.IRedactImageRequest|null|undefined, + {}|null|undefined>): void; + redactImage( + request?: protos.google.privacy.dlp.v2.IRedactImageRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.privacy.dlp.v2.IRedactImageResponse, + protos.google.privacy.dlp.v2.IRedactImageRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.privacy.dlp.v2.IRedactImageResponse, + protos.google.privacy.dlp.v2.IRedactImageRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.privacy.dlp.v2.IRedactImageResponse, + protos.google.privacy.dlp.v2.IRedactImageRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as 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 || '', + }); + this.initialize(); + 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 + * Parent resource name. + * + * The format of this value varies depending on whether you have [specified a + * processing + * location](https://cloud.google.com/dlp/docs/specifying-location): + * + * + Projects scope, location specified:
+ * `projects/`PROJECT_ID`/locations/`LOCATION_ID + * + Projects scope, no location specified (defaults to global):
+ * `projects/`PROJECT_ID + * + * The following example `parent` string specifies a parent project with the + * identifier `example-project`, and specifies the `europe-west3` location + * for processing data: + * + * parent=projects/example-project/locations/europe-west3 + * @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 + * Deprecated. This field has no effect. + * @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}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v2/dlp_service.deidentify_content.js + * region_tag:dlp_v2_generated_DlpService_DeidentifyContent_async + */ + deidentifyContent( + request?: protos.google.privacy.dlp.v2.IDeidentifyContentRequest, + options?: CallOptions): + Promise<[ + protos.google.privacy.dlp.v2.IDeidentifyContentResponse, + protos.google.privacy.dlp.v2.IDeidentifyContentRequest|undefined, {}|undefined + ]>; + deidentifyContent( + request: protos.google.privacy.dlp.v2.IDeidentifyContentRequest, + options: CallOptions, + callback: Callback< + protos.google.privacy.dlp.v2.IDeidentifyContentResponse, + protos.google.privacy.dlp.v2.IDeidentifyContentRequest|null|undefined, + {}|null|undefined>): void; + deidentifyContent( + request: protos.google.privacy.dlp.v2.IDeidentifyContentRequest, + callback: Callback< + protos.google.privacy.dlp.v2.IDeidentifyContentResponse, + protos.google.privacy.dlp.v2.IDeidentifyContentRequest|null|undefined, + {}|null|undefined>): void; + deidentifyContent( + request?: protos.google.privacy.dlp.v2.IDeidentifyContentRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.privacy.dlp.v2.IDeidentifyContentResponse, + protos.google.privacy.dlp.v2.IDeidentifyContentRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.privacy.dlp.v2.IDeidentifyContentResponse, + protos.google.privacy.dlp.v2.IDeidentifyContentRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.privacy.dlp.v2.IDeidentifyContentResponse, + protos.google.privacy.dlp.v2.IDeidentifyContentRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as 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 || '', + }); + this.initialize(); + 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. Parent resource name. + * + * The format of this value varies depending on whether you have [specified a + * processing + * location](https://cloud.google.com/dlp/docs/specifying-location): + * + * + Projects scope, location specified:
+ * `projects/`PROJECT_ID`/locations/`LOCATION_ID + * + Projects scope, no location specified (defaults to global):
+ * `projects/`PROJECT_ID + * + * The following example `parent` string specifies a parent project with the + * identifier `example-project`, and specifies the `europe-west3` location + * for processing data: + * + * parent=projects/example-project/locations/europe-west3 + * @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. The + * `DeidentifyTemplate` used must include only reversible transformations. + * 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 + * Deprecated. This field has no effect. + * @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}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v2/dlp_service.reidentify_content.js + * region_tag:dlp_v2_generated_DlpService_ReidentifyContent_async + */ + reidentifyContent( + request?: protos.google.privacy.dlp.v2.IReidentifyContentRequest, + options?: CallOptions): + Promise<[ + protos.google.privacy.dlp.v2.IReidentifyContentResponse, + protos.google.privacy.dlp.v2.IReidentifyContentRequest|undefined, {}|undefined + ]>; + reidentifyContent( + request: protos.google.privacy.dlp.v2.IReidentifyContentRequest, + options: CallOptions, + callback: Callback< + protos.google.privacy.dlp.v2.IReidentifyContentResponse, + protos.google.privacy.dlp.v2.IReidentifyContentRequest|null|undefined, + {}|null|undefined>): void; + reidentifyContent( + request: protos.google.privacy.dlp.v2.IReidentifyContentRequest, + callback: Callback< + protos.google.privacy.dlp.v2.IReidentifyContentResponse, + protos.google.privacy.dlp.v2.IReidentifyContentRequest|null|undefined, + {}|null|undefined>): void; + reidentifyContent( + request?: protos.google.privacy.dlp.v2.IReidentifyContentRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.privacy.dlp.v2.IReidentifyContentResponse, + protos.google.privacy.dlp.v2.IReidentifyContentRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.privacy.dlp.v2.IReidentifyContentResponse, + protos.google.privacy.dlp.v2.IReidentifyContentRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.privacy.dlp.v2.IReidentifyContentResponse, + protos.google.privacy.dlp.v2.IReidentifyContentRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as 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 || '', + }); + this.initialize(); + 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.parent + * The parent resource name. + * + * The format of this value is as follows: + * + * locations/LOCATION_ID + * @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 + * Deprecated. This field has no effect. + * @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}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v2/dlp_service.list_info_types.js + * region_tag:dlp_v2_generated_DlpService_ListInfoTypes_async + */ + listInfoTypes( + request?: protos.google.privacy.dlp.v2.IListInfoTypesRequest, + options?: CallOptions): + Promise<[ + protos.google.privacy.dlp.v2.IListInfoTypesResponse, + protos.google.privacy.dlp.v2.IListInfoTypesRequest|undefined, {}|undefined + ]>; + listInfoTypes( + request: protos.google.privacy.dlp.v2.IListInfoTypesRequest, + options: CallOptions, + callback: Callback< + protos.google.privacy.dlp.v2.IListInfoTypesResponse, + protos.google.privacy.dlp.v2.IListInfoTypesRequest|null|undefined, + {}|null|undefined>): void; + listInfoTypes( + request: protos.google.privacy.dlp.v2.IListInfoTypesRequest, + callback: Callback< + protos.google.privacy.dlp.v2.IListInfoTypesResponse, + protos.google.privacy.dlp.v2.IListInfoTypesRequest|null|undefined, + {}|null|undefined>): void; + listInfoTypes( + request?: protos.google.privacy.dlp.v2.IListInfoTypesRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.privacy.dlp.v2.IListInfoTypesResponse, + protos.google.privacy.dlp.v2.IListInfoTypesRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.privacy.dlp.v2.IListInfoTypesResponse, + protos.google.privacy.dlp.v2.IListInfoTypesRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.privacy.dlp.v2.IListInfoTypesResponse, + protos.google.privacy.dlp.v2.IListInfoTypesRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as 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 || '', + }); + this.initialize(); + 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. Parent resource name. + * + * The format of this value varies depending on the scope of the request + * (project or organization) and whether you have [specified a processing + * location](https://cloud.google.com/dlp/docs/specifying-location): + * + * + Projects scope, location specified:
+ * `projects/`PROJECT_ID`/locations/`LOCATION_ID + * + Projects scope, no location specified (defaults to global):
+ * `projects/`PROJECT_ID + * + Organizations scope, location specified:
+ * `organizations/`ORG_ID`/locations/`LOCATION_ID + * + Organizations scope, no location specified (defaults to global):
+ * `organizations/`ORG_ID + * + * The following example `parent` string specifies a parent project with the + * identifier `example-project`, and specifies the `europe-west3` location + * for processing data: + * + * parent=projects/example-project/locations/europe-west3 + * @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 + * Deprecated. This field has no effect. + * @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}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v2/dlp_service.create_inspect_template.js + * region_tag:dlp_v2_generated_DlpService_CreateInspectTemplate_async + */ + createInspectTemplate( + request?: protos.google.privacy.dlp.v2.ICreateInspectTemplateRequest, + options?: CallOptions): + Promise<[ + protos.google.privacy.dlp.v2.IInspectTemplate, + protos.google.privacy.dlp.v2.ICreateInspectTemplateRequest|undefined, {}|undefined + ]>; + createInspectTemplate( + request: protos.google.privacy.dlp.v2.ICreateInspectTemplateRequest, + options: CallOptions, + callback: Callback< + protos.google.privacy.dlp.v2.IInspectTemplate, + protos.google.privacy.dlp.v2.ICreateInspectTemplateRequest|null|undefined, + {}|null|undefined>): void; + createInspectTemplate( + request: protos.google.privacy.dlp.v2.ICreateInspectTemplateRequest, + callback: Callback< + protos.google.privacy.dlp.v2.IInspectTemplate, + protos.google.privacy.dlp.v2.ICreateInspectTemplateRequest|null|undefined, + {}|null|undefined>): void; + createInspectTemplate( + request?: protos.google.privacy.dlp.v2.ICreateInspectTemplateRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.privacy.dlp.v2.IInspectTemplate, + protos.google.privacy.dlp.v2.ICreateInspectTemplateRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.privacy.dlp.v2.IInspectTemplate, + protos.google.privacy.dlp.v2.ICreateInspectTemplateRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.privacy.dlp.v2.IInspectTemplate, + protos.google.privacy.dlp.v2.ICreateInspectTemplateRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as 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 || '', + }); + this.initialize(); + 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 {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}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v2/dlp_service.update_inspect_template.js + * region_tag:dlp_v2_generated_DlpService_UpdateInspectTemplate_async + */ + updateInspectTemplate( + request?: protos.google.privacy.dlp.v2.IUpdateInspectTemplateRequest, + options?: CallOptions): + Promise<[ + protos.google.privacy.dlp.v2.IInspectTemplate, + protos.google.privacy.dlp.v2.IUpdateInspectTemplateRequest|undefined, {}|undefined + ]>; + updateInspectTemplate( + request: protos.google.privacy.dlp.v2.IUpdateInspectTemplateRequest, + options: CallOptions, + callback: Callback< + protos.google.privacy.dlp.v2.IInspectTemplate, + protos.google.privacy.dlp.v2.IUpdateInspectTemplateRequest|null|undefined, + {}|null|undefined>): void; + updateInspectTemplate( + request: protos.google.privacy.dlp.v2.IUpdateInspectTemplateRequest, + callback: Callback< + protos.google.privacy.dlp.v2.IInspectTemplate, + protos.google.privacy.dlp.v2.IUpdateInspectTemplateRequest|null|undefined, + {}|null|undefined>): void; + updateInspectTemplate( + request?: protos.google.privacy.dlp.v2.IUpdateInspectTemplateRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.privacy.dlp.v2.IInspectTemplate, + protos.google.privacy.dlp.v2.IUpdateInspectTemplateRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.privacy.dlp.v2.IInspectTemplate, + protos.google.privacy.dlp.v2.IUpdateInspectTemplateRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.privacy.dlp.v2.IInspectTemplate, + protos.google.privacy.dlp.v2.IUpdateInspectTemplateRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as 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 || '', + }); + this.initialize(); + 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] + * 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}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v2/dlp_service.get_inspect_template.js + * region_tag:dlp_v2_generated_DlpService_GetInspectTemplate_async + */ + getInspectTemplate( + request?: protos.google.privacy.dlp.v2.IGetInspectTemplateRequest, + options?: CallOptions): + Promise<[ + protos.google.privacy.dlp.v2.IInspectTemplate, + protos.google.privacy.dlp.v2.IGetInspectTemplateRequest|undefined, {}|undefined + ]>; + getInspectTemplate( + request: protos.google.privacy.dlp.v2.IGetInspectTemplateRequest, + options: CallOptions, + callback: Callback< + protos.google.privacy.dlp.v2.IInspectTemplate, + protos.google.privacy.dlp.v2.IGetInspectTemplateRequest|null|undefined, + {}|null|undefined>): void; + getInspectTemplate( + request: protos.google.privacy.dlp.v2.IGetInspectTemplateRequest, + callback: Callback< + protos.google.privacy.dlp.v2.IInspectTemplate, + protos.google.privacy.dlp.v2.IGetInspectTemplateRequest|null|undefined, + {}|null|undefined>): void; + getInspectTemplate( + request?: protos.google.privacy.dlp.v2.IGetInspectTemplateRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.privacy.dlp.v2.IInspectTemplate, + protos.google.privacy.dlp.v2.IGetInspectTemplateRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.privacy.dlp.v2.IInspectTemplate, + protos.google.privacy.dlp.v2.IGetInspectTemplateRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.privacy.dlp.v2.IInspectTemplate, + protos.google.privacy.dlp.v2.IGetInspectTemplateRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as 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 || '', + }); + this.initialize(); + return this.innerApiCalls.getInspectTemplate(request, options, callback); + } +/** + * 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}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v2/dlp_service.delete_inspect_template.js + * region_tag:dlp_v2_generated_DlpService_DeleteInspectTemplate_async + */ + deleteInspectTemplate( + request?: protos.google.privacy.dlp.v2.IDeleteInspectTemplateRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.privacy.dlp.v2.IDeleteInspectTemplateRequest|undefined, {}|undefined + ]>; + deleteInspectTemplate( + request: protos.google.privacy.dlp.v2.IDeleteInspectTemplateRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.privacy.dlp.v2.IDeleteInspectTemplateRequest|null|undefined, + {}|null|undefined>): void; + deleteInspectTemplate( + request: protos.google.privacy.dlp.v2.IDeleteInspectTemplateRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.privacy.dlp.v2.IDeleteInspectTemplateRequest|null|undefined, + {}|null|undefined>): void; + deleteInspectTemplate( + request?: protos.google.privacy.dlp.v2.IDeleteInspectTemplateRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.privacy.dlp.v2.IDeleteInspectTemplateRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.privacy.dlp.v2.IDeleteInspectTemplateRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.privacy.dlp.v2.IDeleteInspectTemplateRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as 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 || '', + }); + this.initialize(); + 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. Parent resource name. + * + * The format of this value varies depending on the scope of the request + * (project or organization) and whether you have [specified a processing + * location](https://cloud.google.com/dlp/docs/specifying-location): + * + * + Projects scope, location specified:
+ * `projects/`PROJECT_ID`/locations/`LOCATION_ID + * + Projects scope, no location specified (defaults to global):
+ * `projects/`PROJECT_ID + * + Organizations scope, location specified:
+ * `organizations/`ORG_ID`/locations/`LOCATION_ID + * + Organizations scope, no location specified (defaults to global):
+ * `organizations/`ORG_ID + * + * The following example `parent` string specifies a parent project with the + * identifier `example-project`, and specifies the `europe-west3` location + * for processing data: + * + * parent=projects/example-project/locations/europe-west3 + * @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 + * Deprecated. This field has no effect. + * @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}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v2/dlp_service.create_deidentify_template.js + * region_tag:dlp_v2_generated_DlpService_CreateDeidentifyTemplate_async + */ + createDeidentifyTemplate( + request?: protos.google.privacy.dlp.v2.ICreateDeidentifyTemplateRequest, + options?: CallOptions): + Promise<[ + protos.google.privacy.dlp.v2.IDeidentifyTemplate, + protos.google.privacy.dlp.v2.ICreateDeidentifyTemplateRequest|undefined, {}|undefined + ]>; + createDeidentifyTemplate( + request: protos.google.privacy.dlp.v2.ICreateDeidentifyTemplateRequest, + options: CallOptions, + callback: Callback< + protos.google.privacy.dlp.v2.IDeidentifyTemplate, + protos.google.privacy.dlp.v2.ICreateDeidentifyTemplateRequest|null|undefined, + {}|null|undefined>): void; + createDeidentifyTemplate( + request: protos.google.privacy.dlp.v2.ICreateDeidentifyTemplateRequest, + callback: Callback< + protos.google.privacy.dlp.v2.IDeidentifyTemplate, + protos.google.privacy.dlp.v2.ICreateDeidentifyTemplateRequest|null|undefined, + {}|null|undefined>): void; + createDeidentifyTemplate( + request?: protos.google.privacy.dlp.v2.ICreateDeidentifyTemplateRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.privacy.dlp.v2.IDeidentifyTemplate, + protos.google.privacy.dlp.v2.ICreateDeidentifyTemplateRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.privacy.dlp.v2.IDeidentifyTemplate, + protos.google.privacy.dlp.v2.ICreateDeidentifyTemplateRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.privacy.dlp.v2.IDeidentifyTemplate, + protos.google.privacy.dlp.v2.ICreateDeidentifyTemplateRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as 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 || '', + }); + this.initialize(); + 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 {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}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v2/dlp_service.update_deidentify_template.js + * region_tag:dlp_v2_generated_DlpService_UpdateDeidentifyTemplate_async + */ + updateDeidentifyTemplate( + request?: protos.google.privacy.dlp.v2.IUpdateDeidentifyTemplateRequest, + options?: CallOptions): + Promise<[ + protos.google.privacy.dlp.v2.IDeidentifyTemplate, + protos.google.privacy.dlp.v2.IUpdateDeidentifyTemplateRequest|undefined, {}|undefined + ]>; + updateDeidentifyTemplate( + request: protos.google.privacy.dlp.v2.IUpdateDeidentifyTemplateRequest, + options: CallOptions, + callback: Callback< + protos.google.privacy.dlp.v2.IDeidentifyTemplate, + protos.google.privacy.dlp.v2.IUpdateDeidentifyTemplateRequest|null|undefined, + {}|null|undefined>): void; + updateDeidentifyTemplate( + request: protos.google.privacy.dlp.v2.IUpdateDeidentifyTemplateRequest, + callback: Callback< + protos.google.privacy.dlp.v2.IDeidentifyTemplate, + protos.google.privacy.dlp.v2.IUpdateDeidentifyTemplateRequest|null|undefined, + {}|null|undefined>): void; + updateDeidentifyTemplate( + request?: protos.google.privacy.dlp.v2.IUpdateDeidentifyTemplateRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.privacy.dlp.v2.IDeidentifyTemplate, + protos.google.privacy.dlp.v2.IUpdateDeidentifyTemplateRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.privacy.dlp.v2.IDeidentifyTemplate, + protos.google.privacy.dlp.v2.IUpdateDeidentifyTemplateRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.privacy.dlp.v2.IDeidentifyTemplate, + protos.google.privacy.dlp.v2.IUpdateDeidentifyTemplateRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as 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 || '', + }); + this.initialize(); + 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] + * 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}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v2/dlp_service.get_deidentify_template.js + * region_tag:dlp_v2_generated_DlpService_GetDeidentifyTemplate_async + */ + getDeidentifyTemplate( + request?: protos.google.privacy.dlp.v2.IGetDeidentifyTemplateRequest, + options?: CallOptions): + Promise<[ + protos.google.privacy.dlp.v2.IDeidentifyTemplate, + protos.google.privacy.dlp.v2.IGetDeidentifyTemplateRequest|undefined, {}|undefined + ]>; + getDeidentifyTemplate( + request: protos.google.privacy.dlp.v2.IGetDeidentifyTemplateRequest, + options: CallOptions, + callback: Callback< + protos.google.privacy.dlp.v2.IDeidentifyTemplate, + protos.google.privacy.dlp.v2.IGetDeidentifyTemplateRequest|null|undefined, + {}|null|undefined>): void; + getDeidentifyTemplate( + request: protos.google.privacy.dlp.v2.IGetDeidentifyTemplateRequest, + callback: Callback< + protos.google.privacy.dlp.v2.IDeidentifyTemplate, + protos.google.privacy.dlp.v2.IGetDeidentifyTemplateRequest|null|undefined, + {}|null|undefined>): void; + getDeidentifyTemplate( + request?: protos.google.privacy.dlp.v2.IGetDeidentifyTemplateRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.privacy.dlp.v2.IDeidentifyTemplate, + protos.google.privacy.dlp.v2.IGetDeidentifyTemplateRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.privacy.dlp.v2.IDeidentifyTemplate, + protos.google.privacy.dlp.v2.IGetDeidentifyTemplateRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.privacy.dlp.v2.IDeidentifyTemplate, + protos.google.privacy.dlp.v2.IGetDeidentifyTemplateRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as 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 || '', + }); + this.initialize(); + return this.innerApiCalls.getDeidentifyTemplate(request, options, callback); + } +/** + * 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}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v2/dlp_service.delete_deidentify_template.js + * region_tag:dlp_v2_generated_DlpService_DeleteDeidentifyTemplate_async + */ + deleteDeidentifyTemplate( + request?: protos.google.privacy.dlp.v2.IDeleteDeidentifyTemplateRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.privacy.dlp.v2.IDeleteDeidentifyTemplateRequest|undefined, {}|undefined + ]>; + deleteDeidentifyTemplate( + request: protos.google.privacy.dlp.v2.IDeleteDeidentifyTemplateRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.privacy.dlp.v2.IDeleteDeidentifyTemplateRequest|null|undefined, + {}|null|undefined>): void; + deleteDeidentifyTemplate( + request: protos.google.privacy.dlp.v2.IDeleteDeidentifyTemplateRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.privacy.dlp.v2.IDeleteDeidentifyTemplateRequest|null|undefined, + {}|null|undefined>): void; + deleteDeidentifyTemplate( + request?: protos.google.privacy.dlp.v2.IDeleteDeidentifyTemplateRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.privacy.dlp.v2.IDeleteDeidentifyTemplateRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.privacy.dlp.v2.IDeleteDeidentifyTemplateRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.privacy.dlp.v2.IDeleteDeidentifyTemplateRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as 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 || '', + }); + this.initialize(); + return this.innerApiCalls.deleteDeidentifyTemplate(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. Parent resource name. + * + * The format of this value varies depending on whether you have [specified a + * processing + * location](https://cloud.google.com/dlp/docs/specifying-location): + * + * + Projects scope, location specified:
+ * `projects/`PROJECT_ID`/locations/`LOCATION_ID + * + Projects scope, no location specified (defaults to global):
+ * `projects/`PROJECT_ID + * + * The following example `parent` string specifies a parent project with the + * identifier `example-project`, and specifies the `europe-west3` location + * for processing data: + * + * parent=projects/example-project/locations/europe-west3 + * @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 + * Deprecated. This field has no effect. + * @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}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v2/dlp_service.create_job_trigger.js + * region_tag:dlp_v2_generated_DlpService_CreateJobTrigger_async + */ + createJobTrigger( + request?: protos.google.privacy.dlp.v2.ICreateJobTriggerRequest, + options?: CallOptions): + Promise<[ + protos.google.privacy.dlp.v2.IJobTrigger, + protos.google.privacy.dlp.v2.ICreateJobTriggerRequest|undefined, {}|undefined + ]>; + createJobTrigger( + request: protos.google.privacy.dlp.v2.ICreateJobTriggerRequest, + options: CallOptions, + callback: Callback< + protos.google.privacy.dlp.v2.IJobTrigger, + protos.google.privacy.dlp.v2.ICreateJobTriggerRequest|null|undefined, + {}|null|undefined>): void; + createJobTrigger( + request: protos.google.privacy.dlp.v2.ICreateJobTriggerRequest, + callback: Callback< + protos.google.privacy.dlp.v2.IJobTrigger, + protos.google.privacy.dlp.v2.ICreateJobTriggerRequest|null|undefined, + {}|null|undefined>): void; + createJobTrigger( + request?: protos.google.privacy.dlp.v2.ICreateJobTriggerRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.privacy.dlp.v2.IJobTrigger, + protos.google.privacy.dlp.v2.ICreateJobTriggerRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.privacy.dlp.v2.IJobTrigger, + protos.google.privacy.dlp.v2.ICreateJobTriggerRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.privacy.dlp.v2.IJobTrigger, + protos.google.privacy.dlp.v2.ICreateJobTriggerRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as 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 || '', + }); + this.initialize(); + return this.innerApiCalls.createJobTrigger(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 {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}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v2/dlp_service.update_job_trigger.js + * region_tag:dlp_v2_generated_DlpService_UpdateJobTrigger_async + */ + updateJobTrigger( + request?: protos.google.privacy.dlp.v2.IUpdateJobTriggerRequest, + options?: CallOptions): + Promise<[ + protos.google.privacy.dlp.v2.IJobTrigger, + protos.google.privacy.dlp.v2.IUpdateJobTriggerRequest|undefined, {}|undefined + ]>; + updateJobTrigger( + request: protos.google.privacy.dlp.v2.IUpdateJobTriggerRequest, + options: CallOptions, + callback: Callback< + protos.google.privacy.dlp.v2.IJobTrigger, + protos.google.privacy.dlp.v2.IUpdateJobTriggerRequest|null|undefined, + {}|null|undefined>): void; + updateJobTrigger( + request: protos.google.privacy.dlp.v2.IUpdateJobTriggerRequest, + callback: Callback< + protos.google.privacy.dlp.v2.IJobTrigger, + protos.google.privacy.dlp.v2.IUpdateJobTriggerRequest|null|undefined, + {}|null|undefined>): void; + updateJobTrigger( + request?: protos.google.privacy.dlp.v2.IUpdateJobTriggerRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.privacy.dlp.v2.IJobTrigger, + protos.google.privacy.dlp.v2.IUpdateJobTriggerRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.privacy.dlp.v2.IJobTrigger, + protos.google.privacy.dlp.v2.IUpdateJobTriggerRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.privacy.dlp.v2.IJobTrigger, + protos.google.privacy.dlp.v2.IUpdateJobTriggerRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as 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 || '', + }); + this.initialize(); + return this.innerApiCalls.updateJobTrigger(request, options, callback); + } +/** + * Inspect hybrid content and store findings to a trigger. The inspection + * will be processed asynchronously. To review the findings monitor the + * jobs within the trigger. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Resource name of the trigger to execute a hybrid inspect on, for example + * `projects/dlp-test-project/jobTriggers/53234423`. + * @param {google.privacy.dlp.v2.HybridContentItem} request.hybridItem + * The item to inspect. + * @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 [HybridInspectResponse]{@link google.privacy.dlp.v2.HybridInspectResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v2/dlp_service.hybrid_inspect_job_trigger.js + * region_tag:dlp_v2_generated_DlpService_HybridInspectJobTrigger_async + */ + hybridInspectJobTrigger( + request?: protos.google.privacy.dlp.v2.IHybridInspectJobTriggerRequest, + options?: CallOptions): + Promise<[ + protos.google.privacy.dlp.v2.IHybridInspectResponse, + protos.google.privacy.dlp.v2.IHybridInspectJobTriggerRequest|undefined, {}|undefined + ]>; + hybridInspectJobTrigger( + request: protos.google.privacy.dlp.v2.IHybridInspectJobTriggerRequest, + options: CallOptions, + callback: Callback< + protos.google.privacy.dlp.v2.IHybridInspectResponse, + protos.google.privacy.dlp.v2.IHybridInspectJobTriggerRequest|null|undefined, + {}|null|undefined>): void; + hybridInspectJobTrigger( + request: protos.google.privacy.dlp.v2.IHybridInspectJobTriggerRequest, + callback: Callback< + protos.google.privacy.dlp.v2.IHybridInspectResponse, + protos.google.privacy.dlp.v2.IHybridInspectJobTriggerRequest|null|undefined, + {}|null|undefined>): void; + hybridInspectJobTrigger( + request?: protos.google.privacy.dlp.v2.IHybridInspectJobTriggerRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.privacy.dlp.v2.IHybridInspectResponse, + protos.google.privacy.dlp.v2.IHybridInspectJobTriggerRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.privacy.dlp.v2.IHybridInspectResponse, + protos.google.privacy.dlp.v2.IHybridInspectJobTriggerRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.privacy.dlp.v2.IHybridInspectResponse, + protos.google.privacy.dlp.v2.IHybridInspectJobTriggerRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as 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 || '', + }); + this.initialize(); + return this.innerApiCalls.hybridInspectJobTrigger(request, options, callback); + } +/** + * 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}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v2/dlp_service.get_job_trigger.js + * region_tag:dlp_v2_generated_DlpService_GetJobTrigger_async + */ + getJobTrigger( + request?: protos.google.privacy.dlp.v2.IGetJobTriggerRequest, + options?: CallOptions): + Promise<[ + protos.google.privacy.dlp.v2.IJobTrigger, + protos.google.privacy.dlp.v2.IGetJobTriggerRequest|undefined, {}|undefined + ]>; + getJobTrigger( + request: protos.google.privacy.dlp.v2.IGetJobTriggerRequest, + options: CallOptions, + callback: Callback< + protos.google.privacy.dlp.v2.IJobTrigger, + protos.google.privacy.dlp.v2.IGetJobTriggerRequest|null|undefined, + {}|null|undefined>): void; + getJobTrigger( + request: protos.google.privacy.dlp.v2.IGetJobTriggerRequest, + callback: Callback< + protos.google.privacy.dlp.v2.IJobTrigger, + protos.google.privacy.dlp.v2.IGetJobTriggerRequest|null|undefined, + {}|null|undefined>): void; + getJobTrigger( + request?: protos.google.privacy.dlp.v2.IGetJobTriggerRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.privacy.dlp.v2.IJobTrigger, + protos.google.privacy.dlp.v2.IGetJobTriggerRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.privacy.dlp.v2.IJobTrigger, + protos.google.privacy.dlp.v2.IGetJobTriggerRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.privacy.dlp.v2.IJobTrigger, + protos.google.privacy.dlp.v2.IGetJobTriggerRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as 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 || '', + }); + this.initialize(); + 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] + * 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}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v2/dlp_service.delete_job_trigger.js + * region_tag:dlp_v2_generated_DlpService_DeleteJobTrigger_async + */ + deleteJobTrigger( + request?: protos.google.privacy.dlp.v2.IDeleteJobTriggerRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.privacy.dlp.v2.IDeleteJobTriggerRequest|undefined, {}|undefined + ]>; + deleteJobTrigger( + request: protos.google.privacy.dlp.v2.IDeleteJobTriggerRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.privacy.dlp.v2.IDeleteJobTriggerRequest|null|undefined, + {}|null|undefined>): void; + deleteJobTrigger( + request: protos.google.privacy.dlp.v2.IDeleteJobTriggerRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.privacy.dlp.v2.IDeleteJobTriggerRequest|null|undefined, + {}|null|undefined>): void; + deleteJobTrigger( + request?: protos.google.privacy.dlp.v2.IDeleteJobTriggerRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.privacy.dlp.v2.IDeleteJobTriggerRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.privacy.dlp.v2.IDeleteJobTriggerRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.privacy.dlp.v2.IDeleteJobTriggerRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as 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 || '', + }); + this.initialize(); + return this.innerApiCalls.deleteJobTrigger(request, options, callback); + } +/** + * 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}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v2/dlp_service.activate_job_trigger.js + * region_tag:dlp_v2_generated_DlpService_ActivateJobTrigger_async + */ + activateJobTrigger( + request?: protos.google.privacy.dlp.v2.IActivateJobTriggerRequest, + options?: CallOptions): + Promise<[ + protos.google.privacy.dlp.v2.IDlpJob, + protos.google.privacy.dlp.v2.IActivateJobTriggerRequest|undefined, {}|undefined + ]>; + activateJobTrigger( + request: protos.google.privacy.dlp.v2.IActivateJobTriggerRequest, + options: CallOptions, + callback: Callback< + protos.google.privacy.dlp.v2.IDlpJob, + protos.google.privacy.dlp.v2.IActivateJobTriggerRequest|null|undefined, + {}|null|undefined>): void; + activateJobTrigger( + request: protos.google.privacy.dlp.v2.IActivateJobTriggerRequest, + callback: Callback< + protos.google.privacy.dlp.v2.IDlpJob, + protos.google.privacy.dlp.v2.IActivateJobTriggerRequest|null|undefined, + {}|null|undefined>): void; + activateJobTrigger( + request?: protos.google.privacy.dlp.v2.IActivateJobTriggerRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.privacy.dlp.v2.IDlpJob, + protos.google.privacy.dlp.v2.IActivateJobTriggerRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.privacy.dlp.v2.IDlpJob, + protos.google.privacy.dlp.v2.IActivateJobTriggerRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.privacy.dlp.v2.IDlpJob, + protos.google.privacy.dlp.v2.IActivateJobTriggerRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as 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 || '', + }); + this.initialize(); + return this.innerApiCalls.activateJobTrigger(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. Parent resource name. + * + * The format of this value varies depending on whether you have [specified a + * processing + * location](https://cloud.google.com/dlp/docs/specifying-location): + * + * + Projects scope, location specified:
+ * `projects/`PROJECT_ID`/locations/`LOCATION_ID + * + Projects scope, no location specified (defaults to global):
+ * `projects/`PROJECT_ID + * + * The following example `parent` string specifies a parent project with the + * identifier `example-project`, and specifies the `europe-west3` location + * for processing data: + * + * parent=projects/example-project/locations/europe-west3 + * @param {google.privacy.dlp.v2.InspectJobConfig} request.inspectJob + * An inspection job scans a storage repository for InfoTypes. + * @param {google.privacy.dlp.v2.RiskAnalysisJobConfig} request.riskJob + * A risk analysis job calculates re-identification risk metrics for a + * BigQuery table. + * @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 + * Deprecated. This field has no effect. + * @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}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v2/dlp_service.create_dlp_job.js + * region_tag:dlp_v2_generated_DlpService_CreateDlpJob_async + */ + createDlpJob( + request?: protos.google.privacy.dlp.v2.ICreateDlpJobRequest, + options?: CallOptions): + Promise<[ + protos.google.privacy.dlp.v2.IDlpJob, + protos.google.privacy.dlp.v2.ICreateDlpJobRequest|undefined, {}|undefined + ]>; + createDlpJob( + request: protos.google.privacy.dlp.v2.ICreateDlpJobRequest, + options: CallOptions, + callback: Callback< + protos.google.privacy.dlp.v2.IDlpJob, + protos.google.privacy.dlp.v2.ICreateDlpJobRequest|null|undefined, + {}|null|undefined>): void; + createDlpJob( + request: protos.google.privacy.dlp.v2.ICreateDlpJobRequest, + callback: Callback< + protos.google.privacy.dlp.v2.IDlpJob, + protos.google.privacy.dlp.v2.ICreateDlpJobRequest|null|undefined, + {}|null|undefined>): void; + createDlpJob( + request?: protos.google.privacy.dlp.v2.ICreateDlpJobRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.privacy.dlp.v2.IDlpJob, + protos.google.privacy.dlp.v2.ICreateDlpJobRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.privacy.dlp.v2.IDlpJob, + protos.google.privacy.dlp.v2.ICreateDlpJobRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.privacy.dlp.v2.IDlpJob, + protos.google.privacy.dlp.v2.ICreateDlpJobRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as 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 || '', + }); + this.initialize(); + return this.innerApiCalls.createDlpJob(request, options, callback); + } +/** + * 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}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v2/dlp_service.get_dlp_job.js + * region_tag:dlp_v2_generated_DlpService_GetDlpJob_async + */ + getDlpJob( + request?: protos.google.privacy.dlp.v2.IGetDlpJobRequest, + options?: CallOptions): + Promise<[ + protos.google.privacy.dlp.v2.IDlpJob, + protos.google.privacy.dlp.v2.IGetDlpJobRequest|undefined, {}|undefined + ]>; + getDlpJob( + request: protos.google.privacy.dlp.v2.IGetDlpJobRequest, + options: CallOptions, + callback: Callback< + protos.google.privacy.dlp.v2.IDlpJob, + protos.google.privacy.dlp.v2.IGetDlpJobRequest|null|undefined, + {}|null|undefined>): void; + getDlpJob( + request: protos.google.privacy.dlp.v2.IGetDlpJobRequest, + callback: Callback< + protos.google.privacy.dlp.v2.IDlpJob, + protos.google.privacy.dlp.v2.IGetDlpJobRequest|null|undefined, + {}|null|undefined>): void; + getDlpJob( + request?: protos.google.privacy.dlp.v2.IGetDlpJobRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.privacy.dlp.v2.IDlpJob, + protos.google.privacy.dlp.v2.IGetDlpJobRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.privacy.dlp.v2.IDlpJob, + protos.google.privacy.dlp.v2.IGetDlpJobRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.privacy.dlp.v2.IDlpJob, + protos.google.privacy.dlp.v2.IGetDlpJobRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as 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 || '', + }); + this.initialize(); + 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] + * 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}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v2/dlp_service.delete_dlp_job.js + * region_tag:dlp_v2_generated_DlpService_DeleteDlpJob_async + */ + deleteDlpJob( + request?: protos.google.privacy.dlp.v2.IDeleteDlpJobRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.privacy.dlp.v2.IDeleteDlpJobRequest|undefined, {}|undefined + ]>; + deleteDlpJob( + request: protos.google.privacy.dlp.v2.IDeleteDlpJobRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.privacy.dlp.v2.IDeleteDlpJobRequest|null|undefined, + {}|null|undefined>): void; + deleteDlpJob( + request: protos.google.privacy.dlp.v2.IDeleteDlpJobRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.privacy.dlp.v2.IDeleteDlpJobRequest|null|undefined, + {}|null|undefined>): void; + deleteDlpJob( + request?: protos.google.privacy.dlp.v2.IDeleteDlpJobRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.privacy.dlp.v2.IDeleteDlpJobRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.privacy.dlp.v2.IDeleteDlpJobRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.privacy.dlp.v2.IDeleteDlpJobRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as 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 || '', + }); + this.initialize(); + 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] + * 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}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v2/dlp_service.cancel_dlp_job.js + * region_tag:dlp_v2_generated_DlpService_CancelDlpJob_async + */ + cancelDlpJob( + request?: protos.google.privacy.dlp.v2.ICancelDlpJobRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.privacy.dlp.v2.ICancelDlpJobRequest|undefined, {}|undefined + ]>; + cancelDlpJob( + request: protos.google.privacy.dlp.v2.ICancelDlpJobRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.privacy.dlp.v2.ICancelDlpJobRequest|null|undefined, + {}|null|undefined>): void; + cancelDlpJob( + request: protos.google.privacy.dlp.v2.ICancelDlpJobRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.privacy.dlp.v2.ICancelDlpJobRequest|null|undefined, + {}|null|undefined>): void; + cancelDlpJob( + request?: protos.google.privacy.dlp.v2.ICancelDlpJobRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.privacy.dlp.v2.ICancelDlpJobRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.privacy.dlp.v2.ICancelDlpJobRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.privacy.dlp.v2.ICancelDlpJobRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as 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 || '', + }); + this.initialize(); + return this.innerApiCalls.cancelDlpJob(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. Parent resource name. + * + * The format of this value varies depending on the scope of the request + * (project or organization) and whether you have [specified a processing + * location](https://cloud.google.com/dlp/docs/specifying-location): + * + * + Projects scope, location specified:
+ * `projects/`PROJECT_ID`/locations/`LOCATION_ID + * + Projects scope, no location specified (defaults to global):
+ * `projects/`PROJECT_ID + * + Organizations scope, location specified:
+ * `organizations/`ORG_ID`/locations/`LOCATION_ID + * + Organizations scope, no location specified (defaults to global):
+ * `organizations/`ORG_ID + * + * The following example `parent` string specifies a parent project with the + * identifier `example-project`, and specifies the `europe-west3` location + * for processing data: + * + * parent=projects/example-project/locations/europe-west3 + * @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 + * Deprecated. This field has no effect. + * @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}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v2/dlp_service.create_stored_info_type.js + * region_tag:dlp_v2_generated_DlpService_CreateStoredInfoType_async + */ + createStoredInfoType( + request?: protos.google.privacy.dlp.v2.ICreateStoredInfoTypeRequest, + options?: CallOptions): + Promise<[ + protos.google.privacy.dlp.v2.IStoredInfoType, + protos.google.privacy.dlp.v2.ICreateStoredInfoTypeRequest|undefined, {}|undefined + ]>; + createStoredInfoType( + request: protos.google.privacy.dlp.v2.ICreateStoredInfoTypeRequest, + options: CallOptions, + callback: Callback< + protos.google.privacy.dlp.v2.IStoredInfoType, + protos.google.privacy.dlp.v2.ICreateStoredInfoTypeRequest|null|undefined, + {}|null|undefined>): void; + createStoredInfoType( + request: protos.google.privacy.dlp.v2.ICreateStoredInfoTypeRequest, + callback: Callback< + protos.google.privacy.dlp.v2.IStoredInfoType, + protos.google.privacy.dlp.v2.ICreateStoredInfoTypeRequest|null|undefined, + {}|null|undefined>): void; + createStoredInfoType( + request?: protos.google.privacy.dlp.v2.ICreateStoredInfoTypeRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.privacy.dlp.v2.IStoredInfoType, + protos.google.privacy.dlp.v2.ICreateStoredInfoTypeRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.privacy.dlp.v2.IStoredInfoType, + protos.google.privacy.dlp.v2.ICreateStoredInfoTypeRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.privacy.dlp.v2.IStoredInfoType, + protos.google.privacy.dlp.v2.ICreateStoredInfoTypeRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as 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 || '', + }); + this.initialize(); + 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 {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}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v2/dlp_service.update_stored_info_type.js + * region_tag:dlp_v2_generated_DlpService_UpdateStoredInfoType_async + */ + updateStoredInfoType( + request?: protos.google.privacy.dlp.v2.IUpdateStoredInfoTypeRequest, + options?: CallOptions): + Promise<[ + protos.google.privacy.dlp.v2.IStoredInfoType, + protos.google.privacy.dlp.v2.IUpdateStoredInfoTypeRequest|undefined, {}|undefined + ]>; + updateStoredInfoType( + request: protos.google.privacy.dlp.v2.IUpdateStoredInfoTypeRequest, + options: CallOptions, + callback: Callback< + protos.google.privacy.dlp.v2.IStoredInfoType, + protos.google.privacy.dlp.v2.IUpdateStoredInfoTypeRequest|null|undefined, + {}|null|undefined>): void; + updateStoredInfoType( + request: protos.google.privacy.dlp.v2.IUpdateStoredInfoTypeRequest, + callback: Callback< + protos.google.privacy.dlp.v2.IStoredInfoType, + protos.google.privacy.dlp.v2.IUpdateStoredInfoTypeRequest|null|undefined, + {}|null|undefined>): void; + updateStoredInfoType( + request?: protos.google.privacy.dlp.v2.IUpdateStoredInfoTypeRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.privacy.dlp.v2.IStoredInfoType, + protos.google.privacy.dlp.v2.IUpdateStoredInfoTypeRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.privacy.dlp.v2.IStoredInfoType, + protos.google.privacy.dlp.v2.IUpdateStoredInfoTypeRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.privacy.dlp.v2.IStoredInfoType, + protos.google.privacy.dlp.v2.IUpdateStoredInfoTypeRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as 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 || '', + }); + this.initialize(); + 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] + * 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}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v2/dlp_service.get_stored_info_type.js + * region_tag:dlp_v2_generated_DlpService_GetStoredInfoType_async + */ + getStoredInfoType( + request?: protos.google.privacy.dlp.v2.IGetStoredInfoTypeRequest, + options?: CallOptions): + Promise<[ + protos.google.privacy.dlp.v2.IStoredInfoType, + protos.google.privacy.dlp.v2.IGetStoredInfoTypeRequest|undefined, {}|undefined + ]>; + getStoredInfoType( + request: protos.google.privacy.dlp.v2.IGetStoredInfoTypeRequest, + options: CallOptions, + callback: Callback< + protos.google.privacy.dlp.v2.IStoredInfoType, + protos.google.privacy.dlp.v2.IGetStoredInfoTypeRequest|null|undefined, + {}|null|undefined>): void; + getStoredInfoType( + request: protos.google.privacy.dlp.v2.IGetStoredInfoTypeRequest, + callback: Callback< + protos.google.privacy.dlp.v2.IStoredInfoType, + protos.google.privacy.dlp.v2.IGetStoredInfoTypeRequest|null|undefined, + {}|null|undefined>): void; + getStoredInfoType( + request?: protos.google.privacy.dlp.v2.IGetStoredInfoTypeRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.privacy.dlp.v2.IStoredInfoType, + protos.google.privacy.dlp.v2.IGetStoredInfoTypeRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.privacy.dlp.v2.IStoredInfoType, + protos.google.privacy.dlp.v2.IGetStoredInfoTypeRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.privacy.dlp.v2.IStoredInfoType, + protos.google.privacy.dlp.v2.IGetStoredInfoTypeRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as 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 || '', + }); + this.initialize(); + return this.innerApiCalls.getStoredInfoType(request, options, callback); + } +/** + * 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}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v2/dlp_service.delete_stored_info_type.js + * region_tag:dlp_v2_generated_DlpService_DeleteStoredInfoType_async + */ + deleteStoredInfoType( + request?: protos.google.privacy.dlp.v2.IDeleteStoredInfoTypeRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.privacy.dlp.v2.IDeleteStoredInfoTypeRequest|undefined, {}|undefined + ]>; + deleteStoredInfoType( + request: protos.google.privacy.dlp.v2.IDeleteStoredInfoTypeRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.privacy.dlp.v2.IDeleteStoredInfoTypeRequest|null|undefined, + {}|null|undefined>): void; + deleteStoredInfoType( + request: protos.google.privacy.dlp.v2.IDeleteStoredInfoTypeRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.privacy.dlp.v2.IDeleteStoredInfoTypeRequest|null|undefined, + {}|null|undefined>): void; + deleteStoredInfoType( + request?: protos.google.privacy.dlp.v2.IDeleteStoredInfoTypeRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.privacy.dlp.v2.IDeleteStoredInfoTypeRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.privacy.dlp.v2.IDeleteStoredInfoTypeRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.privacy.dlp.v2.IDeleteStoredInfoTypeRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as 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 || '', + }); + this.initialize(); + return this.innerApiCalls.deleteStoredInfoType(request, options, callback); + } +/** + * Inspect hybrid content and store findings to a job. + * To review the findings, inspect the job. Inspection will occur + * asynchronously. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Resource name of the job to execute a hybrid inspect on, for example + * `projects/dlp-test-project/dlpJob/53234423`. + * @param {google.privacy.dlp.v2.HybridContentItem} request.hybridItem + * The item to inspect. + * @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 [HybridInspectResponse]{@link google.privacy.dlp.v2.HybridInspectResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v2/dlp_service.hybrid_inspect_dlp_job.js + * region_tag:dlp_v2_generated_DlpService_HybridInspectDlpJob_async + */ + hybridInspectDlpJob( + request?: protos.google.privacy.dlp.v2.IHybridInspectDlpJobRequest, + options?: CallOptions): + Promise<[ + protos.google.privacy.dlp.v2.IHybridInspectResponse, + protos.google.privacy.dlp.v2.IHybridInspectDlpJobRequest|undefined, {}|undefined + ]>; + hybridInspectDlpJob( + request: protos.google.privacy.dlp.v2.IHybridInspectDlpJobRequest, + options: CallOptions, + callback: Callback< + protos.google.privacy.dlp.v2.IHybridInspectResponse, + protos.google.privacy.dlp.v2.IHybridInspectDlpJobRequest|null|undefined, + {}|null|undefined>): void; + hybridInspectDlpJob( + request: protos.google.privacy.dlp.v2.IHybridInspectDlpJobRequest, + callback: Callback< + protos.google.privacy.dlp.v2.IHybridInspectResponse, + protos.google.privacy.dlp.v2.IHybridInspectDlpJobRequest|null|undefined, + {}|null|undefined>): void; + hybridInspectDlpJob( + request?: protos.google.privacy.dlp.v2.IHybridInspectDlpJobRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.privacy.dlp.v2.IHybridInspectResponse, + protos.google.privacy.dlp.v2.IHybridInspectDlpJobRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.privacy.dlp.v2.IHybridInspectResponse, + protos.google.privacy.dlp.v2.IHybridInspectDlpJobRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.privacy.dlp.v2.IHybridInspectResponse, + protos.google.privacy.dlp.v2.IHybridInspectDlpJobRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as 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 || '', + }); + this.initialize(); + return this.innerApiCalls.hybridInspectDlpJob(request, options, callback); + } +/** + * Finish a running hybrid DlpJob. Triggers the finalization steps and running + * of any enabled actions that have not yet run. + * + * @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}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v2/dlp_service.finish_dlp_job.js + * region_tag:dlp_v2_generated_DlpService_FinishDlpJob_async + */ + finishDlpJob( + request?: protos.google.privacy.dlp.v2.IFinishDlpJobRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.privacy.dlp.v2.IFinishDlpJobRequest|undefined, {}|undefined + ]>; + finishDlpJob( + request: protos.google.privacy.dlp.v2.IFinishDlpJobRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.privacy.dlp.v2.IFinishDlpJobRequest|null|undefined, + {}|null|undefined>): void; + finishDlpJob( + request: protos.google.privacy.dlp.v2.IFinishDlpJobRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.privacy.dlp.v2.IFinishDlpJobRequest|null|undefined, + {}|null|undefined>): void; + finishDlpJob( + request?: protos.google.privacy.dlp.v2.IFinishDlpJobRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.privacy.dlp.v2.IFinishDlpJobRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.privacy.dlp.v2.IFinishDlpJobRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.privacy.dlp.v2.IFinishDlpJobRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as 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 || '', + }); + this.initialize(); + return this.innerApiCalls.finishDlpJob(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. Parent resource name. + * + * The format of this value varies depending on the scope of the request + * (project or organization) and whether you have [specified a processing + * location](https://cloud.google.com/dlp/docs/specifying-location): + * + * + Projects scope, location specified:
+ * `projects/`PROJECT_ID`/locations/`LOCATION_ID + * + Projects scope, no location specified (defaults to global):
+ * `projects/`PROJECT_ID + * + Organizations scope, location specified:
+ * `organizations/`ORG_ID`/locations/`LOCATION_ID + * + Organizations scope, no location specified (defaults to global):
+ * `organizations/`ORG_ID + * + * The following example `parent` string specifies a parent project with the + * identifier `example-project`, and specifies the `europe-west3` location + * for processing data: + * + * parent=projects/example-project/locations/europe-west3 + * @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 + * Deprecated. This field has no effect. + * @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 will perform 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. + * Note that it can affect your quota. + * We recommend using `listInspectTemplatesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listInspectTemplates( + request?: protos.google.privacy.dlp.v2.IListInspectTemplatesRequest, + options?: CallOptions): + Promise<[ + protos.google.privacy.dlp.v2.IInspectTemplate[], + protos.google.privacy.dlp.v2.IListInspectTemplatesRequest|null, + protos.google.privacy.dlp.v2.IListInspectTemplatesResponse + ]>; + listInspectTemplates( + request: protos.google.privacy.dlp.v2.IListInspectTemplatesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.privacy.dlp.v2.IListInspectTemplatesRequest, + protos.google.privacy.dlp.v2.IListInspectTemplatesResponse|null|undefined, + protos.google.privacy.dlp.v2.IInspectTemplate>): void; + listInspectTemplates( + request: protos.google.privacy.dlp.v2.IListInspectTemplatesRequest, + callback: PaginationCallback< + protos.google.privacy.dlp.v2.IListInspectTemplatesRequest, + protos.google.privacy.dlp.v2.IListInspectTemplatesResponse|null|undefined, + protos.google.privacy.dlp.v2.IInspectTemplate>): void; + listInspectTemplates( + request?: protos.google.privacy.dlp.v2.IListInspectTemplatesRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.privacy.dlp.v2.IListInspectTemplatesRequest, + protos.google.privacy.dlp.v2.IListInspectTemplatesResponse|null|undefined, + protos.google.privacy.dlp.v2.IInspectTemplate>, + callback?: PaginationCallback< + protos.google.privacy.dlp.v2.IListInspectTemplatesRequest, + protos.google.privacy.dlp.v2.IListInspectTemplatesResponse|null|undefined, + protos.google.privacy.dlp.v2.IInspectTemplate>): + Promise<[ + protos.google.privacy.dlp.v2.IInspectTemplate[], + protos.google.privacy.dlp.v2.IListInspectTemplatesRequest|null, + protos.google.privacy.dlp.v2.IListInspectTemplatesResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as 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 || '', + }); + this.initialize(); + return this.innerApiCalls.listInspectTemplates(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent resource name. + * + * The format of this value varies depending on the scope of the request + * (project or organization) and whether you have [specified a processing + * location](https://cloud.google.com/dlp/docs/specifying-location): + * + * + Projects scope, location specified:
+ * `projects/`PROJECT_ID`/locations/`LOCATION_ID + * + Projects scope, no location specified (defaults to global):
+ * `projects/`PROJECT_ID + * + Organizations scope, location specified:
+ * `organizations/`ORG_ID`/locations/`LOCATION_ID + * + Organizations scope, no location specified (defaults to global):
+ * `organizations/`ORG_ID + * + * The following example `parent` string specifies a parent project with the + * identifier `example-project`, and specifies the `europe-west3` location + * for processing data: + * + * parent=projects/example-project/locations/europe-west3 + * @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 + * Deprecated. This field has no effect. + * @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. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listInspectTemplatesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listInspectTemplatesStream( + request?: protos.google.privacy.dlp.v2.IListInspectTemplatesRequest, + options?: CallOptions): + Transform{ + 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 || '', + }); + const defaultCallSettings = this._defaults['listInspectTemplates']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listInspectTemplates.createStream( + this.innerApiCalls.listInspectTemplates as gax.GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listInspectTemplates`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent resource name. + * + * The format of this value varies depending on the scope of the request + * (project or organization) and whether you have [specified a processing + * location](https://cloud.google.com/dlp/docs/specifying-location): + * + * + Projects scope, location specified:
+ * `projects/`PROJECT_ID`/locations/`LOCATION_ID + * + Projects scope, no location specified (defaults to global):
+ * `projects/`PROJECT_ID + * + Organizations scope, location specified:
+ * `organizations/`ORG_ID`/locations/`LOCATION_ID + * + Organizations scope, no location specified (defaults to global):
+ * `organizations/`ORG_ID + * + * The following example `parent` string specifies a parent project with the + * identifier `example-project`, and specifies the `europe-west3` location + * for processing data: + * + * parent=projects/example-project/locations/europe-west3 + * @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 + * Deprecated. This field has no effect. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [InspectTemplate]{@link google.privacy.dlp.v2.InspectTemplate}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v2/dlp_service.list_inspect_templates.js + * region_tag:dlp_v2_generated_DlpService_ListInspectTemplates_async + */ + listInspectTemplatesAsync( + request?: protos.google.privacy.dlp.v2.IListInspectTemplatesRequest, + options?: CallOptions): + AsyncIterable{ + 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 || '', + }); + const defaultCallSettings = this._defaults['listInspectTemplates']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listInspectTemplates.asyncIterate( + this.innerApiCalls['listInspectTemplates'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + /** + * 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. Parent resource name. + * + * The format of this value varies depending on the scope of the request + * (project or organization) and whether you have [specified a processing + * location](https://cloud.google.com/dlp/docs/specifying-location): + * + * + Projects scope, location specified:
+ * `projects/`PROJECT_ID`/locations/`LOCATION_ID + * + Projects scope, no location specified (defaults to global):
+ * `projects/`PROJECT_ID + * + Organizations scope, location specified:
+ * `organizations/`ORG_ID`/locations/`LOCATION_ID + * + Organizations scope, no location specified (defaults to global):
+ * `organizations/`ORG_ID + * + * The following example `parent` string specifies a parent project with the + * identifier `example-project`, and specifies the `europe-west3` location + * for processing data: + * + * parent=projects/example-project/locations/europe-west3 + * @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 + * Deprecated. This field has no effect. + * @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 will perform 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. + * Note that it can affect your quota. + * We recommend using `listDeidentifyTemplatesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listDeidentifyTemplates( + request?: protos.google.privacy.dlp.v2.IListDeidentifyTemplatesRequest, + options?: CallOptions): + Promise<[ + protos.google.privacy.dlp.v2.IDeidentifyTemplate[], + protos.google.privacy.dlp.v2.IListDeidentifyTemplatesRequest|null, + protos.google.privacy.dlp.v2.IListDeidentifyTemplatesResponse + ]>; + listDeidentifyTemplates( + request: protos.google.privacy.dlp.v2.IListDeidentifyTemplatesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.privacy.dlp.v2.IListDeidentifyTemplatesRequest, + protos.google.privacy.dlp.v2.IListDeidentifyTemplatesResponse|null|undefined, + protos.google.privacy.dlp.v2.IDeidentifyTemplate>): void; + listDeidentifyTemplates( + request: protos.google.privacy.dlp.v2.IListDeidentifyTemplatesRequest, + callback: PaginationCallback< + protos.google.privacy.dlp.v2.IListDeidentifyTemplatesRequest, + protos.google.privacy.dlp.v2.IListDeidentifyTemplatesResponse|null|undefined, + protos.google.privacy.dlp.v2.IDeidentifyTemplate>): void; + listDeidentifyTemplates( + request?: protos.google.privacy.dlp.v2.IListDeidentifyTemplatesRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.privacy.dlp.v2.IListDeidentifyTemplatesRequest, + protos.google.privacy.dlp.v2.IListDeidentifyTemplatesResponse|null|undefined, + protos.google.privacy.dlp.v2.IDeidentifyTemplate>, + callback?: PaginationCallback< + protos.google.privacy.dlp.v2.IListDeidentifyTemplatesRequest, + protos.google.privacy.dlp.v2.IListDeidentifyTemplatesResponse|null|undefined, + protos.google.privacy.dlp.v2.IDeidentifyTemplate>): + Promise<[ + protos.google.privacy.dlp.v2.IDeidentifyTemplate[], + protos.google.privacy.dlp.v2.IListDeidentifyTemplatesRequest|null, + protos.google.privacy.dlp.v2.IListDeidentifyTemplatesResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as 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 || '', + }); + this.initialize(); + return this.innerApiCalls.listDeidentifyTemplates(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent resource name. + * + * The format of this value varies depending on the scope of the request + * (project or organization) and whether you have [specified a processing + * location](https://cloud.google.com/dlp/docs/specifying-location): + * + * + Projects scope, location specified:
+ * `projects/`PROJECT_ID`/locations/`LOCATION_ID + * + Projects scope, no location specified (defaults to global):
+ * `projects/`PROJECT_ID + * + Organizations scope, location specified:
+ * `organizations/`ORG_ID`/locations/`LOCATION_ID + * + Organizations scope, no location specified (defaults to global):
+ * `organizations/`ORG_ID + * + * The following example `parent` string specifies a parent project with the + * identifier `example-project`, and specifies the `europe-west3` location + * for processing data: + * + * parent=projects/example-project/locations/europe-west3 + * @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 + * Deprecated. This field has no effect. + * @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. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listDeidentifyTemplatesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listDeidentifyTemplatesStream( + request?: protos.google.privacy.dlp.v2.IListDeidentifyTemplatesRequest, + options?: CallOptions): + Transform{ + 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 || '', + }); + const defaultCallSettings = this._defaults['listDeidentifyTemplates']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listDeidentifyTemplates.createStream( + this.innerApiCalls.listDeidentifyTemplates as gax.GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listDeidentifyTemplates`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent resource name. + * + * The format of this value varies depending on the scope of the request + * (project or organization) and whether you have [specified a processing + * location](https://cloud.google.com/dlp/docs/specifying-location): + * + * + Projects scope, location specified:
+ * `projects/`PROJECT_ID`/locations/`LOCATION_ID + * + Projects scope, no location specified (defaults to global):
+ * `projects/`PROJECT_ID + * + Organizations scope, location specified:
+ * `organizations/`ORG_ID`/locations/`LOCATION_ID + * + Organizations scope, no location specified (defaults to global):
+ * `organizations/`ORG_ID + * + * The following example `parent` string specifies a parent project with the + * identifier `example-project`, and specifies the `europe-west3` location + * for processing data: + * + * parent=projects/example-project/locations/europe-west3 + * @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 + * Deprecated. This field has no effect. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [DeidentifyTemplate]{@link google.privacy.dlp.v2.DeidentifyTemplate}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v2/dlp_service.list_deidentify_templates.js + * region_tag:dlp_v2_generated_DlpService_ListDeidentifyTemplates_async + */ + listDeidentifyTemplatesAsync( + request?: protos.google.privacy.dlp.v2.IListDeidentifyTemplatesRequest, + options?: CallOptions): + AsyncIterable{ + 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 || '', + }); + const defaultCallSettings = this._defaults['listDeidentifyTemplates']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listDeidentifyTemplates.asyncIterate( + this.innerApiCalls['listDeidentifyTemplates'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + /** + * 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. Parent resource name. + * + * The format of this value varies depending on whether you have [specified a + * processing + * location](https://cloud.google.com/dlp/docs/specifying-location): + * + * + Projects scope, location specified:
+ * `projects/`PROJECT_ID`/locations/`LOCATION_ID + * + Projects scope, no location specified (defaults to global):
+ * `projects/`PROJECT_ID + * + * The following example `parent` string specifies a parent project with the + * identifier `example-project`, and specifies the `europe-west3` location + * for processing data: + * + * parent=projects/example-project/locations/europe-west3 + * @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 triggers: + * - `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 {google.privacy.dlp.v2.DlpJobType} request.type + * The type of jobs. Will use `DlpJobType.INSPECT` if not set. + * @param {string} request.locationId + * Deprecated. This field has no effect. + * @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 will perform 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. + * Note that it can affect your quota. + * We recommend using `listJobTriggersAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listJobTriggers( + request?: protos.google.privacy.dlp.v2.IListJobTriggersRequest, + options?: CallOptions): + Promise<[ + protos.google.privacy.dlp.v2.IJobTrigger[], + protos.google.privacy.dlp.v2.IListJobTriggersRequest|null, + protos.google.privacy.dlp.v2.IListJobTriggersResponse + ]>; + listJobTriggers( + request: protos.google.privacy.dlp.v2.IListJobTriggersRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.privacy.dlp.v2.IListJobTriggersRequest, + protos.google.privacy.dlp.v2.IListJobTriggersResponse|null|undefined, + protos.google.privacy.dlp.v2.IJobTrigger>): void; + listJobTriggers( + request: protos.google.privacy.dlp.v2.IListJobTriggersRequest, + callback: PaginationCallback< + protos.google.privacy.dlp.v2.IListJobTriggersRequest, + protos.google.privacy.dlp.v2.IListJobTriggersResponse|null|undefined, + protos.google.privacy.dlp.v2.IJobTrigger>): void; + listJobTriggers( + request?: protos.google.privacy.dlp.v2.IListJobTriggersRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.privacy.dlp.v2.IListJobTriggersRequest, + protos.google.privacy.dlp.v2.IListJobTriggersResponse|null|undefined, + protos.google.privacy.dlp.v2.IJobTrigger>, + callback?: PaginationCallback< + protos.google.privacy.dlp.v2.IListJobTriggersRequest, + protos.google.privacy.dlp.v2.IListJobTriggersResponse|null|undefined, + protos.google.privacy.dlp.v2.IJobTrigger>): + Promise<[ + protos.google.privacy.dlp.v2.IJobTrigger[], + protos.google.privacy.dlp.v2.IListJobTriggersRequest|null, + protos.google.privacy.dlp.v2.IListJobTriggersResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as 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 || '', + }); + this.initialize(); + return this.innerApiCalls.listJobTriggers(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent resource name. + * + * The format of this value varies depending on whether you have [specified a + * processing + * location](https://cloud.google.com/dlp/docs/specifying-location): + * + * + Projects scope, location specified:
+ * `projects/`PROJECT_ID`/locations/`LOCATION_ID + * + Projects scope, no location specified (defaults to global):
+ * `projects/`PROJECT_ID + * + * The following example `parent` string specifies a parent project with the + * identifier `example-project`, and specifies the `europe-west3` location + * for processing data: + * + * parent=projects/example-project/locations/europe-west3 + * @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 triggers: + * - `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 {google.privacy.dlp.v2.DlpJobType} request.type + * The type of jobs. Will use `DlpJobType.INSPECT` if not set. + * @param {string} request.locationId + * Deprecated. This field has no effect. + * @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. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listJobTriggersAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listJobTriggersStream( + request?: protos.google.privacy.dlp.v2.IListJobTriggersRequest, + options?: CallOptions): + Transform{ + 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 || '', + }); + const defaultCallSettings = this._defaults['listJobTriggers']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listJobTriggers.createStream( + this.innerApiCalls.listJobTriggers as gax.GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listJobTriggers`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent resource name. + * + * The format of this value varies depending on whether you have [specified a + * processing + * location](https://cloud.google.com/dlp/docs/specifying-location): + * + * + Projects scope, location specified:
+ * `projects/`PROJECT_ID`/locations/`LOCATION_ID + * + Projects scope, no location specified (defaults to global):
+ * `projects/`PROJECT_ID + * + * The following example `parent` string specifies a parent project with the + * identifier `example-project`, and specifies the `europe-west3` location + * for processing data: + * + * parent=projects/example-project/locations/europe-west3 + * @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 triggers: + * - `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 {google.privacy.dlp.v2.DlpJobType} request.type + * The type of jobs. Will use `DlpJobType.INSPECT` if not set. + * @param {string} request.locationId + * Deprecated. This field has no effect. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [JobTrigger]{@link google.privacy.dlp.v2.JobTrigger}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v2/dlp_service.list_job_triggers.js + * region_tag:dlp_v2_generated_DlpService_ListJobTriggers_async + */ + listJobTriggersAsync( + request?: protos.google.privacy.dlp.v2.IListJobTriggersRequest, + options?: CallOptions): + AsyncIterable{ + 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 || '', + }); + const defaultCallSettings = this._defaults['listJobTriggers']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listJobTriggers.asyncIterate( + this.innerApiCalls['listJobTriggers'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + /** + * 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. Parent resource name. + * + * The format of this value varies depending on whether you have [specified a + * processing + * location](https://cloud.google.com/dlp/docs/specifying-location): + * + * + Projects scope, location specified:
+ * `projects/`PROJECT_ID`/locations/`LOCATION_ID + * + Projects scope, no location specified (defaults to global):
+ * `projects/`PROJECT_ID + * + * The following example `parent` string specifies a parent project with the + * identifier `example-project`, and specifies the `europe-west3` location + * for processing data: + * + * parent=projects/example-project/locations/europe-west3 + * @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 + * Deprecated. This field has no effect. + * @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 will perform 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. + * Note that it can affect your quota. + * We recommend using `listDlpJobsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listDlpJobs( + request?: protos.google.privacy.dlp.v2.IListDlpJobsRequest, + options?: CallOptions): + Promise<[ + protos.google.privacy.dlp.v2.IDlpJob[], + protos.google.privacy.dlp.v2.IListDlpJobsRequest|null, + protos.google.privacy.dlp.v2.IListDlpJobsResponse + ]>; + listDlpJobs( + request: protos.google.privacy.dlp.v2.IListDlpJobsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.privacy.dlp.v2.IListDlpJobsRequest, + protos.google.privacy.dlp.v2.IListDlpJobsResponse|null|undefined, + protos.google.privacy.dlp.v2.IDlpJob>): void; + listDlpJobs( + request: protos.google.privacy.dlp.v2.IListDlpJobsRequest, + callback: PaginationCallback< + protos.google.privacy.dlp.v2.IListDlpJobsRequest, + protos.google.privacy.dlp.v2.IListDlpJobsResponse|null|undefined, + protos.google.privacy.dlp.v2.IDlpJob>): void; + listDlpJobs( + request?: protos.google.privacy.dlp.v2.IListDlpJobsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.privacy.dlp.v2.IListDlpJobsRequest, + protos.google.privacy.dlp.v2.IListDlpJobsResponse|null|undefined, + protos.google.privacy.dlp.v2.IDlpJob>, + callback?: PaginationCallback< + protos.google.privacy.dlp.v2.IListDlpJobsRequest, + protos.google.privacy.dlp.v2.IListDlpJobsResponse|null|undefined, + protos.google.privacy.dlp.v2.IDlpJob>): + Promise<[ + protos.google.privacy.dlp.v2.IDlpJob[], + protos.google.privacy.dlp.v2.IListDlpJobsRequest|null, + protos.google.privacy.dlp.v2.IListDlpJobsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as 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 || '', + }); + this.initialize(); + return this.innerApiCalls.listDlpJobs(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent resource name. + * + * The format of this value varies depending on whether you have [specified a + * processing + * location](https://cloud.google.com/dlp/docs/specifying-location): + * + * + Projects scope, location specified:
+ * `projects/`PROJECT_ID`/locations/`LOCATION_ID + * + Projects scope, no location specified (defaults to global):
+ * `projects/`PROJECT_ID + * + * The following example `parent` string specifies a parent project with the + * identifier `example-project`, and specifies the `europe-west3` location + * for processing data: + * + * parent=projects/example-project/locations/europe-west3 + * @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 + * Deprecated. This field has no effect. + * @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. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listDlpJobsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listDlpJobsStream( + request?: protos.google.privacy.dlp.v2.IListDlpJobsRequest, + options?: CallOptions): + Transform{ + 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 || '', + }); + const defaultCallSettings = this._defaults['listDlpJobs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listDlpJobs.createStream( + this.innerApiCalls.listDlpJobs as gax.GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listDlpJobs`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent resource name. + * + * The format of this value varies depending on whether you have [specified a + * processing + * location](https://cloud.google.com/dlp/docs/specifying-location): + * + * + Projects scope, location specified:
+ * `projects/`PROJECT_ID`/locations/`LOCATION_ID + * + Projects scope, no location specified (defaults to global):
+ * `projects/`PROJECT_ID + * + * The following example `parent` string specifies a parent project with the + * identifier `example-project`, and specifies the `europe-west3` location + * for processing data: + * + * parent=projects/example-project/locations/europe-west3 + * @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 + * Deprecated. This field has no effect. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [DlpJob]{@link google.privacy.dlp.v2.DlpJob}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v2/dlp_service.list_dlp_jobs.js + * region_tag:dlp_v2_generated_DlpService_ListDlpJobs_async + */ + listDlpJobsAsync( + request?: protos.google.privacy.dlp.v2.IListDlpJobsRequest, + options?: CallOptions): + AsyncIterable{ + 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 || '', + }); + const defaultCallSettings = this._defaults['listDlpJobs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listDlpJobs.asyncIterate( + this.innerApiCalls['listDlpJobs'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + /** + * 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. Parent resource name. + * + * The format of this value varies depending on the scope of the request + * (project or organization) and whether you have [specified a processing + * location](https://cloud.google.com/dlp/docs/specifying-location): + * + * + Projects scope, location specified:
+ * `projects/`PROJECT_ID`/locations/`LOCATION_ID + * + Projects scope, no location specified (defaults to global):
+ * `projects/`PROJECT_ID + * + Organizations scope, location specified:
+ * `organizations/`ORG_ID`/locations/`LOCATION_ID + * + Organizations scope, no location specified (defaults to global):
+ * `organizations/`ORG_ID + * + * The following example `parent` string specifies a parent project with the + * identifier `example-project`, and specifies the `europe-west3` location + * for processing data: + * + * parent=projects/example-project/locations/europe-west3 + * @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 + * Deprecated. This field has no effect. + * @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 will perform 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. + * Note that it can affect your quota. + * We recommend using `listStoredInfoTypesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listStoredInfoTypes( + request?: protos.google.privacy.dlp.v2.IListStoredInfoTypesRequest, + options?: CallOptions): + Promise<[ + protos.google.privacy.dlp.v2.IStoredInfoType[], + protos.google.privacy.dlp.v2.IListStoredInfoTypesRequest|null, + protos.google.privacy.dlp.v2.IListStoredInfoTypesResponse + ]>; + listStoredInfoTypes( + request: protos.google.privacy.dlp.v2.IListStoredInfoTypesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.privacy.dlp.v2.IListStoredInfoTypesRequest, + protos.google.privacy.dlp.v2.IListStoredInfoTypesResponse|null|undefined, + protos.google.privacy.dlp.v2.IStoredInfoType>): void; + listStoredInfoTypes( + request: protos.google.privacy.dlp.v2.IListStoredInfoTypesRequest, + callback: PaginationCallback< + protos.google.privacy.dlp.v2.IListStoredInfoTypesRequest, + protos.google.privacy.dlp.v2.IListStoredInfoTypesResponse|null|undefined, + protos.google.privacy.dlp.v2.IStoredInfoType>): void; + listStoredInfoTypes( + request?: protos.google.privacy.dlp.v2.IListStoredInfoTypesRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.privacy.dlp.v2.IListStoredInfoTypesRequest, + protos.google.privacy.dlp.v2.IListStoredInfoTypesResponse|null|undefined, + protos.google.privacy.dlp.v2.IStoredInfoType>, + callback?: PaginationCallback< + protos.google.privacy.dlp.v2.IListStoredInfoTypesRequest, + protos.google.privacy.dlp.v2.IListStoredInfoTypesResponse|null|undefined, + protos.google.privacy.dlp.v2.IStoredInfoType>): + Promise<[ + protos.google.privacy.dlp.v2.IStoredInfoType[], + protos.google.privacy.dlp.v2.IListStoredInfoTypesRequest|null, + protos.google.privacy.dlp.v2.IListStoredInfoTypesResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as 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 || '', + }); + this.initialize(); + return this.innerApiCalls.listStoredInfoTypes(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent resource name. + * + * The format of this value varies depending on the scope of the request + * (project or organization) and whether you have [specified a processing + * location](https://cloud.google.com/dlp/docs/specifying-location): + * + * + Projects scope, location specified:
+ * `projects/`PROJECT_ID`/locations/`LOCATION_ID + * + Projects scope, no location specified (defaults to global):
+ * `projects/`PROJECT_ID + * + Organizations scope, location specified:
+ * `organizations/`ORG_ID`/locations/`LOCATION_ID + * + Organizations scope, no location specified (defaults to global):
+ * `organizations/`ORG_ID + * + * The following example `parent` string specifies a parent project with the + * identifier `example-project`, and specifies the `europe-west3` location + * for processing data: + * + * parent=projects/example-project/locations/europe-west3 + * @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 + * Deprecated. This field has no effect. + * @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. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listStoredInfoTypesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listStoredInfoTypesStream( + request?: protos.google.privacy.dlp.v2.IListStoredInfoTypesRequest, + options?: CallOptions): + Transform{ + 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 || '', + }); + const defaultCallSettings = this._defaults['listStoredInfoTypes']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listStoredInfoTypes.createStream( + this.innerApiCalls.listStoredInfoTypes as gax.GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listStoredInfoTypes`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent resource name. + * + * The format of this value varies depending on the scope of the request + * (project or organization) and whether you have [specified a processing + * location](https://cloud.google.com/dlp/docs/specifying-location): + * + * + Projects scope, location specified:
+ * `projects/`PROJECT_ID`/locations/`LOCATION_ID + * + Projects scope, no location specified (defaults to global):
+ * `projects/`PROJECT_ID + * + Organizations scope, location specified:
+ * `organizations/`ORG_ID`/locations/`LOCATION_ID + * + Organizations scope, no location specified (defaults to global):
+ * `organizations/`ORG_ID + * + * The following example `parent` string specifies a parent project with the + * identifier `example-project`, and specifies the `europe-west3` location + * for processing data: + * + * parent=projects/example-project/locations/europe-west3 + * @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 + * Deprecated. This field has no effect. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [StoredInfoType]{@link google.privacy.dlp.v2.StoredInfoType}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v2/dlp_service.list_stored_info_types.js + * region_tag:dlp_v2_generated_DlpService_ListStoredInfoTypes_async + */ + listStoredInfoTypesAsync( + request?: protos.google.privacy.dlp.v2.IListStoredInfoTypesRequest, + options?: CallOptions): + AsyncIterable{ + 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 || '', + }); + const defaultCallSettings = this._defaults['listStoredInfoTypes']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listStoredInfoTypes.asyncIterate( + this.innerApiCalls['listStoredInfoTypes'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified finding resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} finding + * @returns {string} Resource name string. + */ + findingPath(project:string,location:string,finding:string) { + return this.pathTemplates.findingPathTemplate.render({ + project: project, + location: location, + finding: finding, + }); + } + + /** + * Parse the project from Finding resource. + * + * @param {string} findingName + * A fully-qualified path representing Finding resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFindingName(findingName: string) { + return this.pathTemplates.findingPathTemplate.match(findingName).project; + } + + /** + * Parse the location from Finding resource. + * + * @param {string} findingName + * A fully-qualified path representing Finding resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFindingName(findingName: string) { + return this.pathTemplates.findingPathTemplate.match(findingName).location; + } + + /** + * Parse the finding from Finding resource. + * + * @param {string} findingName + * A fully-qualified path representing Finding resource. + * @returns {string} A string representing the finding. + */ + matchFindingFromFindingName(findingName: string) { + return this.pathTemplates.findingPathTemplate.match(findingName).finding; + } + + /** + * 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: 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 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: 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 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: 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 organizationLocationDeidentifyTemplate resource name string. + * + * @param {string} organization + * @param {string} location + * @param {string} deidentify_template + * @returns {string} Resource name string. + */ + organizationLocationDeidentifyTemplatePath(organization:string,location:string,deidentifyTemplate:string) { + return this.pathTemplates.organizationLocationDeidentifyTemplatePathTemplate.render({ + organization: organization, + location: location, + deidentify_template: deidentifyTemplate, + }); + } + + /** + * Parse the organization from OrganizationLocationDeidentifyTemplate resource. + * + * @param {string} organizationLocationDeidentifyTemplateName + * A fully-qualified path representing organization_location_deidentify_template resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationLocationDeidentifyTemplateName(organizationLocationDeidentifyTemplateName: string) { + return this.pathTemplates.organizationLocationDeidentifyTemplatePathTemplate.match(organizationLocationDeidentifyTemplateName).organization; + } + + /** + * Parse the location from OrganizationLocationDeidentifyTemplate resource. + * + * @param {string} organizationLocationDeidentifyTemplateName + * A fully-qualified path representing organization_location_deidentify_template resource. + * @returns {string} A string representing the location. + */ + matchLocationFromOrganizationLocationDeidentifyTemplateName(organizationLocationDeidentifyTemplateName: string) { + return this.pathTemplates.organizationLocationDeidentifyTemplatePathTemplate.match(organizationLocationDeidentifyTemplateName).location; + } + + /** + * Parse the deidentify_template from OrganizationLocationDeidentifyTemplate resource. + * + * @param {string} organizationLocationDeidentifyTemplateName + * A fully-qualified path representing organization_location_deidentify_template resource. + * @returns {string} A string representing the deidentify_template. + */ + matchDeidentifyTemplateFromOrganizationLocationDeidentifyTemplateName(organizationLocationDeidentifyTemplateName: string) { + return this.pathTemplates.organizationLocationDeidentifyTemplatePathTemplate.match(organizationLocationDeidentifyTemplateName).deidentify_template; + } + + /** + * Return a fully-qualified organizationLocationInspectTemplate resource name string. + * + * @param {string} organization + * @param {string} location + * @param {string} inspect_template + * @returns {string} Resource name string. + */ + organizationLocationInspectTemplatePath(organization:string,location:string,inspectTemplate:string) { + return this.pathTemplates.organizationLocationInspectTemplatePathTemplate.render({ + organization: organization, + location: location, + inspect_template: inspectTemplate, + }); + } + + /** + * Parse the organization from OrganizationLocationInspectTemplate resource. + * + * @param {string} organizationLocationInspectTemplateName + * A fully-qualified path representing organization_location_inspect_template resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationLocationInspectTemplateName(organizationLocationInspectTemplateName: string) { + return this.pathTemplates.organizationLocationInspectTemplatePathTemplate.match(organizationLocationInspectTemplateName).organization; + } + + /** + * Parse the location from OrganizationLocationInspectTemplate resource. + * + * @param {string} organizationLocationInspectTemplateName + * A fully-qualified path representing organization_location_inspect_template resource. + * @returns {string} A string representing the location. + */ + matchLocationFromOrganizationLocationInspectTemplateName(organizationLocationInspectTemplateName: string) { + return this.pathTemplates.organizationLocationInspectTemplatePathTemplate.match(organizationLocationInspectTemplateName).location; + } + + /** + * Parse the inspect_template from OrganizationLocationInspectTemplate resource. + * + * @param {string} organizationLocationInspectTemplateName + * A fully-qualified path representing organization_location_inspect_template resource. + * @returns {string} A string representing the inspect_template. + */ + matchInspectTemplateFromOrganizationLocationInspectTemplateName(organizationLocationInspectTemplateName: string) { + return this.pathTemplates.organizationLocationInspectTemplatePathTemplate.match(organizationLocationInspectTemplateName).inspect_template; + } + + /** + * Return a fully-qualified organizationLocationStoredInfoType resource name string. + * + * @param {string} organization + * @param {string} location + * @param {string} stored_info_type + * @returns {string} Resource name string. + */ + organizationLocationStoredInfoTypePath(organization:string,location:string,storedInfoType:string) { + return this.pathTemplates.organizationLocationStoredInfoTypePathTemplate.render({ + organization: organization, + location: location, + stored_info_type: storedInfoType, + }); + } + + /** + * Parse the organization from OrganizationLocationStoredInfoType resource. + * + * @param {string} organizationLocationStoredInfoTypeName + * A fully-qualified path representing organization_location_stored_info_type resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationLocationStoredInfoTypeName(organizationLocationStoredInfoTypeName: string) { + return this.pathTemplates.organizationLocationStoredInfoTypePathTemplate.match(organizationLocationStoredInfoTypeName).organization; + } + + /** + * Parse the location from OrganizationLocationStoredInfoType resource. + * + * @param {string} organizationLocationStoredInfoTypeName + * A fully-qualified path representing organization_location_stored_info_type resource. + * @returns {string} A string representing the location. + */ + matchLocationFromOrganizationLocationStoredInfoTypeName(organizationLocationStoredInfoTypeName: string) { + return this.pathTemplates.organizationLocationStoredInfoTypePathTemplate.match(organizationLocationStoredInfoTypeName).location; + } + + /** + * Parse the stored_info_type from OrganizationLocationStoredInfoType resource. + * + * @param {string} organizationLocationStoredInfoTypeName + * A fully-qualified path representing organization_location_stored_info_type resource. + * @returns {string} A string representing the stored_info_type. + */ + matchStoredInfoTypeFromOrganizationLocationStoredInfoTypeName(organizationLocationStoredInfoTypeName: string) { + return this.pathTemplates.organizationLocationStoredInfoTypePathTemplate.match(organizationLocationStoredInfoTypeName).stored_info_type; + } + + /** + * 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: 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 project resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectPath(project:string) { + return this.pathTemplates.projectPathTemplate.render({ + project: 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 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: 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 projectDlpContent resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectDlpContentPath(project:string) { + return this.pathTemplates.projectDlpContentPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from ProjectDlpContent resource. + * + * @param {string} projectDlpContentName + * A fully-qualified path representing project_dlpContent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectDlpContentName(projectDlpContentName: string) { + return this.pathTemplates.projectDlpContentPathTemplate.match(projectDlpContentName).project; + } + + /** + * Return a fully-qualified projectDlpJob resource name string. + * + * @param {string} project + * @param {string} dlp_job + * @returns {string} Resource name string. + */ + projectDlpJobPath(project:string,dlpJob:string) { + return this.pathTemplates.projectDlpJobPathTemplate.render({ + project: project, + dlp_job: dlpJob, + }); + } + + /** + * Parse the project from ProjectDlpJob resource. + * + * @param {string} projectDlpJobName + * A fully-qualified path representing project_dlp_job resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectDlpJobName(projectDlpJobName: string) { + return this.pathTemplates.projectDlpJobPathTemplate.match(projectDlpJobName).project; + } + + /** + * Parse the dlp_job from ProjectDlpJob resource. + * + * @param {string} projectDlpJobName + * A fully-qualified path representing project_dlp_job resource. + * @returns {string} A string representing the dlp_job. + */ + matchDlpJobFromProjectDlpJobName(projectDlpJobName: string) { + return this.pathTemplates.projectDlpJobPathTemplate.match(projectDlpJobName).dlp_job; + } + + /** + * 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: 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 projectJobTrigger resource name string. + * + * @param {string} project + * @param {string} job_trigger + * @returns {string} Resource name string. + */ + projectJobTriggerPath(project:string,jobTrigger:string) { + return this.pathTemplates.projectJobTriggerPathTemplate.render({ + project: project, + job_trigger: jobTrigger, + }); + } + + /** + * Parse the project from ProjectJobTrigger resource. + * + * @param {string} projectJobTriggerName + * A fully-qualified path representing project_job_trigger resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectJobTriggerName(projectJobTriggerName: string) { + return this.pathTemplates.projectJobTriggerPathTemplate.match(projectJobTriggerName).project; + } + + /** + * Parse the job_trigger from ProjectJobTrigger resource. + * + * @param {string} projectJobTriggerName + * A fully-qualified path representing project_job_trigger resource. + * @returns {string} A string representing the job_trigger. + */ + matchJobTriggerFromProjectJobTriggerName(projectJobTriggerName: string) { + return this.pathTemplates.projectJobTriggerPathTemplate.match(projectJobTriggerName).job_trigger; + } + + /** + * Return a fully-qualified projectLocationDeidentifyTemplate resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} deidentify_template + * @returns {string} Resource name string. + */ + projectLocationDeidentifyTemplatePath(project:string,location:string,deidentifyTemplate:string) { + return this.pathTemplates.projectLocationDeidentifyTemplatePathTemplate.render({ + project: project, + location: location, + deidentify_template: deidentifyTemplate, + }); + } + + /** + * Parse the project from ProjectLocationDeidentifyTemplate resource. + * + * @param {string} projectLocationDeidentifyTemplateName + * A fully-qualified path representing project_location_deidentify_template resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationDeidentifyTemplateName(projectLocationDeidentifyTemplateName: string) { + return this.pathTemplates.projectLocationDeidentifyTemplatePathTemplate.match(projectLocationDeidentifyTemplateName).project; + } + + /** + * Parse the location from ProjectLocationDeidentifyTemplate resource. + * + * @param {string} projectLocationDeidentifyTemplateName + * A fully-qualified path representing project_location_deidentify_template resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationDeidentifyTemplateName(projectLocationDeidentifyTemplateName: string) { + return this.pathTemplates.projectLocationDeidentifyTemplatePathTemplate.match(projectLocationDeidentifyTemplateName).location; + } + + /** + * Parse the deidentify_template from ProjectLocationDeidentifyTemplate resource. + * + * @param {string} projectLocationDeidentifyTemplateName + * A fully-qualified path representing project_location_deidentify_template resource. + * @returns {string} A string representing the deidentify_template. + */ + matchDeidentifyTemplateFromProjectLocationDeidentifyTemplateName(projectLocationDeidentifyTemplateName: string) { + return this.pathTemplates.projectLocationDeidentifyTemplatePathTemplate.match(projectLocationDeidentifyTemplateName).deidentify_template; + } + + /** + * Return a fully-qualified projectLocationDlpJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dlp_job + * @returns {string} Resource name string. + */ + projectLocationDlpJobPath(project:string,location:string,dlpJob:string) { + return this.pathTemplates.projectLocationDlpJobPathTemplate.render({ + project: project, + location: location, + dlp_job: dlpJob, + }); + } + + /** + * Parse the project from ProjectLocationDlpJob resource. + * + * @param {string} projectLocationDlpJobName + * A fully-qualified path representing project_location_dlp_job resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationDlpJobName(projectLocationDlpJobName: string) { + return this.pathTemplates.projectLocationDlpJobPathTemplate.match(projectLocationDlpJobName).project; + } + + /** + * Parse the location from ProjectLocationDlpJob resource. + * + * @param {string} projectLocationDlpJobName + * A fully-qualified path representing project_location_dlp_job resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationDlpJobName(projectLocationDlpJobName: string) { + return this.pathTemplates.projectLocationDlpJobPathTemplate.match(projectLocationDlpJobName).location; + } + + /** + * Parse the dlp_job from ProjectLocationDlpJob resource. + * + * @param {string} projectLocationDlpJobName + * A fully-qualified path representing project_location_dlp_job resource. + * @returns {string} A string representing the dlp_job. + */ + matchDlpJobFromProjectLocationDlpJobName(projectLocationDlpJobName: string) { + return this.pathTemplates.projectLocationDlpJobPathTemplate.match(projectLocationDlpJobName).dlp_job; + } + + /** + * Return a fully-qualified projectLocationInspectTemplate resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} inspect_template + * @returns {string} Resource name string. + */ + projectLocationInspectTemplatePath(project:string,location:string,inspectTemplate:string) { + return this.pathTemplates.projectLocationInspectTemplatePathTemplate.render({ + project: project, + location: location, + inspect_template: inspectTemplate, + }); + } + + /** + * Parse the project from ProjectLocationInspectTemplate resource. + * + * @param {string} projectLocationInspectTemplateName + * A fully-qualified path representing project_location_inspect_template resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationInspectTemplateName(projectLocationInspectTemplateName: string) { + return this.pathTemplates.projectLocationInspectTemplatePathTemplate.match(projectLocationInspectTemplateName).project; + } + + /** + * Parse the location from ProjectLocationInspectTemplate resource. + * + * @param {string} projectLocationInspectTemplateName + * A fully-qualified path representing project_location_inspect_template resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationInspectTemplateName(projectLocationInspectTemplateName: string) { + return this.pathTemplates.projectLocationInspectTemplatePathTemplate.match(projectLocationInspectTemplateName).location; + } + + /** + * Parse the inspect_template from ProjectLocationInspectTemplate resource. + * + * @param {string} projectLocationInspectTemplateName + * A fully-qualified path representing project_location_inspect_template resource. + * @returns {string} A string representing the inspect_template. + */ + matchInspectTemplateFromProjectLocationInspectTemplateName(projectLocationInspectTemplateName: string) { + return this.pathTemplates.projectLocationInspectTemplatePathTemplate.match(projectLocationInspectTemplateName).inspect_template; + } + + /** + * Return a fully-qualified projectLocationJobTrigger resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} job_trigger + * @returns {string} Resource name string. + */ + projectLocationJobTriggerPath(project:string,location:string,jobTrigger:string) { + return this.pathTemplates.projectLocationJobTriggerPathTemplate.render({ + project: project, + location: location, + job_trigger: jobTrigger, + }); + } + + /** + * Parse the project from ProjectLocationJobTrigger resource. + * + * @param {string} projectLocationJobTriggerName + * A fully-qualified path representing project_location_job_trigger resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationJobTriggerName(projectLocationJobTriggerName: string) { + return this.pathTemplates.projectLocationJobTriggerPathTemplate.match(projectLocationJobTriggerName).project; + } + + /** + * Parse the location from ProjectLocationJobTrigger resource. + * + * @param {string} projectLocationJobTriggerName + * A fully-qualified path representing project_location_job_trigger resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationJobTriggerName(projectLocationJobTriggerName: string) { + return this.pathTemplates.projectLocationJobTriggerPathTemplate.match(projectLocationJobTriggerName).location; + } + + /** + * Parse the job_trigger from ProjectLocationJobTrigger resource. + * + * @param {string} projectLocationJobTriggerName + * A fully-qualified path representing project_location_job_trigger resource. + * @returns {string} A string representing the job_trigger. + */ + matchJobTriggerFromProjectLocationJobTriggerName(projectLocationJobTriggerName: string) { + return this.pathTemplates.projectLocationJobTriggerPathTemplate.match(projectLocationJobTriggerName).job_trigger; + } + + /** + * Return a fully-qualified projectLocationStoredInfoType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} stored_info_type + * @returns {string} Resource name string. + */ + projectLocationStoredInfoTypePath(project:string,location:string,storedInfoType:string) { + return this.pathTemplates.projectLocationStoredInfoTypePathTemplate.render({ + project: project, + location: location, + stored_info_type: storedInfoType, + }); + } + + /** + * Parse the project from ProjectLocationStoredInfoType resource. + * + * @param {string} projectLocationStoredInfoTypeName + * A fully-qualified path representing project_location_stored_info_type resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationStoredInfoTypeName(projectLocationStoredInfoTypeName: string) { + return this.pathTemplates.projectLocationStoredInfoTypePathTemplate.match(projectLocationStoredInfoTypeName).project; + } + + /** + * Parse the location from ProjectLocationStoredInfoType resource. + * + * @param {string} projectLocationStoredInfoTypeName + * A fully-qualified path representing project_location_stored_info_type resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationStoredInfoTypeName(projectLocationStoredInfoTypeName: string) { + return this.pathTemplates.projectLocationStoredInfoTypePathTemplate.match(projectLocationStoredInfoTypeName).location; + } + + /** + * Parse the stored_info_type from ProjectLocationStoredInfoType resource. + * + * @param {string} projectLocationStoredInfoTypeName + * A fully-qualified path representing project_location_stored_info_type resource. + * @returns {string} A string representing the stored_info_type. + */ + matchStoredInfoTypeFromProjectLocationStoredInfoTypeName(projectLocationStoredInfoTypeName: string) { + return this.pathTemplates.projectLocationStoredInfoTypePathTemplate.match(projectLocationStoredInfoTypeName).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: 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. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + if (this.dlpServiceStub && !this._terminated) { + return this.dlpServiceStub.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/v2/src/v2/dlp_service_client_config.json b/owl-bot-staging/v2/src/v2/dlp_service_client_config.json new file mode 100644 index 00000000..bcdbe63f --- /dev/null +++ b/owl-bot-staging/v2/src/v2/dlp_service_client_config.json @@ -0,0 +1,196 @@ +{ + "interfaces": { + "google.privacy.dlp.v2.DlpService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "InspectContent": { + "timeout_millis": 300000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "RedactImage": { + "timeout_millis": 300000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "DeidentifyContent": { + "timeout_millis": 300000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ReidentifyContent": { + "timeout_millis": 300000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ListInfoTypes": { + "timeout_millis": 300000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "CreateInspectTemplate": { + "timeout_millis": 300000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateInspectTemplate": { + "timeout_millis": 300000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetInspectTemplate": { + "timeout_millis": 300000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ListInspectTemplates": { + "timeout_millis": 300000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "DeleteInspectTemplate": { + "timeout_millis": 300000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "CreateDeidentifyTemplate": { + "timeout_millis": 300000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateDeidentifyTemplate": { + "timeout_millis": 300000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetDeidentifyTemplate": { + "timeout_millis": 300000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ListDeidentifyTemplates": { + "timeout_millis": 300000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "DeleteDeidentifyTemplate": { + "timeout_millis": 300000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "CreateJobTrigger": { + "timeout_millis": 300000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateJobTrigger": { + "timeout_millis": 300000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "HybridInspectJobTrigger": { + "timeout_millis": 300000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetJobTrigger": { + "timeout_millis": 300000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ListJobTriggers": { + "timeout_millis": 300000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "DeleteJobTrigger": { + "timeout_millis": 300000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ActivateJobTrigger": { + "timeout_millis": 300000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateDlpJob": { + "timeout_millis": 300000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListDlpJobs": { + "timeout_millis": 300000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "GetDlpJob": { + "timeout_millis": 300000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "DeleteDlpJob": { + "timeout_millis": 300000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "CancelDlpJob": { + "timeout_millis": 300000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateStoredInfoType": { + "timeout_millis": 300000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateStoredInfoType": { + "timeout_millis": 300000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetStoredInfoType": { + "timeout_millis": 300000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ListStoredInfoTypes": { + "timeout_millis": 300000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "DeleteStoredInfoType": { + "timeout_millis": 300000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "HybridInspectDlpJob": { + "timeout_millis": 300000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "FinishDlpJob": { + "timeout_millis": 300000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/v2/src/v2/dlp_service_proto_list.json b/owl-bot-staging/v2/src/v2/dlp_service_proto_list.json new file mode 100644 index 00000000..482924bd --- /dev/null +++ b/owl-bot-staging/v2/src/v2/dlp_service_proto_list.json @@ -0,0 +1,4 @@ +[ + "../../protos/google/privacy/dlp/v2/dlp.proto", + "../../protos/google/privacy/dlp/v2/storage.proto" +] diff --git a/owl-bot-staging/v2/src/v2/gapic_metadata.json b/owl-bot-staging/v2/src/v2/gapic_metadata.json new file mode 100644 index 00000000..e82d006d --- /dev/null +++ b/owl-bot-staging/v2/src/v2/gapic_metadata.json @@ -0,0 +1,383 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.privacy.dlp.v2", + "libraryPackage": "@google-cloud/dlp", + "services": { + "DlpService": { + "clients": { + "grpc": { + "libraryClient": "DlpServiceClient", + "rpcs": { + "InspectContent": { + "methods": [ + "inspectContent" + ] + }, + "RedactImage": { + "methods": [ + "redactImage" + ] + }, + "DeidentifyContent": { + "methods": [ + "deidentifyContent" + ] + }, + "ReidentifyContent": { + "methods": [ + "reidentifyContent" + ] + }, + "ListInfoTypes": { + "methods": [ + "listInfoTypes" + ] + }, + "CreateInspectTemplate": { + "methods": [ + "createInspectTemplate" + ] + }, + "UpdateInspectTemplate": { + "methods": [ + "updateInspectTemplate" + ] + }, + "GetInspectTemplate": { + "methods": [ + "getInspectTemplate" + ] + }, + "DeleteInspectTemplate": { + "methods": [ + "deleteInspectTemplate" + ] + }, + "CreateDeidentifyTemplate": { + "methods": [ + "createDeidentifyTemplate" + ] + }, + "UpdateDeidentifyTemplate": { + "methods": [ + "updateDeidentifyTemplate" + ] + }, + "GetDeidentifyTemplate": { + "methods": [ + "getDeidentifyTemplate" + ] + }, + "DeleteDeidentifyTemplate": { + "methods": [ + "deleteDeidentifyTemplate" + ] + }, + "CreateJobTrigger": { + "methods": [ + "createJobTrigger" + ] + }, + "UpdateJobTrigger": { + "methods": [ + "updateJobTrigger" + ] + }, + "HybridInspectJobTrigger": { + "methods": [ + "hybridInspectJobTrigger" + ] + }, + "GetJobTrigger": { + "methods": [ + "getJobTrigger" + ] + }, + "DeleteJobTrigger": { + "methods": [ + "deleteJobTrigger" + ] + }, + "ActivateJobTrigger": { + "methods": [ + "activateJobTrigger" + ] + }, + "CreateDlpJob": { + "methods": [ + "createDlpJob" + ] + }, + "GetDlpJob": { + "methods": [ + "getDlpJob" + ] + }, + "DeleteDlpJob": { + "methods": [ + "deleteDlpJob" + ] + }, + "CancelDlpJob": { + "methods": [ + "cancelDlpJob" + ] + }, + "CreateStoredInfoType": { + "methods": [ + "createStoredInfoType" + ] + }, + "UpdateStoredInfoType": { + "methods": [ + "updateStoredInfoType" + ] + }, + "GetStoredInfoType": { + "methods": [ + "getStoredInfoType" + ] + }, + "DeleteStoredInfoType": { + "methods": [ + "deleteStoredInfoType" + ] + }, + "HybridInspectDlpJob": { + "methods": [ + "hybridInspectDlpJob" + ] + }, + "FinishDlpJob": { + "methods": [ + "finishDlpJob" + ] + }, + "ListInspectTemplates": { + "methods": [ + "listInspectTemplates", + "listInspectTemplatesStream", + "listInspectTemplatesAsync" + ] + }, + "ListDeidentifyTemplates": { + "methods": [ + "listDeidentifyTemplates", + "listDeidentifyTemplatesStream", + "listDeidentifyTemplatesAsync" + ] + }, + "ListJobTriggers": { + "methods": [ + "listJobTriggers", + "listJobTriggersStream", + "listJobTriggersAsync" + ] + }, + "ListDlpJobs": { + "methods": [ + "listDlpJobs", + "listDlpJobsStream", + "listDlpJobsAsync" + ] + }, + "ListStoredInfoTypes": { + "methods": [ + "listStoredInfoTypes", + "listStoredInfoTypesStream", + "listStoredInfoTypesAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "DlpServiceClient", + "rpcs": { + "InspectContent": { + "methods": [ + "inspectContent" + ] + }, + "RedactImage": { + "methods": [ + "redactImage" + ] + }, + "DeidentifyContent": { + "methods": [ + "deidentifyContent" + ] + }, + "ReidentifyContent": { + "methods": [ + "reidentifyContent" + ] + }, + "ListInfoTypes": { + "methods": [ + "listInfoTypes" + ] + }, + "CreateInspectTemplate": { + "methods": [ + "createInspectTemplate" + ] + }, + "UpdateInspectTemplate": { + "methods": [ + "updateInspectTemplate" + ] + }, + "GetInspectTemplate": { + "methods": [ + "getInspectTemplate" + ] + }, + "DeleteInspectTemplate": { + "methods": [ + "deleteInspectTemplate" + ] + }, + "CreateDeidentifyTemplate": { + "methods": [ + "createDeidentifyTemplate" + ] + }, + "UpdateDeidentifyTemplate": { + "methods": [ + "updateDeidentifyTemplate" + ] + }, + "GetDeidentifyTemplate": { + "methods": [ + "getDeidentifyTemplate" + ] + }, + "DeleteDeidentifyTemplate": { + "methods": [ + "deleteDeidentifyTemplate" + ] + }, + "CreateJobTrigger": { + "methods": [ + "createJobTrigger" + ] + }, + "UpdateJobTrigger": { + "methods": [ + "updateJobTrigger" + ] + }, + "HybridInspectJobTrigger": { + "methods": [ + "hybridInspectJobTrigger" + ] + }, + "GetJobTrigger": { + "methods": [ + "getJobTrigger" + ] + }, + "DeleteJobTrigger": { + "methods": [ + "deleteJobTrigger" + ] + }, + "ActivateJobTrigger": { + "methods": [ + "activateJobTrigger" + ] + }, + "CreateDlpJob": { + "methods": [ + "createDlpJob" + ] + }, + "GetDlpJob": { + "methods": [ + "getDlpJob" + ] + }, + "DeleteDlpJob": { + "methods": [ + "deleteDlpJob" + ] + }, + "CancelDlpJob": { + "methods": [ + "cancelDlpJob" + ] + }, + "CreateStoredInfoType": { + "methods": [ + "createStoredInfoType" + ] + }, + "UpdateStoredInfoType": { + "methods": [ + "updateStoredInfoType" + ] + }, + "GetStoredInfoType": { + "methods": [ + "getStoredInfoType" + ] + }, + "DeleteStoredInfoType": { + "methods": [ + "deleteStoredInfoType" + ] + }, + "HybridInspectDlpJob": { + "methods": [ + "hybridInspectDlpJob" + ] + }, + "FinishDlpJob": { + "methods": [ + "finishDlpJob" + ] + }, + "ListInspectTemplates": { + "methods": [ + "listInspectTemplates", + "listInspectTemplatesStream", + "listInspectTemplatesAsync" + ] + }, + "ListDeidentifyTemplates": { + "methods": [ + "listDeidentifyTemplates", + "listDeidentifyTemplatesStream", + "listDeidentifyTemplatesAsync" + ] + }, + "ListJobTriggers": { + "methods": [ + "listJobTriggers", + "listJobTriggersStream", + "listJobTriggersAsync" + ] + }, + "ListDlpJobs": { + "methods": [ + "listDlpJobs", + "listDlpJobsStream", + "listDlpJobsAsync" + ] + }, + "ListStoredInfoTypes": { + "methods": [ + "listStoredInfoTypes", + "listStoredInfoTypesStream", + "listStoredInfoTypesAsync" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/v2/src/v2/index.ts b/owl-bot-staging/v2/src/v2/index.ts new file mode 100644 index 00000000..731648ed --- /dev/null +++ b/owl-bot-staging/v2/src/v2/index.ts @@ -0,0 +1,19 @@ +// Copyright 2022 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. ** + +export {DlpServiceClient} from './dlp_service_client'; diff --git a/owl-bot-staging/v2/system-test/fixtures/sample/src/index.js b/owl-bot-staging/v2/system-test/fixtures/sample/src/index.js new file mode 100644 index 00000000..f7bbc48f --- /dev/null +++ b/owl-bot-staging/v2/system-test/fixtures/sample/src/index.js @@ -0,0 +1,27 @@ +// Copyright 2022 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/owl-bot-staging/v2/system-test/fixtures/sample/src/index.ts b/owl-bot-staging/v2/system-test/fixtures/sample/src/index.ts new file mode 100644 index 00000000..101bbbd2 --- /dev/null +++ b/owl-bot-staging/v2/system-test/fixtures/sample/src/index.ts @@ -0,0 +1,32 @@ +// Copyright 2022 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 {DlpServiceClient} from '@google-cloud/dlp'; + +// check that the client class type name can be used +function doStuffWithDlpServiceClient(client: DlpServiceClient) { + client.close(); +} + +function main() { + // check that the client instance can be created + const dlpServiceClient = new DlpServiceClient(); + doStuffWithDlpServiceClient(dlpServiceClient); +} + +main(); diff --git a/owl-bot-staging/v2/system-test/install.ts b/owl-bot-staging/v2/system-test/install.ts new file mode 100644 index 00000000..8ec45222 --- /dev/null +++ b/owl-bot-staging/v2/system-test/install.ts @@ -0,0 +1,49 @@ +// Copyright 2022 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('📦 pack-n-play test', () => { + + it('TypeScript code', async function() { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'TypeScript user can use the type definitions', + ts: readFileSync('./system-test/fixtures/sample/src/index.ts').toString() + } + }; + await packNTest(options); + }); + + it('JavaScript code', async function() { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'JavaScript user can use the library', + ts: readFileSync('./system-test/fixtures/sample/src/index.js').toString() + } + }; + await packNTest(options); + }); + +}); diff --git a/owl-bot-staging/v2/test/gapic_dlp_service_v2.ts b/owl-bot-staging/v2/test/gapic_dlp_service_v2.ts new file mode 100644 index 00000000..748330fb --- /dev/null +++ b/owl-bot-staging/v2/test/gapic_dlp_service_v2.ts @@ -0,0 +1,4921 @@ +// Copyright 2022 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 protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import { describe, it } from 'mocha'; +import * as dlpserviceModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf} from 'google-gax'; + +function generateSampleMessage(instance: T) { + const filledObject = (instance.constructor as typeof protobuf.Message) + .toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { + return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); +} + +function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { mockStream.write({}); }); + } + setImmediate(() => { mockStream.end(); }); + } else { + setImmediate(() => { mockStream.write({}); }); + setImmediate(() => { mockStream.end(); }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + } + }; + } + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v2.DlpServiceClient', () => { + it('has servicePath', () => { + const servicePath = dlpserviceModule.v2.DlpServiceClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = dlpserviceModule.v2.DlpServiceClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = dlpserviceModule.v2.DlpServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + 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 dlpserviceModule.v2.DlpServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.dlpServiceStub, undefined); + await client.initialize(); + assert(client.dlpServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.dlpServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.dlpServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error|null, projectId?: string|null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + + describe('inspectContent', () => { + it('invokes inspectContent without error', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.InspectContentRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.privacy.dlp.v2.InspectContentResponse()); + client.innerApiCalls.inspectContent = stubSimpleCall(expectedResponse); + const [response] = await client.inspectContent(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.inspectContent as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes inspectContent without error using callback', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.InspectContentRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.privacy.dlp.v2.InspectContentResponse()); + client.innerApiCalls.inspectContent = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.inspectContent( + request, + (err?: Error|null, result?: protos.google.privacy.dlp.v2.IInspectContentResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.inspectContent as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes inspectContent with error', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.InspectContentRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.inspectContent = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.inspectContent(request), expectedError); + assert((client.innerApiCalls.inspectContent as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes inspectContent with closed client', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.InspectContentRequest()); + request.parent = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.inspectContent(request), expectedError); + }); + }); + + describe('redactImage', () => { + it('invokes redactImage without error', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.RedactImageRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.privacy.dlp.v2.RedactImageResponse()); + client.innerApiCalls.redactImage = stubSimpleCall(expectedResponse); + const [response] = await client.redactImage(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.redactImage as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes redactImage without error using callback', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.RedactImageRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.privacy.dlp.v2.RedactImageResponse()); + client.innerApiCalls.redactImage = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.redactImage( + request, + (err?: Error|null, result?: protos.google.privacy.dlp.v2.IRedactImageResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.redactImage as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes redactImage with error', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.RedactImageRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.redactImage = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.redactImage(request), expectedError); + assert((client.innerApiCalls.redactImage as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes redactImage with closed client', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.RedactImageRequest()); + request.parent = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.redactImage(request), expectedError); + }); + }); + + describe('deidentifyContent', () => { + it('invokes deidentifyContent without error', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.DeidentifyContentRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.privacy.dlp.v2.DeidentifyContentResponse()); + client.innerApiCalls.deidentifyContent = stubSimpleCall(expectedResponse); + const [response] = await client.deidentifyContent(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deidentifyContent as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deidentifyContent without error using callback', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.DeidentifyContentRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.privacy.dlp.v2.DeidentifyContentResponse()); + client.innerApiCalls.deidentifyContent = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deidentifyContent( + request, + (err?: Error|null, result?: protos.google.privacy.dlp.v2.IDeidentifyContentResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deidentifyContent as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes deidentifyContent with error', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.DeidentifyContentRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deidentifyContent = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deidentifyContent(request), expectedError); + assert((client.innerApiCalls.deidentifyContent as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deidentifyContent with closed client', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.DeidentifyContentRequest()); + request.parent = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deidentifyContent(request), expectedError); + }); + }); + + describe('reidentifyContent', () => { + it('invokes reidentifyContent without error', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.ReidentifyContentRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.privacy.dlp.v2.ReidentifyContentResponse()); + client.innerApiCalls.reidentifyContent = stubSimpleCall(expectedResponse); + const [response] = await client.reidentifyContent(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.reidentifyContent as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes reidentifyContent without error using callback', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.ReidentifyContentRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.privacy.dlp.v2.ReidentifyContentResponse()); + client.innerApiCalls.reidentifyContent = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.reidentifyContent( + request, + (err?: Error|null, result?: protos.google.privacy.dlp.v2.IReidentifyContentResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.reidentifyContent as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes reidentifyContent with error', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.ReidentifyContentRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.reidentifyContent = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.reidentifyContent(request), expectedError); + assert((client.innerApiCalls.reidentifyContent as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes reidentifyContent with closed client', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.ReidentifyContentRequest()); + request.parent = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.reidentifyContent(request), expectedError); + }); + }); + + describe('listInfoTypes', () => { + it('invokes listInfoTypes without error', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.ListInfoTypesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.privacy.dlp.v2.ListInfoTypesResponse()); + client.innerApiCalls.listInfoTypes = stubSimpleCall(expectedResponse); + const [response] = await client.listInfoTypes(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listInfoTypes as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listInfoTypes without error using callback', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.ListInfoTypesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.privacy.dlp.v2.ListInfoTypesResponse()); + client.innerApiCalls.listInfoTypes = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listInfoTypes( + request, + (err?: Error|null, result?: protos.google.privacy.dlp.v2.IListInfoTypesResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listInfoTypes as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes listInfoTypes with error', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.ListInfoTypesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listInfoTypes = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listInfoTypes(request), expectedError); + assert((client.innerApiCalls.listInfoTypes as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listInfoTypes with closed client', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.ListInfoTypesRequest()); + request.parent = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.listInfoTypes(request), expectedError); + }); + }); + + describe('createInspectTemplate', () => { + it('invokes createInspectTemplate without error', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.CreateInspectTemplateRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.privacy.dlp.v2.InspectTemplate()); + client.innerApiCalls.createInspectTemplate = stubSimpleCall(expectedResponse); + const [response] = await client.createInspectTemplate(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createInspectTemplate as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createInspectTemplate without error using callback', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.CreateInspectTemplateRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.privacy.dlp.v2.InspectTemplate()); + client.innerApiCalls.createInspectTemplate = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createInspectTemplate( + request, + (err?: Error|null, result?: protos.google.privacy.dlp.v2.IInspectTemplate|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createInspectTemplate as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes createInspectTemplate with error', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.CreateInspectTemplateRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createInspectTemplate = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createInspectTemplate(request), expectedError); + assert((client.innerApiCalls.createInspectTemplate as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createInspectTemplate with closed client', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.CreateInspectTemplateRequest()); + request.parent = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createInspectTemplate(request), expectedError); + }); + }); + + describe('updateInspectTemplate', () => { + it('invokes updateInspectTemplate without error', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.UpdateInspectTemplateRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.privacy.dlp.v2.InspectTemplate()); + client.innerApiCalls.updateInspectTemplate = stubSimpleCall(expectedResponse); + const [response] = await client.updateInspectTemplate(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.updateInspectTemplate as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes updateInspectTemplate without error using callback', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.UpdateInspectTemplateRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.privacy.dlp.v2.InspectTemplate()); + client.innerApiCalls.updateInspectTemplate = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateInspectTemplate( + request, + (err?: Error|null, result?: protos.google.privacy.dlp.v2.IInspectTemplate|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.updateInspectTemplate as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes updateInspectTemplate with error', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.UpdateInspectTemplateRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateInspectTemplate = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateInspectTemplate(request), expectedError); + assert((client.innerApiCalls.updateInspectTemplate as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes updateInspectTemplate with closed client', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.UpdateInspectTemplateRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateInspectTemplate(request), expectedError); + }); + }); + + describe('getInspectTemplate', () => { + it('invokes getInspectTemplate without error', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.GetInspectTemplateRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.privacy.dlp.v2.InspectTemplate()); + client.innerApiCalls.getInspectTemplate = stubSimpleCall(expectedResponse); + const [response] = await client.getInspectTemplate(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getInspectTemplate as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getInspectTemplate without error using callback', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.GetInspectTemplateRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.privacy.dlp.v2.InspectTemplate()); + client.innerApiCalls.getInspectTemplate = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getInspectTemplate( + request, + (err?: Error|null, result?: protos.google.privacy.dlp.v2.IInspectTemplate|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getInspectTemplate as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes getInspectTemplate with error', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.GetInspectTemplateRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getInspectTemplate = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getInspectTemplate(request), expectedError); + assert((client.innerApiCalls.getInspectTemplate as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getInspectTemplate with closed client', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.GetInspectTemplateRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getInspectTemplate(request), expectedError); + }); + }); + + describe('deleteInspectTemplate', () => { + it('invokes deleteInspectTemplate without error', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.DeleteInspectTemplateRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); + client.innerApiCalls.deleteInspectTemplate = stubSimpleCall(expectedResponse); + const [response] = await client.deleteInspectTemplate(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteInspectTemplate as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteInspectTemplate without error using callback', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.DeleteInspectTemplateRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); + client.innerApiCalls.deleteInspectTemplate = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteInspectTemplate( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteInspectTemplate as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes deleteInspectTemplate with error', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.DeleteInspectTemplateRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteInspectTemplate = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteInspectTemplate(request), expectedError); + assert((client.innerApiCalls.deleteInspectTemplate as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteInspectTemplate with closed client', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.DeleteInspectTemplateRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteInspectTemplate(request), expectedError); + }); + }); + + describe('createDeidentifyTemplate', () => { + it('invokes createDeidentifyTemplate without error', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.CreateDeidentifyTemplateRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.privacy.dlp.v2.DeidentifyTemplate()); + client.innerApiCalls.createDeidentifyTemplate = stubSimpleCall(expectedResponse); + const [response] = await client.createDeidentifyTemplate(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createDeidentifyTemplate as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createDeidentifyTemplate without error using callback', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.CreateDeidentifyTemplateRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.privacy.dlp.v2.DeidentifyTemplate()); + client.innerApiCalls.createDeidentifyTemplate = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createDeidentifyTemplate( + request, + (err?: Error|null, result?: protos.google.privacy.dlp.v2.IDeidentifyTemplate|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createDeidentifyTemplate as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes createDeidentifyTemplate with error', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.CreateDeidentifyTemplateRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createDeidentifyTemplate = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createDeidentifyTemplate(request), expectedError); + assert((client.innerApiCalls.createDeidentifyTemplate as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createDeidentifyTemplate with closed client', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.CreateDeidentifyTemplateRequest()); + request.parent = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createDeidentifyTemplate(request), expectedError); + }); + }); + + describe('updateDeidentifyTemplate', () => { + it('invokes updateDeidentifyTemplate without error', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.UpdateDeidentifyTemplateRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.privacy.dlp.v2.DeidentifyTemplate()); + client.innerApiCalls.updateDeidentifyTemplate = stubSimpleCall(expectedResponse); + const [response] = await client.updateDeidentifyTemplate(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.updateDeidentifyTemplate as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes updateDeidentifyTemplate without error using callback', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.UpdateDeidentifyTemplateRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.privacy.dlp.v2.DeidentifyTemplate()); + client.innerApiCalls.updateDeidentifyTemplate = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateDeidentifyTemplate( + request, + (err?: Error|null, result?: protos.google.privacy.dlp.v2.IDeidentifyTemplate|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.updateDeidentifyTemplate as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes updateDeidentifyTemplate with error', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.UpdateDeidentifyTemplateRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateDeidentifyTemplate = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateDeidentifyTemplate(request), expectedError); + assert((client.innerApiCalls.updateDeidentifyTemplate as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes updateDeidentifyTemplate with closed client', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.UpdateDeidentifyTemplateRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateDeidentifyTemplate(request), expectedError); + }); + }); + + describe('getDeidentifyTemplate', () => { + it('invokes getDeidentifyTemplate without error', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.GetDeidentifyTemplateRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.privacy.dlp.v2.DeidentifyTemplate()); + client.innerApiCalls.getDeidentifyTemplate = stubSimpleCall(expectedResponse); + const [response] = await client.getDeidentifyTemplate(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getDeidentifyTemplate as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getDeidentifyTemplate without error using callback', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.GetDeidentifyTemplateRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.privacy.dlp.v2.DeidentifyTemplate()); + client.innerApiCalls.getDeidentifyTemplate = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getDeidentifyTemplate( + request, + (err?: Error|null, result?: protos.google.privacy.dlp.v2.IDeidentifyTemplate|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getDeidentifyTemplate as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes getDeidentifyTemplate with error', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.GetDeidentifyTemplateRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getDeidentifyTemplate = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getDeidentifyTemplate(request), expectedError); + assert((client.innerApiCalls.getDeidentifyTemplate as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getDeidentifyTemplate with closed client', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.GetDeidentifyTemplateRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getDeidentifyTemplate(request), expectedError); + }); + }); + + describe('deleteDeidentifyTemplate', () => { + it('invokes deleteDeidentifyTemplate without error', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.DeleteDeidentifyTemplateRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); + client.innerApiCalls.deleteDeidentifyTemplate = stubSimpleCall(expectedResponse); + const [response] = await client.deleteDeidentifyTemplate(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteDeidentifyTemplate as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteDeidentifyTemplate without error using callback', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.DeleteDeidentifyTemplateRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); + client.innerApiCalls.deleteDeidentifyTemplate = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteDeidentifyTemplate( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteDeidentifyTemplate as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes deleteDeidentifyTemplate with error', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.DeleteDeidentifyTemplateRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteDeidentifyTemplate = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteDeidentifyTemplate(request), expectedError); + assert((client.innerApiCalls.deleteDeidentifyTemplate as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteDeidentifyTemplate with closed client', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.DeleteDeidentifyTemplateRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteDeidentifyTemplate(request), expectedError); + }); + }); + + describe('createJobTrigger', () => { + it('invokes createJobTrigger without error', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.CreateJobTriggerRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.privacy.dlp.v2.JobTrigger()); + client.innerApiCalls.createJobTrigger = stubSimpleCall(expectedResponse); + const [response] = await client.createJobTrigger(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createJobTrigger as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createJobTrigger without error using callback', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.CreateJobTriggerRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.privacy.dlp.v2.JobTrigger()); + client.innerApiCalls.createJobTrigger = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createJobTrigger( + request, + (err?: Error|null, result?: protos.google.privacy.dlp.v2.IJobTrigger|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createJobTrigger as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes createJobTrigger with error', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.CreateJobTriggerRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createJobTrigger = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createJobTrigger(request), expectedError); + assert((client.innerApiCalls.createJobTrigger as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createJobTrigger with closed client', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.CreateJobTriggerRequest()); + request.parent = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createJobTrigger(request), expectedError); + }); + }); + + describe('updateJobTrigger', () => { + it('invokes updateJobTrigger without error', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.UpdateJobTriggerRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.privacy.dlp.v2.JobTrigger()); + client.innerApiCalls.updateJobTrigger = stubSimpleCall(expectedResponse); + const [response] = await client.updateJobTrigger(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.updateJobTrigger as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes updateJobTrigger without error using callback', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.UpdateJobTriggerRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.privacy.dlp.v2.JobTrigger()); + client.innerApiCalls.updateJobTrigger = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateJobTrigger( + request, + (err?: Error|null, result?: protos.google.privacy.dlp.v2.IJobTrigger|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.updateJobTrigger as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes updateJobTrigger with error', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.UpdateJobTriggerRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateJobTrigger = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateJobTrigger(request), expectedError); + assert((client.innerApiCalls.updateJobTrigger as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes updateJobTrigger with closed client', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.UpdateJobTriggerRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateJobTrigger(request), expectedError); + }); + }); + + describe('hybridInspectJobTrigger', () => { + it('invokes hybridInspectJobTrigger without error', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.HybridInspectJobTriggerRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.privacy.dlp.v2.HybridInspectResponse()); + client.innerApiCalls.hybridInspectJobTrigger = stubSimpleCall(expectedResponse); + const [response] = await client.hybridInspectJobTrigger(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.hybridInspectJobTrigger as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes hybridInspectJobTrigger without error using callback', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.HybridInspectJobTriggerRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.privacy.dlp.v2.HybridInspectResponse()); + client.innerApiCalls.hybridInspectJobTrigger = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.hybridInspectJobTrigger( + request, + (err?: Error|null, result?: protos.google.privacy.dlp.v2.IHybridInspectResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.hybridInspectJobTrigger as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes hybridInspectJobTrigger with error', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.HybridInspectJobTriggerRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.hybridInspectJobTrigger = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.hybridInspectJobTrigger(request), expectedError); + assert((client.innerApiCalls.hybridInspectJobTrigger as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes hybridInspectJobTrigger with closed client', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.HybridInspectJobTriggerRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.hybridInspectJobTrigger(request), expectedError); + }); + }); + + describe('getJobTrigger', () => { + it('invokes getJobTrigger without error', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.GetJobTriggerRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.privacy.dlp.v2.JobTrigger()); + client.innerApiCalls.getJobTrigger = stubSimpleCall(expectedResponse); + const [response] = await client.getJobTrigger(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getJobTrigger as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getJobTrigger without error using callback', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.GetJobTriggerRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.privacy.dlp.v2.JobTrigger()); + client.innerApiCalls.getJobTrigger = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getJobTrigger( + request, + (err?: Error|null, result?: protos.google.privacy.dlp.v2.IJobTrigger|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getJobTrigger as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes getJobTrigger with error', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.GetJobTriggerRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getJobTrigger = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getJobTrigger(request), expectedError); + assert((client.innerApiCalls.getJobTrigger as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getJobTrigger with closed client', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.GetJobTriggerRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getJobTrigger(request), expectedError); + }); + }); + + describe('deleteJobTrigger', () => { + it('invokes deleteJobTrigger without error', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.DeleteJobTriggerRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); + client.innerApiCalls.deleteJobTrigger = stubSimpleCall(expectedResponse); + const [response] = await client.deleteJobTrigger(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteJobTrigger as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteJobTrigger without error using callback', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.DeleteJobTriggerRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); + client.innerApiCalls.deleteJobTrigger = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteJobTrigger( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteJobTrigger as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes deleteJobTrigger with error', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.DeleteJobTriggerRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteJobTrigger = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteJobTrigger(request), expectedError); + assert((client.innerApiCalls.deleteJobTrigger as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteJobTrigger with closed client', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.DeleteJobTriggerRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteJobTrigger(request), expectedError); + }); + }); + + describe('activateJobTrigger', () => { + it('invokes activateJobTrigger without error', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.ActivateJobTriggerRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.privacy.dlp.v2.DlpJob()); + client.innerApiCalls.activateJobTrigger = stubSimpleCall(expectedResponse); + const [response] = await client.activateJobTrigger(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.activateJobTrigger as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes activateJobTrigger without error using callback', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.ActivateJobTriggerRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.privacy.dlp.v2.DlpJob()); + client.innerApiCalls.activateJobTrigger = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.activateJobTrigger( + request, + (err?: Error|null, result?: protos.google.privacy.dlp.v2.IDlpJob|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.activateJobTrigger as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes activateJobTrigger with error', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.ActivateJobTriggerRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.activateJobTrigger = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.activateJobTrigger(request), expectedError); + assert((client.innerApiCalls.activateJobTrigger as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes activateJobTrigger with closed client', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.ActivateJobTriggerRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.activateJobTrigger(request), expectedError); + }); + }); + + describe('createDlpJob', () => { + it('invokes createDlpJob without error', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.CreateDlpJobRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.privacy.dlp.v2.DlpJob()); + client.innerApiCalls.createDlpJob = stubSimpleCall(expectedResponse); + const [response] = await client.createDlpJob(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createDlpJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createDlpJob without error using callback', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.CreateDlpJobRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.privacy.dlp.v2.DlpJob()); + client.innerApiCalls.createDlpJob = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createDlpJob( + request, + (err?: Error|null, result?: protos.google.privacy.dlp.v2.IDlpJob|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createDlpJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes createDlpJob with error', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.CreateDlpJobRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createDlpJob = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createDlpJob(request), expectedError); + assert((client.innerApiCalls.createDlpJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createDlpJob with closed client', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.CreateDlpJobRequest()); + request.parent = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createDlpJob(request), expectedError); + }); + }); + + describe('getDlpJob', () => { + it('invokes getDlpJob without error', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.GetDlpJobRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.privacy.dlp.v2.DlpJob()); + client.innerApiCalls.getDlpJob = stubSimpleCall(expectedResponse); + const [response] = await client.getDlpJob(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getDlpJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getDlpJob without error using callback', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.GetDlpJobRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.privacy.dlp.v2.DlpJob()); + client.innerApiCalls.getDlpJob = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getDlpJob( + request, + (err?: Error|null, result?: protos.google.privacy.dlp.v2.IDlpJob|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getDlpJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes getDlpJob with error', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.GetDlpJobRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getDlpJob = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getDlpJob(request), expectedError); + assert((client.innerApiCalls.getDlpJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getDlpJob with closed client', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.GetDlpJobRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getDlpJob(request), expectedError); + }); + }); + + describe('deleteDlpJob', () => { + it('invokes deleteDlpJob without error', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.DeleteDlpJobRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); + client.innerApiCalls.deleteDlpJob = stubSimpleCall(expectedResponse); + const [response] = await client.deleteDlpJob(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteDlpJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteDlpJob without error using callback', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.DeleteDlpJobRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); + client.innerApiCalls.deleteDlpJob = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteDlpJob( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteDlpJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes deleteDlpJob with error', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.DeleteDlpJobRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteDlpJob = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteDlpJob(request), expectedError); + assert((client.innerApiCalls.deleteDlpJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteDlpJob with closed client', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.DeleteDlpJobRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteDlpJob(request), expectedError); + }); + }); + + describe('cancelDlpJob', () => { + it('invokes cancelDlpJob without error', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.CancelDlpJobRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); + client.innerApiCalls.cancelDlpJob = stubSimpleCall(expectedResponse); + const [response] = await client.cancelDlpJob(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.cancelDlpJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes cancelDlpJob without error using callback', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.CancelDlpJobRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); + client.innerApiCalls.cancelDlpJob = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.cancelDlpJob( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.cancelDlpJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes cancelDlpJob with error', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.CancelDlpJobRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.cancelDlpJob = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.cancelDlpJob(request), expectedError); + assert((client.innerApiCalls.cancelDlpJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes cancelDlpJob with closed client', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.CancelDlpJobRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.cancelDlpJob(request), expectedError); + }); + }); + + describe('createStoredInfoType', () => { + it('invokes createStoredInfoType without error', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.CreateStoredInfoTypeRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.privacy.dlp.v2.StoredInfoType()); + client.innerApiCalls.createStoredInfoType = stubSimpleCall(expectedResponse); + const [response] = await client.createStoredInfoType(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createStoredInfoType as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createStoredInfoType without error using callback', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.CreateStoredInfoTypeRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.privacy.dlp.v2.StoredInfoType()); + client.innerApiCalls.createStoredInfoType = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createStoredInfoType( + request, + (err?: Error|null, result?: protos.google.privacy.dlp.v2.IStoredInfoType|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createStoredInfoType as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes createStoredInfoType with error', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.CreateStoredInfoTypeRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createStoredInfoType = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createStoredInfoType(request), expectedError); + assert((client.innerApiCalls.createStoredInfoType as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createStoredInfoType with closed client', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.CreateStoredInfoTypeRequest()); + request.parent = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createStoredInfoType(request), expectedError); + }); + }); + + describe('updateStoredInfoType', () => { + it('invokes updateStoredInfoType without error', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.UpdateStoredInfoTypeRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.privacy.dlp.v2.StoredInfoType()); + client.innerApiCalls.updateStoredInfoType = stubSimpleCall(expectedResponse); + const [response] = await client.updateStoredInfoType(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.updateStoredInfoType as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes updateStoredInfoType without error using callback', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.UpdateStoredInfoTypeRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.privacy.dlp.v2.StoredInfoType()); + client.innerApiCalls.updateStoredInfoType = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateStoredInfoType( + request, + (err?: Error|null, result?: protos.google.privacy.dlp.v2.IStoredInfoType|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.updateStoredInfoType as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes updateStoredInfoType with error', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.UpdateStoredInfoTypeRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateStoredInfoType = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateStoredInfoType(request), expectedError); + assert((client.innerApiCalls.updateStoredInfoType as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes updateStoredInfoType with closed client', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.UpdateStoredInfoTypeRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateStoredInfoType(request), expectedError); + }); + }); + + describe('getStoredInfoType', () => { + it('invokes getStoredInfoType without error', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.GetStoredInfoTypeRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.privacy.dlp.v2.StoredInfoType()); + client.innerApiCalls.getStoredInfoType = stubSimpleCall(expectedResponse); + const [response] = await client.getStoredInfoType(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getStoredInfoType as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getStoredInfoType without error using callback', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.GetStoredInfoTypeRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.privacy.dlp.v2.StoredInfoType()); + client.innerApiCalls.getStoredInfoType = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getStoredInfoType( + request, + (err?: Error|null, result?: protos.google.privacy.dlp.v2.IStoredInfoType|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getStoredInfoType as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes getStoredInfoType with error', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.GetStoredInfoTypeRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getStoredInfoType = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getStoredInfoType(request), expectedError); + assert((client.innerApiCalls.getStoredInfoType as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getStoredInfoType with closed client', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.GetStoredInfoTypeRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getStoredInfoType(request), expectedError); + }); + }); + + describe('deleteStoredInfoType', () => { + it('invokes deleteStoredInfoType without error', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.DeleteStoredInfoTypeRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); + client.innerApiCalls.deleteStoredInfoType = stubSimpleCall(expectedResponse); + const [response] = await client.deleteStoredInfoType(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteStoredInfoType as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteStoredInfoType without error using callback', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.DeleteStoredInfoTypeRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); + client.innerApiCalls.deleteStoredInfoType = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteStoredInfoType( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteStoredInfoType as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes deleteStoredInfoType with error', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.DeleteStoredInfoTypeRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteStoredInfoType = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteStoredInfoType(request), expectedError); + assert((client.innerApiCalls.deleteStoredInfoType as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteStoredInfoType with closed client', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.DeleteStoredInfoTypeRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteStoredInfoType(request), expectedError); + }); + }); + + describe('hybridInspectDlpJob', () => { + it('invokes hybridInspectDlpJob without error', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.HybridInspectDlpJobRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.privacy.dlp.v2.HybridInspectResponse()); + client.innerApiCalls.hybridInspectDlpJob = stubSimpleCall(expectedResponse); + const [response] = await client.hybridInspectDlpJob(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.hybridInspectDlpJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes hybridInspectDlpJob without error using callback', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.HybridInspectDlpJobRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.privacy.dlp.v2.HybridInspectResponse()); + client.innerApiCalls.hybridInspectDlpJob = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.hybridInspectDlpJob( + request, + (err?: Error|null, result?: protos.google.privacy.dlp.v2.IHybridInspectResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.hybridInspectDlpJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes hybridInspectDlpJob with error', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.HybridInspectDlpJobRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.hybridInspectDlpJob = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.hybridInspectDlpJob(request), expectedError); + assert((client.innerApiCalls.hybridInspectDlpJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes hybridInspectDlpJob with closed client', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.HybridInspectDlpJobRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.hybridInspectDlpJob(request), expectedError); + }); + }); + + describe('finishDlpJob', () => { + it('invokes finishDlpJob without error', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.FinishDlpJobRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); + client.innerApiCalls.finishDlpJob = stubSimpleCall(expectedResponse); + const [response] = await client.finishDlpJob(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.finishDlpJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes finishDlpJob without error using callback', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.FinishDlpJobRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); + client.innerApiCalls.finishDlpJob = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.finishDlpJob( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.finishDlpJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes finishDlpJob with error', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.FinishDlpJobRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.finishDlpJob = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.finishDlpJob(request), expectedError); + assert((client.innerApiCalls.finishDlpJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes finishDlpJob with closed client', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.FinishDlpJobRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.finishDlpJob(request), expectedError); + }); + }); + + describe('listInspectTemplates', () => { + it('invokes listInspectTemplates without error', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.ListInspectTemplatesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.privacy.dlp.v2.InspectTemplate()), + generateSampleMessage(new protos.google.privacy.dlp.v2.InspectTemplate()), + generateSampleMessage(new protos.google.privacy.dlp.v2.InspectTemplate()), + ]; + client.innerApiCalls.listInspectTemplates = stubSimpleCall(expectedResponse); + const [response] = await client.listInspectTemplates(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listInspectTemplates as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listInspectTemplates without error using callback', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.ListInspectTemplatesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.privacy.dlp.v2.InspectTemplate()), + generateSampleMessage(new protos.google.privacy.dlp.v2.InspectTemplate()), + generateSampleMessage(new protos.google.privacy.dlp.v2.InspectTemplate()), + ]; + client.innerApiCalls.listInspectTemplates = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listInspectTemplates( + request, + (err?: Error|null, result?: protos.google.privacy.dlp.v2.IInspectTemplate[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listInspectTemplates as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes listInspectTemplates with error', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.ListInspectTemplatesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listInspectTemplates = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listInspectTemplates(request), expectedError); + assert((client.innerApiCalls.listInspectTemplates as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listInspectTemplatesStream without error', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.ListInspectTemplatesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.privacy.dlp.v2.InspectTemplate()), + generateSampleMessage(new protos.google.privacy.dlp.v2.InspectTemplate()), + generateSampleMessage(new protos.google.privacy.dlp.v2.InspectTemplate()), + ]; + client.descriptors.page.listInspectTemplates.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listInspectTemplatesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.privacy.dlp.v2.InspectTemplate[] = []; + stream.on('data', (response: protos.google.privacy.dlp.v2.InspectTemplate) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listInspectTemplates.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listInspectTemplates, request)); + assert.strictEqual( + (client.descriptors.page.listInspectTemplates.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listInspectTemplatesStream with error', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.ListInspectTemplatesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedError = new Error('expected'); + client.descriptors.page.listInspectTemplates.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listInspectTemplatesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.privacy.dlp.v2.InspectTemplate[] = []; + stream.on('data', (response: protos.google.privacy.dlp.v2.InspectTemplate) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listInspectTemplates.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listInspectTemplates, request)); + assert.strictEqual( + (client.descriptors.page.listInspectTemplates.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listInspectTemplates without error', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.ListInspectTemplatesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.privacy.dlp.v2.InspectTemplate()), + generateSampleMessage(new protos.google.privacy.dlp.v2.InspectTemplate()), + generateSampleMessage(new protos.google.privacy.dlp.v2.InspectTemplate()), + ]; + client.descriptors.page.listInspectTemplates.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.privacy.dlp.v2.IInspectTemplate[] = []; + const iterable = client.listInspectTemplatesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listInspectTemplates.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listInspectTemplates.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listInspectTemplates with error', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.ListInspectTemplatesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); + client.descriptors.page.listInspectTemplates.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listInspectTemplatesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.privacy.dlp.v2.IInspectTemplate[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listInspectTemplates.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listInspectTemplates.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('listDeidentifyTemplates', () => { + it('invokes listDeidentifyTemplates without error', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.ListDeidentifyTemplatesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.privacy.dlp.v2.DeidentifyTemplate()), + generateSampleMessage(new protos.google.privacy.dlp.v2.DeidentifyTemplate()), + generateSampleMessage(new protos.google.privacy.dlp.v2.DeidentifyTemplate()), + ]; + client.innerApiCalls.listDeidentifyTemplates = stubSimpleCall(expectedResponse); + const [response] = await client.listDeidentifyTemplates(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listDeidentifyTemplates as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listDeidentifyTemplates without error using callback', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.ListDeidentifyTemplatesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.privacy.dlp.v2.DeidentifyTemplate()), + generateSampleMessage(new protos.google.privacy.dlp.v2.DeidentifyTemplate()), + generateSampleMessage(new protos.google.privacy.dlp.v2.DeidentifyTemplate()), + ]; + client.innerApiCalls.listDeidentifyTemplates = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listDeidentifyTemplates( + request, + (err?: Error|null, result?: protos.google.privacy.dlp.v2.IDeidentifyTemplate[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listDeidentifyTemplates as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes listDeidentifyTemplates with error', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.ListDeidentifyTemplatesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listDeidentifyTemplates = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listDeidentifyTemplates(request), expectedError); + assert((client.innerApiCalls.listDeidentifyTemplates as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listDeidentifyTemplatesStream without error', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.ListDeidentifyTemplatesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.privacy.dlp.v2.DeidentifyTemplate()), + generateSampleMessage(new protos.google.privacy.dlp.v2.DeidentifyTemplate()), + generateSampleMessage(new protos.google.privacy.dlp.v2.DeidentifyTemplate()), + ]; + client.descriptors.page.listDeidentifyTemplates.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listDeidentifyTemplatesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.privacy.dlp.v2.DeidentifyTemplate[] = []; + stream.on('data', (response: protos.google.privacy.dlp.v2.DeidentifyTemplate) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listDeidentifyTemplates.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listDeidentifyTemplates, request)); + assert.strictEqual( + (client.descriptors.page.listDeidentifyTemplates.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listDeidentifyTemplatesStream with error', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.ListDeidentifyTemplatesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedError = new Error('expected'); + client.descriptors.page.listDeidentifyTemplates.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listDeidentifyTemplatesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.privacy.dlp.v2.DeidentifyTemplate[] = []; + stream.on('data', (response: protos.google.privacy.dlp.v2.DeidentifyTemplate) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listDeidentifyTemplates.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listDeidentifyTemplates, request)); + assert.strictEqual( + (client.descriptors.page.listDeidentifyTemplates.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listDeidentifyTemplates without error', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.ListDeidentifyTemplatesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.privacy.dlp.v2.DeidentifyTemplate()), + generateSampleMessage(new protos.google.privacy.dlp.v2.DeidentifyTemplate()), + generateSampleMessage(new protos.google.privacy.dlp.v2.DeidentifyTemplate()), + ]; + client.descriptors.page.listDeidentifyTemplates.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.privacy.dlp.v2.IDeidentifyTemplate[] = []; + const iterable = client.listDeidentifyTemplatesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listDeidentifyTemplates.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listDeidentifyTemplates.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listDeidentifyTemplates with error', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.ListDeidentifyTemplatesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); + client.descriptors.page.listDeidentifyTemplates.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listDeidentifyTemplatesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.privacy.dlp.v2.IDeidentifyTemplate[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listDeidentifyTemplates.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listDeidentifyTemplates.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('listJobTriggers', () => { + it('invokes listJobTriggers without error', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.ListJobTriggersRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.privacy.dlp.v2.JobTrigger()), + generateSampleMessage(new protos.google.privacy.dlp.v2.JobTrigger()), + generateSampleMessage(new protos.google.privacy.dlp.v2.JobTrigger()), + ]; + client.innerApiCalls.listJobTriggers = stubSimpleCall(expectedResponse); + const [response] = await client.listJobTriggers(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listJobTriggers as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listJobTriggers without error using callback', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.ListJobTriggersRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.privacy.dlp.v2.JobTrigger()), + generateSampleMessage(new protos.google.privacy.dlp.v2.JobTrigger()), + generateSampleMessage(new protos.google.privacy.dlp.v2.JobTrigger()), + ]; + client.innerApiCalls.listJobTriggers = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listJobTriggers( + request, + (err?: Error|null, result?: protos.google.privacy.dlp.v2.IJobTrigger[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listJobTriggers as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes listJobTriggers with error', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.ListJobTriggersRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listJobTriggers = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listJobTriggers(request), expectedError); + assert((client.innerApiCalls.listJobTriggers as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listJobTriggersStream without error', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.ListJobTriggersRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.privacy.dlp.v2.JobTrigger()), + generateSampleMessage(new protos.google.privacy.dlp.v2.JobTrigger()), + generateSampleMessage(new protos.google.privacy.dlp.v2.JobTrigger()), + ]; + client.descriptors.page.listJobTriggers.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listJobTriggersStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.privacy.dlp.v2.JobTrigger[] = []; + stream.on('data', (response: protos.google.privacy.dlp.v2.JobTrigger) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listJobTriggers.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listJobTriggers, request)); + assert.strictEqual( + (client.descriptors.page.listJobTriggers.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listJobTriggersStream with error', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.ListJobTriggersRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedError = new Error('expected'); + client.descriptors.page.listJobTriggers.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listJobTriggersStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.privacy.dlp.v2.JobTrigger[] = []; + stream.on('data', (response: protos.google.privacy.dlp.v2.JobTrigger) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listJobTriggers.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listJobTriggers, request)); + assert.strictEqual( + (client.descriptors.page.listJobTriggers.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listJobTriggers without error', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.ListJobTriggersRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.privacy.dlp.v2.JobTrigger()), + generateSampleMessage(new protos.google.privacy.dlp.v2.JobTrigger()), + generateSampleMessage(new protos.google.privacy.dlp.v2.JobTrigger()), + ]; + client.descriptors.page.listJobTriggers.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.privacy.dlp.v2.IJobTrigger[] = []; + const iterable = client.listJobTriggersAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listJobTriggers.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listJobTriggers.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listJobTriggers with error', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.ListJobTriggersRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); + client.descriptors.page.listJobTriggers.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listJobTriggersAsync(request); + await assert.rejects(async () => { + const responses: protos.google.privacy.dlp.v2.IJobTrigger[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listJobTriggers.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listJobTriggers.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('listDlpJobs', () => { + it('invokes listDlpJobs without error', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.ListDlpJobsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.privacy.dlp.v2.DlpJob()), + generateSampleMessage(new protos.google.privacy.dlp.v2.DlpJob()), + generateSampleMessage(new protos.google.privacy.dlp.v2.DlpJob()), + ]; + client.innerApiCalls.listDlpJobs = stubSimpleCall(expectedResponse); + const [response] = await client.listDlpJobs(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listDlpJobs as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listDlpJobs without error using callback', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.ListDlpJobsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.privacy.dlp.v2.DlpJob()), + generateSampleMessage(new protos.google.privacy.dlp.v2.DlpJob()), + generateSampleMessage(new protos.google.privacy.dlp.v2.DlpJob()), + ]; + client.innerApiCalls.listDlpJobs = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listDlpJobs( + request, + (err?: Error|null, result?: protos.google.privacy.dlp.v2.IDlpJob[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listDlpJobs as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes listDlpJobs with error', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.ListDlpJobsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listDlpJobs = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listDlpJobs(request), expectedError); + assert((client.innerApiCalls.listDlpJobs as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listDlpJobsStream without error', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.ListDlpJobsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.privacy.dlp.v2.DlpJob()), + generateSampleMessage(new protos.google.privacy.dlp.v2.DlpJob()), + generateSampleMessage(new protos.google.privacy.dlp.v2.DlpJob()), + ]; + client.descriptors.page.listDlpJobs.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listDlpJobsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.privacy.dlp.v2.DlpJob[] = []; + stream.on('data', (response: protos.google.privacy.dlp.v2.DlpJob) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listDlpJobs.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listDlpJobs, request)); + assert.strictEqual( + (client.descriptors.page.listDlpJobs.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listDlpJobsStream with error', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.ListDlpJobsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedError = new Error('expected'); + client.descriptors.page.listDlpJobs.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listDlpJobsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.privacy.dlp.v2.DlpJob[] = []; + stream.on('data', (response: protos.google.privacy.dlp.v2.DlpJob) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listDlpJobs.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listDlpJobs, request)); + assert.strictEqual( + (client.descriptors.page.listDlpJobs.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listDlpJobs without error', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.ListDlpJobsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.privacy.dlp.v2.DlpJob()), + generateSampleMessage(new protos.google.privacy.dlp.v2.DlpJob()), + generateSampleMessage(new protos.google.privacy.dlp.v2.DlpJob()), + ]; + client.descriptors.page.listDlpJobs.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.privacy.dlp.v2.IDlpJob[] = []; + const iterable = client.listDlpJobsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listDlpJobs.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listDlpJobs.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listDlpJobs with error', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.ListDlpJobsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); + client.descriptors.page.listDlpJobs.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listDlpJobsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.privacy.dlp.v2.IDlpJob[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listDlpJobs.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listDlpJobs.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('listStoredInfoTypes', () => { + it('invokes listStoredInfoTypes without error', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.ListStoredInfoTypesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.privacy.dlp.v2.StoredInfoType()), + generateSampleMessage(new protos.google.privacy.dlp.v2.StoredInfoType()), + generateSampleMessage(new protos.google.privacy.dlp.v2.StoredInfoType()), + ]; + client.innerApiCalls.listStoredInfoTypes = stubSimpleCall(expectedResponse); + const [response] = await client.listStoredInfoTypes(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listStoredInfoTypes as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listStoredInfoTypes without error using callback', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.ListStoredInfoTypesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.privacy.dlp.v2.StoredInfoType()), + generateSampleMessage(new protos.google.privacy.dlp.v2.StoredInfoType()), + generateSampleMessage(new protos.google.privacy.dlp.v2.StoredInfoType()), + ]; + client.innerApiCalls.listStoredInfoTypes = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listStoredInfoTypes( + request, + (err?: Error|null, result?: protos.google.privacy.dlp.v2.IStoredInfoType[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listStoredInfoTypes as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes listStoredInfoTypes with error', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.ListStoredInfoTypesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listStoredInfoTypes = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listStoredInfoTypes(request), expectedError); + assert((client.innerApiCalls.listStoredInfoTypes as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listStoredInfoTypesStream without error', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.ListStoredInfoTypesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.privacy.dlp.v2.StoredInfoType()), + generateSampleMessage(new protos.google.privacy.dlp.v2.StoredInfoType()), + generateSampleMessage(new protos.google.privacy.dlp.v2.StoredInfoType()), + ]; + client.descriptors.page.listStoredInfoTypes.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listStoredInfoTypesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.privacy.dlp.v2.StoredInfoType[] = []; + stream.on('data', (response: protos.google.privacy.dlp.v2.StoredInfoType) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listStoredInfoTypes.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listStoredInfoTypes, request)); + assert.strictEqual( + (client.descriptors.page.listStoredInfoTypes.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listStoredInfoTypesStream with error', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.ListStoredInfoTypesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedError = new Error('expected'); + client.descriptors.page.listStoredInfoTypes.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listStoredInfoTypesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.privacy.dlp.v2.StoredInfoType[] = []; + stream.on('data', (response: protos.google.privacy.dlp.v2.StoredInfoType) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listStoredInfoTypes.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listStoredInfoTypes, request)); + assert.strictEqual( + (client.descriptors.page.listStoredInfoTypes.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listStoredInfoTypes without error', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.ListStoredInfoTypesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.privacy.dlp.v2.StoredInfoType()), + generateSampleMessage(new protos.google.privacy.dlp.v2.StoredInfoType()), + generateSampleMessage(new protos.google.privacy.dlp.v2.StoredInfoType()), + ]; + client.descriptors.page.listStoredInfoTypes.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.privacy.dlp.v2.IStoredInfoType[] = []; + const iterable = client.listStoredInfoTypesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listStoredInfoTypes.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listStoredInfoTypes.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listStoredInfoTypes with error', async () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.privacy.dlp.v2.ListStoredInfoTypesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); + client.descriptors.page.listStoredInfoTypes.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listStoredInfoTypesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.privacy.dlp.v2.IStoredInfoType[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listStoredInfoTypes.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listStoredInfoTypes.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('Path templates', () => { + + describe('finding', () => { + const fakePath = "/rendered/path/finding"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + finding: "findingValue", + }; + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.findingPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.findingPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('findingPath', () => { + const result = client.findingPath("projectValue", "locationValue", "findingValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.findingPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromFindingName', () => { + const result = client.matchProjectFromFindingName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.findingPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromFindingName', () => { + const result = client.matchLocationFromFindingName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.findingPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFindingFromFindingName', () => { + const result = client.matchFindingFromFindingName(fakePath); + assert.strictEqual(result, "findingValue"); + assert((client.pathTemplates.findingPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('organization', () => { + const fakePath = "/rendered/path/organization"; + const expectedParameters = { + organization: "organizationValue", + }; + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.organizationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationPath', () => { + const result = client.organizationPath("organizationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.organizationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchOrganizationFromOrganizationName', () => { + const result = client.matchOrganizationFromOrganizationName(fakePath); + assert.strictEqual(result, "organizationValue"); + assert((client.pathTemplates.organizationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('organizationDeidentifyTemplate', () => { + const fakePath = "/rendered/path/organizationDeidentifyTemplate"; + const expectedParameters = { + organization: "organizationValue", + deidentify_template: "deidentifyTemplateValue", + }; + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.organizationDeidentifyTemplatePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationDeidentifyTemplatePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationDeidentifyTemplatePath', () => { + const result = client.organizationDeidentifyTemplatePath("organizationValue", "deidentifyTemplateValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.organizationDeidentifyTemplatePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchOrganizationFromOrganizationDeidentifyTemplateName', () => { + const result = client.matchOrganizationFromOrganizationDeidentifyTemplateName(fakePath); + assert.strictEqual(result, "organizationValue"); + assert((client.pathTemplates.organizationDeidentifyTemplatePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDeidentifyTemplateFromOrganizationDeidentifyTemplateName', () => { + const result = client.matchDeidentifyTemplateFromOrganizationDeidentifyTemplateName(fakePath); + assert.strictEqual(result, "deidentifyTemplateValue"); + assert((client.pathTemplates.organizationDeidentifyTemplatePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('organizationInspectTemplate', () => { + const fakePath = "/rendered/path/organizationInspectTemplate"; + const expectedParameters = { + organization: "organizationValue", + inspect_template: "inspectTemplateValue", + }; + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.organizationInspectTemplatePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationInspectTemplatePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationInspectTemplatePath', () => { + const result = client.organizationInspectTemplatePath("organizationValue", "inspectTemplateValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.organizationInspectTemplatePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchOrganizationFromOrganizationInspectTemplateName', () => { + const result = client.matchOrganizationFromOrganizationInspectTemplateName(fakePath); + assert.strictEqual(result, "organizationValue"); + assert((client.pathTemplates.organizationInspectTemplatePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchInspectTemplateFromOrganizationInspectTemplateName', () => { + const result = client.matchInspectTemplateFromOrganizationInspectTemplateName(fakePath); + assert.strictEqual(result, "inspectTemplateValue"); + assert((client.pathTemplates.organizationInspectTemplatePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('organizationLocationDeidentifyTemplate', () => { + const fakePath = "/rendered/path/organizationLocationDeidentifyTemplate"; + const expectedParameters = { + organization: "organizationValue", + location: "locationValue", + deidentify_template: "deidentifyTemplateValue", + }; + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.organizationLocationDeidentifyTemplatePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationLocationDeidentifyTemplatePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationLocationDeidentifyTemplatePath', () => { + const result = client.organizationLocationDeidentifyTemplatePath("organizationValue", "locationValue", "deidentifyTemplateValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.organizationLocationDeidentifyTemplatePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchOrganizationFromOrganizationLocationDeidentifyTemplateName', () => { + const result = client.matchOrganizationFromOrganizationLocationDeidentifyTemplateName(fakePath); + assert.strictEqual(result, "organizationValue"); + assert((client.pathTemplates.organizationLocationDeidentifyTemplatePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromOrganizationLocationDeidentifyTemplateName', () => { + const result = client.matchLocationFromOrganizationLocationDeidentifyTemplateName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.organizationLocationDeidentifyTemplatePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDeidentifyTemplateFromOrganizationLocationDeidentifyTemplateName', () => { + const result = client.matchDeidentifyTemplateFromOrganizationLocationDeidentifyTemplateName(fakePath); + assert.strictEqual(result, "deidentifyTemplateValue"); + assert((client.pathTemplates.organizationLocationDeidentifyTemplatePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('organizationLocationInspectTemplate', () => { + const fakePath = "/rendered/path/organizationLocationInspectTemplate"; + const expectedParameters = { + organization: "organizationValue", + location: "locationValue", + inspect_template: "inspectTemplateValue", + }; + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.organizationLocationInspectTemplatePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationLocationInspectTemplatePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationLocationInspectTemplatePath', () => { + const result = client.organizationLocationInspectTemplatePath("organizationValue", "locationValue", "inspectTemplateValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.organizationLocationInspectTemplatePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchOrganizationFromOrganizationLocationInspectTemplateName', () => { + const result = client.matchOrganizationFromOrganizationLocationInspectTemplateName(fakePath); + assert.strictEqual(result, "organizationValue"); + assert((client.pathTemplates.organizationLocationInspectTemplatePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromOrganizationLocationInspectTemplateName', () => { + const result = client.matchLocationFromOrganizationLocationInspectTemplateName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.organizationLocationInspectTemplatePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchInspectTemplateFromOrganizationLocationInspectTemplateName', () => { + const result = client.matchInspectTemplateFromOrganizationLocationInspectTemplateName(fakePath); + assert.strictEqual(result, "inspectTemplateValue"); + assert((client.pathTemplates.organizationLocationInspectTemplatePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('organizationLocationStoredInfoType', () => { + const fakePath = "/rendered/path/organizationLocationStoredInfoType"; + const expectedParameters = { + organization: "organizationValue", + location: "locationValue", + stored_info_type: "storedInfoTypeValue", + }; + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.organizationLocationStoredInfoTypePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationLocationStoredInfoTypePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationLocationStoredInfoTypePath', () => { + const result = client.organizationLocationStoredInfoTypePath("organizationValue", "locationValue", "storedInfoTypeValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.organizationLocationStoredInfoTypePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchOrganizationFromOrganizationLocationStoredInfoTypeName', () => { + const result = client.matchOrganizationFromOrganizationLocationStoredInfoTypeName(fakePath); + assert.strictEqual(result, "organizationValue"); + assert((client.pathTemplates.organizationLocationStoredInfoTypePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromOrganizationLocationStoredInfoTypeName', () => { + const result = client.matchLocationFromOrganizationLocationStoredInfoTypeName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.organizationLocationStoredInfoTypePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchStoredInfoTypeFromOrganizationLocationStoredInfoTypeName', () => { + const result = client.matchStoredInfoTypeFromOrganizationLocationStoredInfoTypeName(fakePath); + assert.strictEqual(result, "storedInfoTypeValue"); + assert((client.pathTemplates.organizationLocationStoredInfoTypePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('organizationStoredInfoType', () => { + const fakePath = "/rendered/path/organizationStoredInfoType"; + const expectedParameters = { + organization: "organizationValue", + stored_info_type: "storedInfoTypeValue", + }; + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.organizationStoredInfoTypePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationStoredInfoTypePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationStoredInfoTypePath', () => { + const result = client.organizationStoredInfoTypePath("organizationValue", "storedInfoTypeValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.organizationStoredInfoTypePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchOrganizationFromOrganizationStoredInfoTypeName', () => { + const result = client.matchOrganizationFromOrganizationStoredInfoTypeName(fakePath); + assert.strictEqual(result, "organizationValue"); + assert((client.pathTemplates.organizationStoredInfoTypePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchStoredInfoTypeFromOrganizationStoredInfoTypeName', () => { + const result = client.matchStoredInfoTypeFromOrganizationStoredInfoTypeName(fakePath); + assert.strictEqual(result, "storedInfoTypeValue"); + assert((client.pathTemplates.organizationStoredInfoTypePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('project', () => { + const fakePath = "/rendered/path/project"; + const expectedParameters = { + project: "projectValue", + }; + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath("projectValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectDeidentifyTemplate', () => { + const fakePath = "/rendered/path/projectDeidentifyTemplate"; + const expectedParameters = { + project: "projectValue", + deidentify_template: "deidentifyTemplateValue", + }; + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectDeidentifyTemplatePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectDeidentifyTemplatePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectDeidentifyTemplatePath', () => { + const result = client.projectDeidentifyTemplatePath("projectValue", "deidentifyTemplateValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectDeidentifyTemplatePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectDeidentifyTemplateName', () => { + const result = client.matchProjectFromProjectDeidentifyTemplateName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectDeidentifyTemplatePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDeidentifyTemplateFromProjectDeidentifyTemplateName', () => { + const result = client.matchDeidentifyTemplateFromProjectDeidentifyTemplateName(fakePath); + assert.strictEqual(result, "deidentifyTemplateValue"); + assert((client.pathTemplates.projectDeidentifyTemplatePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectDlpContent', () => { + const fakePath = "/rendered/path/projectDlpContent"; + const expectedParameters = { + project: "projectValue", + }; + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectDlpContentPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectDlpContentPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectDlpContentPath', () => { + const result = client.projectDlpContentPath("projectValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectDlpContentPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectDlpContentName', () => { + const result = client.matchProjectFromProjectDlpContentName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectDlpContentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectDlpJob', () => { + const fakePath = "/rendered/path/projectDlpJob"; + const expectedParameters = { + project: "projectValue", + dlp_job: "dlpJobValue", + }; + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectDlpJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectDlpJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectDlpJobPath', () => { + const result = client.projectDlpJobPath("projectValue", "dlpJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectDlpJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectDlpJobName', () => { + const result = client.matchProjectFromProjectDlpJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectDlpJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDlpJobFromProjectDlpJobName', () => { + const result = client.matchDlpJobFromProjectDlpJobName(fakePath); + assert.strictEqual(result, "dlpJobValue"); + assert((client.pathTemplates.projectDlpJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectInspectTemplate', () => { + const fakePath = "/rendered/path/projectInspectTemplate"; + const expectedParameters = { + project: "projectValue", + inspect_template: "inspectTemplateValue", + }; + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectInspectTemplatePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectInspectTemplatePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectInspectTemplatePath', () => { + const result = client.projectInspectTemplatePath("projectValue", "inspectTemplateValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectInspectTemplatePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectInspectTemplateName', () => { + const result = client.matchProjectFromProjectInspectTemplateName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectInspectTemplatePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchInspectTemplateFromProjectInspectTemplateName', () => { + const result = client.matchInspectTemplateFromProjectInspectTemplateName(fakePath); + assert.strictEqual(result, "inspectTemplateValue"); + assert((client.pathTemplates.projectInspectTemplatePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectJobTrigger', () => { + const fakePath = "/rendered/path/projectJobTrigger"; + const expectedParameters = { + project: "projectValue", + job_trigger: "jobTriggerValue", + }; + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectJobTriggerPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectJobTriggerPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectJobTriggerPath', () => { + const result = client.projectJobTriggerPath("projectValue", "jobTriggerValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectJobTriggerPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectJobTriggerName', () => { + const result = client.matchProjectFromProjectJobTriggerName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectJobTriggerPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchJobTriggerFromProjectJobTriggerName', () => { + const result = client.matchJobTriggerFromProjectJobTriggerName(fakePath); + assert.strictEqual(result, "jobTriggerValue"); + assert((client.pathTemplates.projectJobTriggerPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectLocationDeidentifyTemplate', () => { + const fakePath = "/rendered/path/projectLocationDeidentifyTemplate"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + deidentify_template: "deidentifyTemplateValue", + }; + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationDeidentifyTemplatePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationDeidentifyTemplatePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationDeidentifyTemplatePath', () => { + const result = client.projectLocationDeidentifyTemplatePath("projectValue", "locationValue", "deidentifyTemplateValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectLocationDeidentifyTemplatePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectLocationDeidentifyTemplateName', () => { + const result = client.matchProjectFromProjectLocationDeidentifyTemplateName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectLocationDeidentifyTemplatePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProjectLocationDeidentifyTemplateName', () => { + const result = client.matchLocationFromProjectLocationDeidentifyTemplateName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.projectLocationDeidentifyTemplatePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDeidentifyTemplateFromProjectLocationDeidentifyTemplateName', () => { + const result = client.matchDeidentifyTemplateFromProjectLocationDeidentifyTemplateName(fakePath); + assert.strictEqual(result, "deidentifyTemplateValue"); + assert((client.pathTemplates.projectLocationDeidentifyTemplatePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectLocationDlpJob', () => { + const fakePath = "/rendered/path/projectLocationDlpJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dlp_job: "dlpJobValue", + }; + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationDlpJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationDlpJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationDlpJobPath', () => { + const result = client.projectLocationDlpJobPath("projectValue", "locationValue", "dlpJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectLocationDlpJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectLocationDlpJobName', () => { + const result = client.matchProjectFromProjectLocationDlpJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectLocationDlpJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProjectLocationDlpJobName', () => { + const result = client.matchLocationFromProjectLocationDlpJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.projectLocationDlpJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDlpJobFromProjectLocationDlpJobName', () => { + const result = client.matchDlpJobFromProjectLocationDlpJobName(fakePath); + assert.strictEqual(result, "dlpJobValue"); + assert((client.pathTemplates.projectLocationDlpJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectLocationInspectTemplate', () => { + const fakePath = "/rendered/path/projectLocationInspectTemplate"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + inspect_template: "inspectTemplateValue", + }; + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationInspectTemplatePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationInspectTemplatePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationInspectTemplatePath', () => { + const result = client.projectLocationInspectTemplatePath("projectValue", "locationValue", "inspectTemplateValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectLocationInspectTemplatePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectLocationInspectTemplateName', () => { + const result = client.matchProjectFromProjectLocationInspectTemplateName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectLocationInspectTemplatePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProjectLocationInspectTemplateName', () => { + const result = client.matchLocationFromProjectLocationInspectTemplateName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.projectLocationInspectTemplatePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchInspectTemplateFromProjectLocationInspectTemplateName', () => { + const result = client.matchInspectTemplateFromProjectLocationInspectTemplateName(fakePath); + assert.strictEqual(result, "inspectTemplateValue"); + assert((client.pathTemplates.projectLocationInspectTemplatePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectLocationJobTrigger', () => { + const fakePath = "/rendered/path/projectLocationJobTrigger"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + job_trigger: "jobTriggerValue", + }; + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationJobTriggerPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationJobTriggerPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationJobTriggerPath', () => { + const result = client.projectLocationJobTriggerPath("projectValue", "locationValue", "jobTriggerValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectLocationJobTriggerPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectLocationJobTriggerName', () => { + const result = client.matchProjectFromProjectLocationJobTriggerName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectLocationJobTriggerPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProjectLocationJobTriggerName', () => { + const result = client.matchLocationFromProjectLocationJobTriggerName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.projectLocationJobTriggerPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchJobTriggerFromProjectLocationJobTriggerName', () => { + const result = client.matchJobTriggerFromProjectLocationJobTriggerName(fakePath); + assert.strictEqual(result, "jobTriggerValue"); + assert((client.pathTemplates.projectLocationJobTriggerPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectLocationStoredInfoType', () => { + const fakePath = "/rendered/path/projectLocationStoredInfoType"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + stored_info_type: "storedInfoTypeValue", + }; + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationStoredInfoTypePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationStoredInfoTypePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationStoredInfoTypePath', () => { + const result = client.projectLocationStoredInfoTypePath("projectValue", "locationValue", "storedInfoTypeValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectLocationStoredInfoTypePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectLocationStoredInfoTypeName', () => { + const result = client.matchProjectFromProjectLocationStoredInfoTypeName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectLocationStoredInfoTypePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProjectLocationStoredInfoTypeName', () => { + const result = client.matchLocationFromProjectLocationStoredInfoTypeName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.projectLocationStoredInfoTypePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchStoredInfoTypeFromProjectLocationStoredInfoTypeName', () => { + const result = client.matchStoredInfoTypeFromProjectLocationStoredInfoTypeName(fakePath); + assert.strictEqual(result, "storedInfoTypeValue"); + assert((client.pathTemplates.projectLocationStoredInfoTypePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectStoredInfoType', () => { + const fakePath = "/rendered/path/projectStoredInfoType"; + const expectedParameters = { + project: "projectValue", + stored_info_type: "storedInfoTypeValue", + }; + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectStoredInfoTypePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectStoredInfoTypePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectStoredInfoTypePath', () => { + const result = client.projectStoredInfoTypePath("projectValue", "storedInfoTypeValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectStoredInfoTypePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectStoredInfoTypeName', () => { + const result = client.matchProjectFromProjectStoredInfoTypeName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectStoredInfoTypePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchStoredInfoTypeFromProjectStoredInfoTypeName', () => { + const result = client.matchStoredInfoTypeFromProjectStoredInfoTypeName(fakePath); + assert.strictEqual(result, "storedInfoTypeValue"); + assert((client.pathTemplates.projectStoredInfoTypePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/owl-bot-staging/v2/tsconfig.json b/owl-bot-staging/v2/tsconfig.json new file mode 100644 index 00000000..c78f1c88 --- /dev/null +++ b/owl-bot-staging/v2/tsconfig.json @@ -0,0 +1,19 @@ +{ + "extends": "./node_modules/gts/tsconfig-google.json", + "compilerOptions": { + "rootDir": ".", + "outDir": "build", + "resolveJsonModule": true, + "lib": [ + "es2018", + "dom" + ] + }, + "include": [ + "src/*.ts", + "src/**/*.ts", + "test/*.ts", + "test/**/*.ts", + "system-test/*.ts" + ] +} diff --git a/owl-bot-staging/v2/webpack.config.js b/owl-bot-staging/v2/webpack.config.js new file mode 100644 index 00000000..4eaa3715 --- /dev/null +++ b/owl-bot-staging/v2/webpack.config.js @@ -0,0 +1,64 @@ +// Copyright 2021 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. + +const path = require('path'); + +module.exports = { + entry: './src/index.ts', + output: { + library: 'DlpService', + filename: './dlp-service.js', + }, + node: { + child_process: 'empty', + fs: 'empty', + crypto: 'empty', + }, + resolve: { + alias: { + '../../../package.json': path.resolve(__dirname, 'package.json'), + }, + extensions: ['.js', '.json', '.ts'], + }, + module: { + rules: [ + { + 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[\\/]gtoken/, + use: 'null-loader' + }, + ], + }, + mode: 'production', +}; From 8ebb809581eb3cf5a53f0889c7948cf3212ebbea Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Fri, 25 Mar 2022 17:50:40 +0000 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=A6=89=20Updates=20from=20OwlBot=20po?= =?UTF-8?q?st-processor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --- owl-bot-staging/v2/.eslintignore | 7 - owl-bot-staging/v2/.eslintrc.json | 3 - owl-bot-staging/v2/.gitignore | 14 - owl-bot-staging/v2/.jsdoc.js | 55 - owl-bot-staging/v2/.mocharc.js | 33 - owl-bot-staging/v2/.prettierrc.js | 22 - owl-bot-staging/v2/README.md | 1 - owl-bot-staging/v2/linkinator.config.json | 16 - owl-bot-staging/v2/package.json | 64 - .../v2/protos/google/privacy/dlp/v2/dlp.proto | 4427 -------------- .../google/privacy/dlp/v2/storage.proto | 755 --- .../v2/dlp_service.activate_job_trigger.js | 59 - .../v2/dlp_service.cancel_dlp_job.js | 58 - .../dlp_service.create_deidentify_template.js | 85 - .../v2/dlp_service.create_dlp_job.js | 85 - .../v2/dlp_service.create_inspect_template.js | 85 - .../v2/dlp_service.create_job_trigger.js | 81 - .../v2/dlp_service.create_stored_info_type.js | 85 - .../v2/dlp_service.deidentify_content.js | 100 - .../dlp_service.delete_deidentify_template.js | 60 - .../v2/dlp_service.delete_dlp_job.js | 58 - .../v2/dlp_service.delete_inspect_template.js | 60 - .../v2/dlp_service.delete_job_trigger.js | 59 - .../v2/dlp_service.delete_stored_info_type.js | 60 - .../v2/dlp_service.finish_dlp_job.js | 58 - .../v2/dlp_service.get_deidentify_template.js | 60 - .../generated/v2/dlp_service.get_dlp_job.js | 58 - .../v2/dlp_service.get_inspect_template.js | 60 - .../v2/dlp_service.get_job_trigger.js | 59 - .../v2/dlp_service.get_stored_info_type.js | 60 - .../v2/dlp_service.hybrid_inspect_dlp_job.js | 63 - .../dlp_service.hybrid_inspect_job_trigger.js | 63 - .../v2/dlp_service.inspect_content.js | 85 - .../dlp_service.list_deidentify_templates.js | 98 - .../generated/v2/dlp_service.list_dlp_jobs.js | 122 - .../v2/dlp_service.list_info_types.js | 70 - .../v2/dlp_service.list_inspect_templates.js | 98 - .../v2/dlp_service.list_job_triggers.js | 122 - .../v2/dlp_service.list_stored_info_types.js | 99 - .../generated/v2/dlp_service.redact_image.js | 85 - .../v2/dlp_service.reidentify_content.js | 107 - .../dlp_service.update_deidentify_template.js | 68 - .../v2/dlp_service.update_inspect_template.js | 68 - .../v2/dlp_service.update_job_trigger.js | 67 - .../v2/dlp_service.update_stored_info_type.js | 70 - ...nippet_metadata.google.privacy.dlp.v2.json | 1671 ------ owl-bot-staging/v2/src/index.ts | 25 - .../v2/src/v2/dlp_service_client.ts | 5238 ----------------- .../v2/src/v2/dlp_service_client_config.json | 196 - .../v2/src/v2/dlp_service_proto_list.json | 4 - owl-bot-staging/v2/src/v2/gapic_metadata.json | 383 -- owl-bot-staging/v2/src/v2/index.ts | 19 - .../system-test/fixtures/sample/src/index.js | 27 - .../system-test/fixtures/sample/src/index.ts | 32 - owl-bot-staging/v2/system-test/install.ts | 49 - .../v2/test/gapic_dlp_service_v2.ts | 4921 ---------------- owl-bot-staging/v2/tsconfig.json | 19 - owl-bot-staging/v2/webpack.config.js | 64 - protos/google/privacy/dlp/v2/dlp.proto | 46 +- protos/google/privacy/dlp/v2/storage.proto | 154 +- protos/protos.d.ts | 656 ++- protos/protos.js | 1956 +++--- protos/protos.json | 240 +- 63 files changed, 1553 insertions(+), 22119 deletions(-) delete mode 100644 owl-bot-staging/v2/.eslintignore delete mode 100644 owl-bot-staging/v2/.eslintrc.json delete mode 100644 owl-bot-staging/v2/.gitignore delete mode 100644 owl-bot-staging/v2/.jsdoc.js delete mode 100644 owl-bot-staging/v2/.mocharc.js delete mode 100644 owl-bot-staging/v2/.prettierrc.js delete mode 100644 owl-bot-staging/v2/README.md delete mode 100644 owl-bot-staging/v2/linkinator.config.json delete mode 100644 owl-bot-staging/v2/package.json delete mode 100644 owl-bot-staging/v2/protos/google/privacy/dlp/v2/dlp.proto delete mode 100644 owl-bot-staging/v2/protos/google/privacy/dlp/v2/storage.proto delete mode 100644 owl-bot-staging/v2/samples/generated/v2/dlp_service.activate_job_trigger.js delete mode 100644 owl-bot-staging/v2/samples/generated/v2/dlp_service.cancel_dlp_job.js delete mode 100644 owl-bot-staging/v2/samples/generated/v2/dlp_service.create_deidentify_template.js delete mode 100644 owl-bot-staging/v2/samples/generated/v2/dlp_service.create_dlp_job.js delete mode 100644 owl-bot-staging/v2/samples/generated/v2/dlp_service.create_inspect_template.js delete mode 100644 owl-bot-staging/v2/samples/generated/v2/dlp_service.create_job_trigger.js delete mode 100644 owl-bot-staging/v2/samples/generated/v2/dlp_service.create_stored_info_type.js delete mode 100644 owl-bot-staging/v2/samples/generated/v2/dlp_service.deidentify_content.js delete mode 100644 owl-bot-staging/v2/samples/generated/v2/dlp_service.delete_deidentify_template.js delete mode 100644 owl-bot-staging/v2/samples/generated/v2/dlp_service.delete_dlp_job.js delete mode 100644 owl-bot-staging/v2/samples/generated/v2/dlp_service.delete_inspect_template.js delete mode 100644 owl-bot-staging/v2/samples/generated/v2/dlp_service.delete_job_trigger.js delete mode 100644 owl-bot-staging/v2/samples/generated/v2/dlp_service.delete_stored_info_type.js delete mode 100644 owl-bot-staging/v2/samples/generated/v2/dlp_service.finish_dlp_job.js delete mode 100644 owl-bot-staging/v2/samples/generated/v2/dlp_service.get_deidentify_template.js delete mode 100644 owl-bot-staging/v2/samples/generated/v2/dlp_service.get_dlp_job.js delete mode 100644 owl-bot-staging/v2/samples/generated/v2/dlp_service.get_inspect_template.js delete mode 100644 owl-bot-staging/v2/samples/generated/v2/dlp_service.get_job_trigger.js delete mode 100644 owl-bot-staging/v2/samples/generated/v2/dlp_service.get_stored_info_type.js delete mode 100644 owl-bot-staging/v2/samples/generated/v2/dlp_service.hybrid_inspect_dlp_job.js delete mode 100644 owl-bot-staging/v2/samples/generated/v2/dlp_service.hybrid_inspect_job_trigger.js delete mode 100644 owl-bot-staging/v2/samples/generated/v2/dlp_service.inspect_content.js delete mode 100644 owl-bot-staging/v2/samples/generated/v2/dlp_service.list_deidentify_templates.js delete mode 100644 owl-bot-staging/v2/samples/generated/v2/dlp_service.list_dlp_jobs.js delete mode 100644 owl-bot-staging/v2/samples/generated/v2/dlp_service.list_info_types.js delete mode 100644 owl-bot-staging/v2/samples/generated/v2/dlp_service.list_inspect_templates.js delete mode 100644 owl-bot-staging/v2/samples/generated/v2/dlp_service.list_job_triggers.js delete mode 100644 owl-bot-staging/v2/samples/generated/v2/dlp_service.list_stored_info_types.js delete mode 100644 owl-bot-staging/v2/samples/generated/v2/dlp_service.redact_image.js delete mode 100644 owl-bot-staging/v2/samples/generated/v2/dlp_service.reidentify_content.js delete mode 100644 owl-bot-staging/v2/samples/generated/v2/dlp_service.update_deidentify_template.js delete mode 100644 owl-bot-staging/v2/samples/generated/v2/dlp_service.update_inspect_template.js delete mode 100644 owl-bot-staging/v2/samples/generated/v2/dlp_service.update_job_trigger.js delete mode 100644 owl-bot-staging/v2/samples/generated/v2/dlp_service.update_stored_info_type.js delete mode 100644 owl-bot-staging/v2/samples/generated/v2/snippet_metadata.google.privacy.dlp.v2.json delete mode 100644 owl-bot-staging/v2/src/index.ts delete mode 100644 owl-bot-staging/v2/src/v2/dlp_service_client.ts delete mode 100644 owl-bot-staging/v2/src/v2/dlp_service_client_config.json delete mode 100644 owl-bot-staging/v2/src/v2/dlp_service_proto_list.json delete mode 100644 owl-bot-staging/v2/src/v2/gapic_metadata.json delete mode 100644 owl-bot-staging/v2/src/v2/index.ts delete mode 100644 owl-bot-staging/v2/system-test/fixtures/sample/src/index.js delete mode 100644 owl-bot-staging/v2/system-test/fixtures/sample/src/index.ts delete mode 100644 owl-bot-staging/v2/system-test/install.ts delete mode 100644 owl-bot-staging/v2/test/gapic_dlp_service_v2.ts delete mode 100644 owl-bot-staging/v2/tsconfig.json delete mode 100644 owl-bot-staging/v2/webpack.config.js diff --git a/owl-bot-staging/v2/.eslintignore b/owl-bot-staging/v2/.eslintignore deleted file mode 100644 index cfc348ec..00000000 --- a/owl-bot-staging/v2/.eslintignore +++ /dev/null @@ -1,7 +0,0 @@ -**/node_modules -**/.coverage -build/ -docs/ -protos/ -system-test/ -samples/generated/ diff --git a/owl-bot-staging/v2/.eslintrc.json b/owl-bot-staging/v2/.eslintrc.json deleted file mode 100644 index 78215349..00000000 --- a/owl-bot-staging/v2/.eslintrc.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./node_modules/gts" -} diff --git a/owl-bot-staging/v2/.gitignore b/owl-bot-staging/v2/.gitignore deleted file mode 100644 index 5d32b237..00000000 --- a/owl-bot-staging/v2/.gitignore +++ /dev/null @@ -1,14 +0,0 @@ -**/*.log -**/node_modules -.coverage -coverage -.nyc_output -docs/ -out/ -build/ -system-test/secrets.js -system-test/*key.json -*.lock -.DS_Store -package-lock.json -__pycache__ diff --git a/owl-bot-staging/v2/.jsdoc.js b/owl-bot-staging/v2/.jsdoc.js deleted file mode 100644 index ebb722fc..00000000 --- a/owl-bot-staging/v2/.jsdoc.js +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright 2022 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. ** - -'use strict'; - -module.exports = { - opts: { - readme: './README.md', - package: './package.json', - template: './node_modules/jsdoc-fresh', - recurse: true, - verbose: true, - destination: './docs/' - }, - plugins: [ - 'plugins/markdown', - 'jsdoc-region-tag' - ], - source: { - excludePattern: '(^|\\/|\\\\)[._]', - include: [ - 'build/src', - 'protos' - ], - includePattern: '\\.js$' - }, - templates: { - copyright: 'Copyright 2022 Google LLC', - includeDate: false, - sourceFiles: false, - systemName: '@google-cloud/dlp', - theme: 'lumen', - default: { - outputSourceFiles: false - } - }, - markdown: { - idInHeadings: true - } -}; diff --git a/owl-bot-staging/v2/.mocharc.js b/owl-bot-staging/v2/.mocharc.js deleted file mode 100644 index 481c522b..00000000 --- a/owl-bot-staging/v2/.mocharc.js +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright 2022 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. ** - -const config = { - "enable-source-maps": true, - "throw-deprecation": true, - "timeout": 10000 -} -if (process.env.MOCHA_THROW_DEPRECATION === 'false') { - delete config['throw-deprecation']; -} -if (process.env.MOCHA_REPORTER) { - config.reporter = process.env.MOCHA_REPORTER; -} -if (process.env.MOCHA_REPORTER_OUTPUT) { - config['reporter-option'] = `output=${process.env.MOCHA_REPORTER_OUTPUT}`; -} -module.exports = config diff --git a/owl-bot-staging/v2/.prettierrc.js b/owl-bot-staging/v2/.prettierrc.js deleted file mode 100644 index 494e1478..00000000 --- a/owl-bot-staging/v2/.prettierrc.js +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2022 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. ** - - -module.exports = { - ...require('gts/.prettierrc.json') -} diff --git a/owl-bot-staging/v2/README.md b/owl-bot-staging/v2/README.md deleted file mode 100644 index cb63619c..00000000 --- a/owl-bot-staging/v2/README.md +++ /dev/null @@ -1 +0,0 @@ -Dlp: Nodejs Client diff --git a/owl-bot-staging/v2/linkinator.config.json b/owl-bot-staging/v2/linkinator.config.json deleted file mode 100644 index befd23c8..00000000 --- a/owl-bot-staging/v2/linkinator.config.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "recurse": true, - "skip": [ - "https://codecov.io/gh/googleapis/", - "www.googleapis.com", - "img.shields.io", - "https://console.cloud.google.com/cloudshell", - "https://support.google.com" - ], - "silent": true, - "concurrency": 5, - "retry": true, - "retryErrors": true, - "retryErrorsCount": 5, - "retryErrorsJitter": 3000 -} diff --git a/owl-bot-staging/v2/package.json b/owl-bot-staging/v2/package.json deleted file mode 100644 index c6cc3851..00000000 --- a/owl-bot-staging/v2/package.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "name": "@google-cloud/dlp", - "version": "0.1.0", - "description": "Dlp client for Node.js", - "repository": "googleapis/nodejs-dlp", - "license": "Apache-2.0", - "author": "Google LLC", - "main": "build/src/index.js", - "files": [ - "build/src", - "build/protos" - ], - "keywords": [ - "google apis client", - "google api client", - "google apis", - "google api", - "google", - "google cloud platform", - "google cloud", - "cloud", - "google dlp", - "dlp", - "dlp service" - ], - "scripts": { - "clean": "gts clean", - "compile": "tsc -p . && cp -r protos build/", - "compile-protos": "compileProtos src", - "docs": "jsdoc -c .jsdoc.js", - "predocs-test": "npm run docs", - "docs-test": "linkinator docs", - "fix": "gts fix", - "lint": "gts check", - "prepare": "npm run compile-protos && npm run compile", - "system-test": "c8 mocha build/system-test", - "test": "c8 mocha build/test" - }, - "dependencies": { - "google-gax": "^2.29.4" - }, - "devDependencies": { - "@types/mocha": "^9.1.0", - "@types/node": "^16.0.0", - "@types/sinon": "^10.0.8", - "c8": "^7.11.0", - "gts": "^3.1.0", - "jsdoc": "^3.6.7", - "jsdoc-fresh": "^1.1.1", - "jsdoc-region-tag": "^1.3.1", - "linkinator": "^3.0.0", - "mocha": "^9.1.4", - "null-loader": "^4.0.1", - "pack-n-play": "^1.0.0-2", - "sinon": "^13.0.0", - "ts-loader": "^9.2.6", - "typescript": "^4.5.5", - "webpack": "^5.67.0", - "webpack-cli": "^4.9.1" - }, - "engines": { - "node": ">=v10.24.0" - } -} diff --git a/owl-bot-staging/v2/protos/google/privacy/dlp/v2/dlp.proto b/owl-bot-staging/v2/protos/google/privacy/dlp/v2/dlp.proto deleted file mode 100644 index 03776b0b..00000000 --- a/owl-bot-staging/v2/protos/google/privacy/dlp/v2/dlp.proto +++ /dev/null @@ -1,4427 +0,0 @@ -// Copyright 2022 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. - -syntax = "proto3"; - -package google.privacy.dlp.v2; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/privacy/dlp/v2/storage.proto"; -import "google/protobuf/duration.proto"; -import "google/protobuf/empty.proto"; -import "google/protobuf/field_mask.proto"; -import "google/protobuf/timestamp.proto"; -import "google/rpc/status.proto"; -import "google/type/date.proto"; -import "google/type/dayofweek.proto"; -import "google/type/timeofday.proto"; - -option csharp_namespace = "Google.Cloud.Dlp.V2"; -option go_package = "google.golang.org/genproto/googleapis/privacy/dlp/v2;dlp"; -option java_multiple_files = true; -option java_outer_classname = "DlpProto"; -option java_package = "com.google.privacy.dlp.v2"; -option php_namespace = "Google\\Cloud\\Dlp\\V2"; -option ruby_package = "Google::Cloud::Dlp::V2"; -option (google.api.resource_definition) = { - type: "dlp.googleapis.com/DlpContent" - pattern: "projects/{project}/dlpContent" - pattern: "projects/{project}/locations/{location}/dlpContent" -}; -option (google.api.resource_definition) = { - type: "dlp.googleapis.com/OrganizationLocation" - pattern: "organizations/{organization}/locations/{location}" -}; - -// 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/. -service DlpService { - option (google.api.default_host) = "dlp.googleapis.com"; - option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; - - // 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, - rpc InspectContent(InspectContentRequest) returns (InspectContentResponse) { - option (google.api.http) = { - post: "/v2/{parent=projects/*}/content:inspect" - body: "*" - additional_bindings { - post: "/v2/{parent=projects/*/locations/*}/content:inspect" - body: "*" - } - }; - } - - // 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. - rpc RedactImage(RedactImageRequest) returns (RedactImageResponse) { - option (google.api.http) = { - post: "/v2/{parent=projects/*}/image:redact" - body: "*" - additional_bindings { - post: "/v2/{parent=projects/*/locations/*}/image:redact" - body: "*" - } - }; - } - - // 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. - rpc DeidentifyContent(DeidentifyContentRequest) returns (DeidentifyContentResponse) { - option (google.api.http) = { - post: "/v2/{parent=projects/*}/content:deidentify" - body: "*" - additional_bindings { - post: "/v2/{parent=projects/*/locations/*}/content:deidentify" - body: "*" - } - }; - } - - // 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. - rpc ReidentifyContent(ReidentifyContentRequest) returns (ReidentifyContentResponse) { - option (google.api.http) = { - post: "/v2/{parent=projects/*}/content:reidentify" - body: "*" - additional_bindings { - post: "/v2/{parent=projects/*/locations/*}/content:reidentify" - body: "*" - } - }; - } - - // 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. - rpc ListInfoTypes(ListInfoTypesRequest) returns (ListInfoTypesResponse) { - option (google.api.http) = { - get: "/v2/infoTypes" - additional_bindings { - get: "/v2/{parent=locations/*}/infoTypes" - } - }; - option (google.api.method_signature) = "parent"; - } - - // 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. - rpc CreateInspectTemplate(CreateInspectTemplateRequest) returns (InspectTemplate) { - option (google.api.http) = { - post: "/v2/{parent=organizations/*}/inspectTemplates" - body: "*" - additional_bindings { - post: "/v2/{parent=organizations/*/locations/*}/inspectTemplates" - body: "*" - } - additional_bindings { - post: "/v2/{parent=projects/*}/inspectTemplates" - body: "*" - } - additional_bindings { - post: "/v2/{parent=projects/*/locations/*}/inspectTemplates" - body: "*" - } - }; - option (google.api.method_signature) = "parent,inspect_template"; - } - - // Updates the InspectTemplate. - // See https://cloud.google.com/dlp/docs/creating-templates to learn more. - rpc UpdateInspectTemplate(UpdateInspectTemplateRequest) returns (InspectTemplate) { - option (google.api.http) = { - patch: "/v2/{name=organizations/*/inspectTemplates/*}" - body: "*" - additional_bindings { - patch: "/v2/{name=organizations/*/locations/*/inspectTemplates/*}" - body: "*" - } - additional_bindings { - patch: "/v2/{name=projects/*/inspectTemplates/*}" - body: "*" - } - additional_bindings { - patch: "/v2/{name=projects/*/locations/*/inspectTemplates/*}" - body: "*" - } - }; - option (google.api.method_signature) = "name,inspect_template,update_mask"; - } - - // Gets an InspectTemplate. - // See https://cloud.google.com/dlp/docs/creating-templates to learn more. - rpc GetInspectTemplate(GetInspectTemplateRequest) returns (InspectTemplate) { - option (google.api.http) = { - get: "/v2/{name=organizations/*/inspectTemplates/*}" - additional_bindings { - get: "/v2/{name=organizations/*/locations/*/inspectTemplates/*}" - } - additional_bindings { - get: "/v2/{name=projects/*/inspectTemplates/*}" - } - additional_bindings { - get: "/v2/{name=projects/*/locations/*/inspectTemplates/*}" - } - }; - option (google.api.method_signature) = "name"; - } - - // Lists InspectTemplates. - // See https://cloud.google.com/dlp/docs/creating-templates to learn more. - rpc ListInspectTemplates(ListInspectTemplatesRequest) returns (ListInspectTemplatesResponse) { - option (google.api.http) = { - get: "/v2/{parent=organizations/*}/inspectTemplates" - additional_bindings { - get: "/v2/{parent=organizations/*/locations/*}/inspectTemplates" - } - additional_bindings { - get: "/v2/{parent=projects/*}/inspectTemplates" - } - additional_bindings { - get: "/v2/{parent=projects/*/locations/*}/inspectTemplates" - } - }; - option (google.api.method_signature) = "parent"; - } - - // Deletes an InspectTemplate. - // See https://cloud.google.com/dlp/docs/creating-templates to learn more. - rpc DeleteInspectTemplate(DeleteInspectTemplateRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v2/{name=organizations/*/inspectTemplates/*}" - additional_bindings { - delete: "/v2/{name=organizations/*/locations/*/inspectTemplates/*}" - } - additional_bindings { - delete: "/v2/{name=projects/*/inspectTemplates/*}" - } - additional_bindings { - delete: "/v2/{name=projects/*/locations/*/inspectTemplates/*}" - } - }; - option (google.api.method_signature) = "name"; - } - - // 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. - rpc CreateDeidentifyTemplate(CreateDeidentifyTemplateRequest) returns (DeidentifyTemplate) { - option (google.api.http) = { - post: "/v2/{parent=organizations/*}/deidentifyTemplates" - body: "*" - additional_bindings { - post: "/v2/{parent=organizations/*/locations/*}/deidentifyTemplates" - body: "*" - } - additional_bindings { - post: "/v2/{parent=projects/*}/deidentifyTemplates" - body: "*" - } - additional_bindings { - post: "/v2/{parent=projects/*/locations/*}/deidentifyTemplates" - body: "*" - } - }; - option (google.api.method_signature) = "parent,deidentify_template"; - } - - // Updates the DeidentifyTemplate. - // See https://cloud.google.com/dlp/docs/creating-templates-deid to learn - // more. - rpc UpdateDeidentifyTemplate(UpdateDeidentifyTemplateRequest) returns (DeidentifyTemplate) { - option (google.api.http) = { - patch: "/v2/{name=organizations/*/deidentifyTemplates/*}" - body: "*" - additional_bindings { - patch: "/v2/{name=organizations/*/locations/*/deidentifyTemplates/*}" - body: "*" - } - additional_bindings { - patch: "/v2/{name=projects/*/deidentifyTemplates/*}" - body: "*" - } - additional_bindings { - patch: "/v2/{name=projects/*/locations/*/deidentifyTemplates/*}" - body: "*" - } - }; - option (google.api.method_signature) = "name,deidentify_template,update_mask"; - } - - // Gets a DeidentifyTemplate. - // See https://cloud.google.com/dlp/docs/creating-templates-deid to learn - // more. - rpc GetDeidentifyTemplate(GetDeidentifyTemplateRequest) returns (DeidentifyTemplate) { - option (google.api.http) = { - get: "/v2/{name=organizations/*/deidentifyTemplates/*}" - additional_bindings { - get: "/v2/{name=organizations/*/locations/*/deidentifyTemplates/*}" - } - additional_bindings { - get: "/v2/{name=projects/*/deidentifyTemplates/*}" - } - additional_bindings { - get: "/v2/{name=projects/*/locations/*/deidentifyTemplates/*}" - } - }; - option (google.api.method_signature) = "name"; - } - - // Lists DeidentifyTemplates. - // See https://cloud.google.com/dlp/docs/creating-templates-deid to learn - // more. - rpc ListDeidentifyTemplates(ListDeidentifyTemplatesRequest) returns (ListDeidentifyTemplatesResponse) { - option (google.api.http) = { - get: "/v2/{parent=organizations/*}/deidentifyTemplates" - additional_bindings { - get: "/v2/{parent=organizations/*/locations/*}/deidentifyTemplates" - } - additional_bindings { - get: "/v2/{parent=projects/*}/deidentifyTemplates" - } - additional_bindings { - get: "/v2/{parent=projects/*/locations/*}/deidentifyTemplates" - } - }; - option (google.api.method_signature) = "parent"; - } - - // Deletes a DeidentifyTemplate. - // See https://cloud.google.com/dlp/docs/creating-templates-deid to learn - // more. - rpc DeleteDeidentifyTemplate(DeleteDeidentifyTemplateRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v2/{name=organizations/*/deidentifyTemplates/*}" - additional_bindings { - delete: "/v2/{name=organizations/*/locations/*/deidentifyTemplates/*}" - } - additional_bindings { - delete: "/v2/{name=projects/*/deidentifyTemplates/*}" - } - additional_bindings { - delete: "/v2/{name=projects/*/locations/*/deidentifyTemplates/*}" - } - }; - option (google.api.method_signature) = "name"; - } - - // 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. - rpc CreateJobTrigger(CreateJobTriggerRequest) returns (JobTrigger) { - option (google.api.http) = { - post: "/v2/{parent=projects/*}/jobTriggers" - body: "*" - additional_bindings { - post: "/v2/{parent=projects/*/locations/*}/jobTriggers" - body: "*" - } - additional_bindings { - post: "/v2/{parent=organizations/*/locations/*}/jobTriggers" - body: "*" - } - }; - option (google.api.method_signature) = "parent,job_trigger"; - } - - // Updates a job trigger. - // See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more. - rpc UpdateJobTrigger(UpdateJobTriggerRequest) returns (JobTrigger) { - option (google.api.http) = { - patch: "/v2/{name=projects/*/jobTriggers/*}" - body: "*" - additional_bindings { - patch: "/v2/{name=projects/*/locations/*/jobTriggers/*}" - body: "*" - } - additional_bindings { - patch: "/v2/{name=organizations/*/locations/*/jobTriggers/*}" - body: "*" - } - }; - option (google.api.method_signature) = "name,job_trigger,update_mask"; - } - - // Inspect hybrid content and store findings to a trigger. The inspection - // will be processed asynchronously. To review the findings monitor the - // jobs within the trigger. - rpc HybridInspectJobTrigger(HybridInspectJobTriggerRequest) returns (HybridInspectResponse) { - option (google.api.http) = { - post: "/v2/{name=projects/*/locations/*/jobTriggers/*}:hybridInspect" - body: "*" - }; - option (google.api.method_signature) = "name"; - } - - // Gets a job trigger. - // See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more. - rpc GetJobTrigger(GetJobTriggerRequest) returns (JobTrigger) { - option (google.api.http) = { - get: "/v2/{name=projects/*/jobTriggers/*}" - additional_bindings { - get: "/v2/{name=projects/*/locations/*/jobTriggers/*}" - } - additional_bindings { - get: "/v2/{name=organizations/*/locations/*/jobTriggers/*}" - } - }; - option (google.api.method_signature) = "name"; - } - - // Lists job triggers. - // See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more. - rpc ListJobTriggers(ListJobTriggersRequest) returns (ListJobTriggersResponse) { - option (google.api.http) = { - get: "/v2/{parent=projects/*}/jobTriggers" - additional_bindings { - get: "/v2/{parent=projects/*/locations/*}/jobTriggers" - } - additional_bindings { - get: "/v2/{parent=organizations/*/locations/*}/jobTriggers" - } - }; - option (google.api.method_signature) = "parent"; - } - - // Deletes a job trigger. - // See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more. - rpc DeleteJobTrigger(DeleteJobTriggerRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v2/{name=projects/*/jobTriggers/*}" - additional_bindings { - delete: "/v2/{name=projects/*/locations/*/jobTriggers/*}" - } - additional_bindings { - delete: "/v2/{name=organizations/*/locations/*/jobTriggers/*}" - } - }; - option (google.api.method_signature) = "name"; - } - - // Activate a job trigger. Causes the immediate execute of a trigger - // instead of waiting on the trigger event to occur. - rpc ActivateJobTrigger(ActivateJobTriggerRequest) returns (DlpJob) { - option (google.api.http) = { - post: "/v2/{name=projects/*/jobTriggers/*}:activate" - body: "*" - additional_bindings { - post: "/v2/{name=projects/*/locations/*/jobTriggers/*}:activate" - body: "*" - } - }; - } - - // 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. - rpc CreateDlpJob(CreateDlpJobRequest) returns (DlpJob) { - option (google.api.http) = { - post: "/v2/{parent=projects/*}/dlpJobs" - body: "*" - additional_bindings { - post: "/v2/{parent=projects/*/locations/*}/dlpJobs" - body: "*" - } - }; - option (google.api.method_signature) = "parent,inspect_job"; - option (google.api.method_signature) = "parent,risk_job"; - } - - // 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. - rpc ListDlpJobs(ListDlpJobsRequest) returns (ListDlpJobsResponse) { - option (google.api.http) = { - get: "/v2/{parent=projects/*}/dlpJobs" - additional_bindings { - get: "/v2/{parent=projects/*/locations/*}/dlpJobs" - } - additional_bindings { - get: "/v2/{parent=organizations/*/locations/*}/dlpJobs" - } - }; - option (google.api.method_signature) = "parent"; - } - - // 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. - rpc GetDlpJob(GetDlpJobRequest) returns (DlpJob) { - option (google.api.http) = { - get: "/v2/{name=projects/*/dlpJobs/*}" - additional_bindings { - get: "/v2/{name=projects/*/locations/*/dlpJobs/*}" - } - }; - option (google.api.method_signature) = "name"; - } - - // 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. - rpc DeleteDlpJob(DeleteDlpJobRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v2/{name=projects/*/dlpJobs/*}" - additional_bindings { - delete: "/v2/{name=projects/*/locations/*/dlpJobs/*}" - } - }; - option (google.api.method_signature) = "name"; - } - - // 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. - rpc CancelDlpJob(CancelDlpJobRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - post: "/v2/{name=projects/*/dlpJobs/*}:cancel" - body: "*" - additional_bindings { - post: "/v2/{name=projects/*/locations/*/dlpJobs/*}:cancel" - body: "*" - } - }; - } - - // Creates a pre-built stored infoType to be used for inspection. - // See https://cloud.google.com/dlp/docs/creating-stored-infotypes to - // learn more. - rpc CreateStoredInfoType(CreateStoredInfoTypeRequest) returns (StoredInfoType) { - option (google.api.http) = { - post: "/v2/{parent=organizations/*}/storedInfoTypes" - body: "*" - additional_bindings { - post: "/v2/{parent=organizations/*/locations/*}/storedInfoTypes" - body: "*" - } - additional_bindings { - post: "/v2/{parent=projects/*}/storedInfoTypes" - body: "*" - } - additional_bindings { - post: "/v2/{parent=projects/*/locations/*}/storedInfoTypes" - body: "*" - } - }; - option (google.api.method_signature) = "parent,config"; - } - - // 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. - rpc UpdateStoredInfoType(UpdateStoredInfoTypeRequest) returns (StoredInfoType) { - option (google.api.http) = { - patch: "/v2/{name=organizations/*/storedInfoTypes/*}" - body: "*" - additional_bindings { - patch: "/v2/{name=organizations/*/locations/*/storedInfoTypes/*}" - body: "*" - } - additional_bindings { - patch: "/v2/{name=projects/*/storedInfoTypes/*}" - body: "*" - } - additional_bindings { - patch: "/v2/{name=projects/*/locations/*/storedInfoTypes/*}" - body: "*" - } - }; - option (google.api.method_signature) = "name,config,update_mask"; - } - - // Gets a stored infoType. - // See https://cloud.google.com/dlp/docs/creating-stored-infotypes to - // learn more. - rpc GetStoredInfoType(GetStoredInfoTypeRequest) returns (StoredInfoType) { - option (google.api.http) = { - get: "/v2/{name=organizations/*/storedInfoTypes/*}" - additional_bindings { - get: "/v2/{name=organizations/*/locations/*/storedInfoTypes/*}" - } - additional_bindings { - get: "/v2/{name=projects/*/storedInfoTypes/*}" - } - additional_bindings { - get: "/v2/{name=projects/*/locations/*/storedInfoTypes/*}" - } - }; - option (google.api.method_signature) = "name"; - } - - // Lists stored infoTypes. - // See https://cloud.google.com/dlp/docs/creating-stored-infotypes to - // learn more. - rpc ListStoredInfoTypes(ListStoredInfoTypesRequest) returns (ListStoredInfoTypesResponse) { - option (google.api.http) = { - get: "/v2/{parent=organizations/*}/storedInfoTypes" - additional_bindings { - get: "/v2/{parent=organizations/*/locations/*}/storedInfoTypes" - } - additional_bindings { - get: "/v2/{parent=projects/*}/storedInfoTypes" - } - additional_bindings { - get: "/v2/{parent=projects/*/locations/*}/storedInfoTypes" - } - }; - option (google.api.method_signature) = "parent"; - } - - // Deletes a stored infoType. - // See https://cloud.google.com/dlp/docs/creating-stored-infotypes to - // learn more. - rpc DeleteStoredInfoType(DeleteStoredInfoTypeRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v2/{name=organizations/*/storedInfoTypes/*}" - additional_bindings { - delete: "/v2/{name=organizations/*/locations/*/storedInfoTypes/*}" - } - additional_bindings { - delete: "/v2/{name=projects/*/storedInfoTypes/*}" - } - additional_bindings { - delete: "/v2/{name=projects/*/locations/*/storedInfoTypes/*}" - } - }; - option (google.api.method_signature) = "name"; - } - - // Inspect hybrid content and store findings to a job. - // To review the findings, inspect the job. Inspection will occur - // asynchronously. - rpc HybridInspectDlpJob(HybridInspectDlpJobRequest) returns (HybridInspectResponse) { - option (google.api.http) = { - post: "/v2/{name=projects/*/locations/*/dlpJobs/*}:hybridInspect" - body: "*" - }; - option (google.api.method_signature) = "name"; - } - - // Finish a running hybrid DlpJob. Triggers the finalization steps and running - // of any enabled actions that have not yet run. - rpc FinishDlpJob(FinishDlpJobRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - post: "/v2/{name=projects/*/locations/*/dlpJobs/*}:finish" - body: "*" - }; - } -} - -// List of exclude infoTypes. -message ExcludeInfoTypes { - // 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. - repeated InfoType info_types = 1; -} - -// The rule that specifies conditions when findings of infoTypes specified in -// `InspectionRuleSet` are removed from results. -message ExclusionRule { - // Exclusion rule types. - oneof type { - // Dictionary which defines the rule. - CustomInfoType.Dictionary dictionary = 1; - - // Regular expression which defines the rule. - CustomInfoType.Regex regex = 2; - - // Set of infoTypes for which findings would affect this rule. - ExcludeInfoTypes exclude_info_types = 3; - } - - // How the rule is applied, see MatchingType documentation for details. - MatchingType matching_type = 4; -} - -// A single inspection rule to be applied to infoTypes, specified in -// `InspectionRuleSet`. -message InspectionRule { - // Inspection rule types. - oneof type { - // Hotword-based detection rule. - CustomInfoType.DetectionRule.HotwordRule hotword_rule = 1; - - // Exclusion rule. - ExclusionRule exclusion_rule = 2; - } -} - -// 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. -message InspectionRuleSet { - // List of infoTypes this rule set is applied to. - repeated InfoType info_types = 1; - - // Set of rules to be applied to infoTypes. The rules are applied in order. - repeated InspectionRule rules = 2; -} - -// Configuration description of the scanning process. -// When used with redactContent only info_types and min_likelihood are currently -// used. -message InspectConfig { - // Configuration to control the number of findings returned for inspection. - // This is not used for de-identification or data profiling. - message FindingLimits { - // Max findings configuration per infoType, per content item or long - // running DlpJob. - message InfoTypeLimit { - // 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. - InfoType info_type = 1; - - // Max findings limit for the given infoType. - int32 max_findings = 2; - } - - // Max number of findings that will be returned for each item scanned. - // When set within `InspectJobConfig`, - // the maximum returned is 2000 regardless if this is set higher. - // When set within `InspectContentRequest`, this field is ignored. - int32 max_findings_per_item = 1; - - // 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. - int32 max_findings_per_request = 2; - - // Configuration of findings limit given for specified infoTypes. - repeated InfoTypeLimit max_findings_per_info_type = 3; - } - - // 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. - repeated InfoType info_types = 1; - - // Only returns findings equal or above this threshold. The default is - // POSSIBLE. - // See https://cloud.google.com/dlp/docs/likelihood to learn more. - Likelihood min_likelihood = 2; - - // Configuration to control the number of findings returned. - // This is not used for data profiling. - FindingLimits limits = 3; - - // When true, a contextual quote from the data that triggered a finding is - // included in the response; see Finding.quote. - // This is not used for data profiling. - bool include_quote = 4; - - // When true, excludes type information of the findings. - // This is not used for data profiling. - bool exclude_info_types = 5; - - // CustomInfoTypes provided by the user. See - // https://cloud.google.com/dlp/docs/creating-custom-infotypes to learn more. - repeated CustomInfoType custom_info_types = 6; - - // Deprecated and unused. - repeated ContentOption content_options = 8; - - // 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. - repeated InspectionRuleSet rule_set = 10; -} - -// Container for bytes to inspect or redact. -message ByteContentItem { - // The type of data being sent for inspection. To learn more, see - // [Supported file - // types](https://cloud.google.com/dlp/docs/supported-file-types). - enum 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; - - // docx, docm, dotx, dotm - WORD_DOCUMENT = 7; - - // pdf - PDF = 8; - - // pptx, pptm, potx, potm, pot - POWERPOINT_DOCUMENT = 9; - - // xlsx, xlsm, xltx, xltm - EXCEL_DOCUMENT = 10; - - // avro - AVRO = 11; - - // csv - CSV = 12; - - // tsv - TSV = 13; - } - - // The type of data stored in the bytes string. Default will be TEXT_UTF8. - BytesType type = 1; - - // Content data to inspect or redact. - bytes data = 2; -} - -// Container structure for the content to inspect. -message ContentItem { - // Data of the item either in the byte array or UTF-8 string form, or table. - oneof data_item { - // String data to inspect or redact. - string value = 3; - - // Structured content for inspection. See - // https://cloud.google.com/dlp/docs/inspecting-text#inspecting_a_table to - // learn more. - Table table = 4; - - // Content data to inspect or redact. Replaces `type` and `data`. - ByteContentItem byte_item = 5; - } -} - -// Structured content to inspect. Up to 50,000 `Value`s per request allowed. See -// https://cloud.google.com/dlp/docs/inspecting-structured-text#inspecting_a_table -// to learn more. -message Table { - // Values of the row. - message Row { - // Individual cells. - repeated Value values = 1; - } - - // Headers of the table. - repeated FieldId headers = 1; - - // Rows of the table. - repeated Row rows = 2; -} - -// All the findings for a single scanned item. -message InspectResult { - // List of findings for an item. - repeated Finding findings = 1; - - // 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. - bool findings_truncated = 2; -} - -// Represents a piece of potentially sensitive content. -message Finding { - option (google.api.resource) = { - type: "dlp.googleapis.com/Finding" - pattern: "projects/{project}/locations/{location}/findings/{finding}" - }; - - // Resource name in format - // projects/{project}/locations/{location}/findings/{finding} Populated only - // when viewing persisted findings. - string name = 14; - - // 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. - string quote = 1; - - // The type of content that might have been found. - // Provided if `excluded_types` is false. - InfoType info_type = 2; - - // Confidence of how likely it is that the `info_type` is correct. - Likelihood likelihood = 3; - - // Where the content was found. - Location location = 4; - - // Timestamp when finding was detected. - google.protobuf.Timestamp create_time = 6; - - // 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. - QuoteInfo quote_info = 7; - - // The job that stored the finding. - string resource_name = 8 [(google.api.resource_reference) = { - type: "dlp.googleapis.com/DlpJob" - }]; - - // Job trigger name, if applicable, for this finding. - string trigger_name = 9 [(google.api.resource_reference) = { - type: "dlp.googleapis.com/JobTrigger" - }]; - - // The labels associated with this `Finding`. - // - // Label keys must be between 1 and 63 characters long and must conform - // to the following regular expression: `[a-z]([-a-z0-9]*[a-z0-9])?`. - // - // Label values must be between 0 and 63 characters long and must conform - // to the regular expression `([a-z]([-a-z0-9]*[a-z0-9])?)?`. - // - // No more than 10 labels can be associated with a given finding. - // - // Examples: - // * `"environment" : "production"` - // * `"pipeline" : "etl"` - map labels = 10; - - // Time the job started that produced this finding. - google.protobuf.Timestamp job_create_time = 11; - - // The job that stored the finding. - string job_name = 13 [(google.api.resource_reference) = { - type: "dlp.googleapis.com/DlpJob" - }]; - - // The unique finding id. - string finding_id = 15; -} - -// Specifies the location of the finding. -message Location { - // 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. - Range byte_range = 1; - - // Unicode character offsets delimiting the finding. - // These are relative to the finding's containing element. - // Provided when the content is text. - Range codepoint_range = 2; - - // List of nested objects pointing to the precise location of the finding - // within the file or record. - repeated ContentLocation content_locations = 7; - - // Information about the container where this finding occurred, if available. - Container container = 8; -} - -// Precise location of the finding within a document, record, image, or metadata -// container. -message ContentLocation { - // 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). - string container_name = 1; - - // Type of the container within the file with location of the finding. - oneof location { - // Location within a row or record of a database table. - RecordLocation record_location = 2; - - // Location within an image's pixels. - ImageLocation image_location = 3; - - // Location data for document files. - DocumentLocation document_location = 5; - - // Location within the metadata for inspected content. - MetadataLocation metadata_location = 8; - } - - // 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. - google.protobuf.Timestamp container_timestamp = 6; - - // Findings container version, if available - // ("generation" for Google Cloud Storage). - string container_version = 7; -} - -// Metadata Location -message MetadataLocation { - // Type of metadata containing the finding. - MetadataType type = 1; - - // Label of the piece of metadata containing the finding, for example - - // latitude, author, caption. - oneof label { - // Storage metadata. - StorageMetadataLabel storage_label = 3; - } -} - -// Storage metadata label to indicate which metadata entry contains findings. -message StorageMetadataLabel { - string key = 1; -} - -// Location of a finding within a document. -message DocumentLocation { - // Offset of the line, from the beginning of the file, where the finding - // is located. - int64 file_offset = 1; -} - -// Location of a finding within a row or record. -message RecordLocation { - // Key of the finding. - RecordKey record_key = 1; - - // Field id of the field containing the finding. - FieldId field_id = 2; - - // Location within a `ContentItem.Table`. - TableLocation table_location = 3; -} - -// Location of a finding within a table. -message TableLocation { - // The zero-based index of the row where the finding is located. Only - // populated for resources that have a natural ordering, not BigQuery. In - // BigQuery, to identify the row a finding came from, populate - // BigQueryOptions.identifying_fields with your primary key column names and - // when you store the findings the value of those columns will be stored - // inside of Finding. - int64 row_index = 1; -} - -// Represents a container that may contain DLP findings. -// Examples of a container include a file, table, or database record. -message Container { - // Container type, for example BigQuery or Google Cloud Storage. - string type = 1; - - // Project where the finding was found. - // Can be different from the project that owns the finding. - string project_id = 2; - - // A string representation of the full container name. - // Examples: - // - BigQuery: 'Project:DataSetId.TableId' - // - Google Cloud Storage: 'gs://Bucket/folders/filename.txt' - string full_path = 3; - - // The root of the container. - // Examples: - // - For BigQuery table `project_id:dataset_id.table_id`, the root is - // `dataset_id` - // - For Google Cloud Storage file `gs://bucket/folder/filename.txt`, the root - // is `gs://bucket` - string root_path = 4; - - // The rest of the path after the root. - // Examples: - // - For BigQuery table `project_id:dataset_id.table_id`, the relative path is - // `table_id` - // - Google Cloud Storage file `gs://bucket/folder/filename.txt`, the relative - // path is `folder/filename.txt` - string relative_path = 5; - - // 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. - google.protobuf.Timestamp update_time = 6; - - // Findings container version, if available - // ("generation" for Google Cloud Storage). - string version = 7; -} - -// Generic half-open interval [start, end) -message Range { - // Index of the first character of the range (inclusive). - int64 start = 1; - - // Index of the last character of the range (exclusive). - int64 end = 2; -} - -// Location of the finding within an image. -message ImageLocation { - // Bounding boxes locating the pixels within the image containing the finding. - repeated BoundingBox bounding_boxes = 1; -} - -// Bounding box encompassing detected text within an image. -message BoundingBox { - // Top coordinate of the bounding box. (0,0) is upper left. - int32 top = 1; - - // Left coordinate of the bounding box. (0,0) is upper left. - int32 left = 2; - - // Width of the bounding box in pixels. - int32 width = 3; - - // Height of the bounding box in pixels. - int32 height = 4; -} - -// Request to search for potentially sensitive info in an image and redact it -// by covering it with a colored rectangle. -message RedactImageRequest { - // Configuration for determining how redaction of images should occur. - message ImageRedactionConfig { - // Type of information to redact from images. - oneof target { - // 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. - InfoType info_type = 1; - - // If true, all text found in the image, regardless whether it matches an - // info_type, is redacted. Only one should be provided. - bool redact_all_text = 2; - } - - // The color to use when redacting content from an image. If not specified, - // the default is black. - Color redaction_color = 3; - } - - // Parent resource name. - // - // The format of this value varies depending on whether you have [specified a - // processing - // location](https://cloud.google.com/dlp/docs/specifying-location): - // - // + Projects scope, location specified:
- // `projects/`PROJECT_ID`/locations/`LOCATION_ID - // + Projects scope, no location specified (defaults to global):
- // `projects/`PROJECT_ID - // - // The following example `parent` string specifies a parent project with the - // identifier `example-project`, and specifies the `europe-west3` location - // for processing data: - // - // parent=projects/example-project/locations/europe-west3 - string parent = 1 [(google.api.resource_reference) = { - child_type: "dlp.googleapis.com/DlpContent" - }]; - - // Deprecated. This field has no effect. - string location_id = 8; - - // Configuration for the inspector. - InspectConfig inspect_config = 2; - - // The configuration for specifying what content to redact from images. - repeated ImageRedactionConfig image_redaction_configs = 5; - - // Whether the response should include findings along with the redacted - // image. - bool include_findings = 6; - - // The content must be PNG, JPEG, SVG or BMP. - ByteContentItem byte_item = 7; -} - -// Represents a color in the RGB color space. -message Color { - // The amount of red in the color as a value in the interval [0, 1]. - float red = 1; - - // The amount of green in the color as a value in the interval [0, 1]. - float green = 2; - - // The amount of blue in the color as a value in the interval [0, 1]. - float blue = 3; -} - -// Results of redacting an image. -message RedactImageResponse { - // The redacted image. The type will be the same as the original image. - bytes redacted_image = 1; - - // 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. - string extracted_text = 2; - - // The findings. Populated when include_findings in the request is true. - InspectResult inspect_result = 3; -} - -// Request to de-identify a list of items. -message DeidentifyContentRequest { - // Parent resource name. - // - // The format of this value varies depending on whether you have [specified a - // processing - // location](https://cloud.google.com/dlp/docs/specifying-location): - // - // + Projects scope, location specified:
- // `projects/`PROJECT_ID`/locations/`LOCATION_ID - // + Projects scope, no location specified (defaults to global):
- // `projects/`PROJECT_ID - // - // The following example `parent` string specifies a parent project with the - // identifier `example-project`, and specifies the `europe-west3` location - // for processing data: - // - // parent=projects/example-project/locations/europe-west3 - string parent = 1 [(google.api.resource_reference) = { - child_type: "dlp.googleapis.com/DlpContent" - }]; - - // Configuration for the de-identification of the content item. - // Items specified here will override the template referenced by the - // deidentify_template_name argument. - DeidentifyConfig deidentify_config = 2; - - // Configuration for the inspector. - // Items specified here will override the template referenced by the - // inspect_template_name argument. - InspectConfig inspect_config = 3; - - // The item to de-identify. Will be treated as text. - ContentItem item = 4; - - // 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. - string inspect_template_name = 5; - - // 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. - string deidentify_template_name = 6; - - // Deprecated. This field has no effect. - string location_id = 7; -} - -// Results of de-identifying a ContentItem. -message DeidentifyContentResponse { - // The de-identified item. - ContentItem item = 1; - - // An overview of the changes that were made on the `item`. - TransformationOverview overview = 2; -} - -// Request to re-identify an item. -message ReidentifyContentRequest { - // Required. Parent resource name. - // - // The format of this value varies depending on whether you have [specified a - // processing - // location](https://cloud.google.com/dlp/docs/specifying-location): - // - // + Projects scope, location specified:
- // `projects/`PROJECT_ID`/locations/`LOCATION_ID - // + Projects scope, no location specified (defaults to global):
- // `projects/`PROJECT_ID - // - // The following example `parent` string specifies a parent project with the - // identifier `example-project`, and specifies the `europe-west3` location - // for processing data: - // - // parent=projects/example-project/locations/europe-west3 - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "dlp.googleapis.com/DlpContent" - } - ]; - - // 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` - DeidentifyConfig reidentify_config = 2; - - // Configuration for the inspector. - InspectConfig inspect_config = 3; - - // The item to re-identify. Will be treated as text. - ContentItem item = 4; - - // 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. - string inspect_template_name = 5; - - // 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. The - // `DeidentifyTemplate` used must include only reversible transformations. - // 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. - string reidentify_template_name = 6; - - // Deprecated. This field has no effect. - string location_id = 7; -} - -// Results of re-identifying a item. -message ReidentifyContentResponse { - // The re-identified item. - ContentItem item = 1; - - // An overview of the changes that were made to the `item`. - TransformationOverview overview = 2; -} - -// Request to search for potentially sensitive info in a ContentItem. -message InspectContentRequest { - // Parent resource name. - // - // The format of this value varies depending on whether you have [specified a - // processing - // location](https://cloud.google.com/dlp/docs/specifying-location): - // - // + Projects scope, location specified:
- // `projects/`PROJECT_ID`/locations/`LOCATION_ID - // + Projects scope, no location specified (defaults to global):
- // `projects/`PROJECT_ID - // - // The following example `parent` string specifies a parent project with the - // identifier `example-project`, and specifies the `europe-west3` location - // for processing data: - // - // parent=projects/example-project/locations/europe-west3 - string parent = 1 [(google.api.resource_reference) = { - child_type: "dlp.googleapis.com/DlpContent" - }]; - - // Configuration for the inspector. What specified here will override - // the template referenced by the inspect_template_name argument. - InspectConfig inspect_config = 2; - - // The item to inspect. - ContentItem item = 3; - - // 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. - string inspect_template_name = 4; - - // Deprecated. This field has no effect. - string location_id = 5; -} - -// Results of inspecting an item. -message InspectContentResponse { - // The findings. - InspectResult result = 1; -} - -// Cloud repository for storing output. -message OutputStorageConfig { - // Predefined schemas for storing findings. - // Only for use with external storage. - enum 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; - } - - // Output storage types. - oneof type { - // 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. - BigQueryTable table = 1; - } - - // 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. - // Only for use with external storage. - OutputSchema output_schema = 3; -} - -// Statistics regarding a specific InfoType. -message InfoTypeStats { - // The type of finding this stat is for. - InfoType info_type = 1; - - // Number of findings for this infoType. - int64 count = 2; -} - -// The results of an inspect DataSource job. -message InspectDataSourceDetails { - // Snapshot of the inspection configuration. - message RequestedOptions { - // If run with an InspectTemplate, a snapshot of its state at the time of - // this run. - InspectTemplate snapshot_inspect_template = 1; - - // Inspect config. - InspectJobConfig job_config = 3; - } - - // All result fields mentioned below are updated while the job is processing. - message Result { - // Total size in bytes that were processed. - int64 processed_bytes = 1; - - // Estimate of the number of bytes to process. - int64 total_estimated_bytes = 2; - - // Statistics of how many instances of each info type were found during - // inspect job. - repeated InfoTypeStats info_type_stats = 3; - - // Statistics related to the processing of hybrid inspect. - HybridInspectStatistics hybrid_stats = 7; - } - - // The configuration used for this job. - RequestedOptions requested_options = 2; - - // A summary of the outcome of this inspection job. - Result result = 3; -} - -// Statistics related to processing hybrid inspect requests. -message HybridInspectStatistics { - // The number of hybrid inspection requests processed within this job. - int64 processed_count = 1; - - // The number of hybrid inspection requests aborted because the job ran - // out of quota or was ended before they could be processed. - int64 aborted_count = 2; - - // The number of hybrid requests currently being processed. Only populated - // when called via method `getDlpJob`. - // A burst of traffic may cause hybrid inspect requests to be enqueued. - // Processing will take place as quickly as possible, but resource limitations - // may impact how long a request is enqueued for. - int64 pending_count = 3; -} - -// InfoType description. -message InfoTypeDescription { - // Internal name of the infoType. - string name = 1; - - // Human readable form of the infoType name. - string display_name = 2; - - // Which parts of the API supports this InfoType. - repeated InfoTypeSupportedBy supported_by = 3; - - // Description of the infotype. Translated when language is provided in the - // request. - string description = 4; -} - -// Request for the list of infoTypes. -message ListInfoTypesRequest { - // The parent resource name. - // - // The format of this value is as follows: - // - // locations/LOCATION_ID - string parent = 4; - - // BCP-47 language code for localized infoType friendly - // names. If omitted, or if localized strings are not available, - // en-US strings will be returned. - string language_code = 1; - - // filter to only return infoTypes supported by certain parts of the - // API. Defaults to supported_by=INSPECT. - string filter = 2; - - // Deprecated. This field has no effect. - string location_id = 3; -} - -// Response to the ListInfoTypes request. -message ListInfoTypesResponse { - // Set of sensitive infoTypes. - repeated InfoTypeDescription info_types = 1; -} - -// Configuration for a risk analysis job. See -// https://cloud.google.com/dlp/docs/concepts-risk-analysis to learn more. -message RiskAnalysisJobConfig { - // Privacy metric to compute. - PrivacyMetric privacy_metric = 1; - - // Input dataset to compute metrics over. - BigQueryTable source_table = 2; - - // Actions to execute at the completion of the job. Are executed in the order - // provided. - repeated Action actions = 3; -} - -// A column with a semantic tag attached. -message QuasiId { - // Required. Identifies the column. - FieldId field = 1 [(google.api.field_behavior) = REQUIRED]; - - // Semantic tag that identifies what a column contains, to determine which - // statistical model to use to estimate the reidentifiability of each - // value. [required] - oneof tag { - // 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. - InfoType info_type = 2; - - // 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). - string custom_tag = 3; - - // If no semantic tag is indicated, we infer the statistical model from - // the distribution of values in the input data - google.protobuf.Empty inferred = 4; - } -} - -// 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). -message StatisticalTable { - // A quasi-identifier column has a custom_tag, used to know which column - // in the data corresponds to which column in the statistical model. - message QuasiIdentifierField { - // Identifies the column. - FieldId field = 1; - - // 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). - string custom_tag = 2; - } - - // Required. Auxiliary table location. - BigQueryTable table = 3 [(google.api.field_behavior) = REQUIRED]; - - // Required. Quasi-identifier columns. - repeated QuasiIdentifierField quasi_ids = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The relative frequency column must contain a floating-point number - // between 0 and 1 (inclusive). Null values are assumed to be zero. - FieldId relative_frequency = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Privacy metric to compute for reidentification risk analysis. -message PrivacyMetric { - // Compute numerical stats over an individual column, including - // min, max, and quantiles. - message NumericalStatsConfig { - // Field to compute numerical stats on. Supported types are - // integer, float, date, datetime, timestamp, time. - FieldId field = 1; - } - - // Compute numerical stats over an individual column, including - // number of distinct values and value count distribution. - message CategoricalStatsConfig { - // 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. - FieldId field = 1; - } - - // k-anonymity metric, used for analysis of reidentification risk. - message KAnonymityConfig { - // 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. - repeated FieldId quasi_ids = 1; - - // 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. - EntityId entity_id = 2; - } - - // l-diversity metric, used for analysis of reidentification risk. - message LDiversityConfig { - // 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. - repeated FieldId quasi_ids = 1; - - // Sensitive field for computing the l-value. - FieldId sensitive_attribute = 2; - } - - // 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. - message KMapEstimationConfig { - // A column with a semantic tag attached. - message TaggedField { - // Required. Identifies the column. - FieldId field = 1 [(google.api.field_behavior) = REQUIRED]; - - // Semantic tag that identifies what a column contains, to determine which - // statistical model to use to estimate the reidentifiability of each - // value. [required] - oneof tag { - // 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. - InfoType info_type = 2; - - // 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). - string custom_tag = 3; - - // If no semantic tag is indicated, we infer the statistical model from - // the distribution of values in the input data - google.protobuf.Empty inferred = 4; - } - } - - // 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). - message AuxiliaryTable { - // A quasi-identifier column has a custom_tag, used to know which column - // in the data corresponds to which column in the statistical model. - message QuasiIdField { - // Identifies the column. - FieldId field = 1; - - // A auxiliary field. - string custom_tag = 2; - } - - // Required. Auxiliary table location. - BigQueryTable table = 3 [(google.api.field_behavior) = REQUIRED]; - - // Required. Quasi-identifier columns. - repeated QuasiIdField quasi_ids = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The relative frequency column must contain a floating-point number - // between 0 and 1 (inclusive). Null values are assumed to be zero. - FieldId relative_frequency = 2 [(google.api.field_behavior) = REQUIRED]; - } - - // Required. Fields considered to be quasi-identifiers. No two columns can have the - // same tag. - repeated TaggedField quasi_ids = 1 [(google.api.field_behavior) = REQUIRED]; - - // 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. - string region_code = 2; - - // 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. - repeated AuxiliaryTable auxiliary_tables = 3; - } - - // δ-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. - message DeltaPresenceEstimationConfig { - // Required. Fields considered to be quasi-identifiers. No two fields can have the - // same tag. - repeated QuasiId quasi_ids = 1 [(google.api.field_behavior) = REQUIRED]; - - // 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. - string region_code = 2; - - // 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. - repeated StatisticalTable auxiliary_tables = 3; - } - - // Types of analysis. - oneof type { - // Numerical stats - NumericalStatsConfig numerical_stats_config = 1; - - // Categorical stats - CategoricalStatsConfig categorical_stats_config = 2; - - // K-anonymity - KAnonymityConfig k_anonymity_config = 3; - - // l-diversity - LDiversityConfig l_diversity_config = 4; - - // k-map - KMapEstimationConfig k_map_estimation_config = 5; - - // delta-presence - DeltaPresenceEstimationConfig delta_presence_estimation_config = 6; - } -} - -// Result of a risk analysis operation request. -message AnalyzeDataSourceRiskDetails { - // Result of the numerical stats computation. - message NumericalStatsResult { - // Minimum value appearing in the column. - Value min_value = 1; - - // Maximum value appearing in the column. - Value max_value = 2; - - // List of 99 values that partition the set of field values into 100 equal - // sized buckets. - repeated Value quantile_values = 4; - } - - // Result of the categorical stats computation. - message CategoricalStatsResult { - // Histogram of value frequencies in the column. - message CategoricalStatsHistogramBucket { - // Lower bound on the value frequency of the values in this bucket. - int64 value_frequency_lower_bound = 1; - - // Upper bound on the value frequency of the values in this bucket. - int64 value_frequency_upper_bound = 2; - - // Total number of values in this bucket. - int64 bucket_size = 3; - - // Sample of value frequencies in this bucket. The total number of - // values returned per bucket is capped at 20. - repeated ValueFrequency bucket_values = 4; - - // Total number of distinct values in this bucket. - int64 bucket_value_count = 5; - } - - // Histogram of value frequencies in the column. - repeated CategoricalStatsHistogramBucket value_frequency_histogram_buckets = 5; - } - - // Result of the k-anonymity computation. - message KAnonymityResult { - // The set of columns' values that share the same ldiversity value - message KAnonymityEquivalenceClass { - // 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. - repeated Value quasi_ids_values = 1; - - // Size of the equivalence class, for example number of rows with the - // above set of values. - int64 equivalence_class_size = 2; - } - - // Histogram of k-anonymity equivalence classes. - message KAnonymityHistogramBucket { - // Lower bound on the size of the equivalence classes in this bucket. - int64 equivalence_class_size_lower_bound = 1; - - // Upper bound on the size of the equivalence classes in this bucket. - int64 equivalence_class_size_upper_bound = 2; - - // Total number of equivalence classes in this bucket. - int64 bucket_size = 3; - - // Sample of equivalence classes in this bucket. The total number of - // classes returned per bucket is capped at 20. - repeated KAnonymityEquivalenceClass bucket_values = 4; - - // Total number of distinct equivalence classes in this bucket. - int64 bucket_value_count = 5; - } - - // Histogram of k-anonymity equivalence classes. - repeated KAnonymityHistogramBucket equivalence_class_histogram_buckets = 5; - } - - // Result of the l-diversity computation. - message LDiversityResult { - // The set of columns' values that share the same ldiversity value. - message LDiversityEquivalenceClass { - // Quasi-identifier values defining the k-anonymity equivalence - // class. The order is always the same as the original request. - repeated Value quasi_ids_values = 1; - - // Size of the k-anonymity equivalence class. - int64 equivalence_class_size = 2; - - // Number of distinct sensitive values in this equivalence class. - int64 num_distinct_sensitive_values = 3; - - // Estimated frequencies of top sensitive values. - repeated ValueFrequency top_sensitive_values = 4; - } - - // Histogram of l-diversity equivalence class sensitive value frequencies. - message LDiversityHistogramBucket { - // Lower bound on the sensitive value frequencies of the equivalence - // classes in this bucket. - int64 sensitive_value_frequency_lower_bound = 1; - - // Upper bound on the sensitive value frequencies of the equivalence - // classes in this bucket. - int64 sensitive_value_frequency_upper_bound = 2; - - // Total number of equivalence classes in this bucket. - int64 bucket_size = 3; - - // Sample of equivalence classes in this bucket. The total number of - // classes returned per bucket is capped at 20. - repeated LDiversityEquivalenceClass bucket_values = 4; - - // Total number of distinct equivalence classes in this bucket. - int64 bucket_value_count = 5; - } - - // Histogram of l-diversity equivalence class sensitive value frequencies. - repeated LDiversityHistogramBucket sensitive_value_frequency_histogram_buckets = 5; - } - - // Result of the reidentifiability analysis. Note that these results are an - // estimation, not exact values. - message KMapEstimationResult { - // A tuple of values for the quasi-identifier columns. - message KMapEstimationQuasiIdValues { - // The quasi-identifier values. - repeated Value quasi_ids_values = 1; - - // The estimated anonymity for these quasi-identifier values. - int64 estimated_anonymity = 2; - } - - // 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. - message KMapEstimationHistogramBucket { - // Always positive. - int64 min_anonymity = 1; - - // Always greater than or equal to min_anonymity. - int64 max_anonymity = 2; - - // Number of records within these anonymity bounds. - int64 bucket_size = 5; - - // Sample of quasi-identifier tuple values in this bucket. The total - // number of classes returned per bucket is capped at 20. - repeated KMapEstimationQuasiIdValues bucket_values = 6; - - // Total number of distinct quasi-identifier tuple values in this bucket. - int64 bucket_value_count = 7; - } - - // 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. - repeated KMapEstimationHistogramBucket k_map_estimation_histogram = 1; - } - - // Result of the δ-presence computation. Note that these results are an - // estimation, not exact values. - message DeltaPresenceEstimationResult { - // A tuple of values for the quasi-identifier columns. - message DeltaPresenceEstimationQuasiIdValues { - // The quasi-identifier values. - repeated Value quasi_ids_values = 1; - - // 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. - double estimated_probability = 2; - } - - // 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. - message DeltaPresenceEstimationHistogramBucket { - // Between 0 and 1. - double min_probability = 1; - - // Always greater than or equal to min_probability. - double max_probability = 2; - - // Number of records within these probability bounds. - int64 bucket_size = 5; - - // Sample of quasi-identifier tuple values in this bucket. The total - // number of classes returned per bucket is capped at 20. - repeated DeltaPresenceEstimationQuasiIdValues bucket_values = 6; - - // Total number of distinct quasi-identifier tuple values in this bucket. - int64 bucket_value_count = 7; - } - - // 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. - repeated DeltaPresenceEstimationHistogramBucket delta_presence_estimation_histogram = 1; - } - - // Risk analysis options. - message RequestedRiskAnalysisOptions { - // The job config for the risk job. - RiskAnalysisJobConfig job_config = 1; - } - - // Privacy metric to compute. - PrivacyMetric requested_privacy_metric = 1; - - // Input dataset to compute metrics over. - BigQueryTable requested_source_table = 2; - - // Values associated with this metric. - oneof result { - // Numerical stats result - NumericalStatsResult numerical_stats_result = 3; - - // Categorical stats result - CategoricalStatsResult categorical_stats_result = 4; - - // K-anonymity result - KAnonymityResult k_anonymity_result = 5; - - // L-divesity result - LDiversityResult l_diversity_result = 6; - - // K-map result - KMapEstimationResult k_map_estimation_result = 7; - - // Delta-presence result - DeltaPresenceEstimationResult delta_presence_estimation_result = 9; - } - - // The configuration used for this job. - RequestedRiskAnalysisOptions requested_options = 10; -} - -// A value of a field, including its frequency. -message ValueFrequency { - // A value contained in the field in question. - Value value = 1; - - // How many times the value is contained in the field. - int64 count = 2; -} - -// 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. -message Value { - // Value types - oneof type { - // integer - int64 integer_value = 1; - - // float - double float_value = 2; - - // string - string string_value = 3; - - // boolean - bool boolean_value = 4; - - // timestamp - google.protobuf.Timestamp timestamp_value = 5; - - // time of day - google.type.TimeOfDay time_value = 6; - - // date - google.type.Date date_value = 7; - - // day of week - google.type.DayOfWeek day_of_week_value = 8; - } -} - -// Message for infoType-dependent details parsed from quote. -message QuoteInfo { - // Object representation of the quote. - oneof parsed_quote { - // The date time indicated by the quote. - DateTime date_time = 2; - } -} - -// Message for a date time object. -// e.g. 2018-01-01, 5th August. -message DateTime { - // Time zone of the date time object. - message TimeZone { - // Set only if the offset can be determined. Positive for time ahead of UTC. - // E.g. For "UTC-9", this value is -540. - int32 offset_minutes = 1; - } - - // One or more of the following must be set. - // Must be a valid date or time value. - google.type.Date date = 1; - - // Day of week - google.type.DayOfWeek day_of_week = 2; - - // Time of day - google.type.TimeOfDay time = 3; - - // Time zone - TimeZone time_zone = 4; -} - -// The configuration that controls how the data will change. -message DeidentifyConfig { - oneof transformation { - // Treat the dataset as free-form text and apply the same free text - // transformation everywhere. - InfoTypeTransformations info_type_transformations = 1; - - // Treat the dataset as structured. Transformations can be applied to - // specific locations within structured datasets, such as transforming - // a column within a table. - RecordTransformations record_transformations = 2; - } - - // Mode for handling transformation errors. If left unspecified, the default - // mode is `TransformationErrorHandling.ThrowError`. - TransformationErrorHandling transformation_error_handling = 3; -} - -// How to handle transformation errors during de-identification. A -// transformation error occurs when the requested transformation is incompatible -// with the data. For example, trying to de-identify an IP address using a -// `DateShift` transformation would result in a transformation error, since date -// info cannot be extracted from an IP address. -// Information about any incompatible transformations, and how they were -// handled, is returned in the response as part of the -// `TransformationOverviews`. -message TransformationErrorHandling { - // Throw an error and fail the request when a transformation error occurs. - message ThrowError { - - } - - // Skips the data without modifying it if the requested transformation would - // cause an error. For example, if a `DateShift` transformation were applied - // an an IP address, this mode would leave the IP address unchanged in the - // response. - message LeaveUntransformed { - - } - - // How transformation errors should be handled. - oneof mode { - // Throw an error - ThrowError throw_error = 1; - - // Ignore errors - LeaveUntransformed leave_untransformed = 2; - } -} - -// A rule for transforming a value. -message PrimitiveTransformation { - oneof transformation { - // Replace with a specified value. - ReplaceValueConfig replace_config = 1; - - // Redact - RedactConfig redact_config = 2; - - // Mask - CharacterMaskConfig character_mask_config = 3; - - // Ffx-Fpe - CryptoReplaceFfxFpeConfig crypto_replace_ffx_fpe_config = 4; - - // Fixed size bucketing - FixedSizeBucketingConfig fixed_size_bucketing_config = 5; - - // Bucketing - BucketingConfig bucketing_config = 6; - - // Replace with infotype - ReplaceWithInfoTypeConfig replace_with_info_type_config = 7; - - // Time extraction - TimePartConfig time_part_config = 8; - - // Crypto - CryptoHashConfig crypto_hash_config = 9; - - // Date Shift - DateShiftConfig date_shift_config = 11; - - // Deterministic Crypto - CryptoDeterministicConfig crypto_deterministic_config = 12; - - // Replace with a value randomly drawn (with replacement) from a dictionary. - ReplaceDictionaryConfig replace_dictionary_config = 13; - } -} - -// For use with `Date`, `Timestamp`, and `TimeOfDay`, extract or preserve a -// portion of the value. -message TimePartConfig { - // Components that make up time. - enum 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; - } - - // The part of the time to keep. - TimePart part_to_extract = 1; -} - -// 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. -message CryptoHashConfig { - // The key used by the hash function. - CryptoKey crypto_key = 1; -} - -// 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. -message CryptoDeterministicConfig { - // The key used by the encryption function. For deterministic encryption - // using AES-SIV, the provided key is internally expanded to 64 bytes prior to - // use. - CryptoKey crypto_key = 1; - - // 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. - InfoType surrogate_info_type = 2; - - // 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. - FieldId context = 3; -} - -// Replace each input value with a given `Value`. -message ReplaceValueConfig { - // Value to replace it with. - Value new_value = 1; -} - -// Replace each input value with a value randomly selected from the dictionary. -message ReplaceDictionaryConfig { - oneof type { - // A list of words to select from for random replacement. The - // [limits](https://cloud.google.com/dlp/limits) page contains details about - // the size limits of dictionaries. - CustomInfoType.Dictionary.WordList word_list = 1; - } -} - -// Replace each matching finding with the name of the info_type. -message ReplaceWithInfoTypeConfig { - -} - -// 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 '. -message RedactConfig { - -} - -// Characters to skip when doing deidentification of a value. These will be left -// alone and skipped. -message CharsToIgnore { - // Convenience enum for indication common characters to not transform. - enum 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; - } - - oneof characters { - // Characters to not transform when masking. - string characters_to_skip = 1; - - // Common characters to not transform when masking. Useful to avoid removing - // punctuation. - CommonCharsToIgnore common_characters_to_ignore = 2; - } -} - -// 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. -message CharacterMaskConfig { - // 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. - string masking_character = 1; - - // Number of characters to mask. If not set, all matching chars will be - // masked. Skipped characters do not count towards this tally. - int32 number_to_mask = 2; - - // 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***`. - bool reverse_order = 3; - - // 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`. - repeated CharsToIgnore characters_to_ignore = 4; -} - -// 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}. For example, 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. -message FixedSizeBucketingConfig { - // 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". - Value lower_bound = 1 [(google.api.field_behavior) = REQUIRED]; - - // 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+". - Value upper_bound = 2 [(google.api.field_behavior) = REQUIRED]; - - // 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. - double bucket_size = 3 [(google.api.field_behavior) = REQUIRED]; -} - -// 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. -message BucketingConfig { - // Bucket is represented as a range, along with replacement values. - message Bucket { - // Lower bound of the range, inclusive. Type should be the same as max if - // used. - Value min = 1; - - // Upper bound of the range, exclusive; type must match min. - Value max = 2; - - // Required. Replacement value for this bucket. - Value replacement_value = 3 [(google.api.field_behavior) = REQUIRED]; - } - - // Set of buckets. Ranges must be non-overlapping. - repeated Bucket buckets = 1; -} - -// 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. -message CryptoReplaceFfxFpeConfig { - // 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 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; - } - - // Required. The key used by the encryption algorithm. - CryptoKey crypto_key = 1 [(google.api.field_behavior) = REQUIRED]; - - // 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 - FieldId context = 2; - - // Choose an alphabet which the data being transformed will be made up of. - oneof alphabet { - // Common alphabets. - FfxCommonNativeAlphabet common_alphabet = 4; - - // 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. - // The full list of allowed characters is: - // 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz - // ~`!@#$%^&*()_-+={[}]|\:;"'<,>.?/ - string custom_alphabet = 5; - - // The native way to select the alphabet. Must be in the range [2, 95]. - int32 radix = 6; - } - - // 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 - InfoType surrogate_info_type = 8; -} - -// This is a data encryption key (DEK) (as opposed to -// a key encryption key (KEK) stored by Cloud Key Management Service -// (Cloud KMS). -// When using Cloud KMS to wrap or unwrap a DEK, be sure to set an appropriate -// IAM policy on the KEK to ensure an attacker cannot -// unwrap the DEK. -message CryptoKey { - // Sources of crypto keys. - oneof source { - // Transient crypto key - TransientCryptoKey transient = 1; - - // Unwrapped crypto key - UnwrappedCryptoKey unwrapped = 2; - - // Key wrapped using Cloud KMS - KmsWrappedCryptoKey kms_wrapped = 3; - } -} - -// Use this to have a random data crypto key generated. -// It will be discarded after the request finishes. -message TransientCryptoKey { - // 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). - string name = 1 [(google.api.field_behavior) = REQUIRED]; -} - -// Using raw keys is prone to security risks due to accidentally -// leaking the key. Choose another type of key if possible. -message UnwrappedCryptoKey { - // Required. A 128/192/256 bit key. - bytes key = 1 [(google.api.field_behavior) = REQUIRED]; -} - -// Include to use an existing data crypto key wrapped by KMS. -// The wrapped key must be a 128-, 192-, or 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 -// -// For more information, see [Creating a wrapped key] -// (https://cloud.google.com/dlp/docs/create-wrapped-key). -// -// Note: When you use Cloud KMS for cryptographic operations, -// [charges apply](https://cloud.google.com/kms/pricing). -message KmsWrappedCryptoKey { - // Required. The wrapped data crypto key. - bytes wrapped_key = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The resource name of the KMS CryptoKey to use for unwrapping. - string crypto_key_name = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// 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. -message DateShiftConfig { - // 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. - int32 upper_bound_days = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. For example, -5 means shift date to at most 5 days back in the past. - int32 lower_bound_days = 2 [(google.api.field_behavior) = REQUIRED]; - - // 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. - FieldId context = 3; - - // Method for calculating shift that takes context into consideration. If - // set, must also set context. Can only be applied to table items. - oneof method { - // 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. - CryptoKey crypto_key = 4; - } -} - -// 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. -message InfoTypeTransformations { - // A transformation to apply to text that is identified as a specific - // info_type. - message InfoTypeTransformation { - // 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`. - repeated InfoType info_types = 1; - - // Required. Primitive transformation to apply to the infoType. - PrimitiveTransformation primitive_transformation = 2 [(google.api.field_behavior) = REQUIRED]; - } - - // Required. Transformation for each infoType. Cannot specify more than one - // for a given infoType. - repeated InfoTypeTransformation transformations = 1 [(google.api.field_behavior) = REQUIRED]; -} - -// The transformation to apply to the field. -message FieldTransformation { - // Required. Input field(s) to apply the transformation to. - // When you have columns that reference their position within a list, - // omit the index from the FieldId. FieldId name matching ignores the index. - // For example, instead of "contact.nums[0].type", use "contact.nums.type". - repeated FieldId fields = 1 [(google.api.field_behavior) = REQUIRED]; - - // 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. - RecordCondition condition = 3; - - // Transformation to apply. [required] - oneof transformation { - // Apply the transformation to the entire field. - PrimitiveTransformation primitive_transformation = 4; - - // Treat the contents of the field as free text, and selectively - // transform content that matches an `InfoType`. - InfoTypeTransformations info_type_transformations = 5; - } -} - -// A type of transformation that is applied over structured data such as a -// table. -message RecordTransformations { - // Transform the record by applying various field transformations. - repeated FieldTransformation field_transformations = 1; - - // Configuration defining which records get suppressed entirely. Records that - // match any suppression rule are omitted from the output. - repeated RecordSuppression record_suppressions = 2; -} - -// Configuration to suppress records whose suppression conditions evaluate to -// true. -message RecordSuppression { - // A condition that when it evaluates to true will result in the record being - // evaluated to be suppressed from the transformed content. - RecordCondition condition = 1; -} - -// A condition for determining whether a transformation should be applied to -// a field. -message RecordCondition { - // 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. - message Condition { - // Required. Field within the record this condition is evaluated against. - FieldId field = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. Operator used to compare the field or infoType to the value. - RelationalOperator operator = 3 [(google.api.field_behavior) = REQUIRED]; - - // Value to compare against. [Mandatory, except for `EXISTS` tests.] - Value value = 4; - } - - // A collection of conditions. - message Conditions { - // A collection of conditions. - repeated Condition conditions = 1; - } - - // An expression, consisting or an operator and conditions. - message Expressions { - // Logical operators for conditional checks. - enum LogicalOperator { - // Unused - LOGICAL_OPERATOR_UNSPECIFIED = 0; - - // Conditional AND - AND = 1; - } - - // The operator to apply to the result of conditions. Default and currently - // only supported value is `AND`. - LogicalOperator logical_operator = 1; - - // Expression types. - oneof type { - // Conditions to apply to the expression. - Conditions conditions = 3; - } - } - - // An expression. - Expressions expressions = 3; -} - -// Overview of the modifications that occurred. -message TransformationOverview { - // Total size in bytes that were transformed in some way. - int64 transformed_bytes = 2; - - // Transformations applied to the dataset. - repeated TransformationSummary transformation_summaries = 3; -} - -// Summary of a single transformation. -// Only one of 'transformation', 'field_transformation', or 'record_suppress' -// will be set. -message TransformationSummary { - // Possible outcomes of transformations. - enum TransformationResultCode { - // Unused - TRANSFORMATION_RESULT_CODE_UNSPECIFIED = 0; - - // Transformation completed without an error. - SUCCESS = 1; - - // Transformation had an error. - ERROR = 2; - } - - // A collection that informs the user the number of times a particular - // `TransformationResultCode` and error details occurred. - message SummaryResult { - // Number of transformations counted by this result. - int64 count = 1; - - // Outcome of the transformation. - TransformationResultCode code = 2; - - // A place for warnings or errors to show up if a transformation didn't - // work as expected. - string details = 3; - } - - // Set if the transformation was limited to a specific InfoType. - InfoType info_type = 1; - - // Set if the transformation was limited to a specific FieldId. - FieldId field = 2; - - // The specific transformation these stats apply to. - PrimitiveTransformation transformation = 3; - - // 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. - repeated FieldTransformation field_transformations = 5; - - // The specific suppression option these stats apply to. - RecordSuppression record_suppress = 6; - - // Collection of all transformations that took place or had an error. - repeated SummaryResult results = 4; - - // Total size in bytes that were transformed in some way. - int64 transformed_bytes = 7; -} - -// Schedule for inspect job triggers. -message Schedule { - oneof option { - // 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. - google.protobuf.Duration recurrence_period_duration = 1; - } -} - -// Job trigger option for hybrid jobs. Jobs must be manually created -// and finished. -message Manual { - -} - -// 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. -message InspectTemplate { - option (google.api.resource) = { - type: "dlp.googleapis.com/InspectTemplate" - pattern: "organizations/{organization}/inspectTemplates/{inspect_template}" - pattern: "projects/{project}/inspectTemplates/{inspect_template}" - pattern: "organizations/{organization}/locations/{location}/inspectTemplates/{inspect_template}" - pattern: "projects/{project}/locations/{location}/inspectTemplates/{inspect_template}" - }; - - // 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`; - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Display name (max 256 chars). - string display_name = 2; - - // Short description (max 256 chars). - string description = 3; - - // Output only. The creation timestamp of an inspectTemplate. - google.protobuf.Timestamp create_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The last update timestamp of an inspectTemplate. - google.protobuf.Timestamp update_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // The core content of the template. Configuration of the scanning process. - InspectConfig inspect_config = 6; -} - -// DeidentifyTemplates contains instructions on how to de-identify content. -// See https://cloud.google.com/dlp/docs/concepts-templates to learn more. -message DeidentifyTemplate { - option (google.api.resource) = { - type: "dlp.googleapis.com/DeidentifyTemplate" - pattern: "organizations/{organization}/deidentifyTemplates/{deidentify_template}" - pattern: "projects/{project}/deidentifyTemplates/{deidentify_template}" - pattern: "organizations/{organization}/locations/{location}/deidentifyTemplates/{deidentify_template}" - pattern: "projects/{project}/locations/{location}/deidentifyTemplates/{deidentify_template}" - }; - - // 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` - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Display name (max 256 chars). - string display_name = 2; - - // Short description (max 256 chars). - string description = 3; - - // Output only. The creation timestamp of an inspectTemplate. - google.protobuf.Timestamp create_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The last update timestamp of an inspectTemplate. - google.protobuf.Timestamp update_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // The core content of the template. - DeidentifyConfig deidentify_config = 6; -} - -// Details information about an error encountered during job execution or -// the results of an unsuccessful activation of the JobTrigger. -message Error { - // Detailed error codes and messages. - google.rpc.Status details = 1; - - // The times the error occurred. - repeated google.protobuf.Timestamp timestamps = 2; -} - -// 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. -message JobTrigger { - option (google.api.resource) = { - type: "dlp.googleapis.com/JobTrigger" - pattern: "projects/{project}/jobTriggers/{job_trigger}" - pattern: "projects/{project}/locations/{location}/jobTriggers/{job_trigger}" - }; - - // What event needs to occur for a new job to be started. - message Trigger { - oneof trigger { - // Create a job on a repeating basis based on the elapse of time. - Schedule schedule = 1; - - // For use with hybrid jobs. Jobs must be manually created and finished. - Manual manual = 2; - } - } - - // 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 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; - } - - // Unique resource name for the triggeredJob, assigned by the service when the - // triggeredJob is created, for example - // `projects/dlp-test-project/jobTriggers/53234423`. - string name = 1; - - // Display name (max 100 chars) - string display_name = 2; - - // User provided description (max 256 chars) - string description = 3; - - // The configuration details for the specific type of job to run. - oneof job { - // For inspect jobs, a snapshot of the configuration. - InspectJobConfig inspect_job = 4; - } - - // 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. - repeated Trigger triggers = 5; - - // 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. - repeated Error errors = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The creation timestamp of a triggeredJob. - google.protobuf.Timestamp create_time = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The last update timestamp of a triggeredJob. - google.protobuf.Timestamp update_time = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The timestamp of the last time this trigger executed. - google.protobuf.Timestamp last_run_time = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Required. A status for this trigger. - Status status = 10 [(google.api.field_behavior) = REQUIRED]; -} - -// A task to execute on the completion of a job. -// See https://cloud.google.com/dlp/docs/concepts-actions to learn more. -message Action { - // 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 - message SaveFindings { - // Location to store findings outside of DLP. - OutputStorageConfig output_config = 1; - } - - // 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 - message PublishToPubSub { - // 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}. - string topic = 1; - } - - // 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 - message PublishSummaryToCscc { - - } - - // Publish findings of a DlpJob to Data Catalog. Labels summarizing the - // results of the DlpJob will be applied to the entry for the resource scanned - // in 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 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 - message PublishFindingsToCloudDataCatalog { - - } - - // Enable email notification to project owners and editors on jobs's - // completion/failure. - message JobNotificationEmails { - - } - - // 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'. - message PublishToStackdriver { - - } - - oneof action { - // Save resulting findings in a provided location. - SaveFindings save_findings = 1; - - // Publish a notification to a pubsub topic. - PublishToPubSub pub_sub = 2; - - // Publish summary to Cloud Security Command Center (Alpha). - PublishSummaryToCscc publish_summary_to_cscc = 3; - - // Publish findings to Cloud Datahub. - PublishFindingsToCloudDataCatalog publish_findings_to_cloud_data_catalog = 5; - - // Enable email notification for project owners and editors on job's - // completion/failure. - JobNotificationEmails job_notification_emails = 8; - - // Enable Stackdriver metric dlp.googleapis.com/finding_count. - PublishToStackdriver publish_to_stackdriver = 9; - } -} - -// Request message for CreateInspectTemplate. -message CreateInspectTemplateRequest { - // Required. Parent resource name. - // - // The format of this value varies depending on the scope of the request - // (project or organization) and whether you have [specified a processing - // location](https://cloud.google.com/dlp/docs/specifying-location): - // - // + Projects scope, location specified:
- // `projects/`PROJECT_ID`/locations/`LOCATION_ID - // + Projects scope, no location specified (defaults to global):
- // `projects/`PROJECT_ID - // + Organizations scope, location specified:
- // `organizations/`ORG_ID`/locations/`LOCATION_ID - // + Organizations scope, no location specified (defaults to global):
- // `organizations/`ORG_ID - // - // The following example `parent` string specifies a parent project with the - // identifier `example-project`, and specifies the `europe-west3` location - // for processing data: - // - // parent=projects/example-project/locations/europe-west3 - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "dlp.googleapis.com/InspectTemplate" - } - ]; - - // Required. The InspectTemplate to create. - InspectTemplate inspect_template = 2 [(google.api.field_behavior) = REQUIRED]; - - // 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. - string template_id = 3; - - // Deprecated. This field has no effect. - string location_id = 4; -} - -// Request message for UpdateInspectTemplate. -message UpdateInspectTemplateRequest { - // Required. Resource name of organization and inspectTemplate to be updated, for - // example `organizations/433245324/inspectTemplates/432452342` or - // projects/project-id/inspectTemplates/432452342. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "dlp.googleapis.com/InspectTemplate" - } - ]; - - // New InspectTemplate value. - InspectTemplate inspect_template = 2; - - // Mask to control which fields get updated. - google.protobuf.FieldMask update_mask = 3; -} - -// Request message for GetInspectTemplate. -message GetInspectTemplateRequest { - // Required. Resource name of the organization and inspectTemplate to be read, for - // example `organizations/433245324/inspectTemplates/432452342` or - // projects/project-id/inspectTemplates/432452342. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "dlp.googleapis.com/InspectTemplate" - } - ]; -} - -// Request message for ListInspectTemplates. -message ListInspectTemplatesRequest { - // Required. Parent resource name. - // - // The format of this value varies depending on the scope of the request - // (project or organization) and whether you have [specified a processing - // location](https://cloud.google.com/dlp/docs/specifying-location): - // - // + Projects scope, location specified:
- // `projects/`PROJECT_ID`/locations/`LOCATION_ID - // + Projects scope, no location specified (defaults to global):
- // `projects/`PROJECT_ID - // + Organizations scope, location specified:
- // `organizations/`ORG_ID`/locations/`LOCATION_ID - // + Organizations scope, no location specified (defaults to global):
- // `organizations/`ORG_ID - // - // The following example `parent` string specifies a parent project with the - // identifier `example-project`, and specifies the `europe-west3` location - // for processing data: - // - // parent=projects/example-project/locations/europe-west3 - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "dlp.googleapis.com/InspectTemplate" - } - ]; - - // Page token to continue retrieval. Comes from previous call - // to `ListInspectTemplates`. - string page_token = 2; - - // Size of the page, can be limited by server. If zero server returns - // a page of max size 100. - int32 page_size = 3; - - // 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. - string order_by = 4; - - // Deprecated. This field has no effect. - string location_id = 5; -} - -// Response message for ListInspectTemplates. -message ListInspectTemplatesResponse { - // List of inspectTemplates, up to page_size in ListInspectTemplatesRequest. - repeated InspectTemplate inspect_templates = 1; - - // If the next page is available then the next page token to be used - // in following ListInspectTemplates request. - string next_page_token = 2; -} - -// Request message for DeleteInspectTemplate. -message DeleteInspectTemplateRequest { - // Required. Resource name of the organization and inspectTemplate to be deleted, for - // example `organizations/433245324/inspectTemplates/432452342` or - // projects/project-id/inspectTemplates/432452342. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "dlp.googleapis.com/InspectTemplate" - } - ]; -} - -// Request message for CreateJobTrigger. -message CreateJobTriggerRequest { - // Required. Parent resource name. - // - // The format of this value varies depending on whether you have [specified a - // processing - // location](https://cloud.google.com/dlp/docs/specifying-location): - // - // + Projects scope, location specified:
- // `projects/`PROJECT_ID`/locations/`LOCATION_ID - // + Projects scope, no location specified (defaults to global):
- // `projects/`PROJECT_ID - // - // The following example `parent` string specifies a parent project with the - // identifier `example-project`, and specifies the `europe-west3` location - // for processing data: - // - // parent=projects/example-project/locations/europe-west3 - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "dlp.googleapis.com/JobTrigger" - } - ]; - - // Required. The JobTrigger to create. - JobTrigger job_trigger = 2 [(google.api.field_behavior) = REQUIRED]; - - // 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. - string trigger_id = 3; - - // Deprecated. This field has no effect. - string location_id = 4; -} - -// Request message for ActivateJobTrigger. -message ActivateJobTriggerRequest { - // Required. Resource name of the trigger to activate, for example - // `projects/dlp-test-project/jobTriggers/53234423`. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "dlp.googleapis.com/JobTrigger" - } - ]; -} - -// Request message for UpdateJobTrigger. -message UpdateJobTriggerRequest { - // Required. Resource name of the project and the triggeredJob, for example - // `projects/dlp-test-project/jobTriggers/53234423`. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "dlp.googleapis.com/JobTrigger" - } - ]; - - // New JobTrigger value. - JobTrigger job_trigger = 2; - - // Mask to control which fields get updated. - google.protobuf.FieldMask update_mask = 3; -} - -// Request message for GetJobTrigger. -message GetJobTriggerRequest { - // Required. Resource name of the project and the triggeredJob, for example - // `projects/dlp-test-project/jobTriggers/53234423`. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "dlp.googleapis.com/JobTrigger" - } - ]; -} - -// Request message for CreateDlpJobRequest. Used to initiate long running -// jobs such as calculating risk metrics or inspecting Google Cloud -// Storage. -message CreateDlpJobRequest { - // Required. Parent resource name. - // - // The format of this value varies depending on whether you have [specified a - // processing - // location](https://cloud.google.com/dlp/docs/specifying-location): - // - // + Projects scope, location specified:
- // `projects/`PROJECT_ID`/locations/`LOCATION_ID - // + Projects scope, no location specified (defaults to global):
- // `projects/`PROJECT_ID - // - // The following example `parent` string specifies a parent project with the - // identifier `example-project`, and specifies the `europe-west3` location - // for processing data: - // - // parent=projects/example-project/locations/europe-west3 - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "dlp.googleapis.com/DlpJob" - } - ]; - - // The configuration details for the specific type of job to run. - oneof job { - // An inspection job scans a storage repository for InfoTypes. - InspectJobConfig inspect_job = 2; - - // A risk analysis job calculates re-identification risk metrics for a - // BigQuery table. - RiskAnalysisJobConfig risk_job = 3; - } - - // 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. - string job_id = 4; - - // Deprecated. This field has no effect. - string location_id = 5; -} - -// Request message for ListJobTriggers. -message ListJobTriggersRequest { - // Required. Parent resource name. - // - // The format of this value varies depending on whether you have [specified a - // processing - // location](https://cloud.google.com/dlp/docs/specifying-location): - // - // + Projects scope, location specified:
- // `projects/`PROJECT_ID`/locations/`LOCATION_ID - // + Projects scope, no location specified (defaults to global):
- // `projects/`PROJECT_ID - // - // The following example `parent` string specifies a parent project with the - // identifier `example-project`, and specifies the `europe-west3` location - // for processing data: - // - // parent=projects/example-project/locations/europe-west3 - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "dlp.googleapis.com/JobTrigger" - } - ]; - - // Page token to continue retrieval. Comes from previous call - // to ListJobTriggers. `order_by` field must not - // change for subsequent calls. - string page_token = 2; - - // Size of the page, can be limited by a server. - int32 page_size = 3; - - // 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. - string order_by = 4; - - // 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 triggers: - // - `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. - string filter = 5; - - // The type of jobs. Will use `DlpJobType.INSPECT` if not set. - DlpJobType type = 6; - - // Deprecated. This field has no effect. - string location_id = 7; -} - -// Response message for ListJobTriggers. -message ListJobTriggersResponse { - // List of triggeredJobs, up to page_size in ListJobTriggersRequest. - repeated JobTrigger job_triggers = 1; - - // If the next page is available then the next page token to be used - // in following ListJobTriggers request. - string next_page_token = 2; -} - -// Request message for DeleteJobTrigger. -message DeleteJobTriggerRequest { - // Required. Resource name of the project and the triggeredJob, for example - // `projects/dlp-test-project/jobTriggers/53234423`. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "dlp.googleapis.com/JobTrigger" - } - ]; -} - -// Controls what and how to inspect for findings. -message InspectJobConfig { - // The data to scan. - StorageConfig storage_config = 1; - - // How and what to scan for. - InspectConfig inspect_config = 2; - - // 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. - string inspect_template_name = 3; - - // Actions to execute at the completion of the job. - repeated Action actions = 4; -} - -// Combines all of the information about a DLP job. -message DlpJob { - option (google.api.resource) = { - type: "dlp.googleapis.com/DlpJob" - pattern: "projects/{project}/dlpJobs/{dlp_job}" - pattern: "projects/{project}/locations/{location}/dlpJobs/{dlp_job}" - }; - - // Possible states of a job. New items may be added. - enum JobState { - // Unused. - JOB_STATE_UNSPECIFIED = 0; - - // The job has not yet started. - PENDING = 1; - - // The job is currently running. Once a job has finished it will transition - // to FAILED or DONE. - 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 job is currently accepting findings via hybridInspect. - // A hybrid job in ACTIVE state may continue to have findings added to it - // through calling of hybridInspect. After the job has finished no more - // calls to hybridInspect may be made. ACTIVE jobs can transition to DONE. - ACTIVE = 6; - } - - // The server-assigned name. - string name = 1; - - // The type of job. - DlpJobType type = 2; - - // State of a job. - JobState state = 3; - - oneof details { - // Results from analyzing risk of a data source. - AnalyzeDataSourceRiskDetails risk_details = 4; - - // Results from inspecting a data source. - InspectDataSourceDetails inspect_details = 5; - } - - // Time when the job was created. - google.protobuf.Timestamp create_time = 6; - - // Time when the job started. - google.protobuf.Timestamp start_time = 7; - - // Time when the job finished. - google.protobuf.Timestamp end_time = 8; - - // If created by a job trigger, the resource name of the trigger that - // instantiated the job. - string job_trigger_name = 10; - - // A stream of errors encountered running the job. - repeated Error errors = 11; -} - -// The request message for [DlpJobs.GetDlpJob][]. -message GetDlpJobRequest { - // Required. The name of the DlpJob resource. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "dlp.googleapis.com/DlpJob" - } - ]; -} - -// The request message for listing DLP jobs. -message ListDlpJobsRequest { - // Required. Parent resource name. - // - // The format of this value varies depending on whether you have [specified a - // processing - // location](https://cloud.google.com/dlp/docs/specifying-location): - // - // + Projects scope, location specified:
- // `projects/`PROJECT_ID`/locations/`LOCATION_ID - // + Projects scope, no location specified (defaults to global):
- // `projects/`PROJECT_ID - // - // The following example `parent` string specifies a parent project with the - // identifier `example-project`, and specifies the `europe-west3` location - // for processing data: - // - // parent=projects/example-project/locations/europe-west3 - string parent = 4 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "dlp.googleapis.com/DlpJob" - } - ]; - - // 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. - string filter = 1; - - // The standard list page size. - int32 page_size = 2; - - // The standard list page token. - string page_token = 3; - - // The type of job. Defaults to `DlpJobType.INSPECT` - DlpJobType type = 5; - - // 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` - string order_by = 6; - - // Deprecated. This field has no effect. - string location_id = 7; -} - -// The response message for listing DLP jobs. -message ListDlpJobsResponse { - // A list of DlpJobs that matches the specified filter in the request. - repeated DlpJob jobs = 1; - - // The standard List next-page token. - string next_page_token = 2; -} - -// The request message for canceling a DLP job. -message CancelDlpJobRequest { - // Required. The name of the DlpJob resource to be cancelled. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "dlp.googleapis.com/DlpJob" - } - ]; -} - -// The request message for finishing a DLP hybrid job. -message FinishDlpJobRequest { - // Required. The name of the DlpJob resource to be cancelled. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "dlp.googleapis.com/DlpJob" - } - ]; -} - -// The request message for deleting a DLP job. -message DeleteDlpJobRequest { - // Required. The name of the DlpJob resource to be deleted. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "dlp.googleapis.com/DlpJob" - } - ]; -} - -// Request message for CreateDeidentifyTemplate. -message CreateDeidentifyTemplateRequest { - // Required. Parent resource name. - // - // The format of this value varies depending on the scope of the request - // (project or organization) and whether you have [specified a processing - // location](https://cloud.google.com/dlp/docs/specifying-location): - // - // + Projects scope, location specified:
- // `projects/`PROJECT_ID`/locations/`LOCATION_ID - // + Projects scope, no location specified (defaults to global):
- // `projects/`PROJECT_ID - // + Organizations scope, location specified:
- // `organizations/`ORG_ID`/locations/`LOCATION_ID - // + Organizations scope, no location specified (defaults to global):
- // `organizations/`ORG_ID - // - // The following example `parent` string specifies a parent project with the - // identifier `example-project`, and specifies the `europe-west3` location - // for processing data: - // - // parent=projects/example-project/locations/europe-west3 - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "dlp.googleapis.com/DeidentifyTemplate" - } - ]; - - // Required. The DeidentifyTemplate to create. - DeidentifyTemplate deidentify_template = 2 [(google.api.field_behavior) = REQUIRED]; - - // 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. - string template_id = 3; - - // Deprecated. This field has no effect. - string location_id = 4; -} - -// Request message for UpdateDeidentifyTemplate. -message UpdateDeidentifyTemplateRequest { - // Required. Resource name of organization and deidentify template to be updated, for - // example `organizations/433245324/deidentifyTemplates/432452342` or - // projects/project-id/deidentifyTemplates/432452342. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "dlp.googleapis.com/DeidentifyTemplate" - } - ]; - - // New DeidentifyTemplate value. - DeidentifyTemplate deidentify_template = 2; - - // Mask to control which fields get updated. - google.protobuf.FieldMask update_mask = 3; -} - -// Request message for GetDeidentifyTemplate. -message GetDeidentifyTemplateRequest { - // Required. Resource name of the organization and deidentify template to be read, for - // example `organizations/433245324/deidentifyTemplates/432452342` or - // projects/project-id/deidentifyTemplates/432452342. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "dlp.googleapis.com/DeidentifyTemplate" - } - ]; -} - -// Request message for ListDeidentifyTemplates. -message ListDeidentifyTemplatesRequest { - // Required. Parent resource name. - // - // The format of this value varies depending on the scope of the request - // (project or organization) and whether you have [specified a processing - // location](https://cloud.google.com/dlp/docs/specifying-location): - // - // + Projects scope, location specified:
- // `projects/`PROJECT_ID`/locations/`LOCATION_ID - // + Projects scope, no location specified (defaults to global):
- // `projects/`PROJECT_ID - // + Organizations scope, location specified:
- // `organizations/`ORG_ID`/locations/`LOCATION_ID - // + Organizations scope, no location specified (defaults to global):
- // `organizations/`ORG_ID - // - // The following example `parent` string specifies a parent project with the - // identifier `example-project`, and specifies the `europe-west3` location - // for processing data: - // - // parent=projects/example-project/locations/europe-west3 - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "dlp.googleapis.com/DeidentifyTemplate" - } - ]; - - // Page token to continue retrieval. Comes from previous call - // to `ListDeidentifyTemplates`. - string page_token = 2; - - // Size of the page, can be limited by server. If zero server returns - // a page of max size 100. - int32 page_size = 3; - - // 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. - string order_by = 4; - - // Deprecated. This field has no effect. - string location_id = 5; -} - -// Response message for ListDeidentifyTemplates. -message ListDeidentifyTemplatesResponse { - // List of deidentify templates, up to page_size in - // ListDeidentifyTemplatesRequest. - repeated DeidentifyTemplate deidentify_templates = 1; - - // If the next page is available then the next page token to be used - // in following ListDeidentifyTemplates request. - string next_page_token = 2; -} - -// Request message for DeleteDeidentifyTemplate. -message DeleteDeidentifyTemplateRequest { - // Required. Resource name of the organization and deidentify template to be deleted, - // for example `organizations/433245324/deidentifyTemplates/432452342` or - // projects/project-id/deidentifyTemplates/432452342. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "dlp.googleapis.com/DeidentifyTemplate" - } - ]; -} - -// 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. -message LargeCustomDictionaryConfig { - // 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. - CloudStoragePath output_path = 1; - - oneof source { - // Set of files containing newline-delimited lists of dictionary phrases. - CloudStorageFileSet cloud_storage_file_set = 2; - - // Field in a BigQuery table where each cell represents a dictionary phrase. - BigQueryField big_query_field = 3; - } -} - -// Summary statistics of a custom dictionary. -message LargeCustomDictionaryStats { - // Approximate number of distinct phrases in the dictionary. - int64 approx_num_phrases = 1; -} - -// 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. -message StoredInfoTypeConfig { - // Display name of the StoredInfoType (max 256 characters). - string display_name = 1; - - // Description of the StoredInfoType (max 256 characters). - string description = 2; - - // Stored infotype types. - oneof type { - // StoredInfoType where findings are defined by a dictionary of phrases. - LargeCustomDictionaryConfig large_custom_dictionary = 3; - - // Store dictionary-based CustomInfoType. - CustomInfoType.Dictionary dictionary = 4; - - // Store regular expression-based StoredInfoType. - CustomInfoType.Regex regex = 5; - } -} - -// Statistics for a StoredInfoType. -message StoredInfoTypeStats { - // Stat types - oneof type { - // StoredInfoType where findings are defined by a dictionary of phrases. - LargeCustomDictionaryStats large_custom_dictionary = 1; - } -} - -// Version of a StoredInfoType, including the configuration used to build it, -// create timestamp, and current state. -message StoredInfoTypeVersion { - // StoredInfoType configuration. - StoredInfoTypeConfig config = 1; - - // Create timestamp of the version. Read-only, determined by the system - // when the version is created. - google.protobuf.Timestamp create_time = 2; - - // Stored info type version state. Read-only, updated by the system - // during dictionary creation. - StoredInfoTypeState state = 3; - - // 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. - repeated Error errors = 4; - - // Statistics about this storedInfoType version. - StoredInfoTypeStats stats = 5; -} - -// StoredInfoType resource message that contains information about the current -// version and any pending updates. -message StoredInfoType { - option (google.api.resource) = { - type: "dlp.googleapis.com/StoredInfoType" - pattern: "organizations/{organization}/storedInfoTypes/{stored_info_type}" - pattern: "projects/{project}/storedInfoTypes/{stored_info_type}" - pattern: "organizations/{organization}/locations/{location}/storedInfoTypes/{stored_info_type}" - pattern: "projects/{project}/locations/{location}/storedInfoTypes/{stored_info_type}" - }; - - // Resource name. - string name = 1; - - // Current version of the stored info type. - StoredInfoTypeVersion current_version = 2; - - // Pending versions of the stored info type. Empty if no versions are - // pending. - repeated StoredInfoTypeVersion pending_versions = 3; -} - -// Request message for CreateStoredInfoType. -message CreateStoredInfoTypeRequest { - // Required. Parent resource name. - // - // The format of this value varies depending on the scope of the request - // (project or organization) and whether you have [specified a processing - // location](https://cloud.google.com/dlp/docs/specifying-location): - // - // + Projects scope, location specified:
- // `projects/`PROJECT_ID`/locations/`LOCATION_ID - // + Projects scope, no location specified (defaults to global):
- // `projects/`PROJECT_ID - // + Organizations scope, location specified:
- // `organizations/`ORG_ID`/locations/`LOCATION_ID - // + Organizations scope, no location specified (defaults to global):
- // `organizations/`ORG_ID - // - // The following example `parent` string specifies a parent project with the - // identifier `example-project`, and specifies the `europe-west3` location - // for processing data: - // - // parent=projects/example-project/locations/europe-west3 - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "dlp.googleapis.com/StoredInfoType" - } - ]; - - // Required. Configuration of the storedInfoType to create. - StoredInfoTypeConfig config = 2 [(google.api.field_behavior) = REQUIRED]; - - // 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. - string stored_info_type_id = 3; - - // Deprecated. This field has no effect. - string location_id = 4; -} - -// Request message for UpdateStoredInfoType. -message UpdateStoredInfoTypeRequest { - // Required. Resource name of organization and storedInfoType to be updated, for - // example `organizations/433245324/storedInfoTypes/432452342` or - // projects/project-id/storedInfoTypes/432452342. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "dlp.googleapis.com/StoredInfoType" - } - ]; - - // Updated configuration for the storedInfoType. If not provided, a new - // version of the storedInfoType will be created with the existing - // configuration. - StoredInfoTypeConfig config = 2; - - // Mask to control which fields get updated. - google.protobuf.FieldMask update_mask = 3; -} - -// Request message for GetStoredInfoType. -message GetStoredInfoTypeRequest { - // Required. Resource name of the organization and storedInfoType to be read, for - // example `organizations/433245324/storedInfoTypes/432452342` or - // projects/project-id/storedInfoTypes/432452342. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "dlp.googleapis.com/StoredInfoType" - } - ]; -} - -// Request message for ListStoredInfoTypes. -message ListStoredInfoTypesRequest { - // Required. Parent resource name. - // - // The format of this value varies depending on the scope of the request - // (project or organization) and whether you have [specified a processing - // location](https://cloud.google.com/dlp/docs/specifying-location): - // - // + Projects scope, location specified:
- // `projects/`PROJECT_ID`/locations/`LOCATION_ID - // + Projects scope, no location specified (defaults to global):
- // `projects/`PROJECT_ID - // + Organizations scope, location specified:
- // `organizations/`ORG_ID`/locations/`LOCATION_ID - // + Organizations scope, no location specified (defaults to global):
- // `organizations/`ORG_ID - // - // The following example `parent` string specifies a parent project with the - // identifier `example-project`, and specifies the `europe-west3` location - // for processing data: - // - // parent=projects/example-project/locations/europe-west3 - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "dlp.googleapis.com/StoredInfoType" - } - ]; - - // Page token to continue retrieval. Comes from previous call - // to `ListStoredInfoTypes`. - string page_token = 2; - - // Size of the page, can be limited by server. If zero server returns - // a page of max size 100. - int32 page_size = 3; - - // 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. - string order_by = 4; - - // Deprecated. This field has no effect. - string location_id = 5; -} - -// Response message for ListStoredInfoTypes. -message ListStoredInfoTypesResponse { - // List of storedInfoTypes, up to page_size in ListStoredInfoTypesRequest. - repeated StoredInfoType stored_info_types = 1; - - // If the next page is available then the next page token to be used - // in following ListStoredInfoTypes request. - string next_page_token = 2; -} - -// Request message for DeleteStoredInfoType. -message DeleteStoredInfoTypeRequest { - // Required. Resource name of the organization and storedInfoType to be deleted, for - // example `organizations/433245324/storedInfoTypes/432452342` or - // projects/project-id/storedInfoTypes/432452342. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "dlp.googleapis.com/StoredInfoType" - } - ]; -} - -// Request to search for potentially sensitive info in a custom location. -message HybridInspectJobTriggerRequest { - // Required. Resource name of the trigger to execute a hybrid inspect on, for example - // `projects/dlp-test-project/jobTriggers/53234423`. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "dlp.googleapis.com/JobTrigger" - } - ]; - - // The item to inspect. - HybridContentItem hybrid_item = 3; -} - -// Request to search for potentially sensitive info in a custom location. -message HybridInspectDlpJobRequest { - // Required. Resource name of the job to execute a hybrid inspect on, for example - // `projects/dlp-test-project/dlpJob/53234423`. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "dlp.googleapis.com/DlpJob" - } - ]; - - // The item to inspect. - HybridContentItem hybrid_item = 3; -} - -// An individual hybrid item to inspect. Will be stored temporarily during -// processing. -message HybridContentItem { - // The item to inspect. - ContentItem item = 1; - - // Supplementary information that will be added to each finding. - HybridFindingDetails finding_details = 2; -} - -// Populate to associate additional data with each finding. -message HybridFindingDetails { - // Details about the container where the content being inspected is from. - Container container_details = 1; - - // Offset in bytes of the line, from the beginning of the file, where the - // finding is located. Populate if the item being scanned is only part of a - // bigger item, such as a shard of a file and you want to track the absolute - // position of the finding. - int64 file_offset = 2; - - // Offset of the row for tables. Populate if the row(s) being scanned are - // part of a bigger dataset and you want to keep track of their absolute - // position. - int64 row_offset = 3; - - // If the container is a table, additional information to make findings - // meaningful such as the columns that are primary keys. If not known ahead - // of time, can also be set within each inspect hybrid call and the two - // will be merged. Note that identifying_fields will only be stored to - // BigQuery, and only if the BigQuery action has been included. - TableOptions table_options = 4; - - // Labels to represent user provided metadata about the data being inspected. - // If configured by the job, some key values may be required. - // The labels associated with `Finding`'s produced by hybrid - // inspection. - // - // Label keys must be between 1 and 63 characters long and must conform - // to the following regular expression: `[a-z]([-a-z0-9]*[a-z0-9])?`. - // - // Label values must be between 0 and 63 characters long and must conform - // to the regular expression `([a-z]([-a-z0-9]*[a-z0-9])?)?`. - // - // No more than 10 labels can be associated with a given finding. - // - // Examples: - // * `"environment" : "production"` - // * `"pipeline" : "etl"` - map labels = 5; -} - -// Quota exceeded errors will be thrown once quota has been met. -message HybridInspectResponse { - -} - -// Operators available for comparing the value of fields. -enum 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; -} - -// 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 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; -} - -// Deprecated and unused. -enum 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; -} - -// Type of metadata containing the finding. -enum MetadataType { - // Unused - METADATATYPE_UNSPECIFIED = 0; - - // General file metadata provided by Cloud Storage. - STORAGE_METADATA = 2; -} - -// Parts of the APIs which use certain infoTypes. -enum InfoTypeSupportedBy { - // Unused. - ENUM_TYPE_UNSPECIFIED = 0; - - // Supported by the inspect operations. - INSPECT = 1; - - // Supported by the risk analysis operations. - RISK_ANALYSIS = 2; -} - -// An enum to represent the various types of DLP jobs. -enum DlpJobType { - // Defaults to INSPECT_JOB. - 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; -} - -// State of a StoredInfoType version. -enum 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; -} diff --git a/owl-bot-staging/v2/protos/google/privacy/dlp/v2/storage.proto b/owl-bot-staging/v2/protos/google/privacy/dlp/v2/storage.proto deleted file mode 100644 index 5c338088..00000000 --- a/owl-bot-staging/v2/protos/google/privacy/dlp/v2/storage.proto +++ /dev/null @@ -1,755 +0,0 @@ -// Copyright 2022 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. - -syntax = "proto3"; - -package google.privacy.dlp.v2; - -import "google/api/resource.proto"; -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.Dlp.V2"; -option go_package = "google.golang.org/genproto/googleapis/privacy/dlp/v2;dlp"; -option java_multiple_files = true; -option java_outer_classname = "DlpStorage"; -option java_package = "com.google.privacy.dlp.v2"; -option php_namespace = "Google\\Cloud\\Dlp\\V2"; -option ruby_package = "Google::Cloud::Dlp::V2"; - -// Type of information detected by the API. -message InfoType { - // 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. When sending Cloud DLP results to Data Catalog, infoType - // names should conform to the pattern `[A-Za-z0-9$-_]{1,64}`. - string name = 1; - - // Optional version name for this InfoType. - string version = 2; -} - -// 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 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; -} - -// A reference to a StoredInfoType to use with scanning. -message StoredType { - // Resource name of the requested `StoredInfoType`, for example - // `organizations/433245324/storedInfoTypes/432452342` or - // `projects/project-id/storedInfoTypes/432452342`. - string name = 1; - - // Timestamp indicating when the version of the `StoredInfoType` used for - // inspection was created. Output-only field, populated by the system. - google.protobuf.Timestamp create_time = 2; -} - -// Custom information type provided by the user. Used to find domain-specific -// sensitive information configurable to the data in question. -message CustomInfoType { - // 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. - message Dictionary { - // Message defining a list of words or phrases to search for in the data. - message WordList { - // 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] - repeated string words = 1; - } - - oneof source { - // List of words or phrases to search for. - WordList word_list = 1; - - // Newline-delimited file of words in Cloud Storage. Only a single file - // is accepted. - CloudStoragePath cloud_storage_path = 3; - } - } - - // Message defining a custom regular expression. - message Regex { - // Pattern defining the regular expression. Its syntax - // (https://github.com/google/re2/wiki/Syntax) can be found under the - // google/re2 repository on GitHub. - string pattern = 1; - - // The index of the submatch to extract as findings. When not - // specified, the entire match is returned. No more than 3 may be included. - repeated int32 group_indexes = 2; - } - - // 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`. - message SurrogateType { - - } - - // 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. - message DetectionRule { - // Message for specifying a window around a finding to apply a detection - // rule. - message Proximity { - // Number of characters before the finding to consider. - int32 window_before = 1; - - // Number of characters after the finding to consider. - int32 window_after = 2; - } - - // Message for specifying an adjustment to the likelihood of a finding as - // part of a detection rule. - message LikelihoodAdjustment { - oneof adjustment { - // Set the likelihood of a finding to a fixed value. - Likelihood fixed_likelihood = 1; - - // 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`. - int32 relative_likelihood = 2; - } - } - - // The rule that adjusts the likelihood of findings within a certain - // proximity of hotwords. - message HotwordRule { - // Regular expression pattern defining what qualifies as a hotword. - Regex hotword_regex = 1; - - // 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. - Proximity proximity = 2; - - // Likelihood adjustment to apply to all matching findings. - LikelihoodAdjustment likelihood_adjustment = 3; - } - - oneof type { - // Hotword-based detection rule. - HotwordRule hotword_rule = 1; - } - } - - enum 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; - } - - // 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. - InfoType info_type = 1; - - // 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. - Likelihood likelihood = 6; - - oneof type { - // A list of phrases to detect as a CustomInfoType. - Dictionary dictionary = 2; - - // Regular expression based CustomInfoType. - Regex regex = 3; - - // Message for detecting output from deidentification transformations that - // support reversing. - SurrogateType surrogate_type = 4; - - // Load an existing `StoredInfoType` resource for use in - // `InspectDataSource`. Not currently supported in `InspectContent`. - StoredType stored_type = 5; - } - - // 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. - repeated DetectionRule detection_rules = 7; - - // If set to EXCLUSION_TYPE_EXCLUDE this infoType will not cause a finding - // to be returned. It still can be used for rules matching. - ExclusionType exclusion_type = 8; -} - -// General identifier of a data field in a storage service. -message FieldId { - // Name describing the field. - string name = 1; -} - -// 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. -message PartitionId { - // The ID of the project to which the entities belong. - string project_id = 2; - - // If not empty, the ID of the namespace to which the entities belong. - string namespace_id = 4; -} - -// A representation of a Datastore kind. -message KindExpression { - // The name of the kind. - string name = 1; -} - -// Options defining a data set within Google Cloud Datastore. -message DatastoreOptions { - // A partition ID identifies a grouping of entities. The grouping is always - // by project and namespace, however the namespace ID may be empty. - PartitionId partition_id = 1; - - // The kind to process. - KindExpression kind = 2; -} - -// Definitions of file type groups to scan. New types will be added to this -// list. -enum FileType { - // Includes all files. - FILE_TYPE_UNSPECIFIED = 0; - - // Includes all file extensions not covered by another entry. Binary - // scanning attempts to convert the content of the file to utf_8 to scan - // the file. - // If you wish to avoid this fall back, specify one or more of the other - // FileType's in your storage scan. - BINARY_FILE = 1; - - // Included file extensions: - // asc,asp, aspx, brf, c, cc,cfm, cgi, cpp, csv, cxx, c++, cs, css, dart, - // dat, dot, eml,, epbub, ged, go, h, hh, hpp, hxx, h++, hs, html, htm, - // mkd, markdown, m, ml, mli, perl, pl, plist, pm, php, phtml, pht, - // properties, py, pyw, rb, rbw, rs, rss, rc, scala, sh, sql, swift, tex, - // shtml, shtm, xhtml, lhs, ics, ini, java, js, json, kix, kml, ocaml, md, - // txt, text, tsv, vb, vcard, vcs, wml, xcodeproj, 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 inspection is restricted to 'global', 'us', 'asia', and 'europe'. - IMAGE = 3; - - // Word files >30 MB will be scanned as binary files. - // Included file extensions: - // docx, dotx, docm, dotm - WORD = 5; - - // PDF files >30 MB will be scanned as binary files. - // Included file extensions: - // pdf - PDF = 6; - - // Included file extensions: - // avro - AVRO = 7; - - // Included file extensions: - // csv - CSV = 8; - - // Included file extensions: - // tsv - TSV = 9; - - // Powerpoint files >30 MB will be scanned as binary files. - // Included file extensions: - // pptx, pptm, potx, potm, pot - POWERPOINT = 11; - - // Excel files >30 MB will be scanned as binary files. - // Included file extensions: - // xlsx, xlsm, xltx, xltm - EXCEL = 12; -} - -// 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 `/` -message CloudStorageRegexFileSet { - // The name of a Cloud Storage bucket. Required. - string bucket_name = 1; - - // 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. - repeated string include_regex = 2; - - // 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. - repeated string exclude_regex = 3; -} - -// Options defining a file or a set of files within a Google Cloud Storage -// bucket. -message CloudStorageOptions { - // Set of files to scan. - message FileSet { - // 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. - string url = 1; - - // The regex-filtered set of files to scan. Exactly one of `url` or - // `regex_file_set` must be set. - CloudStorageRegexFileSet regex_file_set = 2; - } - - // 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 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; - } - - // The set of one or more files to scan. - FileSet file_set = 1; - - // 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. - // Cannot be set if de-identification is requested. - int64 bytes_limit_per_file = 4; - - // 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. - // Cannot be set if de-identification is requested. - int32 bytes_limit_per_file_percent = 8; - - // 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. - // Images are scanned only as binary if the specified region - // does not support image inspection and no file_types were specified. - // Image inspection is restricted to 'global', 'us', 'asia', and 'europe'. - repeated FileType file_types = 5; - - SampleMethod sample_method = 6; - - // 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. - int32 files_limit_percent = 7; -} - -// Message representing a set of files in Cloud Storage. -message CloudStorageFileSet { - // The url, in the format `gs:///`. Trailing wildcard in the - // path is allowed. - string url = 1; -} - -// Message representing a single file or path in Cloud Storage. -message CloudStoragePath { - // A url representing a file or path (no wildcards) in Cloud Storage. - // Example: gs://[BUCKET_NAME]/dictionary.txt - string path = 1; -} - -// Options defining BigQuery table and row identifiers. -message BigQueryOptions { - // 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, rows are scanned in the order BigQuery reads them. - enum SampleMethod { - SAMPLE_METHOD_UNSPECIFIED = 0; - - // Scan groups of rows in the order BigQuery provides (default). Multiple - // groups of rows may be scanned in parallel, so results may not appear in - // the same order the rows are read. - TOP = 1; - - // Randomly pick groups of rows to scan. - RANDOM_START = 2; - } - - // Complete BigQuery table reference. - BigQueryTable table_reference = 1; - - // Table fields that may uniquely identify a row within the table. When - // `actions.saveFindings.outputConfig.table` is specified, the values of - // columns specified here are available in the output table under - // `location.content_locations.record_location.record_key.id_values`. Nested - // fields such as `person.birthdate.year` are allowed. - repeated FieldId identifying_fields = 2; - - // 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. - int64 rows_limit = 3; - - // 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. - int32 rows_limit_percent = 6; - - SampleMethod sample_method = 4; - - // References to fields excluded from scanning. This allows you to skip - // inspection of entire columns which you know have no findings. - repeated FieldId excluded_fields = 5; - - // Limit scanning only to these fields. - repeated FieldId included_fields = 7; -} - -// Shared message indicating Cloud storage type. -message StorageConfig { - // Configuration of the timespan of the items to include in scanning. - // Currently only supported when inspecting Google Cloud Storage and BigQuery. - message TimespanConfig { - // Exclude files, tables, or rows older than this value. - // If not set, no lower time limit is applied. - google.protobuf.Timestamp start_time = 1; - - // Exclude files, tables, or rows newer than this value. - // If not set, no upper time limit is applied. - google.protobuf.Timestamp end_time = 2; - - // Specification of the field containing the timestamp of scanned items. - // Used for data sources like Datastore and BigQuery. - // - // For BigQuery: - // If this value is not specified and the table was modified between the - // given start and end times, the entire table will be scanned. If this - // value is specified, then rows are filtered based on the given start and - // end times. Rows with a `NULL` value in the provided BigQuery column are - // skipped. - // Valid data types of the provided BigQuery column are: `INTEGER`, `DATE`, - // `TIMESTAMP`, and `DATETIME`. - // - // For Datastore: - // If this value is specified, then entities are filtered based on the given - // start and end times. If an entity does not contain the provided timestamp - // property or contains empty or invalid values, then it is included. - // Valid data types of the provided timestamp property are: `TIMESTAMP`. - FieldId timestamp_field = 3; - - // 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. - bool enable_auto_population_of_timespan_config = 4; - } - - oneof type { - // Google Cloud Datastore options. - DatastoreOptions datastore_options = 2; - - // Google Cloud Storage options. - CloudStorageOptions cloud_storage_options = 3; - - // BigQuery options. - BigQueryOptions big_query_options = 4; - - // Hybrid inspection options. - HybridOptions hybrid_options = 9; - } - - TimespanConfig timespan_config = 6; -} - -// Configuration to control jobs where the content being inspected is outside -// of Google Cloud Platform. -message HybridOptions { - // A short description of where the data is coming from. Will be stored once - // in the job. 256 max length. - string description = 1; - - // These are labels that each inspection request must include within their - // 'finding_labels' map. Request may contain others, but any missing one of - // these will be rejected. - // - // Label keys must be between 1 and 63 characters long and must conform - // to the following regular expression: `[a-z]([-a-z0-9]*[a-z0-9])?`. - // - // No more than 10 keys can be required. - repeated string required_finding_label_keys = 2; - - // To organize findings, these labels will be added to each finding. - // - // Label keys must be between 1 and 63 characters long and must conform - // to the following regular expression: `[a-z]([-a-z0-9]*[a-z0-9])?`. - // - // Label values must be between 0 and 63 characters long and must conform - // to the regular expression `([a-z]([-a-z0-9]*[a-z0-9])?)?`. - // - // No more than 10 labels can be associated with a given finding. - // - // Examples: - // * `"environment" : "production"` - // * `"pipeline" : "etl"` - map labels = 3; - - // If the container is a table, additional information to make findings - // meaningful such as the columns that are primary keys. - TableOptions table_options = 4; -} - -// Row key for identifying a record in BigQuery table. -message BigQueryKey { - // Complete BigQuery table reference. - BigQueryTable table_reference = 1; - - // Row number inferred at the time the table was scanned. This value is - // nondeterministic, cannot be queried, and may be null for inspection - // jobs. To locate findings within a table, specify - // `inspect_job.storage_config.big_query_options.identifying_fields` in - // `CreateDlpJobRequest`. - int64 row_number = 2; -} - -// Record key for a finding in Cloud Datastore. -message DatastoreKey { - // Datastore entity key. - Key entity_key = 1; -} - -// 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. -message Key { - // 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. - message PathElement { - // 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 `""`. - string kind = 1; - - // The type of ID. - oneof id_type { - // 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. - int64 id = 2; - - // 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 `""`. - string name = 3; - } - } - - // Entities are partitioned into subsets, currently identified by a project - // ID and namespace ID. - // Queries are scoped to a single partition. - PartitionId partition_id = 1; - - // 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. - repeated PathElement path = 2; -} - -// Message for a unique key indicating a record that contains a finding. -message RecordKey { - oneof type { - DatastoreKey datastore_key = 2; - - BigQueryKey big_query_key = 3; - } - - // Values of identifying columns in the given row. Order of values matches - // the order of `identifying_fields` specified in the scanning request. - repeated string id_values = 5; -} - -// 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 -// `..`. -message BigQueryTable { - // The Google Cloud Platform project ID of the project containing the table. - // If omitted, project ID is inferred from the API call. - string project_id = 1; - - // Dataset ID of the table. - string dataset_id = 2; - - // Name of the table. - string table_id = 3; -} - -// Message defining a field of a BigQuery table. -message BigQueryField { - // Source table of the field. - BigQueryTable table = 1; - - // Designated field in the BigQuery table. - FieldId field = 2; -} - -// 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. -message EntityId { - // Composite key indicating which field contains the entity identifier. - FieldId field = 1; -} - -// Instructions regarding the table content being inspected. -message TableOptions { - // The columns that are the primary keys for table objects included in - // ContentItem. A copy of this cell's value will stored alongside alongside - // each finding so that the finding can be traced to the specific row it came - // from. No more than 3 may be provided. - repeated FieldId identifying_fields = 1; -} diff --git a/owl-bot-staging/v2/samples/generated/v2/dlp_service.activate_job_trigger.js b/owl-bot-staging/v2/samples/generated/v2/dlp_service.activate_job_trigger.js deleted file mode 100644 index 1609743f..00000000 --- a/owl-bot-staging/v2/samples/generated/v2/dlp_service.activate_job_trigger.js +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright 2022 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. ** - - - -'use strict'; - -function main(name) { - // [START dlp_v2_generated_DlpService_ActivateJobTrigger_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Resource name of the trigger to activate, for example - * `projects/dlp-test-project/jobTriggers/53234423`. - */ - // const name = 'abc123' - - // Imports the Dlp library - const {DlpServiceClient} = require('@google-cloud/dlp').v2; - - // Instantiates a client - const dlpClient = new DlpServiceClient(); - - async function callActivateJobTrigger() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await dlpClient.activateJobTrigger(request); - console.log(response); - } - - callActivateJobTrigger(); - // [END dlp_v2_generated_DlpService_ActivateJobTrigger_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v2/samples/generated/v2/dlp_service.cancel_dlp_job.js b/owl-bot-staging/v2/samples/generated/v2/dlp_service.cancel_dlp_job.js deleted file mode 100644 index b40ab6b7..00000000 --- a/owl-bot-staging/v2/samples/generated/v2/dlp_service.cancel_dlp_job.js +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright 2022 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. ** - - - -'use strict'; - -function main(name) { - // [START dlp_v2_generated_DlpService_CancelDlpJob_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the DlpJob resource to be cancelled. - */ - // const name = 'abc123' - - // Imports the Dlp library - const {DlpServiceClient} = require('@google-cloud/dlp').v2; - - // Instantiates a client - const dlpClient = new DlpServiceClient(); - - async function callCancelDlpJob() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await dlpClient.cancelDlpJob(request); - console.log(response); - } - - callCancelDlpJob(); - // [END dlp_v2_generated_DlpService_CancelDlpJob_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v2/samples/generated/v2/dlp_service.create_deidentify_template.js b/owl-bot-staging/v2/samples/generated/v2/dlp_service.create_deidentify_template.js deleted file mode 100644 index 2e383d1e..00000000 --- a/owl-bot-staging/v2/samples/generated/v2/dlp_service.create_deidentify_template.js +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright 2022 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. ** - - - -'use strict'; - -function main(parent, deidentifyTemplate) { - // [START dlp_v2_generated_DlpService_CreateDeidentifyTemplate_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Parent resource name. - * The format of this value varies depending on the scope of the request - * (project or organization) and whether you have specified a processing - * location (https://cloud.google.com/dlp/docs/specifying-location): - * + Projects scope, location specified:
- * `projects/`PROJECT_ID`/locations/`LOCATION_ID - * + Projects scope, no location specified (defaults to global):
- * `projects/`PROJECT_ID - * + Organizations scope, location specified:
- * `organizations/`ORG_ID`/locations/`LOCATION_ID - * + Organizations scope, no location specified (defaults to global):
- * `organizations/`ORG_ID - * The following example `parent` string specifies a parent project with the - * identifier `example-project`, and specifies the `europe-west3` location - * for processing data: - * parent=projects/example-project/locations/europe-west3 - */ - // const parent = 'abc123' - /** - * Required. The DeidentifyTemplate to create. - */ - // const deidentifyTemplate = {} - /** - * The template id can contain uppercase and lowercase letters, - * numbers, and hyphens; that is, it must match the regular - * expression: `[a-zA-Z\d-_]+`. The maximum length is 100 - * characters. Can be empty to allow the system to generate one. - */ - // const templateId = 'abc123' - - // Imports the Dlp library - const {DlpServiceClient} = require('@google-cloud/dlp').v2; - - // Instantiates a client - const dlpClient = new DlpServiceClient(); - - async function callCreateDeidentifyTemplate() { - // Construct request - const request = { - parent, - deidentifyTemplate, - }; - - // Run request - const response = await dlpClient.createDeidentifyTemplate(request); - console.log(response); - } - - callCreateDeidentifyTemplate(); - // [END dlp_v2_generated_DlpService_CreateDeidentifyTemplate_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v2/samples/generated/v2/dlp_service.create_dlp_job.js b/owl-bot-staging/v2/samples/generated/v2/dlp_service.create_dlp_job.js deleted file mode 100644 index 38181d0f..00000000 --- a/owl-bot-staging/v2/samples/generated/v2/dlp_service.create_dlp_job.js +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright 2022 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. ** - - - -'use strict'; - -function main(parent) { - // [START dlp_v2_generated_DlpService_CreateDlpJob_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Parent resource name. - * The format of this value varies depending on whether you have specified a - * processing - * location (https://cloud.google.com/dlp/docs/specifying-location): - * + Projects scope, location specified:
- * `projects/`PROJECT_ID`/locations/`LOCATION_ID - * + Projects scope, no location specified (defaults to global):
- * `projects/`PROJECT_ID - * The following example `parent` string specifies a parent project with the - * identifier `example-project`, and specifies the `europe-west3` location - * for processing data: - * parent=projects/example-project/locations/europe-west3 - */ - // const parent = 'abc123' - /** - * An inspection job scans a storage repository for InfoTypes. - */ - // const inspectJob = {} - /** - * A risk analysis job calculates re-identification risk metrics for a - * BigQuery table. - */ - // const riskJob = {} - /** - * The job id can contain uppercase and lowercase letters, - * numbers, and hyphens; that is, it must match the regular - * expression: `[a-zA-Z\d-_]+`. The maximum length is 100 - * characters. Can be empty to allow the system to generate one. - */ - // const jobId = 'abc123' - - // Imports the Dlp library - const {DlpServiceClient} = require('@google-cloud/dlp').v2; - - // Instantiates a client - const dlpClient = new DlpServiceClient(); - - async function callCreateDlpJob() { - // Construct request - const request = { - parent, - }; - - // Run request - const response = await dlpClient.createDlpJob(request); - console.log(response); - } - - callCreateDlpJob(); - // [END dlp_v2_generated_DlpService_CreateDlpJob_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v2/samples/generated/v2/dlp_service.create_inspect_template.js b/owl-bot-staging/v2/samples/generated/v2/dlp_service.create_inspect_template.js deleted file mode 100644 index e15f5f3f..00000000 --- a/owl-bot-staging/v2/samples/generated/v2/dlp_service.create_inspect_template.js +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright 2022 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. ** - - - -'use strict'; - -function main(parent, inspectTemplate) { - // [START dlp_v2_generated_DlpService_CreateInspectTemplate_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Parent resource name. - * The format of this value varies depending on the scope of the request - * (project or organization) and whether you have specified a processing - * location (https://cloud.google.com/dlp/docs/specifying-location): - * + Projects scope, location specified:
- * `projects/`PROJECT_ID`/locations/`LOCATION_ID - * + Projects scope, no location specified (defaults to global):
- * `projects/`PROJECT_ID - * + Organizations scope, location specified:
- * `organizations/`ORG_ID`/locations/`LOCATION_ID - * + Organizations scope, no location specified (defaults to global):
- * `organizations/`ORG_ID - * The following example `parent` string specifies a parent project with the - * identifier `example-project`, and specifies the `europe-west3` location - * for processing data: - * parent=projects/example-project/locations/europe-west3 - */ - // const parent = 'abc123' - /** - * Required. The InspectTemplate to create. - */ - // const inspectTemplate = {} - /** - * The template id can contain uppercase and lowercase letters, - * numbers, and hyphens; that is, it must match the regular - * expression: `[a-zA-Z\d-_]+`. The maximum length is 100 - * characters. Can be empty to allow the system to generate one. - */ - // const templateId = 'abc123' - - // Imports the Dlp library - const {DlpServiceClient} = require('@google-cloud/dlp').v2; - - // Instantiates a client - const dlpClient = new DlpServiceClient(); - - async function callCreateInspectTemplate() { - // Construct request - const request = { - parent, - inspectTemplate, - }; - - // Run request - const response = await dlpClient.createInspectTemplate(request); - console.log(response); - } - - callCreateInspectTemplate(); - // [END dlp_v2_generated_DlpService_CreateInspectTemplate_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v2/samples/generated/v2/dlp_service.create_job_trigger.js b/owl-bot-staging/v2/samples/generated/v2/dlp_service.create_job_trigger.js deleted file mode 100644 index 41a52f6c..00000000 --- a/owl-bot-staging/v2/samples/generated/v2/dlp_service.create_job_trigger.js +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright 2022 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. ** - - - -'use strict'; - -function main(parent, jobTrigger) { - // [START dlp_v2_generated_DlpService_CreateJobTrigger_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Parent resource name. - * The format of this value varies depending on whether you have specified a - * processing - * location (https://cloud.google.com/dlp/docs/specifying-location): - * + Projects scope, location specified:
- * `projects/`PROJECT_ID`/locations/`LOCATION_ID - * + Projects scope, no location specified (defaults to global):
- * `projects/`PROJECT_ID - * The following example `parent` string specifies a parent project with the - * identifier `example-project`, and specifies the `europe-west3` location - * for processing data: - * parent=projects/example-project/locations/europe-west3 - */ - // const parent = 'abc123' - /** - * Required. The JobTrigger to create. - */ - // const jobTrigger = {} - /** - * The trigger id can contain uppercase and lowercase letters, - * numbers, and hyphens; that is, it must match the regular - * expression: `[a-zA-Z\d-_]+`. The maximum length is 100 - * characters. Can be empty to allow the system to generate one. - */ - // const triggerId = 'abc123' - - // Imports the Dlp library - const {DlpServiceClient} = require('@google-cloud/dlp').v2; - - // Instantiates a client - const dlpClient = new DlpServiceClient(); - - async function callCreateJobTrigger() { - // Construct request - const request = { - parent, - jobTrigger, - }; - - // Run request - const response = await dlpClient.createJobTrigger(request); - console.log(response); - } - - callCreateJobTrigger(); - // [END dlp_v2_generated_DlpService_CreateJobTrigger_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v2/samples/generated/v2/dlp_service.create_stored_info_type.js b/owl-bot-staging/v2/samples/generated/v2/dlp_service.create_stored_info_type.js deleted file mode 100644 index b6347744..00000000 --- a/owl-bot-staging/v2/samples/generated/v2/dlp_service.create_stored_info_type.js +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright 2022 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. ** - - - -'use strict'; - -function main(parent, config) { - // [START dlp_v2_generated_DlpService_CreateStoredInfoType_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Parent resource name. - * The format of this value varies depending on the scope of the request - * (project or organization) and whether you have specified a processing - * location (https://cloud.google.com/dlp/docs/specifying-location): - * + Projects scope, location specified:
- * `projects/`PROJECT_ID`/locations/`LOCATION_ID - * + Projects scope, no location specified (defaults to global):
- * `projects/`PROJECT_ID - * + Organizations scope, location specified:
- * `organizations/`ORG_ID`/locations/`LOCATION_ID - * + Organizations scope, no location specified (defaults to global):
- * `organizations/`ORG_ID - * The following example `parent` string specifies a parent project with the - * identifier `example-project`, and specifies the `europe-west3` location - * for processing data: - * parent=projects/example-project/locations/europe-west3 - */ - // const parent = 'abc123' - /** - * Required. Configuration of the storedInfoType to create. - */ - // const config = {} - /** - * The storedInfoType ID can contain uppercase and lowercase letters, - * numbers, and hyphens; that is, it must match the regular - * expression: `[a-zA-Z\d-_]+`. The maximum length is 100 - * characters. Can be empty to allow the system to generate one. - */ - // const storedInfoTypeId = 'abc123' - - // Imports the Dlp library - const {DlpServiceClient} = require('@google-cloud/dlp').v2; - - // Instantiates a client - const dlpClient = new DlpServiceClient(); - - async function callCreateStoredInfoType() { - // Construct request - const request = { - parent, - config, - }; - - // Run request - const response = await dlpClient.createStoredInfoType(request); - console.log(response); - } - - callCreateStoredInfoType(); - // [END dlp_v2_generated_DlpService_CreateStoredInfoType_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v2/samples/generated/v2/dlp_service.deidentify_content.js b/owl-bot-staging/v2/samples/generated/v2/dlp_service.deidentify_content.js deleted file mode 100644 index c74b1d6d..00000000 --- a/owl-bot-staging/v2/samples/generated/v2/dlp_service.deidentify_content.js +++ /dev/null @@ -1,100 +0,0 @@ -// Copyright 2022 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. ** - - - -'use strict'; - -function main() { - // [START dlp_v2_generated_DlpService_DeidentifyContent_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Parent resource name. - * The format of this value varies depending on whether you have specified a - * processing - * location (https://cloud.google.com/dlp/docs/specifying-location): - * + Projects scope, location specified:
- * `projects/`PROJECT_ID`/locations/`LOCATION_ID - * + Projects scope, no location specified (defaults to global):
- * `projects/`PROJECT_ID - * The following example `parent` string specifies a parent project with the - * identifier `example-project`, and specifies the `europe-west3` location - * for processing data: - * parent=projects/example-project/locations/europe-west3 - */ - // const parent = 'abc123' - /** - * Configuration for the de-identification of the content item. - * Items specified here will override the template referenced by the - * deidentify_template_name argument. - */ - // const deidentifyConfig = {} - /** - * Configuration for the inspector. - * Items specified here will override the template referenced by the - * inspect_template_name argument. - */ - // const inspectConfig = {} - /** - * The item to de-identify. Will be treated as text. - */ - // const item = {} - /** - * Template to use. Any configuration directly specified in - * inspect_config will override those set in the template. Singular fields - * that are set in this request will replace their corresponding fields in the - * template. Repeated fields are appended. Singular sub-messages and groups - * are recursively merged. - */ - // const inspectTemplateName = 'abc123' - /** - * Template to use. Any configuration directly specified in - * deidentify_config will override those set in the template. Singular fields - * that are set in this request will replace their corresponding fields in the - * template. Repeated fields are appended. Singular sub-messages and groups - * are recursively merged. - */ - // const deidentifyTemplateName = 'abc123' - - // Imports the Dlp library - const {DlpServiceClient} = require('@google-cloud/dlp').v2; - - // Instantiates a client - const dlpClient = new DlpServiceClient(); - - async function callDeidentifyContent() { - // Construct request - const request = { - }; - - // Run request - const response = await dlpClient.deidentifyContent(request); - console.log(response); - } - - callDeidentifyContent(); - // [END dlp_v2_generated_DlpService_DeidentifyContent_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v2/samples/generated/v2/dlp_service.delete_deidentify_template.js b/owl-bot-staging/v2/samples/generated/v2/dlp_service.delete_deidentify_template.js deleted file mode 100644 index a3cefacc..00000000 --- a/owl-bot-staging/v2/samples/generated/v2/dlp_service.delete_deidentify_template.js +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright 2022 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. ** - - - -'use strict'; - -function main(name) { - // [START dlp_v2_generated_DlpService_DeleteDeidentifyTemplate_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Resource name of the organization and deidentify template to be deleted, - * for example `organizations/433245324/deidentifyTemplates/432452342` or - * projects/project-id/deidentifyTemplates/432452342. - */ - // const name = 'abc123' - - // Imports the Dlp library - const {DlpServiceClient} = require('@google-cloud/dlp').v2; - - // Instantiates a client - const dlpClient = new DlpServiceClient(); - - async function callDeleteDeidentifyTemplate() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await dlpClient.deleteDeidentifyTemplate(request); - console.log(response); - } - - callDeleteDeidentifyTemplate(); - // [END dlp_v2_generated_DlpService_DeleteDeidentifyTemplate_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v2/samples/generated/v2/dlp_service.delete_dlp_job.js b/owl-bot-staging/v2/samples/generated/v2/dlp_service.delete_dlp_job.js deleted file mode 100644 index 95626de2..00000000 --- a/owl-bot-staging/v2/samples/generated/v2/dlp_service.delete_dlp_job.js +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright 2022 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. ** - - - -'use strict'; - -function main(name) { - // [START dlp_v2_generated_DlpService_DeleteDlpJob_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the DlpJob resource to be deleted. - */ - // const name = 'abc123' - - // Imports the Dlp library - const {DlpServiceClient} = require('@google-cloud/dlp').v2; - - // Instantiates a client - const dlpClient = new DlpServiceClient(); - - async function callDeleteDlpJob() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await dlpClient.deleteDlpJob(request); - console.log(response); - } - - callDeleteDlpJob(); - // [END dlp_v2_generated_DlpService_DeleteDlpJob_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v2/samples/generated/v2/dlp_service.delete_inspect_template.js b/owl-bot-staging/v2/samples/generated/v2/dlp_service.delete_inspect_template.js deleted file mode 100644 index 32491b94..00000000 --- a/owl-bot-staging/v2/samples/generated/v2/dlp_service.delete_inspect_template.js +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright 2022 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. ** - - - -'use strict'; - -function main(name) { - // [START dlp_v2_generated_DlpService_DeleteInspectTemplate_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Resource name of the organization and inspectTemplate to be deleted, for - * example `organizations/433245324/inspectTemplates/432452342` or - * projects/project-id/inspectTemplates/432452342. - */ - // const name = 'abc123' - - // Imports the Dlp library - const {DlpServiceClient} = require('@google-cloud/dlp').v2; - - // Instantiates a client - const dlpClient = new DlpServiceClient(); - - async function callDeleteInspectTemplate() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await dlpClient.deleteInspectTemplate(request); - console.log(response); - } - - callDeleteInspectTemplate(); - // [END dlp_v2_generated_DlpService_DeleteInspectTemplate_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v2/samples/generated/v2/dlp_service.delete_job_trigger.js b/owl-bot-staging/v2/samples/generated/v2/dlp_service.delete_job_trigger.js deleted file mode 100644 index 13bdcbcb..00000000 --- a/owl-bot-staging/v2/samples/generated/v2/dlp_service.delete_job_trigger.js +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright 2022 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. ** - - - -'use strict'; - -function main(name) { - // [START dlp_v2_generated_DlpService_DeleteJobTrigger_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Resource name of the project and the triggeredJob, for example - * `projects/dlp-test-project/jobTriggers/53234423`. - */ - // const name = 'abc123' - - // Imports the Dlp library - const {DlpServiceClient} = require('@google-cloud/dlp').v2; - - // Instantiates a client - const dlpClient = new DlpServiceClient(); - - async function callDeleteJobTrigger() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await dlpClient.deleteJobTrigger(request); - console.log(response); - } - - callDeleteJobTrigger(); - // [END dlp_v2_generated_DlpService_DeleteJobTrigger_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v2/samples/generated/v2/dlp_service.delete_stored_info_type.js b/owl-bot-staging/v2/samples/generated/v2/dlp_service.delete_stored_info_type.js deleted file mode 100644 index 896147e7..00000000 --- a/owl-bot-staging/v2/samples/generated/v2/dlp_service.delete_stored_info_type.js +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright 2022 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. ** - - - -'use strict'; - -function main(name) { - // [START dlp_v2_generated_DlpService_DeleteStoredInfoType_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Resource name of the organization and storedInfoType to be deleted, for - * example `organizations/433245324/storedInfoTypes/432452342` or - * projects/project-id/storedInfoTypes/432452342. - */ - // const name = 'abc123' - - // Imports the Dlp library - const {DlpServiceClient} = require('@google-cloud/dlp').v2; - - // Instantiates a client - const dlpClient = new DlpServiceClient(); - - async function callDeleteStoredInfoType() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await dlpClient.deleteStoredInfoType(request); - console.log(response); - } - - callDeleteStoredInfoType(); - // [END dlp_v2_generated_DlpService_DeleteStoredInfoType_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v2/samples/generated/v2/dlp_service.finish_dlp_job.js b/owl-bot-staging/v2/samples/generated/v2/dlp_service.finish_dlp_job.js deleted file mode 100644 index 4575f5f8..00000000 --- a/owl-bot-staging/v2/samples/generated/v2/dlp_service.finish_dlp_job.js +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright 2022 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. ** - - - -'use strict'; - -function main(name) { - // [START dlp_v2_generated_DlpService_FinishDlpJob_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the DlpJob resource to be cancelled. - */ - // const name = 'abc123' - - // Imports the Dlp library - const {DlpServiceClient} = require('@google-cloud/dlp').v2; - - // Instantiates a client - const dlpClient = new DlpServiceClient(); - - async function callFinishDlpJob() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await dlpClient.finishDlpJob(request); - console.log(response); - } - - callFinishDlpJob(); - // [END dlp_v2_generated_DlpService_FinishDlpJob_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v2/samples/generated/v2/dlp_service.get_deidentify_template.js b/owl-bot-staging/v2/samples/generated/v2/dlp_service.get_deidentify_template.js deleted file mode 100644 index 0319f743..00000000 --- a/owl-bot-staging/v2/samples/generated/v2/dlp_service.get_deidentify_template.js +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright 2022 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. ** - - - -'use strict'; - -function main(name) { - // [START dlp_v2_generated_DlpService_GetDeidentifyTemplate_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Resource name of the organization and deidentify template to be read, for - * example `organizations/433245324/deidentifyTemplates/432452342` or - * projects/project-id/deidentifyTemplates/432452342. - */ - // const name = 'abc123' - - // Imports the Dlp library - const {DlpServiceClient} = require('@google-cloud/dlp').v2; - - // Instantiates a client - const dlpClient = new DlpServiceClient(); - - async function callGetDeidentifyTemplate() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await dlpClient.getDeidentifyTemplate(request); - console.log(response); - } - - callGetDeidentifyTemplate(); - // [END dlp_v2_generated_DlpService_GetDeidentifyTemplate_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v2/samples/generated/v2/dlp_service.get_dlp_job.js b/owl-bot-staging/v2/samples/generated/v2/dlp_service.get_dlp_job.js deleted file mode 100644 index 2b66d79c..00000000 --- a/owl-bot-staging/v2/samples/generated/v2/dlp_service.get_dlp_job.js +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright 2022 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. ** - - - -'use strict'; - -function main(name) { - // [START dlp_v2_generated_DlpService_GetDlpJob_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the DlpJob resource. - */ - // const name = 'abc123' - - // Imports the Dlp library - const {DlpServiceClient} = require('@google-cloud/dlp').v2; - - // Instantiates a client - const dlpClient = new DlpServiceClient(); - - async function callGetDlpJob() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await dlpClient.getDlpJob(request); - console.log(response); - } - - callGetDlpJob(); - // [END dlp_v2_generated_DlpService_GetDlpJob_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v2/samples/generated/v2/dlp_service.get_inspect_template.js b/owl-bot-staging/v2/samples/generated/v2/dlp_service.get_inspect_template.js deleted file mode 100644 index 4d227030..00000000 --- a/owl-bot-staging/v2/samples/generated/v2/dlp_service.get_inspect_template.js +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright 2022 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. ** - - - -'use strict'; - -function main(name) { - // [START dlp_v2_generated_DlpService_GetInspectTemplate_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Resource name of the organization and inspectTemplate to be read, for - * example `organizations/433245324/inspectTemplates/432452342` or - * projects/project-id/inspectTemplates/432452342. - */ - // const name = 'abc123' - - // Imports the Dlp library - const {DlpServiceClient} = require('@google-cloud/dlp').v2; - - // Instantiates a client - const dlpClient = new DlpServiceClient(); - - async function callGetInspectTemplate() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await dlpClient.getInspectTemplate(request); - console.log(response); - } - - callGetInspectTemplate(); - // [END dlp_v2_generated_DlpService_GetInspectTemplate_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v2/samples/generated/v2/dlp_service.get_job_trigger.js b/owl-bot-staging/v2/samples/generated/v2/dlp_service.get_job_trigger.js deleted file mode 100644 index c9ddadf4..00000000 --- a/owl-bot-staging/v2/samples/generated/v2/dlp_service.get_job_trigger.js +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright 2022 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. ** - - - -'use strict'; - -function main(name) { - // [START dlp_v2_generated_DlpService_GetJobTrigger_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Resource name of the project and the triggeredJob, for example - * `projects/dlp-test-project/jobTriggers/53234423`. - */ - // const name = 'abc123' - - // Imports the Dlp library - const {DlpServiceClient} = require('@google-cloud/dlp').v2; - - // Instantiates a client - const dlpClient = new DlpServiceClient(); - - async function callGetJobTrigger() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await dlpClient.getJobTrigger(request); - console.log(response); - } - - callGetJobTrigger(); - // [END dlp_v2_generated_DlpService_GetJobTrigger_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v2/samples/generated/v2/dlp_service.get_stored_info_type.js b/owl-bot-staging/v2/samples/generated/v2/dlp_service.get_stored_info_type.js deleted file mode 100644 index 412c49d0..00000000 --- a/owl-bot-staging/v2/samples/generated/v2/dlp_service.get_stored_info_type.js +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright 2022 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. ** - - - -'use strict'; - -function main(name) { - // [START dlp_v2_generated_DlpService_GetStoredInfoType_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Resource name of the organization and storedInfoType to be read, for - * example `organizations/433245324/storedInfoTypes/432452342` or - * projects/project-id/storedInfoTypes/432452342. - */ - // const name = 'abc123' - - // Imports the Dlp library - const {DlpServiceClient} = require('@google-cloud/dlp').v2; - - // Instantiates a client - const dlpClient = new DlpServiceClient(); - - async function callGetStoredInfoType() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await dlpClient.getStoredInfoType(request); - console.log(response); - } - - callGetStoredInfoType(); - // [END dlp_v2_generated_DlpService_GetStoredInfoType_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v2/samples/generated/v2/dlp_service.hybrid_inspect_dlp_job.js b/owl-bot-staging/v2/samples/generated/v2/dlp_service.hybrid_inspect_dlp_job.js deleted file mode 100644 index 6c1922f2..00000000 --- a/owl-bot-staging/v2/samples/generated/v2/dlp_service.hybrid_inspect_dlp_job.js +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright 2022 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. ** - - - -'use strict'; - -function main(name) { - // [START dlp_v2_generated_DlpService_HybridInspectDlpJob_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Resource name of the job to execute a hybrid inspect on, for example - * `projects/dlp-test-project/dlpJob/53234423`. - */ - // const name = 'abc123' - /** - * The item to inspect. - */ - // const hybridItem = {} - - // Imports the Dlp library - const {DlpServiceClient} = require('@google-cloud/dlp').v2; - - // Instantiates a client - const dlpClient = new DlpServiceClient(); - - async function callHybridInspectDlpJob() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await dlpClient.hybridInspectDlpJob(request); - console.log(response); - } - - callHybridInspectDlpJob(); - // [END dlp_v2_generated_DlpService_HybridInspectDlpJob_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v2/samples/generated/v2/dlp_service.hybrid_inspect_job_trigger.js b/owl-bot-staging/v2/samples/generated/v2/dlp_service.hybrid_inspect_job_trigger.js deleted file mode 100644 index b2c73438..00000000 --- a/owl-bot-staging/v2/samples/generated/v2/dlp_service.hybrid_inspect_job_trigger.js +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright 2022 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. ** - - - -'use strict'; - -function main(name) { - // [START dlp_v2_generated_DlpService_HybridInspectJobTrigger_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Resource name of the trigger to execute a hybrid inspect on, for example - * `projects/dlp-test-project/jobTriggers/53234423`. - */ - // const name = 'abc123' - /** - * The item to inspect. - */ - // const hybridItem = {} - - // Imports the Dlp library - const {DlpServiceClient} = require('@google-cloud/dlp').v2; - - // Instantiates a client - const dlpClient = new DlpServiceClient(); - - async function callHybridInspectJobTrigger() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await dlpClient.hybridInspectJobTrigger(request); - console.log(response); - } - - callHybridInspectJobTrigger(); - // [END dlp_v2_generated_DlpService_HybridInspectJobTrigger_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v2/samples/generated/v2/dlp_service.inspect_content.js b/owl-bot-staging/v2/samples/generated/v2/dlp_service.inspect_content.js deleted file mode 100644 index 5d86ed26..00000000 --- a/owl-bot-staging/v2/samples/generated/v2/dlp_service.inspect_content.js +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright 2022 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. ** - - - -'use strict'; - -function main() { - // [START dlp_v2_generated_DlpService_InspectContent_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Parent resource name. - * The format of this value varies depending on whether you have specified a - * processing - * location (https://cloud.google.com/dlp/docs/specifying-location): - * + Projects scope, location specified:
- * `projects/`PROJECT_ID`/locations/`LOCATION_ID - * + Projects scope, no location specified (defaults to global):
- * `projects/`PROJECT_ID - * The following example `parent` string specifies a parent project with the - * identifier `example-project`, and specifies the `europe-west3` location - * for processing data: - * parent=projects/example-project/locations/europe-west3 - */ - // const parent = 'abc123' - /** - * Configuration for the inspector. What specified here will override - * the template referenced by the inspect_template_name argument. - */ - // const inspectConfig = {} - /** - * The item to inspect. - */ - // const item = {} - /** - * Template to use. Any configuration directly specified in - * inspect_config will override those set in the template. Singular fields - * that are set in this request will replace their corresponding fields in the - * template. Repeated fields are appended. Singular sub-messages and groups - * are recursively merged. - */ - // const inspectTemplateName = 'abc123' - - // Imports the Dlp library - const {DlpServiceClient} = require('@google-cloud/dlp').v2; - - // Instantiates a client - const dlpClient = new DlpServiceClient(); - - async function callInspectContent() { - // Construct request - const request = { - }; - - // Run request - const response = await dlpClient.inspectContent(request); - console.log(response); - } - - callInspectContent(); - // [END dlp_v2_generated_DlpService_InspectContent_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v2/samples/generated/v2/dlp_service.list_deidentify_templates.js b/owl-bot-staging/v2/samples/generated/v2/dlp_service.list_deidentify_templates.js deleted file mode 100644 index 96f34d66..00000000 --- a/owl-bot-staging/v2/samples/generated/v2/dlp_service.list_deidentify_templates.js +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright 2022 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. ** - - - -'use strict'; - -function main(parent) { - // [START dlp_v2_generated_DlpService_ListDeidentifyTemplates_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Parent resource name. - * The format of this value varies depending on the scope of the request - * (project or organization) and whether you have specified a processing - * location (https://cloud.google.com/dlp/docs/specifying-location): - * + Projects scope, location specified:
- * `projects/`PROJECT_ID`/locations/`LOCATION_ID - * + Projects scope, no location specified (defaults to global):
- * `projects/`PROJECT_ID - * + Organizations scope, location specified:
- * `organizations/`ORG_ID`/locations/`LOCATION_ID - * + Organizations scope, no location specified (defaults to global):
- * `organizations/`ORG_ID - * The following example `parent` string specifies a parent project with the - * identifier `example-project`, and specifies the `europe-west3` location - * for processing data: - * parent=projects/example-project/locations/europe-west3 - */ - // const parent = 'abc123' - /** - * Page token to continue retrieval. Comes from previous call - * to `ListDeidentifyTemplates`. - */ - // const pageToken = 'abc123' - /** - * Size of the page, can be limited by server. If zero server returns - * a page of max size 100. - */ - // const pageSize = 1234 - /** - * 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. - */ - // const orderBy = 'abc123' - - // Imports the Dlp library - const {DlpServiceClient} = require('@google-cloud/dlp').v2; - - // Instantiates a client - const dlpClient = new DlpServiceClient(); - - async function callListDeidentifyTemplates() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = await dlpClient.listDeidentifyTemplatesAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListDeidentifyTemplates(); - // [END dlp_v2_generated_DlpService_ListDeidentifyTemplates_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v2/samples/generated/v2/dlp_service.list_dlp_jobs.js b/owl-bot-staging/v2/samples/generated/v2/dlp_service.list_dlp_jobs.js deleted file mode 100644 index b36ccbb1..00000000 --- a/owl-bot-staging/v2/samples/generated/v2/dlp_service.list_dlp_jobs.js +++ /dev/null @@ -1,122 +0,0 @@ -// Copyright 2022 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. ** - - - -'use strict'; - -function main(parent) { - // [START dlp_v2_generated_DlpService_ListDlpJobs_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Parent resource name. - * The format of this value varies depending on whether you have specified a - * processing - * location (https://cloud.google.com/dlp/docs/specifying-location): - * + Projects scope, location specified:
- * `projects/`PROJECT_ID`/locations/`LOCATION_ID - * + Projects scope, no location specified (defaults to global):
- * `projects/`PROJECT_ID - * The following example `parent` string specifies a parent project with the - * identifier `example-project`, and specifies the `europe-west3` location - * for processing data: - * parent=projects/example-project/locations/europe-west3 - */ - // const parent = 'abc123' - /** - * 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. - */ - // const filter = 'abc123' - /** - * The standard list page size. - */ - // const pageSize = 1234 - /** - * The standard list page token. - */ - // const pageToken = 'abc123' - /** - * The type of job. Defaults to `DlpJobType.INSPECT` - */ - // const type = {} - /** - * 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` - */ - // const orderBy = 'abc123' - - // Imports the Dlp library - const {DlpServiceClient} = require('@google-cloud/dlp').v2; - - // Instantiates a client - const dlpClient = new DlpServiceClient(); - - async function callListDlpJobs() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = await dlpClient.listDlpJobsAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListDlpJobs(); - // [END dlp_v2_generated_DlpService_ListDlpJobs_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v2/samples/generated/v2/dlp_service.list_info_types.js b/owl-bot-staging/v2/samples/generated/v2/dlp_service.list_info_types.js deleted file mode 100644 index 81ca34da..00000000 --- a/owl-bot-staging/v2/samples/generated/v2/dlp_service.list_info_types.js +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright 2022 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. ** - - - -'use strict'; - -function main() { - // [START dlp_v2_generated_DlpService_ListInfoTypes_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * The parent resource name. - * The format of this value is as follows: - * locations/LOCATION_ID - */ - // const parent = 'abc123' - /** - * BCP-47 language code for localized infoType friendly - * names. If omitted, or if localized strings are not available, - * en-US strings will be returned. - */ - // const languageCode = 'abc123' - /** - * filter to only return infoTypes supported by certain parts of the - * API. Defaults to supported_by=INSPECT. - */ - // const filter = 'abc123' - - // Imports the Dlp library - const {DlpServiceClient} = require('@google-cloud/dlp').v2; - - // Instantiates a client - const dlpClient = new DlpServiceClient(); - - async function callListInfoTypes() { - // Construct request - const request = { - }; - - // Run request - const response = await dlpClient.listInfoTypes(request); - console.log(response); - } - - callListInfoTypes(); - // [END dlp_v2_generated_DlpService_ListInfoTypes_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v2/samples/generated/v2/dlp_service.list_inspect_templates.js b/owl-bot-staging/v2/samples/generated/v2/dlp_service.list_inspect_templates.js deleted file mode 100644 index 7ce4eaae..00000000 --- a/owl-bot-staging/v2/samples/generated/v2/dlp_service.list_inspect_templates.js +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright 2022 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. ** - - - -'use strict'; - -function main(parent) { - // [START dlp_v2_generated_DlpService_ListInspectTemplates_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Parent resource name. - * The format of this value varies depending on the scope of the request - * (project or organization) and whether you have specified a processing - * location (https://cloud.google.com/dlp/docs/specifying-location): - * + Projects scope, location specified:
- * `projects/`PROJECT_ID`/locations/`LOCATION_ID - * + Projects scope, no location specified (defaults to global):
- * `projects/`PROJECT_ID - * + Organizations scope, location specified:
- * `organizations/`ORG_ID`/locations/`LOCATION_ID - * + Organizations scope, no location specified (defaults to global):
- * `organizations/`ORG_ID - * The following example `parent` string specifies a parent project with the - * identifier `example-project`, and specifies the `europe-west3` location - * for processing data: - * parent=projects/example-project/locations/europe-west3 - */ - // const parent = 'abc123' - /** - * Page token to continue retrieval. Comes from previous call - * to `ListInspectTemplates`. - */ - // const pageToken = 'abc123' - /** - * Size of the page, can be limited by server. If zero server returns - * a page of max size 100. - */ - // const pageSize = 1234 - /** - * 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. - */ - // const orderBy = 'abc123' - - // Imports the Dlp library - const {DlpServiceClient} = require('@google-cloud/dlp').v2; - - // Instantiates a client - const dlpClient = new DlpServiceClient(); - - async function callListInspectTemplates() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = await dlpClient.listInspectTemplatesAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListInspectTemplates(); - // [END dlp_v2_generated_DlpService_ListInspectTemplates_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v2/samples/generated/v2/dlp_service.list_job_triggers.js b/owl-bot-staging/v2/samples/generated/v2/dlp_service.list_job_triggers.js deleted file mode 100644 index 353618f6..00000000 --- a/owl-bot-staging/v2/samples/generated/v2/dlp_service.list_job_triggers.js +++ /dev/null @@ -1,122 +0,0 @@ -// Copyright 2022 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. ** - - - -'use strict'; - -function main(parent) { - // [START dlp_v2_generated_DlpService_ListJobTriggers_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Parent resource name. - * The format of this value varies depending on whether you have specified a - * processing - * location (https://cloud.google.com/dlp/docs/specifying-location): - * + Projects scope, location specified:
- * `projects/`PROJECT_ID`/locations/`LOCATION_ID - * + Projects scope, no location specified (defaults to global):
- * `projects/`PROJECT_ID - * The following example `parent` string specifies a parent project with the - * identifier `example-project`, and specifies the `europe-west3` location - * for processing data: - * parent=projects/example-project/locations/europe-west3 - */ - // const parent = 'abc123' - /** - * Page token to continue retrieval. Comes from previous call - * to ListJobTriggers. `order_by` field must not - * change for subsequent calls. - */ - // const pageToken = 'abc123' - /** - * Size of the page, can be limited by a server. - */ - // const pageSize = 1234 - /** - * 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. - */ - // const orderBy = 'abc123' - /** - * 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 triggers: - * - `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. - */ - // const filter = 'abc123' - /** - * The type of jobs. Will use `DlpJobType.INSPECT` if not set. - */ - // const type = {} - - // Imports the Dlp library - const {DlpServiceClient} = require('@google-cloud/dlp').v2; - - // Instantiates a client - const dlpClient = new DlpServiceClient(); - - async function callListJobTriggers() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = await dlpClient.listJobTriggersAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListJobTriggers(); - // [END dlp_v2_generated_DlpService_ListJobTriggers_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v2/samples/generated/v2/dlp_service.list_stored_info_types.js b/owl-bot-staging/v2/samples/generated/v2/dlp_service.list_stored_info_types.js deleted file mode 100644 index 83719ffb..00000000 --- a/owl-bot-staging/v2/samples/generated/v2/dlp_service.list_stored_info_types.js +++ /dev/null @@ -1,99 +0,0 @@ -// Copyright 2022 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. ** - - - -'use strict'; - -function main(parent) { - // [START dlp_v2_generated_DlpService_ListStoredInfoTypes_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Parent resource name. - * The format of this value varies depending on the scope of the request - * (project or organization) and whether you have specified a processing - * location (https://cloud.google.com/dlp/docs/specifying-location): - * + Projects scope, location specified:
- * `projects/`PROJECT_ID`/locations/`LOCATION_ID - * + Projects scope, no location specified (defaults to global):
- * `projects/`PROJECT_ID - * + Organizations scope, location specified:
- * `organizations/`ORG_ID`/locations/`LOCATION_ID - * + Organizations scope, no location specified (defaults to global):
- * `organizations/`ORG_ID - * The following example `parent` string specifies a parent project with the - * identifier `example-project`, and specifies the `europe-west3` location - * for processing data: - * parent=projects/example-project/locations/europe-west3 - */ - // const parent = 'abc123' - /** - * Page token to continue retrieval. Comes from previous call - * to `ListStoredInfoTypes`. - */ - // const pageToken = 'abc123' - /** - * Size of the page, can be limited by server. If zero server returns - * a page of max size 100. - */ - // const pageSize = 1234 - /** - * 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. - */ - // const orderBy = 'abc123' - - // Imports the Dlp library - const {DlpServiceClient} = require('@google-cloud/dlp').v2; - - // Instantiates a client - const dlpClient = new DlpServiceClient(); - - async function callListStoredInfoTypes() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = await dlpClient.listStoredInfoTypesAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListStoredInfoTypes(); - // [END dlp_v2_generated_DlpService_ListStoredInfoTypes_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v2/samples/generated/v2/dlp_service.redact_image.js b/owl-bot-staging/v2/samples/generated/v2/dlp_service.redact_image.js deleted file mode 100644 index a52edf70..00000000 --- a/owl-bot-staging/v2/samples/generated/v2/dlp_service.redact_image.js +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright 2022 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. ** - - - -'use strict'; - -function main() { - // [START dlp_v2_generated_DlpService_RedactImage_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Parent resource name. - * The format of this value varies depending on whether you have specified a - * processing - * location (https://cloud.google.com/dlp/docs/specifying-location): - * + Projects scope, location specified:
- * `projects/`PROJECT_ID`/locations/`LOCATION_ID - * + Projects scope, no location specified (defaults to global):
- * `projects/`PROJECT_ID - * The following example `parent` string specifies a parent project with the - * identifier `example-project`, and specifies the `europe-west3` location - * for processing data: - * parent=projects/example-project/locations/europe-west3 - */ - // const parent = 'abc123' - /** - * Configuration for the inspector. - */ - // const inspectConfig = {} - /** - * The configuration for specifying what content to redact from images. - */ - // const imageRedactionConfigs = 1234 - /** - * Whether the response should include findings along with the redacted - * image. - */ - // const includeFindings = true - /** - * The content must be PNG, JPEG, SVG or BMP. - */ - // const byteItem = {} - - // Imports the Dlp library - const {DlpServiceClient} = require('@google-cloud/dlp').v2; - - // Instantiates a client - const dlpClient = new DlpServiceClient(); - - async function callRedactImage() { - // Construct request - const request = { - }; - - // Run request - const response = await dlpClient.redactImage(request); - console.log(response); - } - - callRedactImage(); - // [END dlp_v2_generated_DlpService_RedactImage_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v2/samples/generated/v2/dlp_service.reidentify_content.js b/owl-bot-staging/v2/samples/generated/v2/dlp_service.reidentify_content.js deleted file mode 100644 index a6889f0b..00000000 --- a/owl-bot-staging/v2/samples/generated/v2/dlp_service.reidentify_content.js +++ /dev/null @@ -1,107 +0,0 @@ -// Copyright 2022 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. ** - - - -'use strict'; - -function main(parent) { - // [START dlp_v2_generated_DlpService_ReidentifyContent_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Parent resource name. - * The format of this value varies depending on whether you have specified a - * processing - * location (https://cloud.google.com/dlp/docs/specifying-location): - * + Projects scope, location specified:
- * `projects/`PROJECT_ID`/locations/`LOCATION_ID - * + Projects scope, no location specified (defaults to global):
- * `projects/`PROJECT_ID - * The following example `parent` string specifies a parent project with the - * identifier `example-project`, and specifies the `europe-west3` location - * for processing data: - * parent=projects/example-project/locations/europe-west3 - */ - // const parent = 'abc123' - /** - * Configuration for the 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` - */ - // const reidentifyConfig = {} - /** - * Configuration for the inspector. - */ - // const inspectConfig = {} - /** - * The item to re-identify. Will be treated as text. - */ - // const item = {} - /** - * Template to use. Any configuration directly specified in - * `inspect_config` will override those set in the template. Singular fields - * that are set in this request will replace their corresponding fields in the - * template. Repeated fields are appended. Singular sub-messages and groups - * are recursively merged. - */ - // const inspectTemplateName = 'abc123' - /** - * Template to use. References an instance of `DeidentifyTemplate`. - * Any configuration directly specified in `reidentify_config` or - * `inspect_config` will override those set in the template. The - * `DeidentifyTemplate` used must include only reversible transformations. - * Singular fields that are set in this request will replace their - * corresponding fields in the template. Repeated fields are appended. - * Singular sub-messages and groups are recursively merged. - */ - // const reidentifyTemplateName = 'abc123' - - // Imports the Dlp library - const {DlpServiceClient} = require('@google-cloud/dlp').v2; - - // Instantiates a client - const dlpClient = new DlpServiceClient(); - - async function callReidentifyContent() { - // Construct request - const request = { - parent, - }; - - // Run request - const response = await dlpClient.reidentifyContent(request); - console.log(response); - } - - callReidentifyContent(); - // [END dlp_v2_generated_DlpService_ReidentifyContent_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v2/samples/generated/v2/dlp_service.update_deidentify_template.js b/owl-bot-staging/v2/samples/generated/v2/dlp_service.update_deidentify_template.js deleted file mode 100644 index a873150e..00000000 --- a/owl-bot-staging/v2/samples/generated/v2/dlp_service.update_deidentify_template.js +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright 2022 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. ** - - - -'use strict'; - -function main(name) { - // [START dlp_v2_generated_DlpService_UpdateDeidentifyTemplate_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Resource name of organization and deidentify template to be updated, for - * example `organizations/433245324/deidentifyTemplates/432452342` or - * projects/project-id/deidentifyTemplates/432452342. - */ - // const name = 'abc123' - /** - * New DeidentifyTemplate value. - */ - // const deidentifyTemplate = {} - /** - * Mask to control which fields get updated. - */ - // const updateMask = {} - - // Imports the Dlp library - const {DlpServiceClient} = require('@google-cloud/dlp').v2; - - // Instantiates a client - const dlpClient = new DlpServiceClient(); - - async function callUpdateDeidentifyTemplate() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await dlpClient.updateDeidentifyTemplate(request); - console.log(response); - } - - callUpdateDeidentifyTemplate(); - // [END dlp_v2_generated_DlpService_UpdateDeidentifyTemplate_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v2/samples/generated/v2/dlp_service.update_inspect_template.js b/owl-bot-staging/v2/samples/generated/v2/dlp_service.update_inspect_template.js deleted file mode 100644 index c3ec03a7..00000000 --- a/owl-bot-staging/v2/samples/generated/v2/dlp_service.update_inspect_template.js +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright 2022 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. ** - - - -'use strict'; - -function main(name) { - // [START dlp_v2_generated_DlpService_UpdateInspectTemplate_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Resource name of organization and inspectTemplate to be updated, for - * example `organizations/433245324/inspectTemplates/432452342` or - * projects/project-id/inspectTemplates/432452342. - */ - // const name = 'abc123' - /** - * New InspectTemplate value. - */ - // const inspectTemplate = {} - /** - * Mask to control which fields get updated. - */ - // const updateMask = {} - - // Imports the Dlp library - const {DlpServiceClient} = require('@google-cloud/dlp').v2; - - // Instantiates a client - const dlpClient = new DlpServiceClient(); - - async function callUpdateInspectTemplate() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await dlpClient.updateInspectTemplate(request); - console.log(response); - } - - callUpdateInspectTemplate(); - // [END dlp_v2_generated_DlpService_UpdateInspectTemplate_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v2/samples/generated/v2/dlp_service.update_job_trigger.js b/owl-bot-staging/v2/samples/generated/v2/dlp_service.update_job_trigger.js deleted file mode 100644 index fc1a0a72..00000000 --- a/owl-bot-staging/v2/samples/generated/v2/dlp_service.update_job_trigger.js +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2022 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. ** - - - -'use strict'; - -function main(name) { - // [START dlp_v2_generated_DlpService_UpdateJobTrigger_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Resource name of the project and the triggeredJob, for example - * `projects/dlp-test-project/jobTriggers/53234423`. - */ - // const name = 'abc123' - /** - * New JobTrigger value. - */ - // const jobTrigger = {} - /** - * Mask to control which fields get updated. - */ - // const updateMask = {} - - // Imports the Dlp library - const {DlpServiceClient} = require('@google-cloud/dlp').v2; - - // Instantiates a client - const dlpClient = new DlpServiceClient(); - - async function callUpdateJobTrigger() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await dlpClient.updateJobTrigger(request); - console.log(response); - } - - callUpdateJobTrigger(); - // [END dlp_v2_generated_DlpService_UpdateJobTrigger_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v2/samples/generated/v2/dlp_service.update_stored_info_type.js b/owl-bot-staging/v2/samples/generated/v2/dlp_service.update_stored_info_type.js deleted file mode 100644 index fd011481..00000000 --- a/owl-bot-staging/v2/samples/generated/v2/dlp_service.update_stored_info_type.js +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright 2022 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. ** - - - -'use strict'; - -function main(name) { - // [START dlp_v2_generated_DlpService_UpdateStoredInfoType_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Resource name of organization and storedInfoType to be updated, for - * example `organizations/433245324/storedInfoTypes/432452342` or - * projects/project-id/storedInfoTypes/432452342. - */ - // const name = 'abc123' - /** - * Updated configuration for the storedInfoType. If not provided, a new - * version of the storedInfoType will be created with the existing - * configuration. - */ - // const config = {} - /** - * Mask to control which fields get updated. - */ - // const updateMask = {} - - // Imports the Dlp library - const {DlpServiceClient} = require('@google-cloud/dlp').v2; - - // Instantiates a client - const dlpClient = new DlpServiceClient(); - - async function callUpdateStoredInfoType() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await dlpClient.updateStoredInfoType(request); - console.log(response); - } - - callUpdateStoredInfoType(); - // [END dlp_v2_generated_DlpService_UpdateStoredInfoType_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v2/samples/generated/v2/snippet_metadata.google.privacy.dlp.v2.json b/owl-bot-staging/v2/samples/generated/v2/snippet_metadata.google.privacy.dlp.v2.json deleted file mode 100644 index ee897ad8..00000000 --- a/owl-bot-staging/v2/samples/generated/v2/snippet_metadata.google.privacy.dlp.v2.json +++ /dev/null @@ -1,1671 +0,0 @@ -{ - "clientLibrary": { - "name": "nodejs-dlp", - "version": "0.1.0", - "language": "TYPESCRIPT", - "apis": [ - { - "id": "google.privacy.dlp.v2", - "version": "v2" - } - ] - }, - "snippets": [ - { - "regionTag": "dlp_v2_generated_DlpService_InspectContent_async", - "title": "DlpService inspectContent Sample", - "origin": "API_DEFINITION", - "description": " 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,", - "canonical": true, - "file": "dlp_service.inspect_content.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 77, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "InspectContent", - "fullName": "google.privacy.dlp.v2.DlpService.InspectContent", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "inspect_config", - "type": ".google.privacy.dlp.v2.InspectConfig" - }, - { - "name": "item", - "type": ".google.privacy.dlp.v2.ContentItem" - }, - { - "name": "inspect_template_name", - "type": "TYPE_STRING" - }, - { - "name": "location_id", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.privacy.dlp.v2.InspectContentResponse", - "client": { - "shortName": "DlpServiceClient", - "fullName": "google.privacy.dlp.v2.DlpServiceClient" - }, - "method": { - "shortName": "InspectContent", - "fullName": "google.privacy.dlp.v2.DlpService.InspectContent", - "service": { - "shortName": "DlpService", - "fullName": "google.privacy.dlp.v2.DlpService" - } - } - } - }, - { - "regionTag": "dlp_v2_generated_DlpService_RedactImage_async", - "title": "DlpService redactImage Sample", - "origin": "API_DEFINITION", - "description": " 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.", - "canonical": true, - "file": "dlp_service.redact_image.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 77, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "RedactImage", - "fullName": "google.privacy.dlp.v2.DlpService.RedactImage", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "location_id", - "type": "TYPE_STRING" - }, - { - "name": "inspect_config", - "type": ".google.privacy.dlp.v2.InspectConfig" - }, - { - "name": "image_redaction_configs", - "type": "TYPE_MESSAGE[]" - }, - { - "name": "include_findings", - "type": "TYPE_BOOL" - }, - { - "name": "byte_item", - "type": ".google.privacy.dlp.v2.ByteContentItem" - } - ], - "resultType": ".google.privacy.dlp.v2.RedactImageResponse", - "client": { - "shortName": "DlpServiceClient", - "fullName": "google.privacy.dlp.v2.DlpServiceClient" - }, - "method": { - "shortName": "RedactImage", - "fullName": "google.privacy.dlp.v2.DlpService.RedactImage", - "service": { - "shortName": "DlpService", - "fullName": "google.privacy.dlp.v2.DlpService" - } - } - } - }, - { - "regionTag": "dlp_v2_generated_DlpService_DeidentifyContent_async", - "title": "DlpService deidentifyContent Sample", - "origin": "API_DEFINITION", - "description": " 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.", - "canonical": true, - "file": "dlp_service.deidentify_content.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 92, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeidentifyContent", - "fullName": "google.privacy.dlp.v2.DlpService.DeidentifyContent", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "deidentify_config", - "type": ".google.privacy.dlp.v2.DeidentifyConfig" - }, - { - "name": "inspect_config", - "type": ".google.privacy.dlp.v2.InspectConfig" - }, - { - "name": "item", - "type": ".google.privacy.dlp.v2.ContentItem" - }, - { - "name": "inspect_template_name", - "type": "TYPE_STRING" - }, - { - "name": "deidentify_template_name", - "type": "TYPE_STRING" - }, - { - "name": "location_id", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.privacy.dlp.v2.DeidentifyContentResponse", - "client": { - "shortName": "DlpServiceClient", - "fullName": "google.privacy.dlp.v2.DlpServiceClient" - }, - "method": { - "shortName": "DeidentifyContent", - "fullName": "google.privacy.dlp.v2.DlpService.DeidentifyContent", - "service": { - "shortName": "DlpService", - "fullName": "google.privacy.dlp.v2.DlpService" - } - } - } - }, - { - "regionTag": "dlp_v2_generated_DlpService_ReidentifyContent_async", - "title": "DlpService reidentifyContent Sample", - "origin": "API_DEFINITION", - "description": " 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.", - "canonical": true, - "file": "dlp_service.reidentify_content.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 99, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ReidentifyContent", - "fullName": "google.privacy.dlp.v2.DlpService.ReidentifyContent", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "reidentify_config", - "type": ".google.privacy.dlp.v2.DeidentifyConfig" - }, - { - "name": "inspect_config", - "type": ".google.privacy.dlp.v2.InspectConfig" - }, - { - "name": "item", - "type": ".google.privacy.dlp.v2.ContentItem" - }, - { - "name": "inspect_template_name", - "type": "TYPE_STRING" - }, - { - "name": "reidentify_template_name", - "type": "TYPE_STRING" - }, - { - "name": "location_id", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.privacy.dlp.v2.ReidentifyContentResponse", - "client": { - "shortName": "DlpServiceClient", - "fullName": "google.privacy.dlp.v2.DlpServiceClient" - }, - "method": { - "shortName": "ReidentifyContent", - "fullName": "google.privacy.dlp.v2.DlpService.ReidentifyContent", - "service": { - "shortName": "DlpService", - "fullName": "google.privacy.dlp.v2.DlpService" - } - } - } - }, - { - "regionTag": "dlp_v2_generated_DlpService_ListInfoTypes_async", - "title": "DlpService listInfoTypes Sample", - "origin": "API_DEFINITION", - "description": " 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.", - "canonical": true, - "file": "dlp_service.list_info_types.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 62, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListInfoTypes", - "fullName": "google.privacy.dlp.v2.DlpService.ListInfoTypes", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "language_code", - "type": "TYPE_STRING" - }, - { - "name": "filter", - "type": "TYPE_STRING" - }, - { - "name": "location_id", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.privacy.dlp.v2.ListInfoTypesResponse", - "client": { - "shortName": "DlpServiceClient", - "fullName": "google.privacy.dlp.v2.DlpServiceClient" - }, - "method": { - "shortName": "ListInfoTypes", - "fullName": "google.privacy.dlp.v2.DlpService.ListInfoTypes", - "service": { - "shortName": "DlpService", - "fullName": "google.privacy.dlp.v2.DlpService" - } - } - } - }, - { - "regionTag": "dlp_v2_generated_DlpService_CreateInspectTemplate_async", - "title": "DlpService createInspectTemplate Sample", - "origin": "API_DEFINITION", - "description": " 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.", - "canonical": true, - "file": "dlp_service.create_inspect_template.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 77, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateInspectTemplate", - "fullName": "google.privacy.dlp.v2.DlpService.CreateInspectTemplate", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "inspect_template", - "type": ".google.privacy.dlp.v2.InspectTemplate" - }, - { - "name": "template_id", - "type": "TYPE_STRING" - }, - { - "name": "location_id", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.privacy.dlp.v2.InspectTemplate", - "client": { - "shortName": "DlpServiceClient", - "fullName": "google.privacy.dlp.v2.DlpServiceClient" - }, - "method": { - "shortName": "CreateInspectTemplate", - "fullName": "google.privacy.dlp.v2.DlpService.CreateInspectTemplate", - "service": { - "shortName": "DlpService", - "fullName": "google.privacy.dlp.v2.DlpService" - } - } - } - }, - { - "regionTag": "dlp_v2_generated_DlpService_UpdateInspectTemplate_async", - "title": "DlpService updateInspectTemplate Sample", - "origin": "API_DEFINITION", - "description": " Updates the InspectTemplate. See https://cloud.google.com/dlp/docs/creating-templates to learn more.", - "canonical": true, - "file": "dlp_service.update_inspect_template.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 60, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateInspectTemplate", - "fullName": "google.privacy.dlp.v2.DlpService.UpdateInspectTemplate", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "inspect_template", - "type": ".google.privacy.dlp.v2.InspectTemplate" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.privacy.dlp.v2.InspectTemplate", - "client": { - "shortName": "DlpServiceClient", - "fullName": "google.privacy.dlp.v2.DlpServiceClient" - }, - "method": { - "shortName": "UpdateInspectTemplate", - "fullName": "google.privacy.dlp.v2.DlpService.UpdateInspectTemplate", - "service": { - "shortName": "DlpService", - "fullName": "google.privacy.dlp.v2.DlpService" - } - } - } - }, - { - "regionTag": "dlp_v2_generated_DlpService_GetInspectTemplate_async", - "title": "DlpService getInspectTemplate Sample", - "origin": "API_DEFINITION", - "description": " Gets an InspectTemplate. See https://cloud.google.com/dlp/docs/creating-templates to learn more.", - "canonical": true, - "file": "dlp_service.get_inspect_template.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 52, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetInspectTemplate", - "fullName": "google.privacy.dlp.v2.DlpService.GetInspectTemplate", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.privacy.dlp.v2.InspectTemplate", - "client": { - "shortName": "DlpServiceClient", - "fullName": "google.privacy.dlp.v2.DlpServiceClient" - }, - "method": { - "shortName": "GetInspectTemplate", - "fullName": "google.privacy.dlp.v2.DlpService.GetInspectTemplate", - "service": { - "shortName": "DlpService", - "fullName": "google.privacy.dlp.v2.DlpService" - } - } - } - }, - { - "regionTag": "dlp_v2_generated_DlpService_ListInspectTemplates_async", - "title": "DlpService listInspectTemplates Sample", - "origin": "API_DEFINITION", - "description": " Lists InspectTemplates. See https://cloud.google.com/dlp/docs/creating-templates to learn more.", - "canonical": true, - "file": "dlp_service.list_inspect_templates.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 90, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListInspectTemplates", - "fullName": "google.privacy.dlp.v2.DlpService.ListInspectTemplates", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "order_by", - "type": "TYPE_STRING" - }, - { - "name": "location_id", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.privacy.dlp.v2.ListInspectTemplatesResponse", - "client": { - "shortName": "DlpServiceClient", - "fullName": "google.privacy.dlp.v2.DlpServiceClient" - }, - "method": { - "shortName": "ListInspectTemplates", - "fullName": "google.privacy.dlp.v2.DlpService.ListInspectTemplates", - "service": { - "shortName": "DlpService", - "fullName": "google.privacy.dlp.v2.DlpService" - } - } - } - }, - { - "regionTag": "dlp_v2_generated_DlpService_DeleteInspectTemplate_async", - "title": "DlpService deleteInspectTemplate Sample", - "origin": "API_DEFINITION", - "description": " Deletes an InspectTemplate. See https://cloud.google.com/dlp/docs/creating-templates to learn more.", - "canonical": true, - "file": "dlp_service.delete_inspect_template.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 52, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteInspectTemplate", - "fullName": "google.privacy.dlp.v2.DlpService.DeleteInspectTemplate", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "DlpServiceClient", - "fullName": "google.privacy.dlp.v2.DlpServiceClient" - }, - "method": { - "shortName": "DeleteInspectTemplate", - "fullName": "google.privacy.dlp.v2.DlpService.DeleteInspectTemplate", - "service": { - "shortName": "DlpService", - "fullName": "google.privacy.dlp.v2.DlpService" - } - } - } - }, - { - "regionTag": "dlp_v2_generated_DlpService_CreateDeidentifyTemplate_async", - "title": "DlpService createDeidentifyTemplate Sample", - "origin": "API_DEFINITION", - "description": " 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.", - "canonical": true, - "file": "dlp_service.create_deidentify_template.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 77, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateDeidentifyTemplate", - "fullName": "google.privacy.dlp.v2.DlpService.CreateDeidentifyTemplate", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "deidentify_template", - "type": ".google.privacy.dlp.v2.DeidentifyTemplate" - }, - { - "name": "template_id", - "type": "TYPE_STRING" - }, - { - "name": "location_id", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.privacy.dlp.v2.DeidentifyTemplate", - "client": { - "shortName": "DlpServiceClient", - "fullName": "google.privacy.dlp.v2.DlpServiceClient" - }, - "method": { - "shortName": "CreateDeidentifyTemplate", - "fullName": "google.privacy.dlp.v2.DlpService.CreateDeidentifyTemplate", - "service": { - "shortName": "DlpService", - "fullName": "google.privacy.dlp.v2.DlpService" - } - } - } - }, - { - "regionTag": "dlp_v2_generated_DlpService_UpdateDeidentifyTemplate_async", - "title": "DlpService updateDeidentifyTemplate Sample", - "origin": "API_DEFINITION", - "description": " Updates the DeidentifyTemplate. See https://cloud.google.com/dlp/docs/creating-templates-deid to learn more.", - "canonical": true, - "file": "dlp_service.update_deidentify_template.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 60, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateDeidentifyTemplate", - "fullName": "google.privacy.dlp.v2.DlpService.UpdateDeidentifyTemplate", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "deidentify_template", - "type": ".google.privacy.dlp.v2.DeidentifyTemplate" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.privacy.dlp.v2.DeidentifyTemplate", - "client": { - "shortName": "DlpServiceClient", - "fullName": "google.privacy.dlp.v2.DlpServiceClient" - }, - "method": { - "shortName": "UpdateDeidentifyTemplate", - "fullName": "google.privacy.dlp.v2.DlpService.UpdateDeidentifyTemplate", - "service": { - "shortName": "DlpService", - "fullName": "google.privacy.dlp.v2.DlpService" - } - } - } - }, - { - "regionTag": "dlp_v2_generated_DlpService_GetDeidentifyTemplate_async", - "title": "DlpService getDeidentifyTemplate Sample", - "origin": "API_DEFINITION", - "description": " Gets a DeidentifyTemplate. See https://cloud.google.com/dlp/docs/creating-templates-deid to learn more.", - "canonical": true, - "file": "dlp_service.get_deidentify_template.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 52, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetDeidentifyTemplate", - "fullName": "google.privacy.dlp.v2.DlpService.GetDeidentifyTemplate", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.privacy.dlp.v2.DeidentifyTemplate", - "client": { - "shortName": "DlpServiceClient", - "fullName": "google.privacy.dlp.v2.DlpServiceClient" - }, - "method": { - "shortName": "GetDeidentifyTemplate", - "fullName": "google.privacy.dlp.v2.DlpService.GetDeidentifyTemplate", - "service": { - "shortName": "DlpService", - "fullName": "google.privacy.dlp.v2.DlpService" - } - } - } - }, - { - "regionTag": "dlp_v2_generated_DlpService_ListDeidentifyTemplates_async", - "title": "DlpService listDeidentifyTemplates Sample", - "origin": "API_DEFINITION", - "description": " Lists DeidentifyTemplates. See https://cloud.google.com/dlp/docs/creating-templates-deid to learn more.", - "canonical": true, - "file": "dlp_service.list_deidentify_templates.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 90, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListDeidentifyTemplates", - "fullName": "google.privacy.dlp.v2.DlpService.ListDeidentifyTemplates", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "order_by", - "type": "TYPE_STRING" - }, - { - "name": "location_id", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.privacy.dlp.v2.ListDeidentifyTemplatesResponse", - "client": { - "shortName": "DlpServiceClient", - "fullName": "google.privacy.dlp.v2.DlpServiceClient" - }, - "method": { - "shortName": "ListDeidentifyTemplates", - "fullName": "google.privacy.dlp.v2.DlpService.ListDeidentifyTemplates", - "service": { - "shortName": "DlpService", - "fullName": "google.privacy.dlp.v2.DlpService" - } - } - } - }, - { - "regionTag": "dlp_v2_generated_DlpService_DeleteDeidentifyTemplate_async", - "title": "DlpService deleteDeidentifyTemplate Sample", - "origin": "API_DEFINITION", - "description": " Deletes a DeidentifyTemplate. See https://cloud.google.com/dlp/docs/creating-templates-deid to learn more.", - "canonical": true, - "file": "dlp_service.delete_deidentify_template.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 52, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteDeidentifyTemplate", - "fullName": "google.privacy.dlp.v2.DlpService.DeleteDeidentifyTemplate", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "DlpServiceClient", - "fullName": "google.privacy.dlp.v2.DlpServiceClient" - }, - "method": { - "shortName": "DeleteDeidentifyTemplate", - "fullName": "google.privacy.dlp.v2.DlpService.DeleteDeidentifyTemplate", - "service": { - "shortName": "DlpService", - "fullName": "google.privacy.dlp.v2.DlpService" - } - } - } - }, - { - "regionTag": "dlp_v2_generated_DlpService_CreateJobTrigger_async", - "title": "DlpService createJobTrigger Sample", - "origin": "API_DEFINITION", - "description": " 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.", - "canonical": true, - "file": "dlp_service.create_job_trigger.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 73, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateJobTrigger", - "fullName": "google.privacy.dlp.v2.DlpService.CreateJobTrigger", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "job_trigger", - "type": ".google.privacy.dlp.v2.JobTrigger" - }, - { - "name": "trigger_id", - "type": "TYPE_STRING" - }, - { - "name": "location_id", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.privacy.dlp.v2.JobTrigger", - "client": { - "shortName": "DlpServiceClient", - "fullName": "google.privacy.dlp.v2.DlpServiceClient" - }, - "method": { - "shortName": "CreateJobTrigger", - "fullName": "google.privacy.dlp.v2.DlpService.CreateJobTrigger", - "service": { - "shortName": "DlpService", - "fullName": "google.privacy.dlp.v2.DlpService" - } - } - } - }, - { - "regionTag": "dlp_v2_generated_DlpService_UpdateJobTrigger_async", - "title": "DlpService updateJobTrigger Sample", - "origin": "API_DEFINITION", - "description": " Updates a job trigger. See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more.", - "canonical": true, - "file": "dlp_service.update_job_trigger.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 59, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateJobTrigger", - "fullName": "google.privacy.dlp.v2.DlpService.UpdateJobTrigger", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "job_trigger", - "type": ".google.privacy.dlp.v2.JobTrigger" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.privacy.dlp.v2.JobTrigger", - "client": { - "shortName": "DlpServiceClient", - "fullName": "google.privacy.dlp.v2.DlpServiceClient" - }, - "method": { - "shortName": "UpdateJobTrigger", - "fullName": "google.privacy.dlp.v2.DlpService.UpdateJobTrigger", - "service": { - "shortName": "DlpService", - "fullName": "google.privacy.dlp.v2.DlpService" - } - } - } - }, - { - "regionTag": "dlp_v2_generated_DlpService_HybridInspectJobTrigger_async", - "title": "DlpService hybridInspectJobTrigger Sample", - "origin": "API_DEFINITION", - "description": " Inspect hybrid content and store findings to a trigger. The inspection will be processed asynchronously. To review the findings monitor the jobs within the trigger.", - "canonical": true, - "file": "dlp_service.hybrid_inspect_job_trigger.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 55, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "HybridInspectJobTrigger", - "fullName": "google.privacy.dlp.v2.DlpService.HybridInspectJobTrigger", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "hybrid_item", - "type": ".google.privacy.dlp.v2.HybridContentItem" - } - ], - "resultType": ".google.privacy.dlp.v2.HybridInspectResponse", - "client": { - "shortName": "DlpServiceClient", - "fullName": "google.privacy.dlp.v2.DlpServiceClient" - }, - "method": { - "shortName": "HybridInspectJobTrigger", - "fullName": "google.privacy.dlp.v2.DlpService.HybridInspectJobTrigger", - "service": { - "shortName": "DlpService", - "fullName": "google.privacy.dlp.v2.DlpService" - } - } - } - }, - { - "regionTag": "dlp_v2_generated_DlpService_GetJobTrigger_async", - "title": "DlpService getJobTrigger Sample", - "origin": "API_DEFINITION", - "description": " Gets a job trigger. See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more.", - "canonical": true, - "file": "dlp_service.get_job_trigger.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 51, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetJobTrigger", - "fullName": "google.privacy.dlp.v2.DlpService.GetJobTrigger", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.privacy.dlp.v2.JobTrigger", - "client": { - "shortName": "DlpServiceClient", - "fullName": "google.privacy.dlp.v2.DlpServiceClient" - }, - "method": { - "shortName": "GetJobTrigger", - "fullName": "google.privacy.dlp.v2.DlpService.GetJobTrigger", - "service": { - "shortName": "DlpService", - "fullName": "google.privacy.dlp.v2.DlpService" - } - } - } - }, - { - "regionTag": "dlp_v2_generated_DlpService_ListJobTriggers_async", - "title": "DlpService listJobTriggers Sample", - "origin": "API_DEFINITION", - "description": " Lists job triggers. See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more.", - "canonical": true, - "file": "dlp_service.list_job_triggers.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 114, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListJobTriggers", - "fullName": "google.privacy.dlp.v2.DlpService.ListJobTriggers", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "order_by", - "type": "TYPE_STRING" - }, - { - "name": "filter", - "type": "TYPE_STRING" - }, - { - "name": "type", - "type": ".google.privacy.dlp.v2.DlpJobType" - }, - { - "name": "location_id", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.privacy.dlp.v2.ListJobTriggersResponse", - "client": { - "shortName": "DlpServiceClient", - "fullName": "google.privacy.dlp.v2.DlpServiceClient" - }, - "method": { - "shortName": "ListJobTriggers", - "fullName": "google.privacy.dlp.v2.DlpService.ListJobTriggers", - "service": { - "shortName": "DlpService", - "fullName": "google.privacy.dlp.v2.DlpService" - } - } - } - }, - { - "regionTag": "dlp_v2_generated_DlpService_DeleteJobTrigger_async", - "title": "DlpService deleteJobTrigger Sample", - "origin": "API_DEFINITION", - "description": " Deletes a job trigger. See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more.", - "canonical": true, - "file": "dlp_service.delete_job_trigger.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 51, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteJobTrigger", - "fullName": "google.privacy.dlp.v2.DlpService.DeleteJobTrigger", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "DlpServiceClient", - "fullName": "google.privacy.dlp.v2.DlpServiceClient" - }, - "method": { - "shortName": "DeleteJobTrigger", - "fullName": "google.privacy.dlp.v2.DlpService.DeleteJobTrigger", - "service": { - "shortName": "DlpService", - "fullName": "google.privacy.dlp.v2.DlpService" - } - } - } - }, - { - "regionTag": "dlp_v2_generated_DlpService_ActivateJobTrigger_async", - "title": "DlpService activateJobTrigger Sample", - "origin": "API_DEFINITION", - "description": " Activate a job trigger. Causes the immediate execute of a trigger instead of waiting on the trigger event to occur.", - "canonical": true, - "file": "dlp_service.activate_job_trigger.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 51, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ActivateJobTrigger", - "fullName": "google.privacy.dlp.v2.DlpService.ActivateJobTrigger", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.privacy.dlp.v2.DlpJob", - "client": { - "shortName": "DlpServiceClient", - "fullName": "google.privacy.dlp.v2.DlpServiceClient" - }, - "method": { - "shortName": "ActivateJobTrigger", - "fullName": "google.privacy.dlp.v2.DlpService.ActivateJobTrigger", - "service": { - "shortName": "DlpService", - "fullName": "google.privacy.dlp.v2.DlpService" - } - } - } - }, - { - "regionTag": "dlp_v2_generated_DlpService_CreateDlpJob_async", - "title": "DlpService createDlpJob Sample", - "origin": "API_DEFINITION", - "description": " 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.", - "canonical": true, - "file": "dlp_service.create_dlp_job.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 77, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateDlpJob", - "fullName": "google.privacy.dlp.v2.DlpService.CreateDlpJob", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "inspect_job", - "type": ".google.privacy.dlp.v2.InspectJobConfig" - }, - { - "name": "risk_job", - "type": ".google.privacy.dlp.v2.RiskAnalysisJobConfig" - }, - { - "name": "job_id", - "type": "TYPE_STRING" - }, - { - "name": "location_id", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.privacy.dlp.v2.DlpJob", - "client": { - "shortName": "DlpServiceClient", - "fullName": "google.privacy.dlp.v2.DlpServiceClient" - }, - "method": { - "shortName": "CreateDlpJob", - "fullName": "google.privacy.dlp.v2.DlpService.CreateDlpJob", - "service": { - "shortName": "DlpService", - "fullName": "google.privacy.dlp.v2.DlpService" - } - } - } - }, - { - "regionTag": "dlp_v2_generated_DlpService_ListDlpJobs_async", - "title": "DlpService listDlpJobs Sample", - "origin": "API_DEFINITION", - "description": " 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.", - "canonical": true, - "file": "dlp_service.list_dlp_jobs.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 114, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListDlpJobs", - "fullName": "google.privacy.dlp.v2.DlpService.ListDlpJobs", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "filter", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - }, - { - "name": "type", - "type": ".google.privacy.dlp.v2.DlpJobType" - }, - { - "name": "order_by", - "type": "TYPE_STRING" - }, - { - "name": "location_id", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.privacy.dlp.v2.ListDlpJobsResponse", - "client": { - "shortName": "DlpServiceClient", - "fullName": "google.privacy.dlp.v2.DlpServiceClient" - }, - "method": { - "shortName": "ListDlpJobs", - "fullName": "google.privacy.dlp.v2.DlpService.ListDlpJobs", - "service": { - "shortName": "DlpService", - "fullName": "google.privacy.dlp.v2.DlpService" - } - } - } - }, - { - "regionTag": "dlp_v2_generated_DlpService_GetDlpJob_async", - "title": "DlpService getDlpJob Sample", - "origin": "API_DEFINITION", - "description": " 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.", - "canonical": true, - "file": "dlp_service.get_dlp_job.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 50, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetDlpJob", - "fullName": "google.privacy.dlp.v2.DlpService.GetDlpJob", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.privacy.dlp.v2.DlpJob", - "client": { - "shortName": "DlpServiceClient", - "fullName": "google.privacy.dlp.v2.DlpServiceClient" - }, - "method": { - "shortName": "GetDlpJob", - "fullName": "google.privacy.dlp.v2.DlpService.GetDlpJob", - "service": { - "shortName": "DlpService", - "fullName": "google.privacy.dlp.v2.DlpService" - } - } - } - }, - { - "regionTag": "dlp_v2_generated_DlpService_DeleteDlpJob_async", - "title": "DlpService deleteDlpJob Sample", - "origin": "API_DEFINITION", - "description": " 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.", - "canonical": true, - "file": "dlp_service.delete_dlp_job.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 50, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteDlpJob", - "fullName": "google.privacy.dlp.v2.DlpService.DeleteDlpJob", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "DlpServiceClient", - "fullName": "google.privacy.dlp.v2.DlpServiceClient" - }, - "method": { - "shortName": "DeleteDlpJob", - "fullName": "google.privacy.dlp.v2.DlpService.DeleteDlpJob", - "service": { - "shortName": "DlpService", - "fullName": "google.privacy.dlp.v2.DlpService" - } - } - } - }, - { - "regionTag": "dlp_v2_generated_DlpService_CancelDlpJob_async", - "title": "DlpService cancelDlpJob Sample", - "origin": "API_DEFINITION", - "description": " 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.", - "canonical": true, - "file": "dlp_service.cancel_dlp_job.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 50, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CancelDlpJob", - "fullName": "google.privacy.dlp.v2.DlpService.CancelDlpJob", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "DlpServiceClient", - "fullName": "google.privacy.dlp.v2.DlpServiceClient" - }, - "method": { - "shortName": "CancelDlpJob", - "fullName": "google.privacy.dlp.v2.DlpService.CancelDlpJob", - "service": { - "shortName": "DlpService", - "fullName": "google.privacy.dlp.v2.DlpService" - } - } - } - }, - { - "regionTag": "dlp_v2_generated_DlpService_CreateStoredInfoType_async", - "title": "DlpService createStoredInfoType Sample", - "origin": "API_DEFINITION", - "description": " Creates a pre-built stored infoType to be used for inspection. See https://cloud.google.com/dlp/docs/creating-stored-infotypes to learn more.", - "canonical": true, - "file": "dlp_service.create_stored_info_type.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 77, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateStoredInfoType", - "fullName": "google.privacy.dlp.v2.DlpService.CreateStoredInfoType", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "config", - "type": ".google.privacy.dlp.v2.StoredInfoTypeConfig" - }, - { - "name": "stored_info_type_id", - "type": "TYPE_STRING" - }, - { - "name": "location_id", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.privacy.dlp.v2.StoredInfoType", - "client": { - "shortName": "DlpServiceClient", - "fullName": "google.privacy.dlp.v2.DlpServiceClient" - }, - "method": { - "shortName": "CreateStoredInfoType", - "fullName": "google.privacy.dlp.v2.DlpService.CreateStoredInfoType", - "service": { - "shortName": "DlpService", - "fullName": "google.privacy.dlp.v2.DlpService" - } - } - } - }, - { - "regionTag": "dlp_v2_generated_DlpService_UpdateStoredInfoType_async", - "title": "DlpService updateStoredInfoType Sample", - "origin": "API_DEFINITION", - "description": " 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.", - "canonical": true, - "file": "dlp_service.update_stored_info_type.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 62, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateStoredInfoType", - "fullName": "google.privacy.dlp.v2.DlpService.UpdateStoredInfoType", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "config", - "type": ".google.privacy.dlp.v2.StoredInfoTypeConfig" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.privacy.dlp.v2.StoredInfoType", - "client": { - "shortName": "DlpServiceClient", - "fullName": "google.privacy.dlp.v2.DlpServiceClient" - }, - "method": { - "shortName": "UpdateStoredInfoType", - "fullName": "google.privacy.dlp.v2.DlpService.UpdateStoredInfoType", - "service": { - "shortName": "DlpService", - "fullName": "google.privacy.dlp.v2.DlpService" - } - } - } - }, - { - "regionTag": "dlp_v2_generated_DlpService_GetStoredInfoType_async", - "title": "DlpService getStoredInfoType Sample", - "origin": "API_DEFINITION", - "description": " Gets a stored infoType. See https://cloud.google.com/dlp/docs/creating-stored-infotypes to learn more.", - "canonical": true, - "file": "dlp_service.get_stored_info_type.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 52, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetStoredInfoType", - "fullName": "google.privacy.dlp.v2.DlpService.GetStoredInfoType", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.privacy.dlp.v2.StoredInfoType", - "client": { - "shortName": "DlpServiceClient", - "fullName": "google.privacy.dlp.v2.DlpServiceClient" - }, - "method": { - "shortName": "GetStoredInfoType", - "fullName": "google.privacy.dlp.v2.DlpService.GetStoredInfoType", - "service": { - "shortName": "DlpService", - "fullName": "google.privacy.dlp.v2.DlpService" - } - } - } - }, - { - "regionTag": "dlp_v2_generated_DlpService_ListStoredInfoTypes_async", - "title": "DlpService listStoredInfoTypes Sample", - "origin": "API_DEFINITION", - "description": " Lists stored infoTypes. See https://cloud.google.com/dlp/docs/creating-stored-infotypes to learn more.", - "canonical": true, - "file": "dlp_service.list_stored_info_types.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 91, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListStoredInfoTypes", - "fullName": "google.privacy.dlp.v2.DlpService.ListStoredInfoTypes", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "order_by", - "type": "TYPE_STRING" - }, - { - "name": "location_id", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.privacy.dlp.v2.ListStoredInfoTypesResponse", - "client": { - "shortName": "DlpServiceClient", - "fullName": "google.privacy.dlp.v2.DlpServiceClient" - }, - "method": { - "shortName": "ListStoredInfoTypes", - "fullName": "google.privacy.dlp.v2.DlpService.ListStoredInfoTypes", - "service": { - "shortName": "DlpService", - "fullName": "google.privacy.dlp.v2.DlpService" - } - } - } - }, - { - "regionTag": "dlp_v2_generated_DlpService_DeleteStoredInfoType_async", - "title": "DlpService deleteStoredInfoType Sample", - "origin": "API_DEFINITION", - "description": " Deletes a stored infoType. See https://cloud.google.com/dlp/docs/creating-stored-infotypes to learn more.", - "canonical": true, - "file": "dlp_service.delete_stored_info_type.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 52, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteStoredInfoType", - "fullName": "google.privacy.dlp.v2.DlpService.DeleteStoredInfoType", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "DlpServiceClient", - "fullName": "google.privacy.dlp.v2.DlpServiceClient" - }, - "method": { - "shortName": "DeleteStoredInfoType", - "fullName": "google.privacy.dlp.v2.DlpService.DeleteStoredInfoType", - "service": { - "shortName": "DlpService", - "fullName": "google.privacy.dlp.v2.DlpService" - } - } - } - }, - { - "regionTag": "dlp_v2_generated_DlpService_HybridInspectDlpJob_async", - "title": "DlpService hybridInspectDlpJob Sample", - "origin": "API_DEFINITION", - "description": " Inspect hybrid content and store findings to a job. To review the findings, inspect the job. Inspection will occur asynchronously.", - "canonical": true, - "file": "dlp_service.hybrid_inspect_dlp_job.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 55, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "HybridInspectDlpJob", - "fullName": "google.privacy.dlp.v2.DlpService.HybridInspectDlpJob", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "hybrid_item", - "type": ".google.privacy.dlp.v2.HybridContentItem" - } - ], - "resultType": ".google.privacy.dlp.v2.HybridInspectResponse", - "client": { - "shortName": "DlpServiceClient", - "fullName": "google.privacy.dlp.v2.DlpServiceClient" - }, - "method": { - "shortName": "HybridInspectDlpJob", - "fullName": "google.privacy.dlp.v2.DlpService.HybridInspectDlpJob", - "service": { - "shortName": "DlpService", - "fullName": "google.privacy.dlp.v2.DlpService" - } - } - } - }, - { - "regionTag": "dlp_v2_generated_DlpService_FinishDlpJob_async", - "title": "DlpService finishDlpJob Sample", - "origin": "API_DEFINITION", - "description": " Finish a running hybrid DlpJob. Triggers the finalization steps and running of any enabled actions that have not yet run.", - "canonical": true, - "file": "dlp_service.finish_dlp_job.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 50, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "FinishDlpJob", - "fullName": "google.privacy.dlp.v2.DlpService.FinishDlpJob", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "DlpServiceClient", - "fullName": "google.privacy.dlp.v2.DlpServiceClient" - }, - "method": { - "shortName": "FinishDlpJob", - "fullName": "google.privacy.dlp.v2.DlpService.FinishDlpJob", - "service": { - "shortName": "DlpService", - "fullName": "google.privacy.dlp.v2.DlpService" - } - } - } - } - ] -} diff --git a/owl-bot-staging/v2/src/index.ts b/owl-bot-staging/v2/src/index.ts deleted file mode 100644 index 3697ec51..00000000 --- a/owl-bot-staging/v2/src/index.ts +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2022 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; -type DlpServiceClient = v2.DlpServiceClient; -export {v2, DlpServiceClient}; -export default {v2, DlpServiceClient}; -import * as protos from '../protos/protos'; -export {protos} diff --git a/owl-bot-staging/v2/src/v2/dlp_service_client.ts b/owl-bot-staging/v2/src/v2/dlp_service_client.ts deleted file mode 100644 index daf346fe..00000000 --- a/owl-bot-staging/v2/src/v2/dlp_service_client.ts +++ /dev/null @@ -1,5238 +0,0 @@ -// Copyright 2022 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. ** - -/* global window */ -import * as gax from 'google-gax'; -import {Callback, CallOptions, Descriptors, ClientOptions, PaginationCallback, GaxCall} from 'google-gax'; - -import { Transform } from 'stream'; -import { RequestType } from 'google-gax/build/src/apitypes'; -import * as protos from '../../protos/protos'; -import jsonProtos = require('../../protos/protos.json'); -/** - * Client JSON configuration object, loaded from - * `src/v2/dlp_service_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -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 _terminated = false; - private _opts: ClientOptions; - private _providedCustomServicePath: boolean; - private _gaxModule: typeof gax | typeof gax.fallback; - private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; - private _protos: {}; - private _defaults: {[method: string]: gax.CallSettings}; - auth: gax.GoogleAuth; - descriptors: Descriptors = { - page: {}, - stream: {}, - longrunning: {}, - batching: {}, - }; - warn: (code: string, message: string, warnType?: string) => void; - innerApiCalls: {[name: string]: Function}; - pathTemplates: {[name: string]: gax.PathTemplate}; - dlpServiceStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of DlpServiceClient. - * - * @param {object} [options] - The configuration object. - * The options accepted by the constructor are described in detail - * in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance). - * The common options are: - * @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 {string} [options.apiEndpoint] - The domain name of the - * API remote host. - * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. - * Follows the structure of {@link gapicConfig}. - * @param {boolean} [options.fallback] - Use HTTP fallback mode. - * In fallback mode, a special browser-compatible transport implementation is used - * instead of gRPC transport. In browser context (if the `window` object is defined) - * the fallback mode is enabled automatically; set `options.fallback` to `false` - * if you need to override this behavior. - */ - constructor(opts?: ClientOptions) { - // Ensure that options include all the required fields. - const staticMembers = this.constructor as typeof DlpServiceClient; - const servicePath = opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; - this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); - const port = opts?.port || staticMembers.port; - const clientConfig = opts?.clientConfig ?? {}; - const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); - opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); - - // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. - if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { - opts['scopes'] = staticMembers.scopes; - } - - // Choose either gRPC or proto-over-HTTP implementation of google-gax. - this._gaxModule = opts.fallback ? gax.fallback : gax; - - // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. - this._gaxGrpc = new this._gaxModule.GrpcClient(opts); - - // Save options to use in initialize() method. - this._opts = opts; - - // Save the auth object to the client, for use by other methods. - this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); - - // Set useJWTAccessWithScope on the auth object. - this.auth.useJWTAccessWithScope = true; - - // Set defaultServicePath on the auth object. - this.auth.defaultServicePath = staticMembers.servicePath; - - // Set the default scopes in auth client if needed. - if (servicePath === staticMembers.servicePath) { - this.auth.defaultScopes = staticMembers.scopes; - } - - // Determine the client header string. - const clientHeader = [ - `gax/${this._gaxModule.version}`, - `gapic/${version}`, - ]; - if (typeof process !== 'undefined' && 'versions' in process) { - clientHeader.push(`gl-node/${process.versions.node}`); - } else { - clientHeader.push(`gl-web/${this._gaxModule.version}`); - } - if (!opts.fallback) { - clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest' ) { - clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); - } - if (opts.libName && opts.libVersion) { - clientHeader.push(`${opts.libName}/${opts.libVersion}`); - } - // Load the applicable protos. - this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); - - // This API contains "path templates"; forward-slash-separated - // identifiers to uniquely identify resources within the API. - // Create useful helper objects for these. - this.pathTemplates = { - findingPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/findings/{finding}' - ), - organizationPathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}' - ), - organizationDeidentifyTemplatePathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}/deidentifyTemplates/{deidentify_template}' - ), - organizationInspectTemplatePathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}/inspectTemplates/{inspect_template}' - ), - organizationLocationDeidentifyTemplatePathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}/locations/{location}/deidentifyTemplates/{deidentify_template}' - ), - organizationLocationInspectTemplatePathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}/locations/{location}/inspectTemplates/{inspect_template}' - ), - organizationLocationStoredInfoTypePathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}/locations/{location}/storedInfoTypes/{stored_info_type}' - ), - organizationStoredInfoTypePathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}/storedInfoTypes/{stored_info_type}' - ), - projectPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}' - ), - projectDeidentifyTemplatePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/deidentifyTemplates/{deidentify_template}' - ), - projectDlpContentPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/dlpContent' - ), - projectDlpJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/dlpJobs/{dlp_job}' - ), - projectInspectTemplatePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/inspectTemplates/{inspect_template}' - ), - projectJobTriggerPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/jobTriggers/{job_trigger}' - ), - projectLocationDeidentifyTemplatePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/deidentifyTemplates/{deidentify_template}' - ), - projectLocationDlpJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/dlpJobs/{dlp_job}' - ), - projectLocationInspectTemplatePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/inspectTemplates/{inspect_template}' - ), - projectLocationJobTriggerPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/jobTriggers/{job_trigger}' - ), - projectLocationStoredInfoTypePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/storedInfoTypes/{stored_info_type}' - ), - projectStoredInfoTypePathTemplate: new this._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 this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'inspectTemplates'), - listDeidentifyTemplates: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'deidentifyTemplates'), - listJobTriggers: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'jobTriggers'), - listDlpJobs: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'jobs'), - listStoredInfoTypes: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'storedInfoTypes') - }; - - // Put together the default options sent with requests. - this._defaults = this._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 = {}; - - // Add a warn function to the client constructor so it can be easily tested. - this.warn = gax.warn; - } - - /** - * Initialize the client. - * Performs asynchronous operations (such as authentication) and prepares the client. - * This function will be called automatically when any class method is called for the - * first time, but if you need to initialize it before calling an actual method, - * feel free to call initialize() directly. - * - * You can await on this method if you want to make sure the client is initialized. - * - * @returns {Promise} A promise that resolves to an authenticated service stub. - */ - initialize() { - // If the client stub promise is already initialized, return immediately. - if (this.dlpServiceStub) { - return this.dlpServiceStub; - } - - // Put together the "service stub" for - // google.privacy.dlp.v2.DlpService. - this.dlpServiceStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.privacy.dlp.v2.DlpService') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.privacy.dlp.v2.DlpService, - this._opts, this._providedCustomServicePath) 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', 'hybridInspectJobTrigger', 'getJobTrigger', 'listJobTriggers', 'deleteJobTrigger', 'activateJobTrigger', 'createDlpJob', 'listDlpJobs', 'getDlpJob', 'deleteDlpJob', 'cancelDlpJob', 'createStoredInfoType', 'updateStoredInfoType', 'getStoredInfoType', 'listStoredInfoTypes', 'deleteStoredInfoType', 'hybridInspectDlpJob', 'finishDlpJob']; - for (const methodName of dlpServiceStubMethods) { - const callPromise = this.dlpServiceStub.then( - stub => (...args: Array<{}>) => { - if (this._terminated) { - return Promise.reject('The client has already been closed.'); - } - const func = stub[methodName]; - return func.apply(stub, args); - }, - (err: Error|null|undefined) => () => { - throw err; - }); - - const descriptor = - this.descriptors.page[methodName] || - undefined; - const apiCall = this._gaxModule.createApiCall( - callPromise, - this._defaults[methodName], - descriptor - ); - - this.innerApiCalls[methodName] = apiCall; - } - - return this.dlpServiceStub; - } - - /** - * The DNS address for this API service. - * @returns {string} The DNS address for this service. - */ - static get servicePath() { - return 'dlp.googleapis.com'; - } - - /** - * The DNS address for this API service - same as servicePath(), - * exists for compatibility reasons. - * @returns {string} The DNS address for this service. - */ - static get apiEndpoint() { - return 'dlp.googleapis.com'; - } - - /** - * The port for this API service. - * @returns {number} The default port for this service. - */ - static get port() { - return 443; - } - - /** - * The scopes needed to make gRPC calls for every method defined - * in this service. - * @returns {string[]} List of default scopes. - */ - 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. - * @returns {Promise} A promise that resolves to string containing the project ID. - */ - getProjectId(callback?: Callback): - Promise|void { - if (callback) { - this.auth.getProjectId(callback); - return; - } - return this.auth.getProjectId(); - } - - // ------------------- - // -- 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 - * Parent resource name. - * - * The format of this value varies depending on whether you have [specified a - * processing - * location](https://cloud.google.com/dlp/docs/specifying-location): - * - * + Projects scope, location specified:
- * `projects/`PROJECT_ID`/locations/`LOCATION_ID - * + Projects scope, no location specified (defaults to global):
- * `projects/`PROJECT_ID - * - * The following example `parent` string specifies a parent project with the - * identifier `example-project`, and specifies the `europe-west3` location - * for processing data: - * - * parent=projects/example-project/locations/europe-west3 - * @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 - * Deprecated. This field has no effect. - * @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}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v2/dlp_service.inspect_content.js - * region_tag:dlp_v2_generated_DlpService_InspectContent_async - */ - inspectContent( - request?: protos.google.privacy.dlp.v2.IInspectContentRequest, - options?: CallOptions): - Promise<[ - protos.google.privacy.dlp.v2.IInspectContentResponse, - protos.google.privacy.dlp.v2.IInspectContentRequest|undefined, {}|undefined - ]>; - inspectContent( - request: protos.google.privacy.dlp.v2.IInspectContentRequest, - options: CallOptions, - callback: Callback< - protos.google.privacy.dlp.v2.IInspectContentResponse, - protos.google.privacy.dlp.v2.IInspectContentRequest|null|undefined, - {}|null|undefined>): void; - inspectContent( - request: protos.google.privacy.dlp.v2.IInspectContentRequest, - callback: Callback< - protos.google.privacy.dlp.v2.IInspectContentResponse, - protos.google.privacy.dlp.v2.IInspectContentRequest|null|undefined, - {}|null|undefined>): void; - inspectContent( - request?: protos.google.privacy.dlp.v2.IInspectContentRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.privacy.dlp.v2.IInspectContentResponse, - protos.google.privacy.dlp.v2.IInspectContentRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.privacy.dlp.v2.IInspectContentResponse, - protos.google.privacy.dlp.v2.IInspectContentRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.privacy.dlp.v2.IInspectContentResponse, - protos.google.privacy.dlp.v2.IInspectContentRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as 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 || '', - }); - this.initialize(); - 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 - * Parent resource name. - * - * The format of this value varies depending on whether you have [specified a - * processing - * location](https://cloud.google.com/dlp/docs/specifying-location): - * - * + Projects scope, location specified:
- * `projects/`PROJECT_ID`/locations/`LOCATION_ID - * + Projects scope, no location specified (defaults to global):
- * `projects/`PROJECT_ID - * - * The following example `parent` string specifies a parent project with the - * identifier `example-project`, and specifies the `europe-west3` location - * for processing data: - * - * parent=projects/example-project/locations/europe-west3 - * @param {string} request.locationId - * Deprecated. This field has no effect. - * @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}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v2/dlp_service.redact_image.js - * region_tag:dlp_v2_generated_DlpService_RedactImage_async - */ - redactImage( - request?: protos.google.privacy.dlp.v2.IRedactImageRequest, - options?: CallOptions): - Promise<[ - protos.google.privacy.dlp.v2.IRedactImageResponse, - protos.google.privacy.dlp.v2.IRedactImageRequest|undefined, {}|undefined - ]>; - redactImage( - request: protos.google.privacy.dlp.v2.IRedactImageRequest, - options: CallOptions, - callback: Callback< - protos.google.privacy.dlp.v2.IRedactImageResponse, - protos.google.privacy.dlp.v2.IRedactImageRequest|null|undefined, - {}|null|undefined>): void; - redactImage( - request: protos.google.privacy.dlp.v2.IRedactImageRequest, - callback: Callback< - protos.google.privacy.dlp.v2.IRedactImageResponse, - protos.google.privacy.dlp.v2.IRedactImageRequest|null|undefined, - {}|null|undefined>): void; - redactImage( - request?: protos.google.privacy.dlp.v2.IRedactImageRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.privacy.dlp.v2.IRedactImageResponse, - protos.google.privacy.dlp.v2.IRedactImageRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.privacy.dlp.v2.IRedactImageResponse, - protos.google.privacy.dlp.v2.IRedactImageRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.privacy.dlp.v2.IRedactImageResponse, - protos.google.privacy.dlp.v2.IRedactImageRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as 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 || '', - }); - this.initialize(); - 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 - * Parent resource name. - * - * The format of this value varies depending on whether you have [specified a - * processing - * location](https://cloud.google.com/dlp/docs/specifying-location): - * - * + Projects scope, location specified:
- * `projects/`PROJECT_ID`/locations/`LOCATION_ID - * + Projects scope, no location specified (defaults to global):
- * `projects/`PROJECT_ID - * - * The following example `parent` string specifies a parent project with the - * identifier `example-project`, and specifies the `europe-west3` location - * for processing data: - * - * parent=projects/example-project/locations/europe-west3 - * @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 - * Deprecated. This field has no effect. - * @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}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v2/dlp_service.deidentify_content.js - * region_tag:dlp_v2_generated_DlpService_DeidentifyContent_async - */ - deidentifyContent( - request?: protos.google.privacy.dlp.v2.IDeidentifyContentRequest, - options?: CallOptions): - Promise<[ - protos.google.privacy.dlp.v2.IDeidentifyContentResponse, - protos.google.privacy.dlp.v2.IDeidentifyContentRequest|undefined, {}|undefined - ]>; - deidentifyContent( - request: protos.google.privacy.dlp.v2.IDeidentifyContentRequest, - options: CallOptions, - callback: Callback< - protos.google.privacy.dlp.v2.IDeidentifyContentResponse, - protos.google.privacy.dlp.v2.IDeidentifyContentRequest|null|undefined, - {}|null|undefined>): void; - deidentifyContent( - request: protos.google.privacy.dlp.v2.IDeidentifyContentRequest, - callback: Callback< - protos.google.privacy.dlp.v2.IDeidentifyContentResponse, - protos.google.privacy.dlp.v2.IDeidentifyContentRequest|null|undefined, - {}|null|undefined>): void; - deidentifyContent( - request?: protos.google.privacy.dlp.v2.IDeidentifyContentRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.privacy.dlp.v2.IDeidentifyContentResponse, - protos.google.privacy.dlp.v2.IDeidentifyContentRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.privacy.dlp.v2.IDeidentifyContentResponse, - protos.google.privacy.dlp.v2.IDeidentifyContentRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.privacy.dlp.v2.IDeidentifyContentResponse, - protos.google.privacy.dlp.v2.IDeidentifyContentRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as 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 || '', - }); - this.initialize(); - 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. Parent resource name. - * - * The format of this value varies depending on whether you have [specified a - * processing - * location](https://cloud.google.com/dlp/docs/specifying-location): - * - * + Projects scope, location specified:
- * `projects/`PROJECT_ID`/locations/`LOCATION_ID - * + Projects scope, no location specified (defaults to global):
- * `projects/`PROJECT_ID - * - * The following example `parent` string specifies a parent project with the - * identifier `example-project`, and specifies the `europe-west3` location - * for processing data: - * - * parent=projects/example-project/locations/europe-west3 - * @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. The - * `DeidentifyTemplate` used must include only reversible transformations. - * 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 - * Deprecated. This field has no effect. - * @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}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v2/dlp_service.reidentify_content.js - * region_tag:dlp_v2_generated_DlpService_ReidentifyContent_async - */ - reidentifyContent( - request?: protos.google.privacy.dlp.v2.IReidentifyContentRequest, - options?: CallOptions): - Promise<[ - protos.google.privacy.dlp.v2.IReidentifyContentResponse, - protos.google.privacy.dlp.v2.IReidentifyContentRequest|undefined, {}|undefined - ]>; - reidentifyContent( - request: protos.google.privacy.dlp.v2.IReidentifyContentRequest, - options: CallOptions, - callback: Callback< - protos.google.privacy.dlp.v2.IReidentifyContentResponse, - protos.google.privacy.dlp.v2.IReidentifyContentRequest|null|undefined, - {}|null|undefined>): void; - reidentifyContent( - request: protos.google.privacy.dlp.v2.IReidentifyContentRequest, - callback: Callback< - protos.google.privacy.dlp.v2.IReidentifyContentResponse, - protos.google.privacy.dlp.v2.IReidentifyContentRequest|null|undefined, - {}|null|undefined>): void; - reidentifyContent( - request?: protos.google.privacy.dlp.v2.IReidentifyContentRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.privacy.dlp.v2.IReidentifyContentResponse, - protos.google.privacy.dlp.v2.IReidentifyContentRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.privacy.dlp.v2.IReidentifyContentResponse, - protos.google.privacy.dlp.v2.IReidentifyContentRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.privacy.dlp.v2.IReidentifyContentResponse, - protos.google.privacy.dlp.v2.IReidentifyContentRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as 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 || '', - }); - this.initialize(); - 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.parent - * The parent resource name. - * - * The format of this value is as follows: - * - * locations/LOCATION_ID - * @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 - * Deprecated. This field has no effect. - * @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}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v2/dlp_service.list_info_types.js - * region_tag:dlp_v2_generated_DlpService_ListInfoTypes_async - */ - listInfoTypes( - request?: protos.google.privacy.dlp.v2.IListInfoTypesRequest, - options?: CallOptions): - Promise<[ - protos.google.privacy.dlp.v2.IListInfoTypesResponse, - protos.google.privacy.dlp.v2.IListInfoTypesRequest|undefined, {}|undefined - ]>; - listInfoTypes( - request: protos.google.privacy.dlp.v2.IListInfoTypesRequest, - options: CallOptions, - callback: Callback< - protos.google.privacy.dlp.v2.IListInfoTypesResponse, - protos.google.privacy.dlp.v2.IListInfoTypesRequest|null|undefined, - {}|null|undefined>): void; - listInfoTypes( - request: protos.google.privacy.dlp.v2.IListInfoTypesRequest, - callback: Callback< - protos.google.privacy.dlp.v2.IListInfoTypesResponse, - protos.google.privacy.dlp.v2.IListInfoTypesRequest|null|undefined, - {}|null|undefined>): void; - listInfoTypes( - request?: protos.google.privacy.dlp.v2.IListInfoTypesRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.privacy.dlp.v2.IListInfoTypesResponse, - protos.google.privacy.dlp.v2.IListInfoTypesRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.privacy.dlp.v2.IListInfoTypesResponse, - protos.google.privacy.dlp.v2.IListInfoTypesRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.privacy.dlp.v2.IListInfoTypesResponse, - protos.google.privacy.dlp.v2.IListInfoTypesRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as 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 || '', - }); - this.initialize(); - 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. Parent resource name. - * - * The format of this value varies depending on the scope of the request - * (project or organization) and whether you have [specified a processing - * location](https://cloud.google.com/dlp/docs/specifying-location): - * - * + Projects scope, location specified:
- * `projects/`PROJECT_ID`/locations/`LOCATION_ID - * + Projects scope, no location specified (defaults to global):
- * `projects/`PROJECT_ID - * + Organizations scope, location specified:
- * `organizations/`ORG_ID`/locations/`LOCATION_ID - * + Organizations scope, no location specified (defaults to global):
- * `organizations/`ORG_ID - * - * The following example `parent` string specifies a parent project with the - * identifier `example-project`, and specifies the `europe-west3` location - * for processing data: - * - * parent=projects/example-project/locations/europe-west3 - * @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 - * Deprecated. This field has no effect. - * @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}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v2/dlp_service.create_inspect_template.js - * region_tag:dlp_v2_generated_DlpService_CreateInspectTemplate_async - */ - createInspectTemplate( - request?: protos.google.privacy.dlp.v2.ICreateInspectTemplateRequest, - options?: CallOptions): - Promise<[ - protos.google.privacy.dlp.v2.IInspectTemplate, - protos.google.privacy.dlp.v2.ICreateInspectTemplateRequest|undefined, {}|undefined - ]>; - createInspectTemplate( - request: protos.google.privacy.dlp.v2.ICreateInspectTemplateRequest, - options: CallOptions, - callback: Callback< - protos.google.privacy.dlp.v2.IInspectTemplate, - protos.google.privacy.dlp.v2.ICreateInspectTemplateRequest|null|undefined, - {}|null|undefined>): void; - createInspectTemplate( - request: protos.google.privacy.dlp.v2.ICreateInspectTemplateRequest, - callback: Callback< - protos.google.privacy.dlp.v2.IInspectTemplate, - protos.google.privacy.dlp.v2.ICreateInspectTemplateRequest|null|undefined, - {}|null|undefined>): void; - createInspectTemplate( - request?: protos.google.privacy.dlp.v2.ICreateInspectTemplateRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.privacy.dlp.v2.IInspectTemplate, - protos.google.privacy.dlp.v2.ICreateInspectTemplateRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.privacy.dlp.v2.IInspectTemplate, - protos.google.privacy.dlp.v2.ICreateInspectTemplateRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.privacy.dlp.v2.IInspectTemplate, - protos.google.privacy.dlp.v2.ICreateInspectTemplateRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as 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 || '', - }); - this.initialize(); - 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 {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}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v2/dlp_service.update_inspect_template.js - * region_tag:dlp_v2_generated_DlpService_UpdateInspectTemplate_async - */ - updateInspectTemplate( - request?: protos.google.privacy.dlp.v2.IUpdateInspectTemplateRequest, - options?: CallOptions): - Promise<[ - protos.google.privacy.dlp.v2.IInspectTemplate, - protos.google.privacy.dlp.v2.IUpdateInspectTemplateRequest|undefined, {}|undefined - ]>; - updateInspectTemplate( - request: protos.google.privacy.dlp.v2.IUpdateInspectTemplateRequest, - options: CallOptions, - callback: Callback< - protos.google.privacy.dlp.v2.IInspectTemplate, - protos.google.privacy.dlp.v2.IUpdateInspectTemplateRequest|null|undefined, - {}|null|undefined>): void; - updateInspectTemplate( - request: protos.google.privacy.dlp.v2.IUpdateInspectTemplateRequest, - callback: Callback< - protos.google.privacy.dlp.v2.IInspectTemplate, - protos.google.privacy.dlp.v2.IUpdateInspectTemplateRequest|null|undefined, - {}|null|undefined>): void; - updateInspectTemplate( - request?: protos.google.privacy.dlp.v2.IUpdateInspectTemplateRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.privacy.dlp.v2.IInspectTemplate, - protos.google.privacy.dlp.v2.IUpdateInspectTemplateRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.privacy.dlp.v2.IInspectTemplate, - protos.google.privacy.dlp.v2.IUpdateInspectTemplateRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.privacy.dlp.v2.IInspectTemplate, - protos.google.privacy.dlp.v2.IUpdateInspectTemplateRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as 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 || '', - }); - this.initialize(); - 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] - * 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}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v2/dlp_service.get_inspect_template.js - * region_tag:dlp_v2_generated_DlpService_GetInspectTemplate_async - */ - getInspectTemplate( - request?: protos.google.privacy.dlp.v2.IGetInspectTemplateRequest, - options?: CallOptions): - Promise<[ - protos.google.privacy.dlp.v2.IInspectTemplate, - protos.google.privacy.dlp.v2.IGetInspectTemplateRequest|undefined, {}|undefined - ]>; - getInspectTemplate( - request: protos.google.privacy.dlp.v2.IGetInspectTemplateRequest, - options: CallOptions, - callback: Callback< - protos.google.privacy.dlp.v2.IInspectTemplate, - protos.google.privacy.dlp.v2.IGetInspectTemplateRequest|null|undefined, - {}|null|undefined>): void; - getInspectTemplate( - request: protos.google.privacy.dlp.v2.IGetInspectTemplateRequest, - callback: Callback< - protos.google.privacy.dlp.v2.IInspectTemplate, - protos.google.privacy.dlp.v2.IGetInspectTemplateRequest|null|undefined, - {}|null|undefined>): void; - getInspectTemplate( - request?: protos.google.privacy.dlp.v2.IGetInspectTemplateRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.privacy.dlp.v2.IInspectTemplate, - protos.google.privacy.dlp.v2.IGetInspectTemplateRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.privacy.dlp.v2.IInspectTemplate, - protos.google.privacy.dlp.v2.IGetInspectTemplateRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.privacy.dlp.v2.IInspectTemplate, - protos.google.privacy.dlp.v2.IGetInspectTemplateRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as 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 || '', - }); - this.initialize(); - return this.innerApiCalls.getInspectTemplate(request, options, callback); - } -/** - * 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}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v2/dlp_service.delete_inspect_template.js - * region_tag:dlp_v2_generated_DlpService_DeleteInspectTemplate_async - */ - deleteInspectTemplate( - request?: protos.google.privacy.dlp.v2.IDeleteInspectTemplateRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.privacy.dlp.v2.IDeleteInspectTemplateRequest|undefined, {}|undefined - ]>; - deleteInspectTemplate( - request: protos.google.privacy.dlp.v2.IDeleteInspectTemplateRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.privacy.dlp.v2.IDeleteInspectTemplateRequest|null|undefined, - {}|null|undefined>): void; - deleteInspectTemplate( - request: protos.google.privacy.dlp.v2.IDeleteInspectTemplateRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.privacy.dlp.v2.IDeleteInspectTemplateRequest|null|undefined, - {}|null|undefined>): void; - deleteInspectTemplate( - request?: protos.google.privacy.dlp.v2.IDeleteInspectTemplateRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.privacy.dlp.v2.IDeleteInspectTemplateRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.privacy.dlp.v2.IDeleteInspectTemplateRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.privacy.dlp.v2.IDeleteInspectTemplateRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as 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 || '', - }); - this.initialize(); - 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. Parent resource name. - * - * The format of this value varies depending on the scope of the request - * (project or organization) and whether you have [specified a processing - * location](https://cloud.google.com/dlp/docs/specifying-location): - * - * + Projects scope, location specified:
- * `projects/`PROJECT_ID`/locations/`LOCATION_ID - * + Projects scope, no location specified (defaults to global):
- * `projects/`PROJECT_ID - * + Organizations scope, location specified:
- * `organizations/`ORG_ID`/locations/`LOCATION_ID - * + Organizations scope, no location specified (defaults to global):
- * `organizations/`ORG_ID - * - * The following example `parent` string specifies a parent project with the - * identifier `example-project`, and specifies the `europe-west3` location - * for processing data: - * - * parent=projects/example-project/locations/europe-west3 - * @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 - * Deprecated. This field has no effect. - * @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}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v2/dlp_service.create_deidentify_template.js - * region_tag:dlp_v2_generated_DlpService_CreateDeidentifyTemplate_async - */ - createDeidentifyTemplate( - request?: protos.google.privacy.dlp.v2.ICreateDeidentifyTemplateRequest, - options?: CallOptions): - Promise<[ - protos.google.privacy.dlp.v2.IDeidentifyTemplate, - protos.google.privacy.dlp.v2.ICreateDeidentifyTemplateRequest|undefined, {}|undefined - ]>; - createDeidentifyTemplate( - request: protos.google.privacy.dlp.v2.ICreateDeidentifyTemplateRequest, - options: CallOptions, - callback: Callback< - protos.google.privacy.dlp.v2.IDeidentifyTemplate, - protos.google.privacy.dlp.v2.ICreateDeidentifyTemplateRequest|null|undefined, - {}|null|undefined>): void; - createDeidentifyTemplate( - request: protos.google.privacy.dlp.v2.ICreateDeidentifyTemplateRequest, - callback: Callback< - protos.google.privacy.dlp.v2.IDeidentifyTemplate, - protos.google.privacy.dlp.v2.ICreateDeidentifyTemplateRequest|null|undefined, - {}|null|undefined>): void; - createDeidentifyTemplate( - request?: protos.google.privacy.dlp.v2.ICreateDeidentifyTemplateRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.privacy.dlp.v2.IDeidentifyTemplate, - protos.google.privacy.dlp.v2.ICreateDeidentifyTemplateRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.privacy.dlp.v2.IDeidentifyTemplate, - protos.google.privacy.dlp.v2.ICreateDeidentifyTemplateRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.privacy.dlp.v2.IDeidentifyTemplate, - protos.google.privacy.dlp.v2.ICreateDeidentifyTemplateRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as 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 || '', - }); - this.initialize(); - 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 {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}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v2/dlp_service.update_deidentify_template.js - * region_tag:dlp_v2_generated_DlpService_UpdateDeidentifyTemplate_async - */ - updateDeidentifyTemplate( - request?: protos.google.privacy.dlp.v2.IUpdateDeidentifyTemplateRequest, - options?: CallOptions): - Promise<[ - protos.google.privacy.dlp.v2.IDeidentifyTemplate, - protos.google.privacy.dlp.v2.IUpdateDeidentifyTemplateRequest|undefined, {}|undefined - ]>; - updateDeidentifyTemplate( - request: protos.google.privacy.dlp.v2.IUpdateDeidentifyTemplateRequest, - options: CallOptions, - callback: Callback< - protos.google.privacy.dlp.v2.IDeidentifyTemplate, - protos.google.privacy.dlp.v2.IUpdateDeidentifyTemplateRequest|null|undefined, - {}|null|undefined>): void; - updateDeidentifyTemplate( - request: protos.google.privacy.dlp.v2.IUpdateDeidentifyTemplateRequest, - callback: Callback< - protos.google.privacy.dlp.v2.IDeidentifyTemplate, - protos.google.privacy.dlp.v2.IUpdateDeidentifyTemplateRequest|null|undefined, - {}|null|undefined>): void; - updateDeidentifyTemplate( - request?: protos.google.privacy.dlp.v2.IUpdateDeidentifyTemplateRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.privacy.dlp.v2.IDeidentifyTemplate, - protos.google.privacy.dlp.v2.IUpdateDeidentifyTemplateRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.privacy.dlp.v2.IDeidentifyTemplate, - protos.google.privacy.dlp.v2.IUpdateDeidentifyTemplateRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.privacy.dlp.v2.IDeidentifyTemplate, - protos.google.privacy.dlp.v2.IUpdateDeidentifyTemplateRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as 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 || '', - }); - this.initialize(); - 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] - * 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}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v2/dlp_service.get_deidentify_template.js - * region_tag:dlp_v2_generated_DlpService_GetDeidentifyTemplate_async - */ - getDeidentifyTemplate( - request?: protos.google.privacy.dlp.v2.IGetDeidentifyTemplateRequest, - options?: CallOptions): - Promise<[ - protos.google.privacy.dlp.v2.IDeidentifyTemplate, - protos.google.privacy.dlp.v2.IGetDeidentifyTemplateRequest|undefined, {}|undefined - ]>; - getDeidentifyTemplate( - request: protos.google.privacy.dlp.v2.IGetDeidentifyTemplateRequest, - options: CallOptions, - callback: Callback< - protos.google.privacy.dlp.v2.IDeidentifyTemplate, - protos.google.privacy.dlp.v2.IGetDeidentifyTemplateRequest|null|undefined, - {}|null|undefined>): void; - getDeidentifyTemplate( - request: protos.google.privacy.dlp.v2.IGetDeidentifyTemplateRequest, - callback: Callback< - protos.google.privacy.dlp.v2.IDeidentifyTemplate, - protos.google.privacy.dlp.v2.IGetDeidentifyTemplateRequest|null|undefined, - {}|null|undefined>): void; - getDeidentifyTemplate( - request?: protos.google.privacy.dlp.v2.IGetDeidentifyTemplateRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.privacy.dlp.v2.IDeidentifyTemplate, - protos.google.privacy.dlp.v2.IGetDeidentifyTemplateRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.privacy.dlp.v2.IDeidentifyTemplate, - protos.google.privacy.dlp.v2.IGetDeidentifyTemplateRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.privacy.dlp.v2.IDeidentifyTemplate, - protos.google.privacy.dlp.v2.IGetDeidentifyTemplateRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as 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 || '', - }); - this.initialize(); - return this.innerApiCalls.getDeidentifyTemplate(request, options, callback); - } -/** - * 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}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v2/dlp_service.delete_deidentify_template.js - * region_tag:dlp_v2_generated_DlpService_DeleteDeidentifyTemplate_async - */ - deleteDeidentifyTemplate( - request?: protos.google.privacy.dlp.v2.IDeleteDeidentifyTemplateRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.privacy.dlp.v2.IDeleteDeidentifyTemplateRequest|undefined, {}|undefined - ]>; - deleteDeidentifyTemplate( - request: protos.google.privacy.dlp.v2.IDeleteDeidentifyTemplateRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.privacy.dlp.v2.IDeleteDeidentifyTemplateRequest|null|undefined, - {}|null|undefined>): void; - deleteDeidentifyTemplate( - request: protos.google.privacy.dlp.v2.IDeleteDeidentifyTemplateRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.privacy.dlp.v2.IDeleteDeidentifyTemplateRequest|null|undefined, - {}|null|undefined>): void; - deleteDeidentifyTemplate( - request?: protos.google.privacy.dlp.v2.IDeleteDeidentifyTemplateRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.privacy.dlp.v2.IDeleteDeidentifyTemplateRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.privacy.dlp.v2.IDeleteDeidentifyTemplateRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.privacy.dlp.v2.IDeleteDeidentifyTemplateRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as 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 || '', - }); - this.initialize(); - return this.innerApiCalls.deleteDeidentifyTemplate(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. Parent resource name. - * - * The format of this value varies depending on whether you have [specified a - * processing - * location](https://cloud.google.com/dlp/docs/specifying-location): - * - * + Projects scope, location specified:
- * `projects/`PROJECT_ID`/locations/`LOCATION_ID - * + Projects scope, no location specified (defaults to global):
- * `projects/`PROJECT_ID - * - * The following example `parent` string specifies a parent project with the - * identifier `example-project`, and specifies the `europe-west3` location - * for processing data: - * - * parent=projects/example-project/locations/europe-west3 - * @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 - * Deprecated. This field has no effect. - * @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}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v2/dlp_service.create_job_trigger.js - * region_tag:dlp_v2_generated_DlpService_CreateJobTrigger_async - */ - createJobTrigger( - request?: protos.google.privacy.dlp.v2.ICreateJobTriggerRequest, - options?: CallOptions): - Promise<[ - protos.google.privacy.dlp.v2.IJobTrigger, - protos.google.privacy.dlp.v2.ICreateJobTriggerRequest|undefined, {}|undefined - ]>; - createJobTrigger( - request: protos.google.privacy.dlp.v2.ICreateJobTriggerRequest, - options: CallOptions, - callback: Callback< - protos.google.privacy.dlp.v2.IJobTrigger, - protos.google.privacy.dlp.v2.ICreateJobTriggerRequest|null|undefined, - {}|null|undefined>): void; - createJobTrigger( - request: protos.google.privacy.dlp.v2.ICreateJobTriggerRequest, - callback: Callback< - protos.google.privacy.dlp.v2.IJobTrigger, - protos.google.privacy.dlp.v2.ICreateJobTriggerRequest|null|undefined, - {}|null|undefined>): void; - createJobTrigger( - request?: protos.google.privacy.dlp.v2.ICreateJobTriggerRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.privacy.dlp.v2.IJobTrigger, - protos.google.privacy.dlp.v2.ICreateJobTriggerRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.privacy.dlp.v2.IJobTrigger, - protos.google.privacy.dlp.v2.ICreateJobTriggerRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.privacy.dlp.v2.IJobTrigger, - protos.google.privacy.dlp.v2.ICreateJobTriggerRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as 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 || '', - }); - this.initialize(); - return this.innerApiCalls.createJobTrigger(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 {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}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v2/dlp_service.update_job_trigger.js - * region_tag:dlp_v2_generated_DlpService_UpdateJobTrigger_async - */ - updateJobTrigger( - request?: protos.google.privacy.dlp.v2.IUpdateJobTriggerRequest, - options?: CallOptions): - Promise<[ - protos.google.privacy.dlp.v2.IJobTrigger, - protos.google.privacy.dlp.v2.IUpdateJobTriggerRequest|undefined, {}|undefined - ]>; - updateJobTrigger( - request: protos.google.privacy.dlp.v2.IUpdateJobTriggerRequest, - options: CallOptions, - callback: Callback< - protos.google.privacy.dlp.v2.IJobTrigger, - protos.google.privacy.dlp.v2.IUpdateJobTriggerRequest|null|undefined, - {}|null|undefined>): void; - updateJobTrigger( - request: protos.google.privacy.dlp.v2.IUpdateJobTriggerRequest, - callback: Callback< - protos.google.privacy.dlp.v2.IJobTrigger, - protos.google.privacy.dlp.v2.IUpdateJobTriggerRequest|null|undefined, - {}|null|undefined>): void; - updateJobTrigger( - request?: protos.google.privacy.dlp.v2.IUpdateJobTriggerRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.privacy.dlp.v2.IJobTrigger, - protos.google.privacy.dlp.v2.IUpdateJobTriggerRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.privacy.dlp.v2.IJobTrigger, - protos.google.privacy.dlp.v2.IUpdateJobTriggerRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.privacy.dlp.v2.IJobTrigger, - protos.google.privacy.dlp.v2.IUpdateJobTriggerRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as 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 || '', - }); - this.initialize(); - return this.innerApiCalls.updateJobTrigger(request, options, callback); - } -/** - * Inspect hybrid content and store findings to a trigger. The inspection - * will be processed asynchronously. To review the findings monitor the - * jobs within the trigger. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. Resource name of the trigger to execute a hybrid inspect on, for example - * `projects/dlp-test-project/jobTriggers/53234423`. - * @param {google.privacy.dlp.v2.HybridContentItem} request.hybridItem - * The item to inspect. - * @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 [HybridInspectResponse]{@link google.privacy.dlp.v2.HybridInspectResponse}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v2/dlp_service.hybrid_inspect_job_trigger.js - * region_tag:dlp_v2_generated_DlpService_HybridInspectJobTrigger_async - */ - hybridInspectJobTrigger( - request?: protos.google.privacy.dlp.v2.IHybridInspectJobTriggerRequest, - options?: CallOptions): - Promise<[ - protos.google.privacy.dlp.v2.IHybridInspectResponse, - protos.google.privacy.dlp.v2.IHybridInspectJobTriggerRequest|undefined, {}|undefined - ]>; - hybridInspectJobTrigger( - request: protos.google.privacy.dlp.v2.IHybridInspectJobTriggerRequest, - options: CallOptions, - callback: Callback< - protos.google.privacy.dlp.v2.IHybridInspectResponse, - protos.google.privacy.dlp.v2.IHybridInspectJobTriggerRequest|null|undefined, - {}|null|undefined>): void; - hybridInspectJobTrigger( - request: protos.google.privacy.dlp.v2.IHybridInspectJobTriggerRequest, - callback: Callback< - protos.google.privacy.dlp.v2.IHybridInspectResponse, - protos.google.privacy.dlp.v2.IHybridInspectJobTriggerRequest|null|undefined, - {}|null|undefined>): void; - hybridInspectJobTrigger( - request?: protos.google.privacy.dlp.v2.IHybridInspectJobTriggerRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.privacy.dlp.v2.IHybridInspectResponse, - protos.google.privacy.dlp.v2.IHybridInspectJobTriggerRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.privacy.dlp.v2.IHybridInspectResponse, - protos.google.privacy.dlp.v2.IHybridInspectJobTriggerRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.privacy.dlp.v2.IHybridInspectResponse, - protos.google.privacy.dlp.v2.IHybridInspectJobTriggerRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as 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 || '', - }); - this.initialize(); - return this.innerApiCalls.hybridInspectJobTrigger(request, options, callback); - } -/** - * 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}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v2/dlp_service.get_job_trigger.js - * region_tag:dlp_v2_generated_DlpService_GetJobTrigger_async - */ - getJobTrigger( - request?: protos.google.privacy.dlp.v2.IGetJobTriggerRequest, - options?: CallOptions): - Promise<[ - protos.google.privacy.dlp.v2.IJobTrigger, - protos.google.privacy.dlp.v2.IGetJobTriggerRequest|undefined, {}|undefined - ]>; - getJobTrigger( - request: protos.google.privacy.dlp.v2.IGetJobTriggerRequest, - options: CallOptions, - callback: Callback< - protos.google.privacy.dlp.v2.IJobTrigger, - protos.google.privacy.dlp.v2.IGetJobTriggerRequest|null|undefined, - {}|null|undefined>): void; - getJobTrigger( - request: protos.google.privacy.dlp.v2.IGetJobTriggerRequest, - callback: Callback< - protos.google.privacy.dlp.v2.IJobTrigger, - protos.google.privacy.dlp.v2.IGetJobTriggerRequest|null|undefined, - {}|null|undefined>): void; - getJobTrigger( - request?: protos.google.privacy.dlp.v2.IGetJobTriggerRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.privacy.dlp.v2.IJobTrigger, - protos.google.privacy.dlp.v2.IGetJobTriggerRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.privacy.dlp.v2.IJobTrigger, - protos.google.privacy.dlp.v2.IGetJobTriggerRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.privacy.dlp.v2.IJobTrigger, - protos.google.privacy.dlp.v2.IGetJobTriggerRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as 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 || '', - }); - this.initialize(); - 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] - * 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}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v2/dlp_service.delete_job_trigger.js - * region_tag:dlp_v2_generated_DlpService_DeleteJobTrigger_async - */ - deleteJobTrigger( - request?: protos.google.privacy.dlp.v2.IDeleteJobTriggerRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.privacy.dlp.v2.IDeleteJobTriggerRequest|undefined, {}|undefined - ]>; - deleteJobTrigger( - request: protos.google.privacy.dlp.v2.IDeleteJobTriggerRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.privacy.dlp.v2.IDeleteJobTriggerRequest|null|undefined, - {}|null|undefined>): void; - deleteJobTrigger( - request: protos.google.privacy.dlp.v2.IDeleteJobTriggerRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.privacy.dlp.v2.IDeleteJobTriggerRequest|null|undefined, - {}|null|undefined>): void; - deleteJobTrigger( - request?: protos.google.privacy.dlp.v2.IDeleteJobTriggerRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.privacy.dlp.v2.IDeleteJobTriggerRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.privacy.dlp.v2.IDeleteJobTriggerRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.privacy.dlp.v2.IDeleteJobTriggerRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as 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 || '', - }); - this.initialize(); - return this.innerApiCalls.deleteJobTrigger(request, options, callback); - } -/** - * 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}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v2/dlp_service.activate_job_trigger.js - * region_tag:dlp_v2_generated_DlpService_ActivateJobTrigger_async - */ - activateJobTrigger( - request?: protos.google.privacy.dlp.v2.IActivateJobTriggerRequest, - options?: CallOptions): - Promise<[ - protos.google.privacy.dlp.v2.IDlpJob, - protos.google.privacy.dlp.v2.IActivateJobTriggerRequest|undefined, {}|undefined - ]>; - activateJobTrigger( - request: protos.google.privacy.dlp.v2.IActivateJobTriggerRequest, - options: CallOptions, - callback: Callback< - protos.google.privacy.dlp.v2.IDlpJob, - protos.google.privacy.dlp.v2.IActivateJobTriggerRequest|null|undefined, - {}|null|undefined>): void; - activateJobTrigger( - request: protos.google.privacy.dlp.v2.IActivateJobTriggerRequest, - callback: Callback< - protos.google.privacy.dlp.v2.IDlpJob, - protos.google.privacy.dlp.v2.IActivateJobTriggerRequest|null|undefined, - {}|null|undefined>): void; - activateJobTrigger( - request?: protos.google.privacy.dlp.v2.IActivateJobTriggerRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.privacy.dlp.v2.IDlpJob, - protos.google.privacy.dlp.v2.IActivateJobTriggerRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.privacy.dlp.v2.IDlpJob, - protos.google.privacy.dlp.v2.IActivateJobTriggerRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.privacy.dlp.v2.IDlpJob, - protos.google.privacy.dlp.v2.IActivateJobTriggerRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as 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 || '', - }); - this.initialize(); - return this.innerApiCalls.activateJobTrigger(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. Parent resource name. - * - * The format of this value varies depending on whether you have [specified a - * processing - * location](https://cloud.google.com/dlp/docs/specifying-location): - * - * + Projects scope, location specified:
- * `projects/`PROJECT_ID`/locations/`LOCATION_ID - * + Projects scope, no location specified (defaults to global):
- * `projects/`PROJECT_ID - * - * The following example `parent` string specifies a parent project with the - * identifier `example-project`, and specifies the `europe-west3` location - * for processing data: - * - * parent=projects/example-project/locations/europe-west3 - * @param {google.privacy.dlp.v2.InspectJobConfig} request.inspectJob - * An inspection job scans a storage repository for InfoTypes. - * @param {google.privacy.dlp.v2.RiskAnalysisJobConfig} request.riskJob - * A risk analysis job calculates re-identification risk metrics for a - * BigQuery table. - * @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 - * Deprecated. This field has no effect. - * @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}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v2/dlp_service.create_dlp_job.js - * region_tag:dlp_v2_generated_DlpService_CreateDlpJob_async - */ - createDlpJob( - request?: protos.google.privacy.dlp.v2.ICreateDlpJobRequest, - options?: CallOptions): - Promise<[ - protos.google.privacy.dlp.v2.IDlpJob, - protos.google.privacy.dlp.v2.ICreateDlpJobRequest|undefined, {}|undefined - ]>; - createDlpJob( - request: protos.google.privacy.dlp.v2.ICreateDlpJobRequest, - options: CallOptions, - callback: Callback< - protos.google.privacy.dlp.v2.IDlpJob, - protos.google.privacy.dlp.v2.ICreateDlpJobRequest|null|undefined, - {}|null|undefined>): void; - createDlpJob( - request: protos.google.privacy.dlp.v2.ICreateDlpJobRequest, - callback: Callback< - protos.google.privacy.dlp.v2.IDlpJob, - protos.google.privacy.dlp.v2.ICreateDlpJobRequest|null|undefined, - {}|null|undefined>): void; - createDlpJob( - request?: protos.google.privacy.dlp.v2.ICreateDlpJobRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.privacy.dlp.v2.IDlpJob, - protos.google.privacy.dlp.v2.ICreateDlpJobRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.privacy.dlp.v2.IDlpJob, - protos.google.privacy.dlp.v2.ICreateDlpJobRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.privacy.dlp.v2.IDlpJob, - protos.google.privacy.dlp.v2.ICreateDlpJobRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as 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 || '', - }); - this.initialize(); - return this.innerApiCalls.createDlpJob(request, options, callback); - } -/** - * 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}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v2/dlp_service.get_dlp_job.js - * region_tag:dlp_v2_generated_DlpService_GetDlpJob_async - */ - getDlpJob( - request?: protos.google.privacy.dlp.v2.IGetDlpJobRequest, - options?: CallOptions): - Promise<[ - protos.google.privacy.dlp.v2.IDlpJob, - protos.google.privacy.dlp.v2.IGetDlpJobRequest|undefined, {}|undefined - ]>; - getDlpJob( - request: protos.google.privacy.dlp.v2.IGetDlpJobRequest, - options: CallOptions, - callback: Callback< - protos.google.privacy.dlp.v2.IDlpJob, - protos.google.privacy.dlp.v2.IGetDlpJobRequest|null|undefined, - {}|null|undefined>): void; - getDlpJob( - request: protos.google.privacy.dlp.v2.IGetDlpJobRequest, - callback: Callback< - protos.google.privacy.dlp.v2.IDlpJob, - protos.google.privacy.dlp.v2.IGetDlpJobRequest|null|undefined, - {}|null|undefined>): void; - getDlpJob( - request?: protos.google.privacy.dlp.v2.IGetDlpJobRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.privacy.dlp.v2.IDlpJob, - protos.google.privacy.dlp.v2.IGetDlpJobRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.privacy.dlp.v2.IDlpJob, - protos.google.privacy.dlp.v2.IGetDlpJobRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.privacy.dlp.v2.IDlpJob, - protos.google.privacy.dlp.v2.IGetDlpJobRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as 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 || '', - }); - this.initialize(); - 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] - * 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}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v2/dlp_service.delete_dlp_job.js - * region_tag:dlp_v2_generated_DlpService_DeleteDlpJob_async - */ - deleteDlpJob( - request?: protos.google.privacy.dlp.v2.IDeleteDlpJobRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.privacy.dlp.v2.IDeleteDlpJobRequest|undefined, {}|undefined - ]>; - deleteDlpJob( - request: protos.google.privacy.dlp.v2.IDeleteDlpJobRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.privacy.dlp.v2.IDeleteDlpJobRequest|null|undefined, - {}|null|undefined>): void; - deleteDlpJob( - request: protos.google.privacy.dlp.v2.IDeleteDlpJobRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.privacy.dlp.v2.IDeleteDlpJobRequest|null|undefined, - {}|null|undefined>): void; - deleteDlpJob( - request?: protos.google.privacy.dlp.v2.IDeleteDlpJobRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.privacy.dlp.v2.IDeleteDlpJobRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.privacy.dlp.v2.IDeleteDlpJobRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.privacy.dlp.v2.IDeleteDlpJobRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as 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 || '', - }); - this.initialize(); - 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] - * 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}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v2/dlp_service.cancel_dlp_job.js - * region_tag:dlp_v2_generated_DlpService_CancelDlpJob_async - */ - cancelDlpJob( - request?: protos.google.privacy.dlp.v2.ICancelDlpJobRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.privacy.dlp.v2.ICancelDlpJobRequest|undefined, {}|undefined - ]>; - cancelDlpJob( - request: protos.google.privacy.dlp.v2.ICancelDlpJobRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.privacy.dlp.v2.ICancelDlpJobRequest|null|undefined, - {}|null|undefined>): void; - cancelDlpJob( - request: protos.google.privacy.dlp.v2.ICancelDlpJobRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.privacy.dlp.v2.ICancelDlpJobRequest|null|undefined, - {}|null|undefined>): void; - cancelDlpJob( - request?: protos.google.privacy.dlp.v2.ICancelDlpJobRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.privacy.dlp.v2.ICancelDlpJobRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.privacy.dlp.v2.ICancelDlpJobRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.privacy.dlp.v2.ICancelDlpJobRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as 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 || '', - }); - this.initialize(); - return this.innerApiCalls.cancelDlpJob(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. Parent resource name. - * - * The format of this value varies depending on the scope of the request - * (project or organization) and whether you have [specified a processing - * location](https://cloud.google.com/dlp/docs/specifying-location): - * - * + Projects scope, location specified:
- * `projects/`PROJECT_ID`/locations/`LOCATION_ID - * + Projects scope, no location specified (defaults to global):
- * `projects/`PROJECT_ID - * + Organizations scope, location specified:
- * `organizations/`ORG_ID`/locations/`LOCATION_ID - * + Organizations scope, no location specified (defaults to global):
- * `organizations/`ORG_ID - * - * The following example `parent` string specifies a parent project with the - * identifier `example-project`, and specifies the `europe-west3` location - * for processing data: - * - * parent=projects/example-project/locations/europe-west3 - * @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 - * Deprecated. This field has no effect. - * @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}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v2/dlp_service.create_stored_info_type.js - * region_tag:dlp_v2_generated_DlpService_CreateStoredInfoType_async - */ - createStoredInfoType( - request?: protos.google.privacy.dlp.v2.ICreateStoredInfoTypeRequest, - options?: CallOptions): - Promise<[ - protos.google.privacy.dlp.v2.IStoredInfoType, - protos.google.privacy.dlp.v2.ICreateStoredInfoTypeRequest|undefined, {}|undefined - ]>; - createStoredInfoType( - request: protos.google.privacy.dlp.v2.ICreateStoredInfoTypeRequest, - options: CallOptions, - callback: Callback< - protos.google.privacy.dlp.v2.IStoredInfoType, - protos.google.privacy.dlp.v2.ICreateStoredInfoTypeRequest|null|undefined, - {}|null|undefined>): void; - createStoredInfoType( - request: protos.google.privacy.dlp.v2.ICreateStoredInfoTypeRequest, - callback: Callback< - protos.google.privacy.dlp.v2.IStoredInfoType, - protos.google.privacy.dlp.v2.ICreateStoredInfoTypeRequest|null|undefined, - {}|null|undefined>): void; - createStoredInfoType( - request?: protos.google.privacy.dlp.v2.ICreateStoredInfoTypeRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.privacy.dlp.v2.IStoredInfoType, - protos.google.privacy.dlp.v2.ICreateStoredInfoTypeRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.privacy.dlp.v2.IStoredInfoType, - protos.google.privacy.dlp.v2.ICreateStoredInfoTypeRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.privacy.dlp.v2.IStoredInfoType, - protos.google.privacy.dlp.v2.ICreateStoredInfoTypeRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as 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 || '', - }); - this.initialize(); - 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 {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}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v2/dlp_service.update_stored_info_type.js - * region_tag:dlp_v2_generated_DlpService_UpdateStoredInfoType_async - */ - updateStoredInfoType( - request?: protos.google.privacy.dlp.v2.IUpdateStoredInfoTypeRequest, - options?: CallOptions): - Promise<[ - protos.google.privacy.dlp.v2.IStoredInfoType, - protos.google.privacy.dlp.v2.IUpdateStoredInfoTypeRequest|undefined, {}|undefined - ]>; - updateStoredInfoType( - request: protos.google.privacy.dlp.v2.IUpdateStoredInfoTypeRequest, - options: CallOptions, - callback: Callback< - protos.google.privacy.dlp.v2.IStoredInfoType, - protos.google.privacy.dlp.v2.IUpdateStoredInfoTypeRequest|null|undefined, - {}|null|undefined>): void; - updateStoredInfoType( - request: protos.google.privacy.dlp.v2.IUpdateStoredInfoTypeRequest, - callback: Callback< - protos.google.privacy.dlp.v2.IStoredInfoType, - protos.google.privacy.dlp.v2.IUpdateStoredInfoTypeRequest|null|undefined, - {}|null|undefined>): void; - updateStoredInfoType( - request?: protos.google.privacy.dlp.v2.IUpdateStoredInfoTypeRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.privacy.dlp.v2.IStoredInfoType, - protos.google.privacy.dlp.v2.IUpdateStoredInfoTypeRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.privacy.dlp.v2.IStoredInfoType, - protos.google.privacy.dlp.v2.IUpdateStoredInfoTypeRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.privacy.dlp.v2.IStoredInfoType, - protos.google.privacy.dlp.v2.IUpdateStoredInfoTypeRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as 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 || '', - }); - this.initialize(); - 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] - * 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}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v2/dlp_service.get_stored_info_type.js - * region_tag:dlp_v2_generated_DlpService_GetStoredInfoType_async - */ - getStoredInfoType( - request?: protos.google.privacy.dlp.v2.IGetStoredInfoTypeRequest, - options?: CallOptions): - Promise<[ - protos.google.privacy.dlp.v2.IStoredInfoType, - protos.google.privacy.dlp.v2.IGetStoredInfoTypeRequest|undefined, {}|undefined - ]>; - getStoredInfoType( - request: protos.google.privacy.dlp.v2.IGetStoredInfoTypeRequest, - options: CallOptions, - callback: Callback< - protos.google.privacy.dlp.v2.IStoredInfoType, - protos.google.privacy.dlp.v2.IGetStoredInfoTypeRequest|null|undefined, - {}|null|undefined>): void; - getStoredInfoType( - request: protos.google.privacy.dlp.v2.IGetStoredInfoTypeRequest, - callback: Callback< - protos.google.privacy.dlp.v2.IStoredInfoType, - protos.google.privacy.dlp.v2.IGetStoredInfoTypeRequest|null|undefined, - {}|null|undefined>): void; - getStoredInfoType( - request?: protos.google.privacy.dlp.v2.IGetStoredInfoTypeRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.privacy.dlp.v2.IStoredInfoType, - protos.google.privacy.dlp.v2.IGetStoredInfoTypeRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.privacy.dlp.v2.IStoredInfoType, - protos.google.privacy.dlp.v2.IGetStoredInfoTypeRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.privacy.dlp.v2.IStoredInfoType, - protos.google.privacy.dlp.v2.IGetStoredInfoTypeRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as 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 || '', - }); - this.initialize(); - return this.innerApiCalls.getStoredInfoType(request, options, callback); - } -/** - * 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}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v2/dlp_service.delete_stored_info_type.js - * region_tag:dlp_v2_generated_DlpService_DeleteStoredInfoType_async - */ - deleteStoredInfoType( - request?: protos.google.privacy.dlp.v2.IDeleteStoredInfoTypeRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.privacy.dlp.v2.IDeleteStoredInfoTypeRequest|undefined, {}|undefined - ]>; - deleteStoredInfoType( - request: protos.google.privacy.dlp.v2.IDeleteStoredInfoTypeRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.privacy.dlp.v2.IDeleteStoredInfoTypeRequest|null|undefined, - {}|null|undefined>): void; - deleteStoredInfoType( - request: protos.google.privacy.dlp.v2.IDeleteStoredInfoTypeRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.privacy.dlp.v2.IDeleteStoredInfoTypeRequest|null|undefined, - {}|null|undefined>): void; - deleteStoredInfoType( - request?: protos.google.privacy.dlp.v2.IDeleteStoredInfoTypeRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.privacy.dlp.v2.IDeleteStoredInfoTypeRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.privacy.dlp.v2.IDeleteStoredInfoTypeRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.privacy.dlp.v2.IDeleteStoredInfoTypeRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as 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 || '', - }); - this.initialize(); - return this.innerApiCalls.deleteStoredInfoType(request, options, callback); - } -/** - * Inspect hybrid content and store findings to a job. - * To review the findings, inspect the job. Inspection will occur - * asynchronously. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. Resource name of the job to execute a hybrid inspect on, for example - * `projects/dlp-test-project/dlpJob/53234423`. - * @param {google.privacy.dlp.v2.HybridContentItem} request.hybridItem - * The item to inspect. - * @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 [HybridInspectResponse]{@link google.privacy.dlp.v2.HybridInspectResponse}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v2/dlp_service.hybrid_inspect_dlp_job.js - * region_tag:dlp_v2_generated_DlpService_HybridInspectDlpJob_async - */ - hybridInspectDlpJob( - request?: protos.google.privacy.dlp.v2.IHybridInspectDlpJobRequest, - options?: CallOptions): - Promise<[ - protos.google.privacy.dlp.v2.IHybridInspectResponse, - protos.google.privacy.dlp.v2.IHybridInspectDlpJobRequest|undefined, {}|undefined - ]>; - hybridInspectDlpJob( - request: protos.google.privacy.dlp.v2.IHybridInspectDlpJobRequest, - options: CallOptions, - callback: Callback< - protos.google.privacy.dlp.v2.IHybridInspectResponse, - protos.google.privacy.dlp.v2.IHybridInspectDlpJobRequest|null|undefined, - {}|null|undefined>): void; - hybridInspectDlpJob( - request: protos.google.privacy.dlp.v2.IHybridInspectDlpJobRequest, - callback: Callback< - protos.google.privacy.dlp.v2.IHybridInspectResponse, - protos.google.privacy.dlp.v2.IHybridInspectDlpJobRequest|null|undefined, - {}|null|undefined>): void; - hybridInspectDlpJob( - request?: protos.google.privacy.dlp.v2.IHybridInspectDlpJobRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.privacy.dlp.v2.IHybridInspectResponse, - protos.google.privacy.dlp.v2.IHybridInspectDlpJobRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.privacy.dlp.v2.IHybridInspectResponse, - protos.google.privacy.dlp.v2.IHybridInspectDlpJobRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.privacy.dlp.v2.IHybridInspectResponse, - protos.google.privacy.dlp.v2.IHybridInspectDlpJobRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as 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 || '', - }); - this.initialize(); - return this.innerApiCalls.hybridInspectDlpJob(request, options, callback); - } -/** - * Finish a running hybrid DlpJob. Triggers the finalization steps and running - * of any enabled actions that have not yet run. - * - * @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}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v2/dlp_service.finish_dlp_job.js - * region_tag:dlp_v2_generated_DlpService_FinishDlpJob_async - */ - finishDlpJob( - request?: protos.google.privacy.dlp.v2.IFinishDlpJobRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.privacy.dlp.v2.IFinishDlpJobRequest|undefined, {}|undefined - ]>; - finishDlpJob( - request: protos.google.privacy.dlp.v2.IFinishDlpJobRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.privacy.dlp.v2.IFinishDlpJobRequest|null|undefined, - {}|null|undefined>): void; - finishDlpJob( - request: protos.google.privacy.dlp.v2.IFinishDlpJobRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.privacy.dlp.v2.IFinishDlpJobRequest|null|undefined, - {}|null|undefined>): void; - finishDlpJob( - request?: protos.google.privacy.dlp.v2.IFinishDlpJobRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.privacy.dlp.v2.IFinishDlpJobRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.privacy.dlp.v2.IFinishDlpJobRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.privacy.dlp.v2.IFinishDlpJobRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as 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 || '', - }); - this.initialize(); - return this.innerApiCalls.finishDlpJob(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. Parent resource name. - * - * The format of this value varies depending on the scope of the request - * (project or organization) and whether you have [specified a processing - * location](https://cloud.google.com/dlp/docs/specifying-location): - * - * + Projects scope, location specified:
- * `projects/`PROJECT_ID`/locations/`LOCATION_ID - * + Projects scope, no location specified (defaults to global):
- * `projects/`PROJECT_ID - * + Organizations scope, location specified:
- * `organizations/`ORG_ID`/locations/`LOCATION_ID - * + Organizations scope, no location specified (defaults to global):
- * `organizations/`ORG_ID - * - * The following example `parent` string specifies a parent project with the - * identifier `example-project`, and specifies the `europe-west3` location - * for processing data: - * - * parent=projects/example-project/locations/europe-west3 - * @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 - * Deprecated. This field has no effect. - * @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 will perform 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. - * Note that it can affect your quota. - * We recommend using `listInspectTemplatesAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listInspectTemplates( - request?: protos.google.privacy.dlp.v2.IListInspectTemplatesRequest, - options?: CallOptions): - Promise<[ - protos.google.privacy.dlp.v2.IInspectTemplate[], - protos.google.privacy.dlp.v2.IListInspectTemplatesRequest|null, - protos.google.privacy.dlp.v2.IListInspectTemplatesResponse - ]>; - listInspectTemplates( - request: protos.google.privacy.dlp.v2.IListInspectTemplatesRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.privacy.dlp.v2.IListInspectTemplatesRequest, - protos.google.privacy.dlp.v2.IListInspectTemplatesResponse|null|undefined, - protos.google.privacy.dlp.v2.IInspectTemplate>): void; - listInspectTemplates( - request: protos.google.privacy.dlp.v2.IListInspectTemplatesRequest, - callback: PaginationCallback< - protos.google.privacy.dlp.v2.IListInspectTemplatesRequest, - protos.google.privacy.dlp.v2.IListInspectTemplatesResponse|null|undefined, - protos.google.privacy.dlp.v2.IInspectTemplate>): void; - listInspectTemplates( - request?: protos.google.privacy.dlp.v2.IListInspectTemplatesRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.privacy.dlp.v2.IListInspectTemplatesRequest, - protos.google.privacy.dlp.v2.IListInspectTemplatesResponse|null|undefined, - protos.google.privacy.dlp.v2.IInspectTemplate>, - callback?: PaginationCallback< - protos.google.privacy.dlp.v2.IListInspectTemplatesRequest, - protos.google.privacy.dlp.v2.IListInspectTemplatesResponse|null|undefined, - protos.google.privacy.dlp.v2.IInspectTemplate>): - Promise<[ - protos.google.privacy.dlp.v2.IInspectTemplate[], - protos.google.privacy.dlp.v2.IListInspectTemplatesRequest|null, - protos.google.privacy.dlp.v2.IListInspectTemplatesResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as 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 || '', - }); - this.initialize(); - return this.innerApiCalls.listInspectTemplates(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Parent resource name. - * - * The format of this value varies depending on the scope of the request - * (project or organization) and whether you have [specified a processing - * location](https://cloud.google.com/dlp/docs/specifying-location): - * - * + Projects scope, location specified:
- * `projects/`PROJECT_ID`/locations/`LOCATION_ID - * + Projects scope, no location specified (defaults to global):
- * `projects/`PROJECT_ID - * + Organizations scope, location specified:
- * `organizations/`ORG_ID`/locations/`LOCATION_ID - * + Organizations scope, no location specified (defaults to global):
- * `organizations/`ORG_ID - * - * The following example `parent` string specifies a parent project with the - * identifier `example-project`, and specifies the `europe-west3` location - * for processing data: - * - * parent=projects/example-project/locations/europe-west3 - * @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 - * Deprecated. This field has no effect. - * @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. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listInspectTemplatesAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listInspectTemplatesStream( - request?: protos.google.privacy.dlp.v2.IListInspectTemplatesRequest, - options?: CallOptions): - Transform{ - 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 || '', - }); - const defaultCallSettings = this._defaults['listInspectTemplates']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listInspectTemplates.createStream( - this.innerApiCalls.listInspectTemplates as gax.GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listInspectTemplates`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Parent resource name. - * - * The format of this value varies depending on the scope of the request - * (project or organization) and whether you have [specified a processing - * location](https://cloud.google.com/dlp/docs/specifying-location): - * - * + Projects scope, location specified:
- * `projects/`PROJECT_ID`/locations/`LOCATION_ID - * + Projects scope, no location specified (defaults to global):
- * `projects/`PROJECT_ID - * + Organizations scope, location specified:
- * `organizations/`ORG_ID`/locations/`LOCATION_ID - * + Organizations scope, no location specified (defaults to global):
- * `organizations/`ORG_ID - * - * The following example `parent` string specifies a parent project with the - * identifier `example-project`, and specifies the `europe-west3` location - * for processing data: - * - * parent=projects/example-project/locations/europe-west3 - * @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 - * Deprecated. This field has no effect. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). - * When you iterate the returned iterable, each element will be an object representing - * [InspectTemplate]{@link google.privacy.dlp.v2.InspectTemplate}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - * @example include:samples/generated/v2/dlp_service.list_inspect_templates.js - * region_tag:dlp_v2_generated_DlpService_ListInspectTemplates_async - */ - listInspectTemplatesAsync( - request?: protos.google.privacy.dlp.v2.IListInspectTemplatesRequest, - options?: CallOptions): - AsyncIterable{ - 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 || '', - }); - const defaultCallSettings = this._defaults['listInspectTemplates']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listInspectTemplates.asyncIterate( - this.innerApiCalls['listInspectTemplates'] as GaxCall, - request as unknown as RequestType, - callSettings - ) as AsyncIterable; - } - /** - * 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. Parent resource name. - * - * The format of this value varies depending on the scope of the request - * (project or organization) and whether you have [specified a processing - * location](https://cloud.google.com/dlp/docs/specifying-location): - * - * + Projects scope, location specified:
- * `projects/`PROJECT_ID`/locations/`LOCATION_ID - * + Projects scope, no location specified (defaults to global):
- * `projects/`PROJECT_ID - * + Organizations scope, location specified:
- * `organizations/`ORG_ID`/locations/`LOCATION_ID - * + Organizations scope, no location specified (defaults to global):
- * `organizations/`ORG_ID - * - * The following example `parent` string specifies a parent project with the - * identifier `example-project`, and specifies the `europe-west3` location - * for processing data: - * - * parent=projects/example-project/locations/europe-west3 - * @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 - * Deprecated. This field has no effect. - * @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 will perform 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. - * Note that it can affect your quota. - * We recommend using `listDeidentifyTemplatesAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listDeidentifyTemplates( - request?: protos.google.privacy.dlp.v2.IListDeidentifyTemplatesRequest, - options?: CallOptions): - Promise<[ - protos.google.privacy.dlp.v2.IDeidentifyTemplate[], - protos.google.privacy.dlp.v2.IListDeidentifyTemplatesRequest|null, - protos.google.privacy.dlp.v2.IListDeidentifyTemplatesResponse - ]>; - listDeidentifyTemplates( - request: protos.google.privacy.dlp.v2.IListDeidentifyTemplatesRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.privacy.dlp.v2.IListDeidentifyTemplatesRequest, - protos.google.privacy.dlp.v2.IListDeidentifyTemplatesResponse|null|undefined, - protos.google.privacy.dlp.v2.IDeidentifyTemplate>): void; - listDeidentifyTemplates( - request: protos.google.privacy.dlp.v2.IListDeidentifyTemplatesRequest, - callback: PaginationCallback< - protos.google.privacy.dlp.v2.IListDeidentifyTemplatesRequest, - protos.google.privacy.dlp.v2.IListDeidentifyTemplatesResponse|null|undefined, - protos.google.privacy.dlp.v2.IDeidentifyTemplate>): void; - listDeidentifyTemplates( - request?: protos.google.privacy.dlp.v2.IListDeidentifyTemplatesRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.privacy.dlp.v2.IListDeidentifyTemplatesRequest, - protos.google.privacy.dlp.v2.IListDeidentifyTemplatesResponse|null|undefined, - protos.google.privacy.dlp.v2.IDeidentifyTemplate>, - callback?: PaginationCallback< - protos.google.privacy.dlp.v2.IListDeidentifyTemplatesRequest, - protos.google.privacy.dlp.v2.IListDeidentifyTemplatesResponse|null|undefined, - protos.google.privacy.dlp.v2.IDeidentifyTemplate>): - Promise<[ - protos.google.privacy.dlp.v2.IDeidentifyTemplate[], - protos.google.privacy.dlp.v2.IListDeidentifyTemplatesRequest|null, - protos.google.privacy.dlp.v2.IListDeidentifyTemplatesResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as 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 || '', - }); - this.initialize(); - return this.innerApiCalls.listDeidentifyTemplates(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Parent resource name. - * - * The format of this value varies depending on the scope of the request - * (project or organization) and whether you have [specified a processing - * location](https://cloud.google.com/dlp/docs/specifying-location): - * - * + Projects scope, location specified:
- * `projects/`PROJECT_ID`/locations/`LOCATION_ID - * + Projects scope, no location specified (defaults to global):
- * `projects/`PROJECT_ID - * + Organizations scope, location specified:
- * `organizations/`ORG_ID`/locations/`LOCATION_ID - * + Organizations scope, no location specified (defaults to global):
- * `organizations/`ORG_ID - * - * The following example `parent` string specifies a parent project with the - * identifier `example-project`, and specifies the `europe-west3` location - * for processing data: - * - * parent=projects/example-project/locations/europe-west3 - * @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 - * Deprecated. This field has no effect. - * @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. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listDeidentifyTemplatesAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listDeidentifyTemplatesStream( - request?: protos.google.privacy.dlp.v2.IListDeidentifyTemplatesRequest, - options?: CallOptions): - Transform{ - 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 || '', - }); - const defaultCallSettings = this._defaults['listDeidentifyTemplates']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listDeidentifyTemplates.createStream( - this.innerApiCalls.listDeidentifyTemplates as gax.GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listDeidentifyTemplates`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Parent resource name. - * - * The format of this value varies depending on the scope of the request - * (project or organization) and whether you have [specified a processing - * location](https://cloud.google.com/dlp/docs/specifying-location): - * - * + Projects scope, location specified:
- * `projects/`PROJECT_ID`/locations/`LOCATION_ID - * + Projects scope, no location specified (defaults to global):
- * `projects/`PROJECT_ID - * + Organizations scope, location specified:
- * `organizations/`ORG_ID`/locations/`LOCATION_ID - * + Organizations scope, no location specified (defaults to global):
- * `organizations/`ORG_ID - * - * The following example `parent` string specifies a parent project with the - * identifier `example-project`, and specifies the `europe-west3` location - * for processing data: - * - * parent=projects/example-project/locations/europe-west3 - * @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 - * Deprecated. This field has no effect. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). - * When you iterate the returned iterable, each element will be an object representing - * [DeidentifyTemplate]{@link google.privacy.dlp.v2.DeidentifyTemplate}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - * @example include:samples/generated/v2/dlp_service.list_deidentify_templates.js - * region_tag:dlp_v2_generated_DlpService_ListDeidentifyTemplates_async - */ - listDeidentifyTemplatesAsync( - request?: protos.google.privacy.dlp.v2.IListDeidentifyTemplatesRequest, - options?: CallOptions): - AsyncIterable{ - 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 || '', - }); - const defaultCallSettings = this._defaults['listDeidentifyTemplates']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listDeidentifyTemplates.asyncIterate( - this.innerApiCalls['listDeidentifyTemplates'] as GaxCall, - request as unknown as RequestType, - callSettings - ) as AsyncIterable; - } - /** - * 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. Parent resource name. - * - * The format of this value varies depending on whether you have [specified a - * processing - * location](https://cloud.google.com/dlp/docs/specifying-location): - * - * + Projects scope, location specified:
- * `projects/`PROJECT_ID`/locations/`LOCATION_ID - * + Projects scope, no location specified (defaults to global):
- * `projects/`PROJECT_ID - * - * The following example `parent` string specifies a parent project with the - * identifier `example-project`, and specifies the `europe-west3` location - * for processing data: - * - * parent=projects/example-project/locations/europe-west3 - * @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 triggers: - * - `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 {google.privacy.dlp.v2.DlpJobType} request.type - * The type of jobs. Will use `DlpJobType.INSPECT` if not set. - * @param {string} request.locationId - * Deprecated. This field has no effect. - * @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 will perform 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. - * Note that it can affect your quota. - * We recommend using `listJobTriggersAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listJobTriggers( - request?: protos.google.privacy.dlp.v2.IListJobTriggersRequest, - options?: CallOptions): - Promise<[ - protos.google.privacy.dlp.v2.IJobTrigger[], - protos.google.privacy.dlp.v2.IListJobTriggersRequest|null, - protos.google.privacy.dlp.v2.IListJobTriggersResponse - ]>; - listJobTriggers( - request: protos.google.privacy.dlp.v2.IListJobTriggersRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.privacy.dlp.v2.IListJobTriggersRequest, - protos.google.privacy.dlp.v2.IListJobTriggersResponse|null|undefined, - protos.google.privacy.dlp.v2.IJobTrigger>): void; - listJobTriggers( - request: protos.google.privacy.dlp.v2.IListJobTriggersRequest, - callback: PaginationCallback< - protos.google.privacy.dlp.v2.IListJobTriggersRequest, - protos.google.privacy.dlp.v2.IListJobTriggersResponse|null|undefined, - protos.google.privacy.dlp.v2.IJobTrigger>): void; - listJobTriggers( - request?: protos.google.privacy.dlp.v2.IListJobTriggersRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.privacy.dlp.v2.IListJobTriggersRequest, - protos.google.privacy.dlp.v2.IListJobTriggersResponse|null|undefined, - protos.google.privacy.dlp.v2.IJobTrigger>, - callback?: PaginationCallback< - protos.google.privacy.dlp.v2.IListJobTriggersRequest, - protos.google.privacy.dlp.v2.IListJobTriggersResponse|null|undefined, - protos.google.privacy.dlp.v2.IJobTrigger>): - Promise<[ - protos.google.privacy.dlp.v2.IJobTrigger[], - protos.google.privacy.dlp.v2.IListJobTriggersRequest|null, - protos.google.privacy.dlp.v2.IListJobTriggersResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as 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 || '', - }); - this.initialize(); - return this.innerApiCalls.listJobTriggers(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Parent resource name. - * - * The format of this value varies depending on whether you have [specified a - * processing - * location](https://cloud.google.com/dlp/docs/specifying-location): - * - * + Projects scope, location specified:
- * `projects/`PROJECT_ID`/locations/`LOCATION_ID - * + Projects scope, no location specified (defaults to global):
- * `projects/`PROJECT_ID - * - * The following example `parent` string specifies a parent project with the - * identifier `example-project`, and specifies the `europe-west3` location - * for processing data: - * - * parent=projects/example-project/locations/europe-west3 - * @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 triggers: - * - `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 {google.privacy.dlp.v2.DlpJobType} request.type - * The type of jobs. Will use `DlpJobType.INSPECT` if not set. - * @param {string} request.locationId - * Deprecated. This field has no effect. - * @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. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listJobTriggersAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listJobTriggersStream( - request?: protos.google.privacy.dlp.v2.IListJobTriggersRequest, - options?: CallOptions): - Transform{ - 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 || '', - }); - const defaultCallSettings = this._defaults['listJobTriggers']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listJobTriggers.createStream( - this.innerApiCalls.listJobTriggers as gax.GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listJobTriggers`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Parent resource name. - * - * The format of this value varies depending on whether you have [specified a - * processing - * location](https://cloud.google.com/dlp/docs/specifying-location): - * - * + Projects scope, location specified:
- * `projects/`PROJECT_ID`/locations/`LOCATION_ID - * + Projects scope, no location specified (defaults to global):
- * `projects/`PROJECT_ID - * - * The following example `parent` string specifies a parent project with the - * identifier `example-project`, and specifies the `europe-west3` location - * for processing data: - * - * parent=projects/example-project/locations/europe-west3 - * @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 triggers: - * - `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 {google.privacy.dlp.v2.DlpJobType} request.type - * The type of jobs. Will use `DlpJobType.INSPECT` if not set. - * @param {string} request.locationId - * Deprecated. This field has no effect. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). - * When you iterate the returned iterable, each element will be an object representing - * [JobTrigger]{@link google.privacy.dlp.v2.JobTrigger}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - * @example include:samples/generated/v2/dlp_service.list_job_triggers.js - * region_tag:dlp_v2_generated_DlpService_ListJobTriggers_async - */ - listJobTriggersAsync( - request?: protos.google.privacy.dlp.v2.IListJobTriggersRequest, - options?: CallOptions): - AsyncIterable{ - 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 || '', - }); - const defaultCallSettings = this._defaults['listJobTriggers']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listJobTriggers.asyncIterate( - this.innerApiCalls['listJobTriggers'] as GaxCall, - request as unknown as RequestType, - callSettings - ) as AsyncIterable; - } - /** - * 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. Parent resource name. - * - * The format of this value varies depending on whether you have [specified a - * processing - * location](https://cloud.google.com/dlp/docs/specifying-location): - * - * + Projects scope, location specified:
- * `projects/`PROJECT_ID`/locations/`LOCATION_ID - * + Projects scope, no location specified (defaults to global):
- * `projects/`PROJECT_ID - * - * The following example `parent` string specifies a parent project with the - * identifier `example-project`, and specifies the `europe-west3` location - * for processing data: - * - * parent=projects/example-project/locations/europe-west3 - * @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 - * Deprecated. This field has no effect. - * @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 will perform 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. - * Note that it can affect your quota. - * We recommend using `listDlpJobsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listDlpJobs( - request?: protos.google.privacy.dlp.v2.IListDlpJobsRequest, - options?: CallOptions): - Promise<[ - protos.google.privacy.dlp.v2.IDlpJob[], - protos.google.privacy.dlp.v2.IListDlpJobsRequest|null, - protos.google.privacy.dlp.v2.IListDlpJobsResponse - ]>; - listDlpJobs( - request: protos.google.privacy.dlp.v2.IListDlpJobsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.privacy.dlp.v2.IListDlpJobsRequest, - protos.google.privacy.dlp.v2.IListDlpJobsResponse|null|undefined, - protos.google.privacy.dlp.v2.IDlpJob>): void; - listDlpJobs( - request: protos.google.privacy.dlp.v2.IListDlpJobsRequest, - callback: PaginationCallback< - protos.google.privacy.dlp.v2.IListDlpJobsRequest, - protos.google.privacy.dlp.v2.IListDlpJobsResponse|null|undefined, - protos.google.privacy.dlp.v2.IDlpJob>): void; - listDlpJobs( - request?: protos.google.privacy.dlp.v2.IListDlpJobsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.privacy.dlp.v2.IListDlpJobsRequest, - protos.google.privacy.dlp.v2.IListDlpJobsResponse|null|undefined, - protos.google.privacy.dlp.v2.IDlpJob>, - callback?: PaginationCallback< - protos.google.privacy.dlp.v2.IListDlpJobsRequest, - protos.google.privacy.dlp.v2.IListDlpJobsResponse|null|undefined, - protos.google.privacy.dlp.v2.IDlpJob>): - Promise<[ - protos.google.privacy.dlp.v2.IDlpJob[], - protos.google.privacy.dlp.v2.IListDlpJobsRequest|null, - protos.google.privacy.dlp.v2.IListDlpJobsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as 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 || '', - }); - this.initialize(); - return this.innerApiCalls.listDlpJobs(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Parent resource name. - * - * The format of this value varies depending on whether you have [specified a - * processing - * location](https://cloud.google.com/dlp/docs/specifying-location): - * - * + Projects scope, location specified:
- * `projects/`PROJECT_ID`/locations/`LOCATION_ID - * + Projects scope, no location specified (defaults to global):
- * `projects/`PROJECT_ID - * - * The following example `parent` string specifies a parent project with the - * identifier `example-project`, and specifies the `europe-west3` location - * for processing data: - * - * parent=projects/example-project/locations/europe-west3 - * @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 - * Deprecated. This field has no effect. - * @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. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listDlpJobsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listDlpJobsStream( - request?: protos.google.privacy.dlp.v2.IListDlpJobsRequest, - options?: CallOptions): - Transform{ - 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 || '', - }); - const defaultCallSettings = this._defaults['listDlpJobs']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listDlpJobs.createStream( - this.innerApiCalls.listDlpJobs as gax.GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listDlpJobs`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Parent resource name. - * - * The format of this value varies depending on whether you have [specified a - * processing - * location](https://cloud.google.com/dlp/docs/specifying-location): - * - * + Projects scope, location specified:
- * `projects/`PROJECT_ID`/locations/`LOCATION_ID - * + Projects scope, no location specified (defaults to global):
- * `projects/`PROJECT_ID - * - * The following example `parent` string specifies a parent project with the - * identifier `example-project`, and specifies the `europe-west3` location - * for processing data: - * - * parent=projects/example-project/locations/europe-west3 - * @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 - * Deprecated. This field has no effect. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). - * When you iterate the returned iterable, each element will be an object representing - * [DlpJob]{@link google.privacy.dlp.v2.DlpJob}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - * @example include:samples/generated/v2/dlp_service.list_dlp_jobs.js - * region_tag:dlp_v2_generated_DlpService_ListDlpJobs_async - */ - listDlpJobsAsync( - request?: protos.google.privacy.dlp.v2.IListDlpJobsRequest, - options?: CallOptions): - AsyncIterable{ - 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 || '', - }); - const defaultCallSettings = this._defaults['listDlpJobs']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listDlpJobs.asyncIterate( - this.innerApiCalls['listDlpJobs'] as GaxCall, - request as unknown as RequestType, - callSettings - ) as AsyncIterable; - } - /** - * 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. Parent resource name. - * - * The format of this value varies depending on the scope of the request - * (project or organization) and whether you have [specified a processing - * location](https://cloud.google.com/dlp/docs/specifying-location): - * - * + Projects scope, location specified:
- * `projects/`PROJECT_ID`/locations/`LOCATION_ID - * + Projects scope, no location specified (defaults to global):
- * `projects/`PROJECT_ID - * + Organizations scope, location specified:
- * `organizations/`ORG_ID`/locations/`LOCATION_ID - * + Organizations scope, no location specified (defaults to global):
- * `organizations/`ORG_ID - * - * The following example `parent` string specifies a parent project with the - * identifier `example-project`, and specifies the `europe-west3` location - * for processing data: - * - * parent=projects/example-project/locations/europe-west3 - * @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 - * Deprecated. This field has no effect. - * @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 will perform 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. - * Note that it can affect your quota. - * We recommend using `listStoredInfoTypesAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listStoredInfoTypes( - request?: protos.google.privacy.dlp.v2.IListStoredInfoTypesRequest, - options?: CallOptions): - Promise<[ - protos.google.privacy.dlp.v2.IStoredInfoType[], - protos.google.privacy.dlp.v2.IListStoredInfoTypesRequest|null, - protos.google.privacy.dlp.v2.IListStoredInfoTypesResponse - ]>; - listStoredInfoTypes( - request: protos.google.privacy.dlp.v2.IListStoredInfoTypesRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.privacy.dlp.v2.IListStoredInfoTypesRequest, - protos.google.privacy.dlp.v2.IListStoredInfoTypesResponse|null|undefined, - protos.google.privacy.dlp.v2.IStoredInfoType>): void; - listStoredInfoTypes( - request: protos.google.privacy.dlp.v2.IListStoredInfoTypesRequest, - callback: PaginationCallback< - protos.google.privacy.dlp.v2.IListStoredInfoTypesRequest, - protos.google.privacy.dlp.v2.IListStoredInfoTypesResponse|null|undefined, - protos.google.privacy.dlp.v2.IStoredInfoType>): void; - listStoredInfoTypes( - request?: protos.google.privacy.dlp.v2.IListStoredInfoTypesRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.privacy.dlp.v2.IListStoredInfoTypesRequest, - protos.google.privacy.dlp.v2.IListStoredInfoTypesResponse|null|undefined, - protos.google.privacy.dlp.v2.IStoredInfoType>, - callback?: PaginationCallback< - protos.google.privacy.dlp.v2.IListStoredInfoTypesRequest, - protos.google.privacy.dlp.v2.IListStoredInfoTypesResponse|null|undefined, - protos.google.privacy.dlp.v2.IStoredInfoType>): - Promise<[ - protos.google.privacy.dlp.v2.IStoredInfoType[], - protos.google.privacy.dlp.v2.IListStoredInfoTypesRequest|null, - protos.google.privacy.dlp.v2.IListStoredInfoTypesResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as 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 || '', - }); - this.initialize(); - return this.innerApiCalls.listStoredInfoTypes(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Parent resource name. - * - * The format of this value varies depending on the scope of the request - * (project or organization) and whether you have [specified a processing - * location](https://cloud.google.com/dlp/docs/specifying-location): - * - * + Projects scope, location specified:
- * `projects/`PROJECT_ID`/locations/`LOCATION_ID - * + Projects scope, no location specified (defaults to global):
- * `projects/`PROJECT_ID - * + Organizations scope, location specified:
- * `organizations/`ORG_ID`/locations/`LOCATION_ID - * + Organizations scope, no location specified (defaults to global):
- * `organizations/`ORG_ID - * - * The following example `parent` string specifies a parent project with the - * identifier `example-project`, and specifies the `europe-west3` location - * for processing data: - * - * parent=projects/example-project/locations/europe-west3 - * @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 - * Deprecated. This field has no effect. - * @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. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listStoredInfoTypesAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listStoredInfoTypesStream( - request?: protos.google.privacy.dlp.v2.IListStoredInfoTypesRequest, - options?: CallOptions): - Transform{ - 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 || '', - }); - const defaultCallSettings = this._defaults['listStoredInfoTypes']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listStoredInfoTypes.createStream( - this.innerApiCalls.listStoredInfoTypes as gax.GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listStoredInfoTypes`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Parent resource name. - * - * The format of this value varies depending on the scope of the request - * (project or organization) and whether you have [specified a processing - * location](https://cloud.google.com/dlp/docs/specifying-location): - * - * + Projects scope, location specified:
- * `projects/`PROJECT_ID`/locations/`LOCATION_ID - * + Projects scope, no location specified (defaults to global):
- * `projects/`PROJECT_ID - * + Organizations scope, location specified:
- * `organizations/`ORG_ID`/locations/`LOCATION_ID - * + Organizations scope, no location specified (defaults to global):
- * `organizations/`ORG_ID - * - * The following example `parent` string specifies a parent project with the - * identifier `example-project`, and specifies the `europe-west3` location - * for processing data: - * - * parent=projects/example-project/locations/europe-west3 - * @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 - * Deprecated. This field has no effect. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). - * When you iterate the returned iterable, each element will be an object representing - * [StoredInfoType]{@link google.privacy.dlp.v2.StoredInfoType}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - * @example include:samples/generated/v2/dlp_service.list_stored_info_types.js - * region_tag:dlp_v2_generated_DlpService_ListStoredInfoTypes_async - */ - listStoredInfoTypesAsync( - request?: protos.google.privacy.dlp.v2.IListStoredInfoTypesRequest, - options?: CallOptions): - AsyncIterable{ - 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 || '', - }); - const defaultCallSettings = this._defaults['listStoredInfoTypes']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listStoredInfoTypes.asyncIterate( - this.innerApiCalls['listStoredInfoTypes'] as GaxCall, - request as unknown as RequestType, - callSettings - ) as AsyncIterable; - } - // -------------------- - // -- Path templates -- - // -------------------- - - /** - * Return a fully-qualified finding resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} finding - * @returns {string} Resource name string. - */ - findingPath(project:string,location:string,finding:string) { - return this.pathTemplates.findingPathTemplate.render({ - project: project, - location: location, - finding: finding, - }); - } - - /** - * Parse the project from Finding resource. - * - * @param {string} findingName - * A fully-qualified path representing Finding resource. - * @returns {string} A string representing the project. - */ - matchProjectFromFindingName(findingName: string) { - return this.pathTemplates.findingPathTemplate.match(findingName).project; - } - - /** - * Parse the location from Finding resource. - * - * @param {string} findingName - * A fully-qualified path representing Finding resource. - * @returns {string} A string representing the location. - */ - matchLocationFromFindingName(findingName: string) { - return this.pathTemplates.findingPathTemplate.match(findingName).location; - } - - /** - * Parse the finding from Finding resource. - * - * @param {string} findingName - * A fully-qualified path representing Finding resource. - * @returns {string} A string representing the finding. - */ - matchFindingFromFindingName(findingName: string) { - return this.pathTemplates.findingPathTemplate.match(findingName).finding; - } - - /** - * 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: 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 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: 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 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: 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 organizationLocationDeidentifyTemplate resource name string. - * - * @param {string} organization - * @param {string} location - * @param {string} deidentify_template - * @returns {string} Resource name string. - */ - organizationLocationDeidentifyTemplatePath(organization:string,location:string,deidentifyTemplate:string) { - return this.pathTemplates.organizationLocationDeidentifyTemplatePathTemplate.render({ - organization: organization, - location: location, - deidentify_template: deidentifyTemplate, - }); - } - - /** - * Parse the organization from OrganizationLocationDeidentifyTemplate resource. - * - * @param {string} organizationLocationDeidentifyTemplateName - * A fully-qualified path representing organization_location_deidentify_template resource. - * @returns {string} A string representing the organization. - */ - matchOrganizationFromOrganizationLocationDeidentifyTemplateName(organizationLocationDeidentifyTemplateName: string) { - return this.pathTemplates.organizationLocationDeidentifyTemplatePathTemplate.match(organizationLocationDeidentifyTemplateName).organization; - } - - /** - * Parse the location from OrganizationLocationDeidentifyTemplate resource. - * - * @param {string} organizationLocationDeidentifyTemplateName - * A fully-qualified path representing organization_location_deidentify_template resource. - * @returns {string} A string representing the location. - */ - matchLocationFromOrganizationLocationDeidentifyTemplateName(organizationLocationDeidentifyTemplateName: string) { - return this.pathTemplates.organizationLocationDeidentifyTemplatePathTemplate.match(organizationLocationDeidentifyTemplateName).location; - } - - /** - * Parse the deidentify_template from OrganizationLocationDeidentifyTemplate resource. - * - * @param {string} organizationLocationDeidentifyTemplateName - * A fully-qualified path representing organization_location_deidentify_template resource. - * @returns {string} A string representing the deidentify_template. - */ - matchDeidentifyTemplateFromOrganizationLocationDeidentifyTemplateName(organizationLocationDeidentifyTemplateName: string) { - return this.pathTemplates.organizationLocationDeidentifyTemplatePathTemplate.match(organizationLocationDeidentifyTemplateName).deidentify_template; - } - - /** - * Return a fully-qualified organizationLocationInspectTemplate resource name string. - * - * @param {string} organization - * @param {string} location - * @param {string} inspect_template - * @returns {string} Resource name string. - */ - organizationLocationInspectTemplatePath(organization:string,location:string,inspectTemplate:string) { - return this.pathTemplates.organizationLocationInspectTemplatePathTemplate.render({ - organization: organization, - location: location, - inspect_template: inspectTemplate, - }); - } - - /** - * Parse the organization from OrganizationLocationInspectTemplate resource. - * - * @param {string} organizationLocationInspectTemplateName - * A fully-qualified path representing organization_location_inspect_template resource. - * @returns {string} A string representing the organization. - */ - matchOrganizationFromOrganizationLocationInspectTemplateName(organizationLocationInspectTemplateName: string) { - return this.pathTemplates.organizationLocationInspectTemplatePathTemplate.match(organizationLocationInspectTemplateName).organization; - } - - /** - * Parse the location from OrganizationLocationInspectTemplate resource. - * - * @param {string} organizationLocationInspectTemplateName - * A fully-qualified path representing organization_location_inspect_template resource. - * @returns {string} A string representing the location. - */ - matchLocationFromOrganizationLocationInspectTemplateName(organizationLocationInspectTemplateName: string) { - return this.pathTemplates.organizationLocationInspectTemplatePathTemplate.match(organizationLocationInspectTemplateName).location; - } - - /** - * Parse the inspect_template from OrganizationLocationInspectTemplate resource. - * - * @param {string} organizationLocationInspectTemplateName - * A fully-qualified path representing organization_location_inspect_template resource. - * @returns {string} A string representing the inspect_template. - */ - matchInspectTemplateFromOrganizationLocationInspectTemplateName(organizationLocationInspectTemplateName: string) { - return this.pathTemplates.organizationLocationInspectTemplatePathTemplate.match(organizationLocationInspectTemplateName).inspect_template; - } - - /** - * Return a fully-qualified organizationLocationStoredInfoType resource name string. - * - * @param {string} organization - * @param {string} location - * @param {string} stored_info_type - * @returns {string} Resource name string. - */ - organizationLocationStoredInfoTypePath(organization:string,location:string,storedInfoType:string) { - return this.pathTemplates.organizationLocationStoredInfoTypePathTemplate.render({ - organization: organization, - location: location, - stored_info_type: storedInfoType, - }); - } - - /** - * Parse the organization from OrganizationLocationStoredInfoType resource. - * - * @param {string} organizationLocationStoredInfoTypeName - * A fully-qualified path representing organization_location_stored_info_type resource. - * @returns {string} A string representing the organization. - */ - matchOrganizationFromOrganizationLocationStoredInfoTypeName(organizationLocationStoredInfoTypeName: string) { - return this.pathTemplates.organizationLocationStoredInfoTypePathTemplate.match(organizationLocationStoredInfoTypeName).organization; - } - - /** - * Parse the location from OrganizationLocationStoredInfoType resource. - * - * @param {string} organizationLocationStoredInfoTypeName - * A fully-qualified path representing organization_location_stored_info_type resource. - * @returns {string} A string representing the location. - */ - matchLocationFromOrganizationLocationStoredInfoTypeName(organizationLocationStoredInfoTypeName: string) { - return this.pathTemplates.organizationLocationStoredInfoTypePathTemplate.match(organizationLocationStoredInfoTypeName).location; - } - - /** - * Parse the stored_info_type from OrganizationLocationStoredInfoType resource. - * - * @param {string} organizationLocationStoredInfoTypeName - * A fully-qualified path representing organization_location_stored_info_type resource. - * @returns {string} A string representing the stored_info_type. - */ - matchStoredInfoTypeFromOrganizationLocationStoredInfoTypeName(organizationLocationStoredInfoTypeName: string) { - return this.pathTemplates.organizationLocationStoredInfoTypePathTemplate.match(organizationLocationStoredInfoTypeName).stored_info_type; - } - - /** - * 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: 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 project resource name string. - * - * @param {string} project - * @returns {string} Resource name string. - */ - projectPath(project:string) { - return this.pathTemplates.projectPathTemplate.render({ - project: 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 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: 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 projectDlpContent resource name string. - * - * @param {string} project - * @returns {string} Resource name string. - */ - projectDlpContentPath(project:string) { - return this.pathTemplates.projectDlpContentPathTemplate.render({ - project: project, - }); - } - - /** - * Parse the project from ProjectDlpContent resource. - * - * @param {string} projectDlpContentName - * A fully-qualified path representing project_dlpContent resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectDlpContentName(projectDlpContentName: string) { - return this.pathTemplates.projectDlpContentPathTemplate.match(projectDlpContentName).project; - } - - /** - * Return a fully-qualified projectDlpJob resource name string. - * - * @param {string} project - * @param {string} dlp_job - * @returns {string} Resource name string. - */ - projectDlpJobPath(project:string,dlpJob:string) { - return this.pathTemplates.projectDlpJobPathTemplate.render({ - project: project, - dlp_job: dlpJob, - }); - } - - /** - * Parse the project from ProjectDlpJob resource. - * - * @param {string} projectDlpJobName - * A fully-qualified path representing project_dlp_job resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectDlpJobName(projectDlpJobName: string) { - return this.pathTemplates.projectDlpJobPathTemplate.match(projectDlpJobName).project; - } - - /** - * Parse the dlp_job from ProjectDlpJob resource. - * - * @param {string} projectDlpJobName - * A fully-qualified path representing project_dlp_job resource. - * @returns {string} A string representing the dlp_job. - */ - matchDlpJobFromProjectDlpJobName(projectDlpJobName: string) { - return this.pathTemplates.projectDlpJobPathTemplate.match(projectDlpJobName).dlp_job; - } - - /** - * 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: 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 projectJobTrigger resource name string. - * - * @param {string} project - * @param {string} job_trigger - * @returns {string} Resource name string. - */ - projectJobTriggerPath(project:string,jobTrigger:string) { - return this.pathTemplates.projectJobTriggerPathTemplate.render({ - project: project, - job_trigger: jobTrigger, - }); - } - - /** - * Parse the project from ProjectJobTrigger resource. - * - * @param {string} projectJobTriggerName - * A fully-qualified path representing project_job_trigger resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectJobTriggerName(projectJobTriggerName: string) { - return this.pathTemplates.projectJobTriggerPathTemplate.match(projectJobTriggerName).project; - } - - /** - * Parse the job_trigger from ProjectJobTrigger resource. - * - * @param {string} projectJobTriggerName - * A fully-qualified path representing project_job_trigger resource. - * @returns {string} A string representing the job_trigger. - */ - matchJobTriggerFromProjectJobTriggerName(projectJobTriggerName: string) { - return this.pathTemplates.projectJobTriggerPathTemplate.match(projectJobTriggerName).job_trigger; - } - - /** - * Return a fully-qualified projectLocationDeidentifyTemplate resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} deidentify_template - * @returns {string} Resource name string. - */ - projectLocationDeidentifyTemplatePath(project:string,location:string,deidentifyTemplate:string) { - return this.pathTemplates.projectLocationDeidentifyTemplatePathTemplate.render({ - project: project, - location: location, - deidentify_template: deidentifyTemplate, - }); - } - - /** - * Parse the project from ProjectLocationDeidentifyTemplate resource. - * - * @param {string} projectLocationDeidentifyTemplateName - * A fully-qualified path representing project_location_deidentify_template resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectLocationDeidentifyTemplateName(projectLocationDeidentifyTemplateName: string) { - return this.pathTemplates.projectLocationDeidentifyTemplatePathTemplate.match(projectLocationDeidentifyTemplateName).project; - } - - /** - * Parse the location from ProjectLocationDeidentifyTemplate resource. - * - * @param {string} projectLocationDeidentifyTemplateName - * A fully-qualified path representing project_location_deidentify_template resource. - * @returns {string} A string representing the location. - */ - matchLocationFromProjectLocationDeidentifyTemplateName(projectLocationDeidentifyTemplateName: string) { - return this.pathTemplates.projectLocationDeidentifyTemplatePathTemplate.match(projectLocationDeidentifyTemplateName).location; - } - - /** - * Parse the deidentify_template from ProjectLocationDeidentifyTemplate resource. - * - * @param {string} projectLocationDeidentifyTemplateName - * A fully-qualified path representing project_location_deidentify_template resource. - * @returns {string} A string representing the deidentify_template. - */ - matchDeidentifyTemplateFromProjectLocationDeidentifyTemplateName(projectLocationDeidentifyTemplateName: string) { - return this.pathTemplates.projectLocationDeidentifyTemplatePathTemplate.match(projectLocationDeidentifyTemplateName).deidentify_template; - } - - /** - * Return a fully-qualified projectLocationDlpJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dlp_job - * @returns {string} Resource name string. - */ - projectLocationDlpJobPath(project:string,location:string,dlpJob:string) { - return this.pathTemplates.projectLocationDlpJobPathTemplate.render({ - project: project, - location: location, - dlp_job: dlpJob, - }); - } - - /** - * Parse the project from ProjectLocationDlpJob resource. - * - * @param {string} projectLocationDlpJobName - * A fully-qualified path representing project_location_dlp_job resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectLocationDlpJobName(projectLocationDlpJobName: string) { - return this.pathTemplates.projectLocationDlpJobPathTemplate.match(projectLocationDlpJobName).project; - } - - /** - * Parse the location from ProjectLocationDlpJob resource. - * - * @param {string} projectLocationDlpJobName - * A fully-qualified path representing project_location_dlp_job resource. - * @returns {string} A string representing the location. - */ - matchLocationFromProjectLocationDlpJobName(projectLocationDlpJobName: string) { - return this.pathTemplates.projectLocationDlpJobPathTemplate.match(projectLocationDlpJobName).location; - } - - /** - * Parse the dlp_job from ProjectLocationDlpJob resource. - * - * @param {string} projectLocationDlpJobName - * A fully-qualified path representing project_location_dlp_job resource. - * @returns {string} A string representing the dlp_job. - */ - matchDlpJobFromProjectLocationDlpJobName(projectLocationDlpJobName: string) { - return this.pathTemplates.projectLocationDlpJobPathTemplate.match(projectLocationDlpJobName).dlp_job; - } - - /** - * Return a fully-qualified projectLocationInspectTemplate resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} inspect_template - * @returns {string} Resource name string. - */ - projectLocationInspectTemplatePath(project:string,location:string,inspectTemplate:string) { - return this.pathTemplates.projectLocationInspectTemplatePathTemplate.render({ - project: project, - location: location, - inspect_template: inspectTemplate, - }); - } - - /** - * Parse the project from ProjectLocationInspectTemplate resource. - * - * @param {string} projectLocationInspectTemplateName - * A fully-qualified path representing project_location_inspect_template resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectLocationInspectTemplateName(projectLocationInspectTemplateName: string) { - return this.pathTemplates.projectLocationInspectTemplatePathTemplate.match(projectLocationInspectTemplateName).project; - } - - /** - * Parse the location from ProjectLocationInspectTemplate resource. - * - * @param {string} projectLocationInspectTemplateName - * A fully-qualified path representing project_location_inspect_template resource. - * @returns {string} A string representing the location. - */ - matchLocationFromProjectLocationInspectTemplateName(projectLocationInspectTemplateName: string) { - return this.pathTemplates.projectLocationInspectTemplatePathTemplate.match(projectLocationInspectTemplateName).location; - } - - /** - * Parse the inspect_template from ProjectLocationInspectTemplate resource. - * - * @param {string} projectLocationInspectTemplateName - * A fully-qualified path representing project_location_inspect_template resource. - * @returns {string} A string representing the inspect_template. - */ - matchInspectTemplateFromProjectLocationInspectTemplateName(projectLocationInspectTemplateName: string) { - return this.pathTemplates.projectLocationInspectTemplatePathTemplate.match(projectLocationInspectTemplateName).inspect_template; - } - - /** - * Return a fully-qualified projectLocationJobTrigger resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} job_trigger - * @returns {string} Resource name string. - */ - projectLocationJobTriggerPath(project:string,location:string,jobTrigger:string) { - return this.pathTemplates.projectLocationJobTriggerPathTemplate.render({ - project: project, - location: location, - job_trigger: jobTrigger, - }); - } - - /** - * Parse the project from ProjectLocationJobTrigger resource. - * - * @param {string} projectLocationJobTriggerName - * A fully-qualified path representing project_location_job_trigger resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectLocationJobTriggerName(projectLocationJobTriggerName: string) { - return this.pathTemplates.projectLocationJobTriggerPathTemplate.match(projectLocationJobTriggerName).project; - } - - /** - * Parse the location from ProjectLocationJobTrigger resource. - * - * @param {string} projectLocationJobTriggerName - * A fully-qualified path representing project_location_job_trigger resource. - * @returns {string} A string representing the location. - */ - matchLocationFromProjectLocationJobTriggerName(projectLocationJobTriggerName: string) { - return this.pathTemplates.projectLocationJobTriggerPathTemplate.match(projectLocationJobTriggerName).location; - } - - /** - * Parse the job_trigger from ProjectLocationJobTrigger resource. - * - * @param {string} projectLocationJobTriggerName - * A fully-qualified path representing project_location_job_trigger resource. - * @returns {string} A string representing the job_trigger. - */ - matchJobTriggerFromProjectLocationJobTriggerName(projectLocationJobTriggerName: string) { - return this.pathTemplates.projectLocationJobTriggerPathTemplate.match(projectLocationJobTriggerName).job_trigger; - } - - /** - * Return a fully-qualified projectLocationStoredInfoType resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} stored_info_type - * @returns {string} Resource name string. - */ - projectLocationStoredInfoTypePath(project:string,location:string,storedInfoType:string) { - return this.pathTemplates.projectLocationStoredInfoTypePathTemplate.render({ - project: project, - location: location, - stored_info_type: storedInfoType, - }); - } - - /** - * Parse the project from ProjectLocationStoredInfoType resource. - * - * @param {string} projectLocationStoredInfoTypeName - * A fully-qualified path representing project_location_stored_info_type resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectLocationStoredInfoTypeName(projectLocationStoredInfoTypeName: string) { - return this.pathTemplates.projectLocationStoredInfoTypePathTemplate.match(projectLocationStoredInfoTypeName).project; - } - - /** - * Parse the location from ProjectLocationStoredInfoType resource. - * - * @param {string} projectLocationStoredInfoTypeName - * A fully-qualified path representing project_location_stored_info_type resource. - * @returns {string} A string representing the location. - */ - matchLocationFromProjectLocationStoredInfoTypeName(projectLocationStoredInfoTypeName: string) { - return this.pathTemplates.projectLocationStoredInfoTypePathTemplate.match(projectLocationStoredInfoTypeName).location; - } - - /** - * Parse the stored_info_type from ProjectLocationStoredInfoType resource. - * - * @param {string} projectLocationStoredInfoTypeName - * A fully-qualified path representing project_location_stored_info_type resource. - * @returns {string} A string representing the stored_info_type. - */ - matchStoredInfoTypeFromProjectLocationStoredInfoTypeName(projectLocationStoredInfoTypeName: string) { - return this.pathTemplates.projectLocationStoredInfoTypePathTemplate.match(projectLocationStoredInfoTypeName).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: 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. - * @returns {Promise} A promise that resolves when the client is closed. - */ - close(): Promise { - if (this.dlpServiceStub && !this._terminated) { - return this.dlpServiceStub.then(stub => { - this._terminated = true; - stub.close(); - }); - } - return Promise.resolve(); - } -} diff --git a/owl-bot-staging/v2/src/v2/dlp_service_client_config.json b/owl-bot-staging/v2/src/v2/dlp_service_client_config.json deleted file mode 100644 index bcdbe63f..00000000 --- a/owl-bot-staging/v2/src/v2/dlp_service_client_config.json +++ /dev/null @@ -1,196 +0,0 @@ -{ - "interfaces": { - "google.privacy.dlp.v2.DlpService": { - "retry_codes": { - "non_idempotent": [], - "idempotent": [ - "DEADLINE_EXCEEDED", - "UNAVAILABLE" - ] - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 600000 - } - }, - "methods": { - "InspectContent": { - "timeout_millis": 300000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "RedactImage": { - "timeout_millis": 300000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "DeidentifyContent": { - "timeout_millis": 300000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "ReidentifyContent": { - "timeout_millis": 300000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "ListInfoTypes": { - "timeout_millis": 300000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "CreateInspectTemplate": { - "timeout_millis": 300000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "UpdateInspectTemplate": { - "timeout_millis": 300000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetInspectTemplate": { - "timeout_millis": 300000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "ListInspectTemplates": { - "timeout_millis": 300000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "DeleteInspectTemplate": { - "timeout_millis": 300000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "CreateDeidentifyTemplate": { - "timeout_millis": 300000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "UpdateDeidentifyTemplate": { - "timeout_millis": 300000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetDeidentifyTemplate": { - "timeout_millis": 300000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "ListDeidentifyTemplates": { - "timeout_millis": 300000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "DeleteDeidentifyTemplate": { - "timeout_millis": 300000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "CreateJobTrigger": { - "timeout_millis": 300000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "UpdateJobTrigger": { - "timeout_millis": 300000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "HybridInspectJobTrigger": { - "timeout_millis": 300000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetJobTrigger": { - "timeout_millis": 300000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "ListJobTriggers": { - "timeout_millis": 300000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "DeleteJobTrigger": { - "timeout_millis": 300000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "ActivateJobTrigger": { - "timeout_millis": 300000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "CreateDlpJob": { - "timeout_millis": 300000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListDlpJobs": { - "timeout_millis": 300000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "GetDlpJob": { - "timeout_millis": 300000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "DeleteDlpJob": { - "timeout_millis": 300000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "CancelDlpJob": { - "timeout_millis": 300000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "CreateStoredInfoType": { - "timeout_millis": 300000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "UpdateStoredInfoType": { - "timeout_millis": 300000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetStoredInfoType": { - "timeout_millis": 300000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "ListStoredInfoTypes": { - "timeout_millis": 300000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "DeleteStoredInfoType": { - "timeout_millis": 300000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "HybridInspectDlpJob": { - "timeout_millis": 300000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "FinishDlpJob": { - "timeout_millis": 300000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - } - } - } - } -} diff --git a/owl-bot-staging/v2/src/v2/dlp_service_proto_list.json b/owl-bot-staging/v2/src/v2/dlp_service_proto_list.json deleted file mode 100644 index 482924bd..00000000 --- a/owl-bot-staging/v2/src/v2/dlp_service_proto_list.json +++ /dev/null @@ -1,4 +0,0 @@ -[ - "../../protos/google/privacy/dlp/v2/dlp.proto", - "../../protos/google/privacy/dlp/v2/storage.proto" -] diff --git a/owl-bot-staging/v2/src/v2/gapic_metadata.json b/owl-bot-staging/v2/src/v2/gapic_metadata.json deleted file mode 100644 index e82d006d..00000000 --- a/owl-bot-staging/v2/src/v2/gapic_metadata.json +++ /dev/null @@ -1,383 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "typescript", - "protoPackage": "google.privacy.dlp.v2", - "libraryPackage": "@google-cloud/dlp", - "services": { - "DlpService": { - "clients": { - "grpc": { - "libraryClient": "DlpServiceClient", - "rpcs": { - "InspectContent": { - "methods": [ - "inspectContent" - ] - }, - "RedactImage": { - "methods": [ - "redactImage" - ] - }, - "DeidentifyContent": { - "methods": [ - "deidentifyContent" - ] - }, - "ReidentifyContent": { - "methods": [ - "reidentifyContent" - ] - }, - "ListInfoTypes": { - "methods": [ - "listInfoTypes" - ] - }, - "CreateInspectTemplate": { - "methods": [ - "createInspectTemplate" - ] - }, - "UpdateInspectTemplate": { - "methods": [ - "updateInspectTemplate" - ] - }, - "GetInspectTemplate": { - "methods": [ - "getInspectTemplate" - ] - }, - "DeleteInspectTemplate": { - "methods": [ - "deleteInspectTemplate" - ] - }, - "CreateDeidentifyTemplate": { - "methods": [ - "createDeidentifyTemplate" - ] - }, - "UpdateDeidentifyTemplate": { - "methods": [ - "updateDeidentifyTemplate" - ] - }, - "GetDeidentifyTemplate": { - "methods": [ - "getDeidentifyTemplate" - ] - }, - "DeleteDeidentifyTemplate": { - "methods": [ - "deleteDeidentifyTemplate" - ] - }, - "CreateJobTrigger": { - "methods": [ - "createJobTrigger" - ] - }, - "UpdateJobTrigger": { - "methods": [ - "updateJobTrigger" - ] - }, - "HybridInspectJobTrigger": { - "methods": [ - "hybridInspectJobTrigger" - ] - }, - "GetJobTrigger": { - "methods": [ - "getJobTrigger" - ] - }, - "DeleteJobTrigger": { - "methods": [ - "deleteJobTrigger" - ] - }, - "ActivateJobTrigger": { - "methods": [ - "activateJobTrigger" - ] - }, - "CreateDlpJob": { - "methods": [ - "createDlpJob" - ] - }, - "GetDlpJob": { - "methods": [ - "getDlpJob" - ] - }, - "DeleteDlpJob": { - "methods": [ - "deleteDlpJob" - ] - }, - "CancelDlpJob": { - "methods": [ - "cancelDlpJob" - ] - }, - "CreateStoredInfoType": { - "methods": [ - "createStoredInfoType" - ] - }, - "UpdateStoredInfoType": { - "methods": [ - "updateStoredInfoType" - ] - }, - "GetStoredInfoType": { - "methods": [ - "getStoredInfoType" - ] - }, - "DeleteStoredInfoType": { - "methods": [ - "deleteStoredInfoType" - ] - }, - "HybridInspectDlpJob": { - "methods": [ - "hybridInspectDlpJob" - ] - }, - "FinishDlpJob": { - "methods": [ - "finishDlpJob" - ] - }, - "ListInspectTemplates": { - "methods": [ - "listInspectTemplates", - "listInspectTemplatesStream", - "listInspectTemplatesAsync" - ] - }, - "ListDeidentifyTemplates": { - "methods": [ - "listDeidentifyTemplates", - "listDeidentifyTemplatesStream", - "listDeidentifyTemplatesAsync" - ] - }, - "ListJobTriggers": { - "methods": [ - "listJobTriggers", - "listJobTriggersStream", - "listJobTriggersAsync" - ] - }, - "ListDlpJobs": { - "methods": [ - "listDlpJobs", - "listDlpJobsStream", - "listDlpJobsAsync" - ] - }, - "ListStoredInfoTypes": { - "methods": [ - "listStoredInfoTypes", - "listStoredInfoTypesStream", - "listStoredInfoTypesAsync" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "DlpServiceClient", - "rpcs": { - "InspectContent": { - "methods": [ - "inspectContent" - ] - }, - "RedactImage": { - "methods": [ - "redactImage" - ] - }, - "DeidentifyContent": { - "methods": [ - "deidentifyContent" - ] - }, - "ReidentifyContent": { - "methods": [ - "reidentifyContent" - ] - }, - "ListInfoTypes": { - "methods": [ - "listInfoTypes" - ] - }, - "CreateInspectTemplate": { - "methods": [ - "createInspectTemplate" - ] - }, - "UpdateInspectTemplate": { - "methods": [ - "updateInspectTemplate" - ] - }, - "GetInspectTemplate": { - "methods": [ - "getInspectTemplate" - ] - }, - "DeleteInspectTemplate": { - "methods": [ - "deleteInspectTemplate" - ] - }, - "CreateDeidentifyTemplate": { - "methods": [ - "createDeidentifyTemplate" - ] - }, - "UpdateDeidentifyTemplate": { - "methods": [ - "updateDeidentifyTemplate" - ] - }, - "GetDeidentifyTemplate": { - "methods": [ - "getDeidentifyTemplate" - ] - }, - "DeleteDeidentifyTemplate": { - "methods": [ - "deleteDeidentifyTemplate" - ] - }, - "CreateJobTrigger": { - "methods": [ - "createJobTrigger" - ] - }, - "UpdateJobTrigger": { - "methods": [ - "updateJobTrigger" - ] - }, - "HybridInspectJobTrigger": { - "methods": [ - "hybridInspectJobTrigger" - ] - }, - "GetJobTrigger": { - "methods": [ - "getJobTrigger" - ] - }, - "DeleteJobTrigger": { - "methods": [ - "deleteJobTrigger" - ] - }, - "ActivateJobTrigger": { - "methods": [ - "activateJobTrigger" - ] - }, - "CreateDlpJob": { - "methods": [ - "createDlpJob" - ] - }, - "GetDlpJob": { - "methods": [ - "getDlpJob" - ] - }, - "DeleteDlpJob": { - "methods": [ - "deleteDlpJob" - ] - }, - "CancelDlpJob": { - "methods": [ - "cancelDlpJob" - ] - }, - "CreateStoredInfoType": { - "methods": [ - "createStoredInfoType" - ] - }, - "UpdateStoredInfoType": { - "methods": [ - "updateStoredInfoType" - ] - }, - "GetStoredInfoType": { - "methods": [ - "getStoredInfoType" - ] - }, - "DeleteStoredInfoType": { - "methods": [ - "deleteStoredInfoType" - ] - }, - "HybridInspectDlpJob": { - "methods": [ - "hybridInspectDlpJob" - ] - }, - "FinishDlpJob": { - "methods": [ - "finishDlpJob" - ] - }, - "ListInspectTemplates": { - "methods": [ - "listInspectTemplates", - "listInspectTemplatesStream", - "listInspectTemplatesAsync" - ] - }, - "ListDeidentifyTemplates": { - "methods": [ - "listDeidentifyTemplates", - "listDeidentifyTemplatesStream", - "listDeidentifyTemplatesAsync" - ] - }, - "ListJobTriggers": { - "methods": [ - "listJobTriggers", - "listJobTriggersStream", - "listJobTriggersAsync" - ] - }, - "ListDlpJobs": { - "methods": [ - "listDlpJobs", - "listDlpJobsStream", - "listDlpJobsAsync" - ] - }, - "ListStoredInfoTypes": { - "methods": [ - "listStoredInfoTypes", - "listStoredInfoTypesStream", - "listStoredInfoTypesAsync" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/v2/src/v2/index.ts b/owl-bot-staging/v2/src/v2/index.ts deleted file mode 100644 index 731648ed..00000000 --- a/owl-bot-staging/v2/src/v2/index.ts +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2022 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. ** - -export {DlpServiceClient} from './dlp_service_client'; diff --git a/owl-bot-staging/v2/system-test/fixtures/sample/src/index.js b/owl-bot-staging/v2/system-test/fixtures/sample/src/index.js deleted file mode 100644 index f7bbc48f..00000000 --- a/owl-bot-staging/v2/system-test/fixtures/sample/src/index.js +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2022 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/owl-bot-staging/v2/system-test/fixtures/sample/src/index.ts b/owl-bot-staging/v2/system-test/fixtures/sample/src/index.ts deleted file mode 100644 index 101bbbd2..00000000 --- a/owl-bot-staging/v2/system-test/fixtures/sample/src/index.ts +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright 2022 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 {DlpServiceClient} from '@google-cloud/dlp'; - -// check that the client class type name can be used -function doStuffWithDlpServiceClient(client: DlpServiceClient) { - client.close(); -} - -function main() { - // check that the client instance can be created - const dlpServiceClient = new DlpServiceClient(); - doStuffWithDlpServiceClient(dlpServiceClient); -} - -main(); diff --git a/owl-bot-staging/v2/system-test/install.ts b/owl-bot-staging/v2/system-test/install.ts deleted file mode 100644 index 8ec45222..00000000 --- a/owl-bot-staging/v2/system-test/install.ts +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright 2022 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('📦 pack-n-play test', () => { - - it('TypeScript code', async function() { - this.timeout(300000); - const options = { - packageDir: process.cwd(), - sample: { - description: 'TypeScript user can use the type definitions', - ts: readFileSync('./system-test/fixtures/sample/src/index.ts').toString() - } - }; - await packNTest(options); - }); - - it('JavaScript code', async function() { - this.timeout(300000); - const options = { - packageDir: process.cwd(), - sample: { - description: 'JavaScript user can use the library', - ts: readFileSync('./system-test/fixtures/sample/src/index.js').toString() - } - }; - await packNTest(options); - }); - -}); diff --git a/owl-bot-staging/v2/test/gapic_dlp_service_v2.ts b/owl-bot-staging/v2/test/gapic_dlp_service_v2.ts deleted file mode 100644 index 748330fb..00000000 --- a/owl-bot-staging/v2/test/gapic_dlp_service_v2.ts +++ /dev/null @@ -1,4921 +0,0 @@ -// Copyright 2022 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 protos from '../protos/protos'; -import * as assert from 'assert'; -import * as sinon from 'sinon'; -import {SinonStub} from 'sinon'; -import { describe, it } from 'mocha'; -import * as dlpserviceModule from '../src'; - -import {PassThrough} from 'stream'; - -import {protobuf} from 'google-gax'; - -function generateSampleMessage(instance: T) { - const filledObject = (instance.constructor as typeof protobuf.Message) - .toObject(instance as protobuf.Message, {defaults: true}); - return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; -} - -function stubSimpleCall(response?: ResponseType, error?: Error) { - return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); -} - -function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { - return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); -} - -function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { - const pagingStub = sinon.stub(); - if (responses) { - for (let i = 0; i < responses.length; ++i) { - pagingStub.onCall(i).callsArgWith(2, null, responses[i]); - } - } - const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; - const mockStream = new PassThrough({ - objectMode: true, - transform: transformStub, - }); - // trigger as many responses as needed - if (responses) { - for (let i = 0; i < responses.length; ++i) { - setImmediate(() => { mockStream.write({}); }); - } - setImmediate(() => { mockStream.end(); }); - } else { - setImmediate(() => { mockStream.write({}); }); - setImmediate(() => { mockStream.end(); }); - } - return sinon.stub().returns(mockStream); -} - -function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { - let counter = 0; - const asyncIterable = { - [Symbol.asyncIterator]() { - return { - async next() { - if (error) { - return Promise.reject(error); - } - if (counter >= responses!.length) { - return Promise.resolve({done: true, value: undefined}); - } - return Promise.resolve({done: false, value: responses![counter++]}); - } - }; - } - }; - return sinon.stub().returns(asyncIterable); -} - -describe('v2.DlpServiceClient', () => { - it('has servicePath', () => { - const servicePath = dlpserviceModule.v2.DlpServiceClient.servicePath; - assert(servicePath); - }); - - it('has apiEndpoint', () => { - const apiEndpoint = dlpserviceModule.v2.DlpServiceClient.apiEndpoint; - assert(apiEndpoint); - }); - - it('has port', () => { - const port = dlpserviceModule.v2.DlpServiceClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - 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 dlpserviceModule.v2.DlpServiceClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.dlpServiceStub, undefined); - await client.initialize(); - assert(client.dlpServiceStub); - }); - - it('has close method for the initialized client', done => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - assert(client.dlpServiceStub); - client.close().then(() => { - done(); - }); - }); - - it('has close method for the non-initialized client', done => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.dlpServiceStub, undefined); - client.close().then(() => { - done(); - }); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); - const result = await client.getProjectId(); - assert.strictEqual(result, fakeProjectId); - assert((client.auth.getProjectId as SinonStub).calledWithExactly()); - }); - - it('has getProjectId method with callback', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); - const promise = new Promise((resolve, reject) => { - client.getProjectId((err?: Error|null, projectId?: string|null) => { - if (err) { - reject(err); - } else { - resolve(projectId); - } - }); - }); - const result = await promise; - assert.strictEqual(result, fakeProjectId); - }); - - describe('inspectContent', () => { - it('invokes inspectContent without error', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.InspectContentRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.privacy.dlp.v2.InspectContentResponse()); - client.innerApiCalls.inspectContent = stubSimpleCall(expectedResponse); - const [response] = await client.inspectContent(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.inspectContent as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes inspectContent without error using callback', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.InspectContentRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.privacy.dlp.v2.InspectContentResponse()); - client.innerApiCalls.inspectContent = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.inspectContent( - request, - (err?: Error|null, result?: protos.google.privacy.dlp.v2.IInspectContentResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.inspectContent as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes inspectContent with error', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.InspectContentRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.inspectContent = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.inspectContent(request), expectedError); - assert((client.innerApiCalls.inspectContent as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes inspectContent with closed client', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.InspectContentRequest()); - request.parent = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.inspectContent(request), expectedError); - }); - }); - - describe('redactImage', () => { - it('invokes redactImage without error', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.RedactImageRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.privacy.dlp.v2.RedactImageResponse()); - client.innerApiCalls.redactImage = stubSimpleCall(expectedResponse); - const [response] = await client.redactImage(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.redactImage as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes redactImage without error using callback', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.RedactImageRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.privacy.dlp.v2.RedactImageResponse()); - client.innerApiCalls.redactImage = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.redactImage( - request, - (err?: Error|null, result?: protos.google.privacy.dlp.v2.IRedactImageResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.redactImage as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes redactImage with error', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.RedactImageRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.redactImage = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.redactImage(request), expectedError); - assert((client.innerApiCalls.redactImage as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes redactImage with closed client', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.RedactImageRequest()); - request.parent = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.redactImage(request), expectedError); - }); - }); - - describe('deidentifyContent', () => { - it('invokes deidentifyContent without error', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.DeidentifyContentRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.privacy.dlp.v2.DeidentifyContentResponse()); - client.innerApiCalls.deidentifyContent = stubSimpleCall(expectedResponse); - const [response] = await client.deidentifyContent(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deidentifyContent as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deidentifyContent without error using callback', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.DeidentifyContentRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.privacy.dlp.v2.DeidentifyContentResponse()); - client.innerApiCalls.deidentifyContent = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deidentifyContent( - request, - (err?: Error|null, result?: protos.google.privacy.dlp.v2.IDeidentifyContentResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deidentifyContent as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes deidentifyContent with error', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.DeidentifyContentRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deidentifyContent = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deidentifyContent(request), expectedError); - assert((client.innerApiCalls.deidentifyContent as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deidentifyContent with closed client', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.DeidentifyContentRequest()); - request.parent = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.deidentifyContent(request), expectedError); - }); - }); - - describe('reidentifyContent', () => { - it('invokes reidentifyContent without error', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.ReidentifyContentRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.privacy.dlp.v2.ReidentifyContentResponse()); - client.innerApiCalls.reidentifyContent = stubSimpleCall(expectedResponse); - const [response] = await client.reidentifyContent(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.reidentifyContent as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes reidentifyContent without error using callback', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.ReidentifyContentRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.privacy.dlp.v2.ReidentifyContentResponse()); - client.innerApiCalls.reidentifyContent = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.reidentifyContent( - request, - (err?: Error|null, result?: protos.google.privacy.dlp.v2.IReidentifyContentResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.reidentifyContent as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes reidentifyContent with error', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.ReidentifyContentRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.reidentifyContent = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.reidentifyContent(request), expectedError); - assert((client.innerApiCalls.reidentifyContent as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes reidentifyContent with closed client', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.ReidentifyContentRequest()); - request.parent = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.reidentifyContent(request), expectedError); - }); - }); - - describe('listInfoTypes', () => { - it('invokes listInfoTypes without error', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.ListInfoTypesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.privacy.dlp.v2.ListInfoTypesResponse()); - client.innerApiCalls.listInfoTypes = stubSimpleCall(expectedResponse); - const [response] = await client.listInfoTypes(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listInfoTypes as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listInfoTypes without error using callback', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.ListInfoTypesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.privacy.dlp.v2.ListInfoTypesResponse()); - client.innerApiCalls.listInfoTypes = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listInfoTypes( - request, - (err?: Error|null, result?: protos.google.privacy.dlp.v2.IListInfoTypesResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listInfoTypes as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes listInfoTypes with error', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.ListInfoTypesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.listInfoTypes = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listInfoTypes(request), expectedError); - assert((client.innerApiCalls.listInfoTypes as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listInfoTypes with closed client', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.ListInfoTypesRequest()); - request.parent = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.listInfoTypes(request), expectedError); - }); - }); - - describe('createInspectTemplate', () => { - it('invokes createInspectTemplate without error', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.CreateInspectTemplateRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.privacy.dlp.v2.InspectTemplate()); - client.innerApiCalls.createInspectTemplate = stubSimpleCall(expectedResponse); - const [response] = await client.createInspectTemplate(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createInspectTemplate as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createInspectTemplate without error using callback', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.CreateInspectTemplateRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.privacy.dlp.v2.InspectTemplate()); - client.innerApiCalls.createInspectTemplate = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createInspectTemplate( - request, - (err?: Error|null, result?: protos.google.privacy.dlp.v2.IInspectTemplate|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createInspectTemplate as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes createInspectTemplate with error', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.CreateInspectTemplateRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.createInspectTemplate = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createInspectTemplate(request), expectedError); - assert((client.innerApiCalls.createInspectTemplate as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createInspectTemplate with closed client', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.CreateInspectTemplateRequest()); - request.parent = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.createInspectTemplate(request), expectedError); - }); - }); - - describe('updateInspectTemplate', () => { - it('invokes updateInspectTemplate without error', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.UpdateInspectTemplateRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.privacy.dlp.v2.InspectTemplate()); - client.innerApiCalls.updateInspectTemplate = stubSimpleCall(expectedResponse); - const [response] = await client.updateInspectTemplate(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.updateInspectTemplate as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes updateInspectTemplate without error using callback', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.UpdateInspectTemplateRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.privacy.dlp.v2.InspectTemplate()); - client.innerApiCalls.updateInspectTemplate = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateInspectTemplate( - request, - (err?: Error|null, result?: protos.google.privacy.dlp.v2.IInspectTemplate|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.updateInspectTemplate as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes updateInspectTemplate with error', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.UpdateInspectTemplateRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.updateInspectTemplate = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateInspectTemplate(request), expectedError); - assert((client.innerApiCalls.updateInspectTemplate as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes updateInspectTemplate with closed client', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.UpdateInspectTemplateRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.updateInspectTemplate(request), expectedError); - }); - }); - - describe('getInspectTemplate', () => { - it('invokes getInspectTemplate without error', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.GetInspectTemplateRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.privacy.dlp.v2.InspectTemplate()); - client.innerApiCalls.getInspectTemplate = stubSimpleCall(expectedResponse); - const [response] = await client.getInspectTemplate(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getInspectTemplate as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getInspectTemplate without error using callback', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.GetInspectTemplateRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.privacy.dlp.v2.InspectTemplate()); - client.innerApiCalls.getInspectTemplate = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getInspectTemplate( - request, - (err?: Error|null, result?: protos.google.privacy.dlp.v2.IInspectTemplate|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getInspectTemplate as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes getInspectTemplate with error', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.GetInspectTemplateRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.getInspectTemplate = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getInspectTemplate(request), expectedError); - assert((client.innerApiCalls.getInspectTemplate as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getInspectTemplate with closed client', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.GetInspectTemplateRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getInspectTemplate(request), expectedError); - }); - }); - - describe('deleteInspectTemplate', () => { - it('invokes deleteInspectTemplate without error', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.DeleteInspectTemplateRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); - client.innerApiCalls.deleteInspectTemplate = stubSimpleCall(expectedResponse); - const [response] = await client.deleteInspectTemplate(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteInspectTemplate as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteInspectTemplate without error using callback', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.DeleteInspectTemplateRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); - client.innerApiCalls.deleteInspectTemplate = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteInspectTemplate( - request, - (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteInspectTemplate as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes deleteInspectTemplate with error', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.DeleteInspectTemplateRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteInspectTemplate = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deleteInspectTemplate(request), expectedError); - assert((client.innerApiCalls.deleteInspectTemplate as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteInspectTemplate with closed client', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.DeleteInspectTemplateRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.deleteInspectTemplate(request), expectedError); - }); - }); - - describe('createDeidentifyTemplate', () => { - it('invokes createDeidentifyTemplate without error', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.CreateDeidentifyTemplateRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.privacy.dlp.v2.DeidentifyTemplate()); - client.innerApiCalls.createDeidentifyTemplate = stubSimpleCall(expectedResponse); - const [response] = await client.createDeidentifyTemplate(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createDeidentifyTemplate as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createDeidentifyTemplate without error using callback', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.CreateDeidentifyTemplateRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.privacy.dlp.v2.DeidentifyTemplate()); - client.innerApiCalls.createDeidentifyTemplate = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createDeidentifyTemplate( - request, - (err?: Error|null, result?: protos.google.privacy.dlp.v2.IDeidentifyTemplate|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createDeidentifyTemplate as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes createDeidentifyTemplate with error', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.CreateDeidentifyTemplateRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.createDeidentifyTemplate = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createDeidentifyTemplate(request), expectedError); - assert((client.innerApiCalls.createDeidentifyTemplate as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createDeidentifyTemplate with closed client', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.CreateDeidentifyTemplateRequest()); - request.parent = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.createDeidentifyTemplate(request), expectedError); - }); - }); - - describe('updateDeidentifyTemplate', () => { - it('invokes updateDeidentifyTemplate without error', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.UpdateDeidentifyTemplateRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.privacy.dlp.v2.DeidentifyTemplate()); - client.innerApiCalls.updateDeidentifyTemplate = stubSimpleCall(expectedResponse); - const [response] = await client.updateDeidentifyTemplate(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.updateDeidentifyTemplate as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes updateDeidentifyTemplate without error using callback', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.UpdateDeidentifyTemplateRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.privacy.dlp.v2.DeidentifyTemplate()); - client.innerApiCalls.updateDeidentifyTemplate = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateDeidentifyTemplate( - request, - (err?: Error|null, result?: protos.google.privacy.dlp.v2.IDeidentifyTemplate|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.updateDeidentifyTemplate as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes updateDeidentifyTemplate with error', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.UpdateDeidentifyTemplateRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.updateDeidentifyTemplate = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateDeidentifyTemplate(request), expectedError); - assert((client.innerApiCalls.updateDeidentifyTemplate as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes updateDeidentifyTemplate with closed client', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.UpdateDeidentifyTemplateRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.updateDeidentifyTemplate(request), expectedError); - }); - }); - - describe('getDeidentifyTemplate', () => { - it('invokes getDeidentifyTemplate without error', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.GetDeidentifyTemplateRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.privacy.dlp.v2.DeidentifyTemplate()); - client.innerApiCalls.getDeidentifyTemplate = stubSimpleCall(expectedResponse); - const [response] = await client.getDeidentifyTemplate(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getDeidentifyTemplate as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getDeidentifyTemplate without error using callback', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.GetDeidentifyTemplateRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.privacy.dlp.v2.DeidentifyTemplate()); - client.innerApiCalls.getDeidentifyTemplate = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getDeidentifyTemplate( - request, - (err?: Error|null, result?: protos.google.privacy.dlp.v2.IDeidentifyTemplate|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getDeidentifyTemplate as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes getDeidentifyTemplate with error', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.GetDeidentifyTemplateRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.getDeidentifyTemplate = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getDeidentifyTemplate(request), expectedError); - assert((client.innerApiCalls.getDeidentifyTemplate as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getDeidentifyTemplate with closed client', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.GetDeidentifyTemplateRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getDeidentifyTemplate(request), expectedError); - }); - }); - - describe('deleteDeidentifyTemplate', () => { - it('invokes deleteDeidentifyTemplate without error', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.DeleteDeidentifyTemplateRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); - client.innerApiCalls.deleteDeidentifyTemplate = stubSimpleCall(expectedResponse); - const [response] = await client.deleteDeidentifyTemplate(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteDeidentifyTemplate as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteDeidentifyTemplate without error using callback', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.DeleteDeidentifyTemplateRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); - client.innerApiCalls.deleteDeidentifyTemplate = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteDeidentifyTemplate( - request, - (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteDeidentifyTemplate as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes deleteDeidentifyTemplate with error', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.DeleteDeidentifyTemplateRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteDeidentifyTemplate = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deleteDeidentifyTemplate(request), expectedError); - assert((client.innerApiCalls.deleteDeidentifyTemplate as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteDeidentifyTemplate with closed client', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.DeleteDeidentifyTemplateRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.deleteDeidentifyTemplate(request), expectedError); - }); - }); - - describe('createJobTrigger', () => { - it('invokes createJobTrigger without error', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.CreateJobTriggerRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.privacy.dlp.v2.JobTrigger()); - client.innerApiCalls.createJobTrigger = stubSimpleCall(expectedResponse); - const [response] = await client.createJobTrigger(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createJobTrigger as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createJobTrigger without error using callback', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.CreateJobTriggerRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.privacy.dlp.v2.JobTrigger()); - client.innerApiCalls.createJobTrigger = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createJobTrigger( - request, - (err?: Error|null, result?: protos.google.privacy.dlp.v2.IJobTrigger|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createJobTrigger as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes createJobTrigger with error', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.CreateJobTriggerRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.createJobTrigger = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createJobTrigger(request), expectedError); - assert((client.innerApiCalls.createJobTrigger as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createJobTrigger with closed client', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.CreateJobTriggerRequest()); - request.parent = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.createJobTrigger(request), expectedError); - }); - }); - - describe('updateJobTrigger', () => { - it('invokes updateJobTrigger without error', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.UpdateJobTriggerRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.privacy.dlp.v2.JobTrigger()); - client.innerApiCalls.updateJobTrigger = stubSimpleCall(expectedResponse); - const [response] = await client.updateJobTrigger(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.updateJobTrigger as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes updateJobTrigger without error using callback', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.UpdateJobTriggerRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.privacy.dlp.v2.JobTrigger()); - client.innerApiCalls.updateJobTrigger = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateJobTrigger( - request, - (err?: Error|null, result?: protos.google.privacy.dlp.v2.IJobTrigger|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.updateJobTrigger as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes updateJobTrigger with error', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.UpdateJobTriggerRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.updateJobTrigger = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateJobTrigger(request), expectedError); - assert((client.innerApiCalls.updateJobTrigger as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes updateJobTrigger with closed client', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.UpdateJobTriggerRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.updateJobTrigger(request), expectedError); - }); - }); - - describe('hybridInspectJobTrigger', () => { - it('invokes hybridInspectJobTrigger without error', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.HybridInspectJobTriggerRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.privacy.dlp.v2.HybridInspectResponse()); - client.innerApiCalls.hybridInspectJobTrigger = stubSimpleCall(expectedResponse); - const [response] = await client.hybridInspectJobTrigger(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.hybridInspectJobTrigger as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes hybridInspectJobTrigger without error using callback', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.HybridInspectJobTriggerRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.privacy.dlp.v2.HybridInspectResponse()); - client.innerApiCalls.hybridInspectJobTrigger = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.hybridInspectJobTrigger( - request, - (err?: Error|null, result?: protos.google.privacy.dlp.v2.IHybridInspectResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.hybridInspectJobTrigger as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes hybridInspectJobTrigger with error', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.HybridInspectJobTriggerRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.hybridInspectJobTrigger = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.hybridInspectJobTrigger(request), expectedError); - assert((client.innerApiCalls.hybridInspectJobTrigger as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes hybridInspectJobTrigger with closed client', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.HybridInspectJobTriggerRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.hybridInspectJobTrigger(request), expectedError); - }); - }); - - describe('getJobTrigger', () => { - it('invokes getJobTrigger without error', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.GetJobTriggerRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.privacy.dlp.v2.JobTrigger()); - client.innerApiCalls.getJobTrigger = stubSimpleCall(expectedResponse); - const [response] = await client.getJobTrigger(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getJobTrigger as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getJobTrigger without error using callback', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.GetJobTriggerRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.privacy.dlp.v2.JobTrigger()); - client.innerApiCalls.getJobTrigger = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getJobTrigger( - request, - (err?: Error|null, result?: protos.google.privacy.dlp.v2.IJobTrigger|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getJobTrigger as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes getJobTrigger with error', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.GetJobTriggerRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.getJobTrigger = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getJobTrigger(request), expectedError); - assert((client.innerApiCalls.getJobTrigger as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getJobTrigger with closed client', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.GetJobTriggerRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getJobTrigger(request), expectedError); - }); - }); - - describe('deleteJobTrigger', () => { - it('invokes deleteJobTrigger without error', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.DeleteJobTriggerRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); - client.innerApiCalls.deleteJobTrigger = stubSimpleCall(expectedResponse); - const [response] = await client.deleteJobTrigger(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteJobTrigger as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteJobTrigger without error using callback', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.DeleteJobTriggerRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); - client.innerApiCalls.deleteJobTrigger = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteJobTrigger( - request, - (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteJobTrigger as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes deleteJobTrigger with error', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.DeleteJobTriggerRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteJobTrigger = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deleteJobTrigger(request), expectedError); - assert((client.innerApiCalls.deleteJobTrigger as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteJobTrigger with closed client', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.DeleteJobTriggerRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.deleteJobTrigger(request), expectedError); - }); - }); - - describe('activateJobTrigger', () => { - it('invokes activateJobTrigger without error', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.ActivateJobTriggerRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.privacy.dlp.v2.DlpJob()); - client.innerApiCalls.activateJobTrigger = stubSimpleCall(expectedResponse); - const [response] = await client.activateJobTrigger(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.activateJobTrigger as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes activateJobTrigger without error using callback', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.ActivateJobTriggerRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.privacy.dlp.v2.DlpJob()); - client.innerApiCalls.activateJobTrigger = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.activateJobTrigger( - request, - (err?: Error|null, result?: protos.google.privacy.dlp.v2.IDlpJob|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.activateJobTrigger as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes activateJobTrigger with error', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.ActivateJobTriggerRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.activateJobTrigger = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.activateJobTrigger(request), expectedError); - assert((client.innerApiCalls.activateJobTrigger as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes activateJobTrigger with closed client', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.ActivateJobTriggerRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.activateJobTrigger(request), expectedError); - }); - }); - - describe('createDlpJob', () => { - it('invokes createDlpJob without error', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.CreateDlpJobRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.privacy.dlp.v2.DlpJob()); - client.innerApiCalls.createDlpJob = stubSimpleCall(expectedResponse); - const [response] = await client.createDlpJob(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createDlpJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createDlpJob without error using callback', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.CreateDlpJobRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.privacy.dlp.v2.DlpJob()); - client.innerApiCalls.createDlpJob = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createDlpJob( - request, - (err?: Error|null, result?: protos.google.privacy.dlp.v2.IDlpJob|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createDlpJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes createDlpJob with error', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.CreateDlpJobRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.createDlpJob = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createDlpJob(request), expectedError); - assert((client.innerApiCalls.createDlpJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createDlpJob with closed client', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.CreateDlpJobRequest()); - request.parent = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.createDlpJob(request), expectedError); - }); - }); - - describe('getDlpJob', () => { - it('invokes getDlpJob without error', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.GetDlpJobRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.privacy.dlp.v2.DlpJob()); - client.innerApiCalls.getDlpJob = stubSimpleCall(expectedResponse); - const [response] = await client.getDlpJob(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getDlpJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getDlpJob without error using callback', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.GetDlpJobRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.privacy.dlp.v2.DlpJob()); - client.innerApiCalls.getDlpJob = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getDlpJob( - request, - (err?: Error|null, result?: protos.google.privacy.dlp.v2.IDlpJob|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getDlpJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes getDlpJob with error', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.GetDlpJobRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.getDlpJob = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getDlpJob(request), expectedError); - assert((client.innerApiCalls.getDlpJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getDlpJob with closed client', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.GetDlpJobRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getDlpJob(request), expectedError); - }); - }); - - describe('deleteDlpJob', () => { - it('invokes deleteDlpJob without error', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.DeleteDlpJobRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); - client.innerApiCalls.deleteDlpJob = stubSimpleCall(expectedResponse); - const [response] = await client.deleteDlpJob(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteDlpJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteDlpJob without error using callback', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.DeleteDlpJobRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); - client.innerApiCalls.deleteDlpJob = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteDlpJob( - request, - (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteDlpJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes deleteDlpJob with error', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.DeleteDlpJobRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteDlpJob = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deleteDlpJob(request), expectedError); - assert((client.innerApiCalls.deleteDlpJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteDlpJob with closed client', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.DeleteDlpJobRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.deleteDlpJob(request), expectedError); - }); - }); - - describe('cancelDlpJob', () => { - it('invokes cancelDlpJob without error', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.CancelDlpJobRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); - client.innerApiCalls.cancelDlpJob = stubSimpleCall(expectedResponse); - const [response] = await client.cancelDlpJob(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.cancelDlpJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes cancelDlpJob without error using callback', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.CancelDlpJobRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); - client.innerApiCalls.cancelDlpJob = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.cancelDlpJob( - request, - (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.cancelDlpJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes cancelDlpJob with error', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.CancelDlpJobRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.cancelDlpJob = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.cancelDlpJob(request), expectedError); - assert((client.innerApiCalls.cancelDlpJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes cancelDlpJob with closed client', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.CancelDlpJobRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.cancelDlpJob(request), expectedError); - }); - }); - - describe('createStoredInfoType', () => { - it('invokes createStoredInfoType without error', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.CreateStoredInfoTypeRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.privacy.dlp.v2.StoredInfoType()); - client.innerApiCalls.createStoredInfoType = stubSimpleCall(expectedResponse); - const [response] = await client.createStoredInfoType(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createStoredInfoType as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createStoredInfoType without error using callback', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.CreateStoredInfoTypeRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.privacy.dlp.v2.StoredInfoType()); - client.innerApiCalls.createStoredInfoType = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createStoredInfoType( - request, - (err?: Error|null, result?: protos.google.privacy.dlp.v2.IStoredInfoType|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createStoredInfoType as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes createStoredInfoType with error', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.CreateStoredInfoTypeRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.createStoredInfoType = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createStoredInfoType(request), expectedError); - assert((client.innerApiCalls.createStoredInfoType as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createStoredInfoType with closed client', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.CreateStoredInfoTypeRequest()); - request.parent = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.createStoredInfoType(request), expectedError); - }); - }); - - describe('updateStoredInfoType', () => { - it('invokes updateStoredInfoType without error', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.UpdateStoredInfoTypeRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.privacy.dlp.v2.StoredInfoType()); - client.innerApiCalls.updateStoredInfoType = stubSimpleCall(expectedResponse); - const [response] = await client.updateStoredInfoType(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.updateStoredInfoType as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes updateStoredInfoType without error using callback', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.UpdateStoredInfoTypeRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.privacy.dlp.v2.StoredInfoType()); - client.innerApiCalls.updateStoredInfoType = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateStoredInfoType( - request, - (err?: Error|null, result?: protos.google.privacy.dlp.v2.IStoredInfoType|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.updateStoredInfoType as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes updateStoredInfoType with error', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.UpdateStoredInfoTypeRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.updateStoredInfoType = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateStoredInfoType(request), expectedError); - assert((client.innerApiCalls.updateStoredInfoType as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes updateStoredInfoType with closed client', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.UpdateStoredInfoTypeRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.updateStoredInfoType(request), expectedError); - }); - }); - - describe('getStoredInfoType', () => { - it('invokes getStoredInfoType without error', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.GetStoredInfoTypeRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.privacy.dlp.v2.StoredInfoType()); - client.innerApiCalls.getStoredInfoType = stubSimpleCall(expectedResponse); - const [response] = await client.getStoredInfoType(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getStoredInfoType as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getStoredInfoType without error using callback', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.GetStoredInfoTypeRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.privacy.dlp.v2.StoredInfoType()); - client.innerApiCalls.getStoredInfoType = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getStoredInfoType( - request, - (err?: Error|null, result?: protos.google.privacy.dlp.v2.IStoredInfoType|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getStoredInfoType as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes getStoredInfoType with error', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.GetStoredInfoTypeRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.getStoredInfoType = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getStoredInfoType(request), expectedError); - assert((client.innerApiCalls.getStoredInfoType as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getStoredInfoType with closed client', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.GetStoredInfoTypeRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getStoredInfoType(request), expectedError); - }); - }); - - describe('deleteStoredInfoType', () => { - it('invokes deleteStoredInfoType without error', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.DeleteStoredInfoTypeRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); - client.innerApiCalls.deleteStoredInfoType = stubSimpleCall(expectedResponse); - const [response] = await client.deleteStoredInfoType(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteStoredInfoType as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteStoredInfoType without error using callback', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.DeleteStoredInfoTypeRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); - client.innerApiCalls.deleteStoredInfoType = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteStoredInfoType( - request, - (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteStoredInfoType as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes deleteStoredInfoType with error', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.DeleteStoredInfoTypeRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteStoredInfoType = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deleteStoredInfoType(request), expectedError); - assert((client.innerApiCalls.deleteStoredInfoType as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteStoredInfoType with closed client', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.DeleteStoredInfoTypeRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.deleteStoredInfoType(request), expectedError); - }); - }); - - describe('hybridInspectDlpJob', () => { - it('invokes hybridInspectDlpJob without error', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.HybridInspectDlpJobRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.privacy.dlp.v2.HybridInspectResponse()); - client.innerApiCalls.hybridInspectDlpJob = stubSimpleCall(expectedResponse); - const [response] = await client.hybridInspectDlpJob(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.hybridInspectDlpJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes hybridInspectDlpJob without error using callback', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.HybridInspectDlpJobRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.privacy.dlp.v2.HybridInspectResponse()); - client.innerApiCalls.hybridInspectDlpJob = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.hybridInspectDlpJob( - request, - (err?: Error|null, result?: protos.google.privacy.dlp.v2.IHybridInspectResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.hybridInspectDlpJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes hybridInspectDlpJob with error', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.HybridInspectDlpJobRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.hybridInspectDlpJob = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.hybridInspectDlpJob(request), expectedError); - assert((client.innerApiCalls.hybridInspectDlpJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes hybridInspectDlpJob with closed client', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.HybridInspectDlpJobRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.hybridInspectDlpJob(request), expectedError); - }); - }); - - describe('finishDlpJob', () => { - it('invokes finishDlpJob without error', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.FinishDlpJobRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); - client.innerApiCalls.finishDlpJob = stubSimpleCall(expectedResponse); - const [response] = await client.finishDlpJob(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.finishDlpJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes finishDlpJob without error using callback', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.FinishDlpJobRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); - client.innerApiCalls.finishDlpJob = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.finishDlpJob( - request, - (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.finishDlpJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes finishDlpJob with error', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.FinishDlpJobRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.finishDlpJob = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.finishDlpJob(request), expectedError); - assert((client.innerApiCalls.finishDlpJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes finishDlpJob with closed client', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.FinishDlpJobRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.finishDlpJob(request), expectedError); - }); - }); - - describe('listInspectTemplates', () => { - it('invokes listInspectTemplates without error', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.ListInspectTemplatesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.privacy.dlp.v2.InspectTemplate()), - generateSampleMessage(new protos.google.privacy.dlp.v2.InspectTemplate()), - generateSampleMessage(new protos.google.privacy.dlp.v2.InspectTemplate()), - ]; - client.innerApiCalls.listInspectTemplates = stubSimpleCall(expectedResponse); - const [response] = await client.listInspectTemplates(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listInspectTemplates as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listInspectTemplates without error using callback', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.ListInspectTemplatesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.privacy.dlp.v2.InspectTemplate()), - generateSampleMessage(new protos.google.privacy.dlp.v2.InspectTemplate()), - generateSampleMessage(new protos.google.privacy.dlp.v2.InspectTemplate()), - ]; - client.innerApiCalls.listInspectTemplates = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listInspectTemplates( - request, - (err?: Error|null, result?: protos.google.privacy.dlp.v2.IInspectTemplate[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listInspectTemplates as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes listInspectTemplates with error', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.ListInspectTemplatesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.listInspectTemplates = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listInspectTemplates(request), expectedError); - assert((client.innerApiCalls.listInspectTemplates as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listInspectTemplatesStream without error', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.ListInspectTemplatesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.privacy.dlp.v2.InspectTemplate()), - generateSampleMessage(new protos.google.privacy.dlp.v2.InspectTemplate()), - generateSampleMessage(new protos.google.privacy.dlp.v2.InspectTemplate()), - ]; - client.descriptors.page.listInspectTemplates.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listInspectTemplatesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.privacy.dlp.v2.InspectTemplate[] = []; - stream.on('data', (response: protos.google.privacy.dlp.v2.InspectTemplate) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listInspectTemplates.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listInspectTemplates, request)); - assert.strictEqual( - (client.descriptors.page.listInspectTemplates.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('invokes listInspectTemplatesStream with error', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.ListInspectTemplatesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedError = new Error('expected'); - client.descriptors.page.listInspectTemplates.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listInspectTemplatesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.privacy.dlp.v2.InspectTemplate[] = []; - stream.on('data', (response: protos.google.privacy.dlp.v2.InspectTemplate) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listInspectTemplates.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listInspectTemplates, request)); - assert.strictEqual( - (client.descriptors.page.listInspectTemplates.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listInspectTemplates without error', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.ListInspectTemplatesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.privacy.dlp.v2.InspectTemplate()), - generateSampleMessage(new protos.google.privacy.dlp.v2.InspectTemplate()), - generateSampleMessage(new protos.google.privacy.dlp.v2.InspectTemplate()), - ]; - client.descriptors.page.listInspectTemplates.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.privacy.dlp.v2.IInspectTemplate[] = []; - const iterable = client.listInspectTemplatesAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listInspectTemplates.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listInspectTemplates.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listInspectTemplates with error', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.ListInspectTemplatesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); - client.descriptors.page.listInspectTemplates.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listInspectTemplatesAsync(request); - await assert.rejects(async () => { - const responses: protos.google.privacy.dlp.v2.IInspectTemplate[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listInspectTemplates.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listInspectTemplates.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - }); - - describe('listDeidentifyTemplates', () => { - it('invokes listDeidentifyTemplates without error', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.ListDeidentifyTemplatesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.privacy.dlp.v2.DeidentifyTemplate()), - generateSampleMessage(new protos.google.privacy.dlp.v2.DeidentifyTemplate()), - generateSampleMessage(new protos.google.privacy.dlp.v2.DeidentifyTemplate()), - ]; - client.innerApiCalls.listDeidentifyTemplates = stubSimpleCall(expectedResponse); - const [response] = await client.listDeidentifyTemplates(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listDeidentifyTemplates as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listDeidentifyTemplates without error using callback', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.ListDeidentifyTemplatesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.privacy.dlp.v2.DeidentifyTemplate()), - generateSampleMessage(new protos.google.privacy.dlp.v2.DeidentifyTemplate()), - generateSampleMessage(new protos.google.privacy.dlp.v2.DeidentifyTemplate()), - ]; - client.innerApiCalls.listDeidentifyTemplates = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listDeidentifyTemplates( - request, - (err?: Error|null, result?: protos.google.privacy.dlp.v2.IDeidentifyTemplate[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listDeidentifyTemplates as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes listDeidentifyTemplates with error', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.ListDeidentifyTemplatesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.listDeidentifyTemplates = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listDeidentifyTemplates(request), expectedError); - assert((client.innerApiCalls.listDeidentifyTemplates as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listDeidentifyTemplatesStream without error', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.ListDeidentifyTemplatesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.privacy.dlp.v2.DeidentifyTemplate()), - generateSampleMessage(new protos.google.privacy.dlp.v2.DeidentifyTemplate()), - generateSampleMessage(new protos.google.privacy.dlp.v2.DeidentifyTemplate()), - ]; - client.descriptors.page.listDeidentifyTemplates.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listDeidentifyTemplatesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.privacy.dlp.v2.DeidentifyTemplate[] = []; - stream.on('data', (response: protos.google.privacy.dlp.v2.DeidentifyTemplate) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listDeidentifyTemplates.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listDeidentifyTemplates, request)); - assert.strictEqual( - (client.descriptors.page.listDeidentifyTemplates.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('invokes listDeidentifyTemplatesStream with error', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.ListDeidentifyTemplatesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedError = new Error('expected'); - client.descriptors.page.listDeidentifyTemplates.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listDeidentifyTemplatesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.privacy.dlp.v2.DeidentifyTemplate[] = []; - stream.on('data', (response: protos.google.privacy.dlp.v2.DeidentifyTemplate) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listDeidentifyTemplates.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listDeidentifyTemplates, request)); - assert.strictEqual( - (client.descriptors.page.listDeidentifyTemplates.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listDeidentifyTemplates without error', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.ListDeidentifyTemplatesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.privacy.dlp.v2.DeidentifyTemplate()), - generateSampleMessage(new protos.google.privacy.dlp.v2.DeidentifyTemplate()), - generateSampleMessage(new protos.google.privacy.dlp.v2.DeidentifyTemplate()), - ]; - client.descriptors.page.listDeidentifyTemplates.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.privacy.dlp.v2.IDeidentifyTemplate[] = []; - const iterable = client.listDeidentifyTemplatesAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listDeidentifyTemplates.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listDeidentifyTemplates.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listDeidentifyTemplates with error', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.ListDeidentifyTemplatesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); - client.descriptors.page.listDeidentifyTemplates.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listDeidentifyTemplatesAsync(request); - await assert.rejects(async () => { - const responses: protos.google.privacy.dlp.v2.IDeidentifyTemplate[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listDeidentifyTemplates.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listDeidentifyTemplates.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - }); - - describe('listJobTriggers', () => { - it('invokes listJobTriggers without error', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.ListJobTriggersRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.privacy.dlp.v2.JobTrigger()), - generateSampleMessage(new protos.google.privacy.dlp.v2.JobTrigger()), - generateSampleMessage(new protos.google.privacy.dlp.v2.JobTrigger()), - ]; - client.innerApiCalls.listJobTriggers = stubSimpleCall(expectedResponse); - const [response] = await client.listJobTriggers(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listJobTriggers as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listJobTriggers without error using callback', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.ListJobTriggersRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.privacy.dlp.v2.JobTrigger()), - generateSampleMessage(new protos.google.privacy.dlp.v2.JobTrigger()), - generateSampleMessage(new protos.google.privacy.dlp.v2.JobTrigger()), - ]; - client.innerApiCalls.listJobTriggers = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listJobTriggers( - request, - (err?: Error|null, result?: protos.google.privacy.dlp.v2.IJobTrigger[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listJobTriggers as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes listJobTriggers with error', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.ListJobTriggersRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.listJobTriggers = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listJobTriggers(request), expectedError); - assert((client.innerApiCalls.listJobTriggers as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listJobTriggersStream without error', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.ListJobTriggersRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.privacy.dlp.v2.JobTrigger()), - generateSampleMessage(new protos.google.privacy.dlp.v2.JobTrigger()), - generateSampleMessage(new protos.google.privacy.dlp.v2.JobTrigger()), - ]; - client.descriptors.page.listJobTriggers.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listJobTriggersStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.privacy.dlp.v2.JobTrigger[] = []; - stream.on('data', (response: protos.google.privacy.dlp.v2.JobTrigger) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listJobTriggers.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listJobTriggers, request)); - assert.strictEqual( - (client.descriptors.page.listJobTriggers.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('invokes listJobTriggersStream with error', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.ListJobTriggersRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedError = new Error('expected'); - client.descriptors.page.listJobTriggers.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listJobTriggersStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.privacy.dlp.v2.JobTrigger[] = []; - stream.on('data', (response: protos.google.privacy.dlp.v2.JobTrigger) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listJobTriggers.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listJobTriggers, request)); - assert.strictEqual( - (client.descriptors.page.listJobTriggers.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listJobTriggers without error', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.ListJobTriggersRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.privacy.dlp.v2.JobTrigger()), - generateSampleMessage(new protos.google.privacy.dlp.v2.JobTrigger()), - generateSampleMessage(new protos.google.privacy.dlp.v2.JobTrigger()), - ]; - client.descriptors.page.listJobTriggers.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.privacy.dlp.v2.IJobTrigger[] = []; - const iterable = client.listJobTriggersAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listJobTriggers.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listJobTriggers.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listJobTriggers with error', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.ListJobTriggersRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); - client.descriptors.page.listJobTriggers.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listJobTriggersAsync(request); - await assert.rejects(async () => { - const responses: protos.google.privacy.dlp.v2.IJobTrigger[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listJobTriggers.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listJobTriggers.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - }); - - describe('listDlpJobs', () => { - it('invokes listDlpJobs without error', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.ListDlpJobsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.privacy.dlp.v2.DlpJob()), - generateSampleMessage(new protos.google.privacy.dlp.v2.DlpJob()), - generateSampleMessage(new protos.google.privacy.dlp.v2.DlpJob()), - ]; - client.innerApiCalls.listDlpJobs = stubSimpleCall(expectedResponse); - const [response] = await client.listDlpJobs(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listDlpJobs as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listDlpJobs without error using callback', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.ListDlpJobsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.privacy.dlp.v2.DlpJob()), - generateSampleMessage(new protos.google.privacy.dlp.v2.DlpJob()), - generateSampleMessage(new protos.google.privacy.dlp.v2.DlpJob()), - ]; - client.innerApiCalls.listDlpJobs = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listDlpJobs( - request, - (err?: Error|null, result?: protos.google.privacy.dlp.v2.IDlpJob[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listDlpJobs as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes listDlpJobs with error', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.ListDlpJobsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.listDlpJobs = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listDlpJobs(request), expectedError); - assert((client.innerApiCalls.listDlpJobs as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listDlpJobsStream without error', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.ListDlpJobsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.privacy.dlp.v2.DlpJob()), - generateSampleMessage(new protos.google.privacy.dlp.v2.DlpJob()), - generateSampleMessage(new protos.google.privacy.dlp.v2.DlpJob()), - ]; - client.descriptors.page.listDlpJobs.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listDlpJobsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.privacy.dlp.v2.DlpJob[] = []; - stream.on('data', (response: protos.google.privacy.dlp.v2.DlpJob) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listDlpJobs.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listDlpJobs, request)); - assert.strictEqual( - (client.descriptors.page.listDlpJobs.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('invokes listDlpJobsStream with error', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.ListDlpJobsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedError = new Error('expected'); - client.descriptors.page.listDlpJobs.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listDlpJobsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.privacy.dlp.v2.DlpJob[] = []; - stream.on('data', (response: protos.google.privacy.dlp.v2.DlpJob) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listDlpJobs.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listDlpJobs, request)); - assert.strictEqual( - (client.descriptors.page.listDlpJobs.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listDlpJobs without error', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.ListDlpJobsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.privacy.dlp.v2.DlpJob()), - generateSampleMessage(new protos.google.privacy.dlp.v2.DlpJob()), - generateSampleMessage(new protos.google.privacy.dlp.v2.DlpJob()), - ]; - client.descriptors.page.listDlpJobs.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.privacy.dlp.v2.IDlpJob[] = []; - const iterable = client.listDlpJobsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listDlpJobs.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listDlpJobs.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listDlpJobs with error', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.ListDlpJobsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); - client.descriptors.page.listDlpJobs.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listDlpJobsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.privacy.dlp.v2.IDlpJob[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listDlpJobs.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listDlpJobs.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - }); - - describe('listStoredInfoTypes', () => { - it('invokes listStoredInfoTypes without error', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.ListStoredInfoTypesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.privacy.dlp.v2.StoredInfoType()), - generateSampleMessage(new protos.google.privacy.dlp.v2.StoredInfoType()), - generateSampleMessage(new protos.google.privacy.dlp.v2.StoredInfoType()), - ]; - client.innerApiCalls.listStoredInfoTypes = stubSimpleCall(expectedResponse); - const [response] = await client.listStoredInfoTypes(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listStoredInfoTypes as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listStoredInfoTypes without error using callback', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.ListStoredInfoTypesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.privacy.dlp.v2.StoredInfoType()), - generateSampleMessage(new protos.google.privacy.dlp.v2.StoredInfoType()), - generateSampleMessage(new protos.google.privacy.dlp.v2.StoredInfoType()), - ]; - client.innerApiCalls.listStoredInfoTypes = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listStoredInfoTypes( - request, - (err?: Error|null, result?: protos.google.privacy.dlp.v2.IStoredInfoType[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listStoredInfoTypes as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes listStoredInfoTypes with error', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.ListStoredInfoTypesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.listStoredInfoTypes = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listStoredInfoTypes(request), expectedError); - assert((client.innerApiCalls.listStoredInfoTypes as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listStoredInfoTypesStream without error', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.ListStoredInfoTypesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.privacy.dlp.v2.StoredInfoType()), - generateSampleMessage(new protos.google.privacy.dlp.v2.StoredInfoType()), - generateSampleMessage(new protos.google.privacy.dlp.v2.StoredInfoType()), - ]; - client.descriptors.page.listStoredInfoTypes.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listStoredInfoTypesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.privacy.dlp.v2.StoredInfoType[] = []; - stream.on('data', (response: protos.google.privacy.dlp.v2.StoredInfoType) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listStoredInfoTypes.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listStoredInfoTypes, request)); - assert.strictEqual( - (client.descriptors.page.listStoredInfoTypes.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('invokes listStoredInfoTypesStream with error', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.ListStoredInfoTypesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedError = new Error('expected'); - client.descriptors.page.listStoredInfoTypes.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listStoredInfoTypesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.privacy.dlp.v2.StoredInfoType[] = []; - stream.on('data', (response: protos.google.privacy.dlp.v2.StoredInfoType) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listStoredInfoTypes.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listStoredInfoTypes, request)); - assert.strictEqual( - (client.descriptors.page.listStoredInfoTypes.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listStoredInfoTypes without error', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.ListStoredInfoTypesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.privacy.dlp.v2.StoredInfoType()), - generateSampleMessage(new protos.google.privacy.dlp.v2.StoredInfoType()), - generateSampleMessage(new protos.google.privacy.dlp.v2.StoredInfoType()), - ]; - client.descriptors.page.listStoredInfoTypes.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.privacy.dlp.v2.IStoredInfoType[] = []; - const iterable = client.listStoredInfoTypesAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listStoredInfoTypes.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listStoredInfoTypes.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listStoredInfoTypes with error', async () => { - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.privacy.dlp.v2.ListStoredInfoTypesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); - client.descriptors.page.listStoredInfoTypes.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listStoredInfoTypesAsync(request); - await assert.rejects(async () => { - const responses: protos.google.privacy.dlp.v2.IStoredInfoType[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listStoredInfoTypes.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listStoredInfoTypes.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - }); - - describe('Path templates', () => { - - describe('finding', () => { - const fakePath = "/rendered/path/finding"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - finding: "findingValue", - }; - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.findingPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.findingPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('findingPath', () => { - const result = client.findingPath("projectValue", "locationValue", "findingValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.findingPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromFindingName', () => { - const result = client.matchProjectFromFindingName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.findingPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromFindingName', () => { - const result = client.matchLocationFromFindingName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.findingPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFindingFromFindingName', () => { - const result = client.matchFindingFromFindingName(fakePath); - assert.strictEqual(result, "findingValue"); - assert((client.pathTemplates.findingPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('organization', () => { - const fakePath = "/rendered/path/organization"; - const expectedParameters = { - organization: "organizationValue", - }; - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.organizationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.organizationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('organizationPath', () => { - const result = client.organizationPath("organizationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.organizationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchOrganizationFromOrganizationName', () => { - const result = client.matchOrganizationFromOrganizationName(fakePath); - assert.strictEqual(result, "organizationValue"); - assert((client.pathTemplates.organizationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('organizationDeidentifyTemplate', () => { - const fakePath = "/rendered/path/organizationDeidentifyTemplate"; - const expectedParameters = { - organization: "organizationValue", - deidentify_template: "deidentifyTemplateValue", - }; - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.organizationDeidentifyTemplatePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.organizationDeidentifyTemplatePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('organizationDeidentifyTemplatePath', () => { - const result = client.organizationDeidentifyTemplatePath("organizationValue", "deidentifyTemplateValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.organizationDeidentifyTemplatePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchOrganizationFromOrganizationDeidentifyTemplateName', () => { - const result = client.matchOrganizationFromOrganizationDeidentifyTemplateName(fakePath); - assert.strictEqual(result, "organizationValue"); - assert((client.pathTemplates.organizationDeidentifyTemplatePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDeidentifyTemplateFromOrganizationDeidentifyTemplateName', () => { - const result = client.matchDeidentifyTemplateFromOrganizationDeidentifyTemplateName(fakePath); - assert.strictEqual(result, "deidentifyTemplateValue"); - assert((client.pathTemplates.organizationDeidentifyTemplatePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('organizationInspectTemplate', () => { - const fakePath = "/rendered/path/organizationInspectTemplate"; - const expectedParameters = { - organization: "organizationValue", - inspect_template: "inspectTemplateValue", - }; - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.organizationInspectTemplatePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.organizationInspectTemplatePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('organizationInspectTemplatePath', () => { - const result = client.organizationInspectTemplatePath("organizationValue", "inspectTemplateValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.organizationInspectTemplatePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchOrganizationFromOrganizationInspectTemplateName', () => { - const result = client.matchOrganizationFromOrganizationInspectTemplateName(fakePath); - assert.strictEqual(result, "organizationValue"); - assert((client.pathTemplates.organizationInspectTemplatePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchInspectTemplateFromOrganizationInspectTemplateName', () => { - const result = client.matchInspectTemplateFromOrganizationInspectTemplateName(fakePath); - assert.strictEqual(result, "inspectTemplateValue"); - assert((client.pathTemplates.organizationInspectTemplatePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('organizationLocationDeidentifyTemplate', () => { - const fakePath = "/rendered/path/organizationLocationDeidentifyTemplate"; - const expectedParameters = { - organization: "organizationValue", - location: "locationValue", - deidentify_template: "deidentifyTemplateValue", - }; - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.organizationLocationDeidentifyTemplatePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.organizationLocationDeidentifyTemplatePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('organizationLocationDeidentifyTemplatePath', () => { - const result = client.organizationLocationDeidentifyTemplatePath("organizationValue", "locationValue", "deidentifyTemplateValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.organizationLocationDeidentifyTemplatePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchOrganizationFromOrganizationLocationDeidentifyTemplateName', () => { - const result = client.matchOrganizationFromOrganizationLocationDeidentifyTemplateName(fakePath); - assert.strictEqual(result, "organizationValue"); - assert((client.pathTemplates.organizationLocationDeidentifyTemplatePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromOrganizationLocationDeidentifyTemplateName', () => { - const result = client.matchLocationFromOrganizationLocationDeidentifyTemplateName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.organizationLocationDeidentifyTemplatePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDeidentifyTemplateFromOrganizationLocationDeidentifyTemplateName', () => { - const result = client.matchDeidentifyTemplateFromOrganizationLocationDeidentifyTemplateName(fakePath); - assert.strictEqual(result, "deidentifyTemplateValue"); - assert((client.pathTemplates.organizationLocationDeidentifyTemplatePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('organizationLocationInspectTemplate', () => { - const fakePath = "/rendered/path/organizationLocationInspectTemplate"; - const expectedParameters = { - organization: "organizationValue", - location: "locationValue", - inspect_template: "inspectTemplateValue", - }; - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.organizationLocationInspectTemplatePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.organizationLocationInspectTemplatePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('organizationLocationInspectTemplatePath', () => { - const result = client.organizationLocationInspectTemplatePath("organizationValue", "locationValue", "inspectTemplateValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.organizationLocationInspectTemplatePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchOrganizationFromOrganizationLocationInspectTemplateName', () => { - const result = client.matchOrganizationFromOrganizationLocationInspectTemplateName(fakePath); - assert.strictEqual(result, "organizationValue"); - assert((client.pathTemplates.organizationLocationInspectTemplatePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromOrganizationLocationInspectTemplateName', () => { - const result = client.matchLocationFromOrganizationLocationInspectTemplateName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.organizationLocationInspectTemplatePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchInspectTemplateFromOrganizationLocationInspectTemplateName', () => { - const result = client.matchInspectTemplateFromOrganizationLocationInspectTemplateName(fakePath); - assert.strictEqual(result, "inspectTemplateValue"); - assert((client.pathTemplates.organizationLocationInspectTemplatePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('organizationLocationStoredInfoType', () => { - const fakePath = "/rendered/path/organizationLocationStoredInfoType"; - const expectedParameters = { - organization: "organizationValue", - location: "locationValue", - stored_info_type: "storedInfoTypeValue", - }; - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.organizationLocationStoredInfoTypePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.organizationLocationStoredInfoTypePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('organizationLocationStoredInfoTypePath', () => { - const result = client.organizationLocationStoredInfoTypePath("organizationValue", "locationValue", "storedInfoTypeValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.organizationLocationStoredInfoTypePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchOrganizationFromOrganizationLocationStoredInfoTypeName', () => { - const result = client.matchOrganizationFromOrganizationLocationStoredInfoTypeName(fakePath); - assert.strictEqual(result, "organizationValue"); - assert((client.pathTemplates.organizationLocationStoredInfoTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromOrganizationLocationStoredInfoTypeName', () => { - const result = client.matchLocationFromOrganizationLocationStoredInfoTypeName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.organizationLocationStoredInfoTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchStoredInfoTypeFromOrganizationLocationStoredInfoTypeName', () => { - const result = client.matchStoredInfoTypeFromOrganizationLocationStoredInfoTypeName(fakePath); - assert.strictEqual(result, "storedInfoTypeValue"); - assert((client.pathTemplates.organizationLocationStoredInfoTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('organizationStoredInfoType', () => { - const fakePath = "/rendered/path/organizationStoredInfoType"; - const expectedParameters = { - organization: "organizationValue", - stored_info_type: "storedInfoTypeValue", - }; - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.organizationStoredInfoTypePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.organizationStoredInfoTypePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('organizationStoredInfoTypePath', () => { - const result = client.organizationStoredInfoTypePath("organizationValue", "storedInfoTypeValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.organizationStoredInfoTypePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchOrganizationFromOrganizationStoredInfoTypeName', () => { - const result = client.matchOrganizationFromOrganizationStoredInfoTypeName(fakePath); - assert.strictEqual(result, "organizationValue"); - assert((client.pathTemplates.organizationStoredInfoTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchStoredInfoTypeFromOrganizationStoredInfoTypeName', () => { - const result = client.matchStoredInfoTypeFromOrganizationStoredInfoTypeName(fakePath); - assert.strictEqual(result, "storedInfoTypeValue"); - assert((client.pathTemplates.organizationStoredInfoTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('project', () => { - const fakePath = "/rendered/path/project"; - const expectedParameters = { - project: "projectValue", - }; - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.projectPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectPath', () => { - const result = client.projectPath("projectValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectName', () => { - const result = client.matchProjectFromProjectName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectDeidentifyTemplate', () => { - const fakePath = "/rendered/path/projectDeidentifyTemplate"; - const expectedParameters = { - project: "projectValue", - deidentify_template: "deidentifyTemplateValue", - }; - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.projectDeidentifyTemplatePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectDeidentifyTemplatePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectDeidentifyTemplatePath', () => { - const result = client.projectDeidentifyTemplatePath("projectValue", "deidentifyTemplateValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectDeidentifyTemplatePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectDeidentifyTemplateName', () => { - const result = client.matchProjectFromProjectDeidentifyTemplateName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectDeidentifyTemplatePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDeidentifyTemplateFromProjectDeidentifyTemplateName', () => { - const result = client.matchDeidentifyTemplateFromProjectDeidentifyTemplateName(fakePath); - assert.strictEqual(result, "deidentifyTemplateValue"); - assert((client.pathTemplates.projectDeidentifyTemplatePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectDlpContent', () => { - const fakePath = "/rendered/path/projectDlpContent"; - const expectedParameters = { - project: "projectValue", - }; - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.projectDlpContentPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectDlpContentPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectDlpContentPath', () => { - const result = client.projectDlpContentPath("projectValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectDlpContentPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectDlpContentName', () => { - const result = client.matchProjectFromProjectDlpContentName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectDlpContentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectDlpJob', () => { - const fakePath = "/rendered/path/projectDlpJob"; - const expectedParameters = { - project: "projectValue", - dlp_job: "dlpJobValue", - }; - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.projectDlpJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectDlpJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectDlpJobPath', () => { - const result = client.projectDlpJobPath("projectValue", "dlpJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectDlpJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectDlpJobName', () => { - const result = client.matchProjectFromProjectDlpJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectDlpJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDlpJobFromProjectDlpJobName', () => { - const result = client.matchDlpJobFromProjectDlpJobName(fakePath); - assert.strictEqual(result, "dlpJobValue"); - assert((client.pathTemplates.projectDlpJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectInspectTemplate', () => { - const fakePath = "/rendered/path/projectInspectTemplate"; - const expectedParameters = { - project: "projectValue", - inspect_template: "inspectTemplateValue", - }; - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.projectInspectTemplatePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectInspectTemplatePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectInspectTemplatePath', () => { - const result = client.projectInspectTemplatePath("projectValue", "inspectTemplateValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectInspectTemplatePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectInspectTemplateName', () => { - const result = client.matchProjectFromProjectInspectTemplateName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectInspectTemplatePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchInspectTemplateFromProjectInspectTemplateName', () => { - const result = client.matchInspectTemplateFromProjectInspectTemplateName(fakePath); - assert.strictEqual(result, "inspectTemplateValue"); - assert((client.pathTemplates.projectInspectTemplatePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectJobTrigger', () => { - const fakePath = "/rendered/path/projectJobTrigger"; - const expectedParameters = { - project: "projectValue", - job_trigger: "jobTriggerValue", - }; - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.projectJobTriggerPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectJobTriggerPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectJobTriggerPath', () => { - const result = client.projectJobTriggerPath("projectValue", "jobTriggerValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectJobTriggerPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectJobTriggerName', () => { - const result = client.matchProjectFromProjectJobTriggerName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectJobTriggerPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchJobTriggerFromProjectJobTriggerName', () => { - const result = client.matchJobTriggerFromProjectJobTriggerName(fakePath); - assert.strictEqual(result, "jobTriggerValue"); - assert((client.pathTemplates.projectJobTriggerPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectLocationDeidentifyTemplate', () => { - const fakePath = "/rendered/path/projectLocationDeidentifyTemplate"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - deidentify_template: "deidentifyTemplateValue", - }; - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.projectLocationDeidentifyTemplatePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectLocationDeidentifyTemplatePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectLocationDeidentifyTemplatePath', () => { - const result = client.projectLocationDeidentifyTemplatePath("projectValue", "locationValue", "deidentifyTemplateValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectLocationDeidentifyTemplatePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectLocationDeidentifyTemplateName', () => { - const result = client.matchProjectFromProjectLocationDeidentifyTemplateName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectLocationDeidentifyTemplatePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromProjectLocationDeidentifyTemplateName', () => { - const result = client.matchLocationFromProjectLocationDeidentifyTemplateName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.projectLocationDeidentifyTemplatePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDeidentifyTemplateFromProjectLocationDeidentifyTemplateName', () => { - const result = client.matchDeidentifyTemplateFromProjectLocationDeidentifyTemplateName(fakePath); - assert.strictEqual(result, "deidentifyTemplateValue"); - assert((client.pathTemplates.projectLocationDeidentifyTemplatePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectLocationDlpJob', () => { - const fakePath = "/rendered/path/projectLocationDlpJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dlp_job: "dlpJobValue", - }; - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.projectLocationDlpJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectLocationDlpJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectLocationDlpJobPath', () => { - const result = client.projectLocationDlpJobPath("projectValue", "locationValue", "dlpJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectLocationDlpJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectLocationDlpJobName', () => { - const result = client.matchProjectFromProjectLocationDlpJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectLocationDlpJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromProjectLocationDlpJobName', () => { - const result = client.matchLocationFromProjectLocationDlpJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.projectLocationDlpJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDlpJobFromProjectLocationDlpJobName', () => { - const result = client.matchDlpJobFromProjectLocationDlpJobName(fakePath); - assert.strictEqual(result, "dlpJobValue"); - assert((client.pathTemplates.projectLocationDlpJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectLocationInspectTemplate', () => { - const fakePath = "/rendered/path/projectLocationInspectTemplate"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - inspect_template: "inspectTemplateValue", - }; - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.projectLocationInspectTemplatePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectLocationInspectTemplatePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectLocationInspectTemplatePath', () => { - const result = client.projectLocationInspectTemplatePath("projectValue", "locationValue", "inspectTemplateValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectLocationInspectTemplatePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectLocationInspectTemplateName', () => { - const result = client.matchProjectFromProjectLocationInspectTemplateName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectLocationInspectTemplatePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromProjectLocationInspectTemplateName', () => { - const result = client.matchLocationFromProjectLocationInspectTemplateName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.projectLocationInspectTemplatePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchInspectTemplateFromProjectLocationInspectTemplateName', () => { - const result = client.matchInspectTemplateFromProjectLocationInspectTemplateName(fakePath); - assert.strictEqual(result, "inspectTemplateValue"); - assert((client.pathTemplates.projectLocationInspectTemplatePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectLocationJobTrigger', () => { - const fakePath = "/rendered/path/projectLocationJobTrigger"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - job_trigger: "jobTriggerValue", - }; - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.projectLocationJobTriggerPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectLocationJobTriggerPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectLocationJobTriggerPath', () => { - const result = client.projectLocationJobTriggerPath("projectValue", "locationValue", "jobTriggerValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectLocationJobTriggerPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectLocationJobTriggerName', () => { - const result = client.matchProjectFromProjectLocationJobTriggerName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectLocationJobTriggerPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromProjectLocationJobTriggerName', () => { - const result = client.matchLocationFromProjectLocationJobTriggerName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.projectLocationJobTriggerPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchJobTriggerFromProjectLocationJobTriggerName', () => { - const result = client.matchJobTriggerFromProjectLocationJobTriggerName(fakePath); - assert.strictEqual(result, "jobTriggerValue"); - assert((client.pathTemplates.projectLocationJobTriggerPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectLocationStoredInfoType', () => { - const fakePath = "/rendered/path/projectLocationStoredInfoType"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - stored_info_type: "storedInfoTypeValue", - }; - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.projectLocationStoredInfoTypePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectLocationStoredInfoTypePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectLocationStoredInfoTypePath', () => { - const result = client.projectLocationStoredInfoTypePath("projectValue", "locationValue", "storedInfoTypeValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectLocationStoredInfoTypePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectLocationStoredInfoTypeName', () => { - const result = client.matchProjectFromProjectLocationStoredInfoTypeName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectLocationStoredInfoTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromProjectLocationStoredInfoTypeName', () => { - const result = client.matchLocationFromProjectLocationStoredInfoTypeName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.projectLocationStoredInfoTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchStoredInfoTypeFromProjectLocationStoredInfoTypeName', () => { - const result = client.matchStoredInfoTypeFromProjectLocationStoredInfoTypeName(fakePath); - assert.strictEqual(result, "storedInfoTypeValue"); - assert((client.pathTemplates.projectLocationStoredInfoTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectStoredInfoType', () => { - const fakePath = "/rendered/path/projectStoredInfoType"; - const expectedParameters = { - project: "projectValue", - stored_info_type: "storedInfoTypeValue", - }; - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.projectStoredInfoTypePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectStoredInfoTypePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectStoredInfoTypePath', () => { - const result = client.projectStoredInfoTypePath("projectValue", "storedInfoTypeValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectStoredInfoTypePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectStoredInfoTypeName', () => { - const result = client.matchProjectFromProjectStoredInfoTypeName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectStoredInfoTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchStoredInfoTypeFromProjectStoredInfoTypeName', () => { - const result = client.matchStoredInfoTypeFromProjectStoredInfoTypeName(fakePath); - assert.strictEqual(result, "storedInfoTypeValue"); - assert((client.pathTemplates.projectStoredInfoTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - }); -}); diff --git a/owl-bot-staging/v2/tsconfig.json b/owl-bot-staging/v2/tsconfig.json deleted file mode 100644 index c78f1c88..00000000 --- a/owl-bot-staging/v2/tsconfig.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "extends": "./node_modules/gts/tsconfig-google.json", - "compilerOptions": { - "rootDir": ".", - "outDir": "build", - "resolveJsonModule": true, - "lib": [ - "es2018", - "dom" - ] - }, - "include": [ - "src/*.ts", - "src/**/*.ts", - "test/*.ts", - "test/**/*.ts", - "system-test/*.ts" - ] -} diff --git a/owl-bot-staging/v2/webpack.config.js b/owl-bot-staging/v2/webpack.config.js deleted file mode 100644 index 4eaa3715..00000000 --- a/owl-bot-staging/v2/webpack.config.js +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright 2021 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. - -const path = require('path'); - -module.exports = { - entry: './src/index.ts', - output: { - library: 'DlpService', - filename: './dlp-service.js', - }, - node: { - child_process: 'empty', - fs: 'empty', - crypto: 'empty', - }, - resolve: { - alias: { - '../../../package.json': path.resolve(__dirname, 'package.json'), - }, - extensions: ['.js', '.json', '.ts'], - }, - module: { - rules: [ - { - 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[\\/]gtoken/, - use: 'null-loader' - }, - ], - }, - mode: 'production', -}; diff --git a/protos/google/privacy/dlp/v2/dlp.proto b/protos/google/privacy/dlp/v2/dlp.proto index 26f5872e..03776b0b 100644 --- a/protos/google/privacy/dlp/v2/dlp.proto +++ b/protos/google/privacy/dlp/v2/dlp.proto @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -16,6 +16,7 @@ syntax = "proto3"; package google.privacy.dlp.v2; +import "google/api/annotations.proto"; import "google/api/client.proto"; import "google/api/field_behavior.proto"; import "google/api/resource.proto"; @@ -28,7 +29,6 @@ import "google/rpc/status.proto"; import "google/type/date.proto"; import "google/type/dayofweek.proto"; import "google/type/timeofday.proto"; -import "google/api/annotations.proto"; option csharp_namespace = "Google.Cloud.Dlp.V2"; option go_package = "google.golang.org/genproto/googleapis/privacy/dlp/v2;dlp"; @@ -719,8 +719,8 @@ message InspectionRuleSet { // When used with redactContent only info_types and min_likelihood are currently // used. message InspectConfig { - // Configuration to control the number of findings returned. Cannot be set if - // de-identification is requested. + // Configuration to control the number of findings returned for inspection. + // This is not used for de-identification or data profiling. message FindingLimits { // Max findings configuration per infoType, per content item or long // running DlpJob. @@ -769,21 +769,23 @@ message InspectConfig { Likelihood min_likelihood = 2; // Configuration to control the number of findings returned. + // This is not used for data profiling. FindingLimits limits = 3; // When true, a contextual quote from the data that triggered a finding is // included in the response; see Finding.quote. + // This is not used for data profiling. bool include_quote = 4; // When true, excludes type information of the findings. + // This is not used for data profiling. bool exclude_info_types = 5; // CustomInfoTypes provided by the user. See // https://cloud.google.com/dlp/docs/creating-custom-infotypes to learn more. repeated CustomInfoType custom_info_types = 6; - // List of options defining data content to scan. - // If empty, text, images, and other content will be included. + // Deprecated and unused. repeated ContentOption content_options = 8; // Set of rules to apply to the findings for this InspectConfig. @@ -825,6 +827,12 @@ message ByteContentItem { // pdf PDF = 8; + // pptx, pptm, potx, potm, pot + POWERPOINT_DOCUMENT = 9; + + // xlsx, xlsm, xltx, xltm + EXCEL_DOCUMENT = 10; + // avro AVRO = 11; @@ -2857,6 +2865,18 @@ message TransformationOverview { // Only one of 'transformation', 'field_transformation', or 'record_suppress' // will be set. message TransformationSummary { + // Possible outcomes of transformations. + enum TransformationResultCode { + // Unused + TRANSFORMATION_RESULT_CODE_UNSPECIFIED = 0; + + // Transformation completed without an error. + SUCCESS = 1; + + // Transformation had an error. + ERROR = 2; + } + // A collection that informs the user the number of times a particular // `TransformationResultCode` and error details occurred. message SummaryResult { @@ -2871,18 +2891,6 @@ message TransformationSummary { string details = 3; } - // Possible outcomes of transformations. - enum TransformationResultCode { - // Unused - TRANSFORMATION_RESULT_CODE_UNSPECIFIED = 0; - - // Transformation completed without an error. - SUCCESS = 1; - - // Transformation had an error. - ERROR = 2; - } - // Set if the transformation was limited to a specific InfoType. InfoType info_type = 1; @@ -4352,7 +4360,7 @@ enum MatchingType { MATCHING_TYPE_INVERSE_MATCH = 3; } -// Options describing which parts of the provided content should be scanned. +// Deprecated and unused. enum ContentOption { // Includes entire content of a file or a data stream. CONTENT_UNSPECIFIED = 0; diff --git a/protos/google/privacy/dlp/v2/storage.proto b/protos/google/privacy/dlp/v2/storage.proto index a9011213..5c338088 100644 --- a/protos/google/privacy/dlp/v2/storage.proto +++ b/protos/google/privacy/dlp/v2/storage.proto @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -16,7 +16,6 @@ syntax = "proto3"; package google.privacy.dlp.v2; -import "google/api/annotations.proto"; import "google/api/resource.proto"; import "google/protobuf/timestamp.proto"; @@ -41,18 +40,6 @@ message InfoType { string version = 2; } -// A reference to a StoredInfoType to use with scanning. -message StoredType { - // Resource name of the requested `StoredInfoType`, for example - // `organizations/433245324/storedInfoTypes/432452342` or - // `projects/project-id/storedInfoTypes/432452342`. - string name = 1; - - // Timestamp indicating when the version of the `StoredInfoType` used for - // inspection was created. Output-only field, populated by the system. - google.protobuf.Timestamp create_time = 2; -} - // 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 Likelihood { @@ -73,6 +60,18 @@ enum Likelihood { VERY_LIKELY = 5; } +// A reference to a StoredInfoType to use with scanning. +message StoredType { + // Resource name of the requested `StoredInfoType`, for example + // `organizations/433245324/storedInfoTypes/432452342` or + // `projects/project-id/storedInfoTypes/432452342`. + string name = 1; + + // Timestamp indicating when the version of the `StoredInfoType` used for + // inspection was created. Output-only field, populated by the system. + google.protobuf.Timestamp create_time = 2; +} + // Custom information type provided by the user. Used to find domain-specific // sensitive information configurable to the data in question. message CustomInfoType { @@ -85,7 +84,7 @@ message CustomInfoType { // 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", - // Plane](https://en.wikipedia.org/wiki/Plane_%28Unicode%29#Basic_Multilingual_Plane) + // "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 @@ -98,7 +97,7 @@ message CustomInfoType { // [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 - // [limits](https://cloud.google.com/dlp/limits) page contains details about + // `StoredInfoType` API. message Dictionary { // Message defining a list of words or phrases to search for in the data. message WordList { @@ -124,7 +123,7 @@ message CustomInfoType { // (https://github.com/google/re2/wiki/Syntax) can be found under the // google/re2 repository on GitHub. string pattern = 1; - // (https://github.com/google/re2/wiki/Syntax) can be found under the + // The index of the submatch to extract as findings. When not // specified, the entire match is returned. No more than 3 may be included. repeated int32 group_indexes = 2; @@ -135,10 +134,12 @@ message CustomInfoType { // [`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 - // [`CryptoReplaceFfxFpeConfig`](https://cloud.google.com/dlp/docs/reference/rest/v2/organizations.deidentifyTemplates#cryptoreplaceffxfpeconfig). + // 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`. - message SurrogateType {} + message SurrogateType { + + } // Deprecated; use `InspectionRuleSet` instead. Rule for modifying a // `CustomInfoType` to alter behavior under certain circumstances, depending @@ -284,6 +285,67 @@ message DatastoreOptions { KindExpression kind = 2; } +// Definitions of file type groups to scan. New types will be added to this +// list. +enum FileType { + // Includes all files. + FILE_TYPE_UNSPECIFIED = 0; + + // Includes all file extensions not covered by another entry. Binary + // scanning attempts to convert the content of the file to utf_8 to scan + // the file. + // If you wish to avoid this fall back, specify one or more of the other + // FileType's in your storage scan. + BINARY_FILE = 1; + + // Included file extensions: + // asc,asp, aspx, brf, c, cc,cfm, cgi, cpp, csv, cxx, c++, cs, css, dart, + // dat, dot, eml,, epbub, ged, go, h, hh, hpp, hxx, h++, hs, html, htm, + // mkd, markdown, m, ml, mli, perl, pl, plist, pm, php, phtml, pht, + // properties, py, pyw, rb, rbw, rs, rss, rc, scala, sh, sql, swift, tex, + // shtml, shtm, xhtml, lhs, ics, ini, java, js, json, kix, kml, ocaml, md, + // txt, text, tsv, vb, vcard, vcs, wml, xcodeproj, 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 inspection is restricted to 'global', 'us', 'asia', and 'europe'. + IMAGE = 3; + + // Word files >30 MB will be scanned as binary files. + // Included file extensions: + // docx, dotx, docm, dotm + WORD = 5; + + // PDF files >30 MB will be scanned as binary files. + // Included file extensions: + // pdf + PDF = 6; + + // Included file extensions: + // avro + AVRO = 7; + + // Included file extensions: + // csv + CSV = 8; + + // Included file extensions: + // tsv + TSV = 9; + + // Powerpoint files >30 MB will be scanned as binary files. + // Included file extensions: + // pptx, pptm, potx, potm, pot + POWERPOINT = 11; + + // Excel files >30 MB will be scanned as binary files. + // Included file extensions: + // xlsx, xlsm, xltx, xltm + EXCEL = 12; +} + // 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. @@ -330,7 +392,7 @@ message CloudStorageRegexFileSet { // [syntax](https://github.com/google/re2/wiki/Syntax); a guide can be found // under the google/re2 repository on GitHub. repeated string include_regex = 2; - // [syntax](https://github.com/google/re2/wiki/Syntax); a guide can be found + // 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. @@ -339,7 +401,6 @@ message CloudStorageRegexFileSet { // [syntax](https://github.com/google/re2/wiki/Syntax); a guide can be found // under the google/re2 repository on GitHub. repeated string exclude_regex = 3; - // [syntax](https://github.com/google/re2/wiki/Syntax); a guide can be found } // Options defining a file or a set of files within a Google Cloud Storage @@ -531,57 +592,6 @@ message StorageConfig { TimespanConfig timespan_config = 6; } -// Definitions of file type groups to scan. New types will be added to this -// list. -enum FileType { - // Includes all files. - FILE_TYPE_UNSPECIFIED = 0; - - // Includes all file extensions not covered by another entry. Binary - // scanning attempts to convert the content of the file to utf_8 to scan - // the file. - // If you wish to avoid this fall back, specify one or more of the other - // FileType's in your storage scan. - BINARY_FILE = 1; - - // Included file extensions: - // asc,asp, aspx, brf, c, cc,cfm, cgi, cpp, csv, cxx, c++, cs, css, dart, - // dat, dot, eml,, epbub, ged, go, h, hh, hpp, hxx, h++, hs, html, htm, - // mkd, markdown, m, ml, mli, perl, pl, plist, pm, php, phtml, pht, - // properties, py, pyw, rb, rbw, rs, rss, rc, scala, sh, sql, swift, tex, - // shtml, shtm, xhtml, lhs, ics, ini, java, js, json, kix, kml, ocaml, md, - // txt, text, tsv, vb, vcard, vcs, wml, xcodeproj, 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 inspection is restricted to 'global', 'us', 'asia', and 'europe'. - IMAGE = 3; - - // Word files >30 MB will be scanned as binary files. - // Included file extensions: - // docx, dotx, docm, dotm - WORD = 5; - - // PDF files >30 MB will be scanned as binary files. - // Included file extensions: - // pdf - PDF = 6; - - // Included file extensions: - // avro - AVRO = 7; - - // Included file extensions: - // csv - CSV = 8; - - // Included file extensions: - // tsv - TSV = 9; -} - // Configuration to control jobs where the content being inspected is outside // of Google Cloud Platform. message HybridOptions { diff --git a/protos/protos.d.ts b/protos/protos.d.ts index 0863f610..47502061 100644 --- a/protos/protos.d.ts +++ b/protos/protos.d.ts @@ -1605,6 +1605,8 @@ export namespace google { TEXT_UTF8 = 5, WORD_DOCUMENT = 7, PDF = 8, + POWERPOINT_DOCUMENT = 9, + EXCEL_DOCUMENT = 10, AVRO = 11, CSV = 12, TSV = 13 @@ -12441,6 +12443,13 @@ export namespace google { namespace TransformationSummary { + /** TransformationResultCode enum. */ + enum TransformationResultCode { + TRANSFORMATION_RESULT_CODE_UNSPECIFIED = 0, + SUCCESS = 1, + ERROR = 2 + } + /** Properties of a SummaryResult. */ interface ISummaryResult { @@ -12542,13 +12551,6 @@ export namespace google { */ public toJSON(): { [k: string]: any }; } - - /** TransformationResultCode enum. */ - enum TransformationResultCode { - TRANSFORMATION_RESULT_CODE_UNSPECIFIED = 0, - SUCCESS = 1, - ERROR = 2 - } } /** Properties of a Schedule. */ @@ -18692,6 +18694,16 @@ export namespace google { public toJSON(): { [k: string]: any }; } + /** Likelihood enum. */ + enum Likelihood { + LIKELIHOOD_UNSPECIFIED = 0, + VERY_UNLIKELY = 1, + UNLIKELY = 2, + POSSIBLE = 3, + LIKELY = 4, + VERY_LIKELY = 5 + } + /** Properties of a StoredType. */ interface IStoredType { @@ -18788,16 +18800,6 @@ export namespace google { public toJSON(): { [k: string]: any }; } - /** Likelihood enum. */ - enum Likelihood { - LIKELIHOOD_UNSPECIFIED = 0, - VERY_UNLIKELY = 1, - UNLIKELY = 2, - POSSIBLE = 3, - LIKELY = 4, - VERY_LIKELY = 5 - } - /** Properties of a CustomInfoType. */ interface ICustomInfoType { @@ -20079,6 +20081,21 @@ export namespace google { public toJSON(): { [k: string]: any }; } + /** FileType enum. */ + enum FileType { + FILE_TYPE_UNSPECIFIED = 0, + BINARY_FILE = 1, + TEXT_FILE = 2, + IMAGE = 3, + WORD = 5, + PDF = 6, + AVRO = 7, + CSV = 8, + TSV = 9, + POWERPOINT = 11, + EXCEL = 12 + } + /** Properties of a CloudStorageRegexFileSet. */ interface ICloudStorageRegexFileSet { @@ -20951,19 +20968,6 @@ export namespace google { } } - /** FileType enum. */ - enum FileType { - FILE_TYPE_UNSPECIFIED = 0, - BINARY_FILE = 1, - TEXT_FILE = 2, - IMAGE = 3, - WORD = 5, - PDF = 6, - AVRO = 7, - CSV = 8, - TSV = 9 - } - /** Properties of a HybridOptions. */ interface IHybridOptions { @@ -21951,590 +21955,590 @@ export namespace google { /** Namespace api. */ namespace api { - /** FieldBehavior enum. */ - enum FieldBehavior { - FIELD_BEHAVIOR_UNSPECIFIED = 0, - OPTIONAL = 1, - REQUIRED = 2, - OUTPUT_ONLY = 3, - INPUT_ONLY = 4, - IMMUTABLE = 5, - UNORDERED_LIST = 6, - NON_EMPTY_DEFAULT = 7 - } - - /** Properties of a ResourceDescriptor. */ - interface IResourceDescriptor { - - /** ResourceDescriptor type */ - type?: (string|null); - - /** ResourceDescriptor pattern */ - pattern?: (string[]|null); - - /** ResourceDescriptor nameField */ - nameField?: (string|null); - - /** ResourceDescriptor history */ - history?: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History|null); - - /** ResourceDescriptor plural */ - plural?: (string|null); + /** Properties of a Http. */ + interface IHttp { - /** ResourceDescriptor singular */ - singular?: (string|null); + /** Http rules */ + rules?: (google.api.IHttpRule[]|null); - /** ResourceDescriptor style */ - style?: (google.api.ResourceDescriptor.Style[]|null); + /** Http fullyDecodeReservedExpansion */ + fullyDecodeReservedExpansion?: (boolean|null); } - /** Represents a ResourceDescriptor. */ - class ResourceDescriptor implements IResourceDescriptor { + /** Represents a Http. */ + class Http implements IHttp { /** - * Constructs a new ResourceDescriptor. + * Constructs a new Http. * @param [properties] Properties to set */ - constructor(properties?: google.api.IResourceDescriptor); - - /** ResourceDescriptor type. */ - public type: string; - - /** ResourceDescriptor pattern. */ - public pattern: string[]; - - /** ResourceDescriptor nameField. */ - public nameField: string; - - /** ResourceDescriptor history. */ - public history: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History); - - /** ResourceDescriptor plural. */ - public plural: string; + constructor(properties?: google.api.IHttp); - /** ResourceDescriptor singular. */ - public singular: string; + /** Http rules. */ + public rules: google.api.IHttpRule[]; - /** ResourceDescriptor style. */ - public style: google.api.ResourceDescriptor.Style[]; + /** Http fullyDecodeReservedExpansion. */ + public fullyDecodeReservedExpansion: boolean; /** - * Creates a new ResourceDescriptor instance using the specified properties. + * Creates a new Http instance using the specified properties. * @param [properties] Properties to set - * @returns ResourceDescriptor instance + * @returns Http instance */ - public static create(properties?: google.api.IResourceDescriptor): google.api.ResourceDescriptor; + public static create(properties?: google.api.IHttp): google.api.Http; /** - * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. - * @param message ResourceDescriptor message or plain object to encode + * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @param message Http message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. - * @param message ResourceDescriptor message or plain object to encode + * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @param message Http message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ResourceDescriptor message from the specified reader or buffer. + * Decodes a Http message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ResourceDescriptor + * @returns Http * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceDescriptor; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.Http; /** - * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. + * Decodes a Http message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ResourceDescriptor + * @returns Http * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceDescriptor; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.Http; /** - * Verifies a ResourceDescriptor message. + * Verifies a Http message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. + * Creates a Http message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ResourceDescriptor + * @returns Http */ - public static fromObject(object: { [k: string]: any }): google.api.ResourceDescriptor; + public static fromObject(object: { [k: string]: any }): google.api.Http; /** - * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. - * @param message ResourceDescriptor + * Creates a plain object from a Http message. Also converts values to other types if specified. + * @param message Http * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.api.ResourceDescriptor, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.api.Http, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ResourceDescriptor to JSON. + * Converts this Http to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace ResourceDescriptor { + /** Properties of a HttpRule. */ + interface IHttpRule { - /** History enum. */ - enum History { - HISTORY_UNSPECIFIED = 0, - ORIGINALLY_SINGLE_PATTERN = 1, - FUTURE_MULTI_PATTERN = 2 - } + /** HttpRule selector */ + selector?: (string|null); - /** Style enum. */ - enum Style { - STYLE_UNSPECIFIED = 0, - DECLARATIVE_FRIENDLY = 1 - } - } + /** HttpRule get */ + get?: (string|null); - /** Properties of a ResourceReference. */ - interface IResourceReference { + /** HttpRule put */ + put?: (string|null); - /** ResourceReference type */ - type?: (string|null); + /** HttpRule post */ + post?: (string|null); - /** ResourceReference childType */ - childType?: (string|null); - } + /** HttpRule delete */ + "delete"?: (string|null); - /** Represents a ResourceReference. */ - class ResourceReference implements IResourceReference { + /** HttpRule patch */ + patch?: (string|null); - /** - * Constructs a new ResourceReference. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IResourceReference); + /** HttpRule custom */ + custom?: (google.api.ICustomHttpPattern|null); - /** ResourceReference type. */ - public type: string; + /** HttpRule body */ + body?: (string|null); - /** ResourceReference childType. */ - public childType: string; + /** HttpRule responseBody */ + responseBody?: (string|null); + + /** HttpRule additionalBindings */ + additionalBindings?: (google.api.IHttpRule[]|null); + } + + /** Represents a HttpRule. */ + class HttpRule implements IHttpRule { /** - * Creates a new ResourceReference instance using the specified properties. + * Constructs a new HttpRule. * @param [properties] Properties to set - * @returns ResourceReference instance */ - public static create(properties?: google.api.IResourceReference): google.api.ResourceReference; + constructor(properties?: google.api.IHttpRule); - /** - * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. - * @param message ResourceReference message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; + /** HttpRule selector. */ + public selector: string; - /** - * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. - * @param message ResourceReference message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; + /** HttpRule get. */ + public get?: (string|null); - /** - * Decodes a ResourceReference message from the specified reader or buffer. + /** HttpRule put. */ + public put?: (string|null); + + /** HttpRule post. */ + public post?: (string|null); + + /** HttpRule delete. */ + public delete?: (string|null); + + /** HttpRule patch. */ + public patch?: (string|null); + + /** HttpRule custom. */ + public custom?: (google.api.ICustomHttpPattern|null); + + /** HttpRule body. */ + public body: string; + + /** HttpRule responseBody. */ + public responseBody: string; + + /** HttpRule additionalBindings. */ + public additionalBindings: google.api.IHttpRule[]; + + /** HttpRule pattern. */ + public pattern?: ("get"|"put"|"post"|"delete"|"patch"|"custom"); + + /** + * Creates a new HttpRule instance using the specified properties. + * @param [properties] Properties to set + * @returns HttpRule instance + */ + public static create(properties?: google.api.IHttpRule): google.api.HttpRule; + + /** + * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @param message HttpRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @param message HttpRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HttpRule message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ResourceReference + * @returns HttpRule * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceReference; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.HttpRule; /** - * Decodes a ResourceReference message from the specified reader or buffer, length delimited. + * Decodes a HttpRule message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ResourceReference + * @returns HttpRule * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceReference; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.HttpRule; /** - * Verifies a ResourceReference message. + * Verifies a HttpRule message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. + * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ResourceReference + * @returns HttpRule */ - public static fromObject(object: { [k: string]: any }): google.api.ResourceReference; + public static fromObject(object: { [k: string]: any }): google.api.HttpRule; /** - * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. - * @param message ResourceReference + * Creates a plain object from a HttpRule message. Also converts values to other types if specified. + * @param message HttpRule * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.api.ResourceReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.api.HttpRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ResourceReference to JSON. + * Converts this HttpRule to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a Http. */ - interface IHttp { + /** Properties of a CustomHttpPattern. */ + interface ICustomHttpPattern { - /** Http rules */ - rules?: (google.api.IHttpRule[]|null); + /** CustomHttpPattern kind */ + kind?: (string|null); - /** Http fullyDecodeReservedExpansion */ - fullyDecodeReservedExpansion?: (boolean|null); + /** CustomHttpPattern path */ + path?: (string|null); } - /** Represents a Http. */ - class Http implements IHttp { + /** Represents a CustomHttpPattern. */ + class CustomHttpPattern implements ICustomHttpPattern { /** - * Constructs a new Http. + * Constructs a new CustomHttpPattern. * @param [properties] Properties to set */ - constructor(properties?: google.api.IHttp); + constructor(properties?: google.api.ICustomHttpPattern); - /** Http rules. */ - public rules: google.api.IHttpRule[]; + /** CustomHttpPattern kind. */ + public kind: string; - /** Http fullyDecodeReservedExpansion. */ - public fullyDecodeReservedExpansion: boolean; + /** CustomHttpPattern path. */ + public path: string; /** - * Creates a new Http instance using the specified properties. + * Creates a new CustomHttpPattern instance using the specified properties. * @param [properties] Properties to set - * @returns Http instance + * @returns CustomHttpPattern instance */ - public static create(properties?: google.api.IHttp): google.api.Http; + public static create(properties?: google.api.ICustomHttpPattern): google.api.CustomHttpPattern; /** - * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. - * @param message Http message or plain object to encode + * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @param message CustomHttpPattern message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. - * @param message Http message or plain object to encode + * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @param message CustomHttpPattern message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Http message from the specified reader or buffer. + * Decodes a CustomHttpPattern message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Http + * @returns CustomHttpPattern * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.Http; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CustomHttpPattern; /** - * Decodes a Http message from the specified reader or buffer, length delimited. + * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Http + * @returns CustomHttpPattern * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.Http; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CustomHttpPattern; /** - * Verifies a Http message. + * Verifies a CustomHttpPattern message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a Http message from a plain object. Also converts values to their respective internal types. + * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Http + * @returns CustomHttpPattern */ - public static fromObject(object: { [k: string]: any }): google.api.Http; + public static fromObject(object: { [k: string]: any }): google.api.CustomHttpPattern; /** - * Creates a plain object from a Http message. Also converts values to other types if specified. - * @param message Http + * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. + * @param message CustomHttpPattern * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.api.Http, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.api.CustomHttpPattern, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Http to JSON. + * Converts this CustomHttpPattern to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a HttpRule. */ - interface IHttpRule { - - /** HttpRule selector */ - selector?: (string|null); - - /** HttpRule get */ - get?: (string|null); + /** FieldBehavior enum. */ + enum FieldBehavior { + FIELD_BEHAVIOR_UNSPECIFIED = 0, + OPTIONAL = 1, + REQUIRED = 2, + OUTPUT_ONLY = 3, + INPUT_ONLY = 4, + IMMUTABLE = 5, + UNORDERED_LIST = 6, + NON_EMPTY_DEFAULT = 7 + } - /** HttpRule put */ - put?: (string|null); + /** Properties of a ResourceDescriptor. */ + interface IResourceDescriptor { - /** HttpRule post */ - post?: (string|null); + /** ResourceDescriptor type */ + type?: (string|null); - /** HttpRule delete */ - "delete"?: (string|null); + /** ResourceDescriptor pattern */ + pattern?: (string[]|null); - /** HttpRule patch */ - patch?: (string|null); + /** ResourceDescriptor nameField */ + nameField?: (string|null); - /** HttpRule custom */ - custom?: (google.api.ICustomHttpPattern|null); + /** ResourceDescriptor history */ + history?: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History|null); - /** HttpRule body */ - body?: (string|null); + /** ResourceDescriptor plural */ + plural?: (string|null); - /** HttpRule responseBody */ - responseBody?: (string|null); + /** ResourceDescriptor singular */ + singular?: (string|null); - /** HttpRule additionalBindings */ - additionalBindings?: (google.api.IHttpRule[]|null); + /** ResourceDescriptor style */ + style?: (google.api.ResourceDescriptor.Style[]|null); } - /** Represents a HttpRule. */ - class HttpRule implements IHttpRule { + /** Represents a ResourceDescriptor. */ + class ResourceDescriptor implements IResourceDescriptor { /** - * Constructs a new HttpRule. + * Constructs a new ResourceDescriptor. * @param [properties] Properties to set */ - constructor(properties?: google.api.IHttpRule); - - /** HttpRule selector. */ - public selector: string; - - /** HttpRule get. */ - public get?: (string|null); - - /** HttpRule put. */ - public put?: (string|null); - - /** HttpRule post. */ - public post?: (string|null); + constructor(properties?: google.api.IResourceDescriptor); - /** HttpRule delete. */ - public delete?: (string|null); + /** ResourceDescriptor type. */ + public type: string; - /** HttpRule patch. */ - public patch?: (string|null); + /** ResourceDescriptor pattern. */ + public pattern: string[]; - /** HttpRule custom. */ - public custom?: (google.api.ICustomHttpPattern|null); + /** ResourceDescriptor nameField. */ + public nameField: string; - /** HttpRule body. */ - public body: string; + /** ResourceDescriptor history. */ + public history: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History); - /** HttpRule responseBody. */ - public responseBody: string; + /** ResourceDescriptor plural. */ + public plural: string; - /** HttpRule additionalBindings. */ - public additionalBindings: google.api.IHttpRule[]; + /** ResourceDescriptor singular. */ + public singular: string; - /** HttpRule pattern. */ - public pattern?: ("get"|"put"|"post"|"delete"|"patch"|"custom"); + /** ResourceDescriptor style. */ + public style: google.api.ResourceDescriptor.Style[]; /** - * Creates a new HttpRule instance using the specified properties. + * Creates a new ResourceDescriptor instance using the specified properties. * @param [properties] Properties to set - * @returns HttpRule instance + * @returns ResourceDescriptor instance */ - public static create(properties?: google.api.IHttpRule): google.api.HttpRule; + public static create(properties?: google.api.IResourceDescriptor): google.api.ResourceDescriptor; /** - * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. - * @param message HttpRule message or plain object to encode + * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @param message ResourceDescriptor message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. - * @param message HttpRule message or plain object to encode + * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @param message ResourceDescriptor message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a HttpRule message from the specified reader or buffer. + * Decodes a ResourceDescriptor message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns HttpRule + * @returns ResourceDescriptor * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.HttpRule; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceDescriptor; /** - * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns HttpRule + * @returns ResourceDescriptor * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.HttpRule; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceDescriptor; /** - * Verifies a HttpRule message. + * Verifies a ResourceDescriptor message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. + * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns HttpRule + * @returns ResourceDescriptor */ - public static fromObject(object: { [k: string]: any }): google.api.HttpRule; + public static fromObject(object: { [k: string]: any }): google.api.ResourceDescriptor; /** - * Creates a plain object from a HttpRule message. Also converts values to other types if specified. - * @param message HttpRule + * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. + * @param message ResourceDescriptor * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.api.HttpRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.api.ResourceDescriptor, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this HttpRule to JSON. + * Converts this ResourceDescriptor to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a CustomHttpPattern. */ - interface ICustomHttpPattern { + namespace ResourceDescriptor { - /** CustomHttpPattern kind */ - kind?: (string|null); + /** History enum. */ + enum History { + HISTORY_UNSPECIFIED = 0, + ORIGINALLY_SINGLE_PATTERN = 1, + FUTURE_MULTI_PATTERN = 2 + } - /** CustomHttpPattern path */ - path?: (string|null); + /** Style enum. */ + enum Style { + STYLE_UNSPECIFIED = 0, + DECLARATIVE_FRIENDLY = 1 + } } - /** Represents a CustomHttpPattern. */ - class CustomHttpPattern implements ICustomHttpPattern { + /** Properties of a ResourceReference. */ + interface IResourceReference { + + /** ResourceReference type */ + type?: (string|null); + + /** ResourceReference childType */ + childType?: (string|null); + } + + /** Represents a ResourceReference. */ + class ResourceReference implements IResourceReference { /** - * Constructs a new CustomHttpPattern. + * Constructs a new ResourceReference. * @param [properties] Properties to set */ - constructor(properties?: google.api.ICustomHttpPattern); + constructor(properties?: google.api.IResourceReference); - /** CustomHttpPattern kind. */ - public kind: string; + /** ResourceReference type. */ + public type: string; - /** CustomHttpPattern path. */ - public path: string; + /** ResourceReference childType. */ + public childType: string; /** - * Creates a new CustomHttpPattern instance using the specified properties. + * Creates a new ResourceReference instance using the specified properties. * @param [properties] Properties to set - * @returns CustomHttpPattern instance + * @returns ResourceReference instance */ - public static create(properties?: google.api.ICustomHttpPattern): google.api.CustomHttpPattern; + public static create(properties?: google.api.IResourceReference): google.api.ResourceReference; /** - * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. - * @param message CustomHttpPattern message or plain object to encode + * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @param message ResourceReference message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. - * @param message CustomHttpPattern message or plain object to encode + * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @param message ResourceReference message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a CustomHttpPattern message from the specified reader or buffer. + * Decodes a ResourceReference message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns CustomHttpPattern + * @returns ResourceReference * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CustomHttpPattern; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceReference; /** - * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * Decodes a ResourceReference message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns CustomHttpPattern + * @returns ResourceReference * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CustomHttpPattern; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceReference; /** - * Verifies a CustomHttpPattern message. + * Verifies a ResourceReference message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns CustomHttpPattern + * @returns ResourceReference */ - public static fromObject(object: { [k: string]: any }): google.api.CustomHttpPattern; + public static fromObject(object: { [k: string]: any }): google.api.ResourceReference; /** - * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. - * @param message CustomHttpPattern + * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. + * @param message ResourceReference * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.api.CustomHttpPattern, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.api.ResourceReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this CustomHttpPattern to JSON. + * Converts this ResourceReference to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; @@ -24931,11 +24935,11 @@ export namespace google { /** MethodOptions uninterpretedOption */ uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - /** MethodOptions .google.api.methodSignature */ - ".google.api.methodSignature"?: (string[]|null); - /** MethodOptions .google.api.http */ ".google.api.http"?: (google.api.IHttpRule|null); + + /** MethodOptions .google.api.methodSignature */ + ".google.api.methodSignature"?: (string[]|null); } /** Represents a MethodOptions. */ diff --git a/protos/protos.js b/protos/protos.js index 1327bf53..c70c2686 100644 --- a/protos/protos.js +++ b/protos/protos.js @@ -3368,6 +3368,8 @@ case 5: case 7: case 8: + case 9: + case 10: case 11: case 12: case 13: @@ -3428,6 +3430,14 @@ case 8: message.type = 8; break; + case "POWERPOINT_DOCUMENT": + case 9: + message.type = 9; + break; + case "EXCEL_DOCUMENT": + case 10: + message.type = 10; + break; case "AVRO": case 11: message.type = 11; @@ -3503,6 +3513,8 @@ * @property {number} TEXT_UTF8=5 TEXT_UTF8 value * @property {number} WORD_DOCUMENT=7 WORD_DOCUMENT value * @property {number} PDF=8 PDF value + * @property {number} POWERPOINT_DOCUMENT=9 POWERPOINT_DOCUMENT value + * @property {number} EXCEL_DOCUMENT=10 EXCEL_DOCUMENT value * @property {number} AVRO=11 AVRO value * @property {number} CSV=12 CSV value * @property {number} TSV=13 TSV value @@ -3518,6 +3530,8 @@ values[valuesById[5] = "TEXT_UTF8"] = 5; values[valuesById[7] = "WORD_DOCUMENT"] = 7; values[valuesById[8] = "PDF"] = 8; + values[valuesById[9] = "POWERPOINT_DOCUMENT"] = 9; + values[valuesById[10] = "EXCEL_DOCUMENT"] = 10; values[valuesById[11] = "AVRO"] = 11; values[valuesById[12] = "CSV"] = 12; values[valuesById[13] = "TSV"] = 13; @@ -31001,6 +31015,22 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * TransformationResultCode enum. + * @name google.privacy.dlp.v2.TransformationSummary.TransformationResultCode + * @enum {number} + * @property {number} TRANSFORMATION_RESULT_CODE_UNSPECIFIED=0 TRANSFORMATION_RESULT_CODE_UNSPECIFIED value + * @property {number} SUCCESS=1 SUCCESS value + * @property {number} ERROR=2 ERROR value + */ + TransformationSummary.TransformationResultCode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TRANSFORMATION_RESULT_CODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "SUCCESS"] = 1; + values[valuesById[2] = "ERROR"] = 2; + return values; + })(); + TransformationSummary.SummaryResult = (function() { /** @@ -31265,22 +31295,6 @@ return SummaryResult; })(); - /** - * TransformationResultCode enum. - * @name google.privacy.dlp.v2.TransformationSummary.TransformationResultCode - * @enum {number} - * @property {number} TRANSFORMATION_RESULT_CODE_UNSPECIFIED=0 TRANSFORMATION_RESULT_CODE_UNSPECIFIED value - * @property {number} SUCCESS=1 SUCCESS value - * @property {number} ERROR=2 ERROR value - */ - TransformationSummary.TransformationResultCode = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "TRANSFORMATION_RESULT_CODE_UNSPECIFIED"] = 0; - values[valuesById[1] = "SUCCESS"] = 1; - values[valuesById[2] = "ERROR"] = 2; - return values; - })(); - return TransformationSummary; })(); @@ -46012,6 +46026,28 @@ return InfoType; })(); + /** + * Likelihood enum. + * @name google.privacy.dlp.v2.Likelihood + * @enum {number} + * @property {number} LIKELIHOOD_UNSPECIFIED=0 LIKELIHOOD_UNSPECIFIED value + * @property {number} VERY_UNLIKELY=1 VERY_UNLIKELY value + * @property {number} UNLIKELY=2 UNLIKELY value + * @property {number} POSSIBLE=3 POSSIBLE value + * @property {number} LIKELY=4 LIKELY value + * @property {number} VERY_LIKELY=5 VERY_LIKELY value + */ + v2.Likelihood = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "LIKELIHOOD_UNSPECIFIED"] = 0; + values[valuesById[1] = "VERY_UNLIKELY"] = 1; + values[valuesById[2] = "UNLIKELY"] = 2; + values[valuesById[3] = "POSSIBLE"] = 3; + values[valuesById[4] = "LIKELY"] = 4; + values[valuesById[5] = "VERY_LIKELY"] = 5; + return values; + })(); + v2.StoredType = (function() { /** @@ -46227,28 +46263,6 @@ return StoredType; })(); - /** - * Likelihood enum. - * @name google.privacy.dlp.v2.Likelihood - * @enum {number} - * @property {number} LIKELIHOOD_UNSPECIFIED=0 LIKELIHOOD_UNSPECIFIED value - * @property {number} VERY_UNLIKELY=1 VERY_UNLIKELY value - * @property {number} UNLIKELY=2 UNLIKELY value - * @property {number} POSSIBLE=3 POSSIBLE value - * @property {number} LIKELY=4 LIKELY value - * @property {number} VERY_LIKELY=5 VERY_LIKELY value - */ - v2.Likelihood = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "LIKELIHOOD_UNSPECIFIED"] = 0; - values[valuesById[1] = "VERY_UNLIKELY"] = 1; - values[valuesById[2] = "UNLIKELY"] = 2; - values[valuesById[3] = "POSSIBLE"] = 3; - values[valuesById[4] = "LIKELY"] = 4; - values[valuesById[5] = "VERY_LIKELY"] = 5; - return values; - })(); - v2.CustomInfoType = (function() { /** @@ -49319,6 +49333,38 @@ return DatastoreOptions; })(); + /** + * FileType enum. + * @name google.privacy.dlp.v2.FileType + * @enum {number} + * @property {number} FILE_TYPE_UNSPECIFIED=0 FILE_TYPE_UNSPECIFIED value + * @property {number} BINARY_FILE=1 BINARY_FILE value + * @property {number} TEXT_FILE=2 TEXT_FILE value + * @property {number} IMAGE=3 IMAGE value + * @property {number} WORD=5 WORD value + * @property {number} PDF=6 PDF value + * @property {number} AVRO=7 AVRO value + * @property {number} CSV=8 CSV value + * @property {number} TSV=9 TSV value + * @property {number} POWERPOINT=11 POWERPOINT value + * @property {number} EXCEL=12 EXCEL value + */ + v2.FileType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FILE_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "BINARY_FILE"] = 1; + values[valuesById[2] = "TEXT_FILE"] = 2; + values[valuesById[3] = "IMAGE"] = 3; + values[valuesById[5] = "WORD"] = 5; + values[valuesById[6] = "PDF"] = 6; + values[valuesById[7] = "AVRO"] = 7; + values[valuesById[8] = "CSV"] = 8; + values[valuesById[9] = "TSV"] = 9; + values[valuesById[11] = "POWERPOINT"] = 11; + values[valuesById[12] = "EXCEL"] = 12; + return values; + })(); + v2.CloudStorageRegexFileSet = (function() { /** @@ -49823,6 +49869,8 @@ case 7: case 8: case 9: + case 11: + case 12: break; } } @@ -49912,6 +49960,14 @@ case 9: message.fileTypes[i] = 9; break; + case "POWERPOINT": + case 11: + message.fileTypes[i] = 11; + break; + case "EXCEL": + case 12: + message.fileTypes[i] = 12; + break; } } switch (object.sampleMethod) { @@ -51647,34 +51703,6 @@ return StorageConfig; })(); - /** - * FileType enum. - * @name google.privacy.dlp.v2.FileType - * @enum {number} - * @property {number} FILE_TYPE_UNSPECIFIED=0 FILE_TYPE_UNSPECIFIED value - * @property {number} BINARY_FILE=1 BINARY_FILE value - * @property {number} TEXT_FILE=2 TEXT_FILE value - * @property {number} IMAGE=3 IMAGE value - * @property {number} WORD=5 WORD value - * @property {number} PDF=6 PDF value - * @property {number} AVRO=7 AVRO value - * @property {number} CSV=8 CSV value - * @property {number} TSV=9 TSV value - */ - v2.FileType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "FILE_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "BINARY_FILE"] = 1; - values[valuesById[2] = "TEXT_FILE"] = 2; - values[valuesById[3] = "IMAGE"] = 3; - values[valuesById[5] = "WORD"] = 5; - values[valuesById[6] = "PDF"] = 6; - values[valuesById[7] = "AVRO"] = 7; - values[valuesById[8] = "CSV"] = 8; - values[valuesById[9] = "TSV"] = 9; - return values; - })(); - v2.HybridOptions = (function() { /** @@ -54064,58 +54092,26 @@ */ var api = {}; - /** - * FieldBehavior enum. - * @name google.api.FieldBehavior - * @enum {number} - * @property {number} FIELD_BEHAVIOR_UNSPECIFIED=0 FIELD_BEHAVIOR_UNSPECIFIED value - * @property {number} OPTIONAL=1 OPTIONAL value - * @property {number} REQUIRED=2 REQUIRED value - * @property {number} OUTPUT_ONLY=3 OUTPUT_ONLY value - * @property {number} INPUT_ONLY=4 INPUT_ONLY value - * @property {number} IMMUTABLE=5 IMMUTABLE value - * @property {number} UNORDERED_LIST=6 UNORDERED_LIST value - * @property {number} NON_EMPTY_DEFAULT=7 NON_EMPTY_DEFAULT value - */ - api.FieldBehavior = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "FIELD_BEHAVIOR_UNSPECIFIED"] = 0; - values[valuesById[1] = "OPTIONAL"] = 1; - values[valuesById[2] = "REQUIRED"] = 2; - values[valuesById[3] = "OUTPUT_ONLY"] = 3; - values[valuesById[4] = "INPUT_ONLY"] = 4; - values[valuesById[5] = "IMMUTABLE"] = 5; - values[valuesById[6] = "UNORDERED_LIST"] = 6; - values[valuesById[7] = "NON_EMPTY_DEFAULT"] = 7; - return values; - })(); - - api.ResourceDescriptor = (function() { + api.Http = (function() { /** - * Properties of a ResourceDescriptor. + * Properties of a Http. * @memberof google.api - * @interface IResourceDescriptor - * @property {string|null} [type] ResourceDescriptor type - * @property {Array.|null} [pattern] ResourceDescriptor pattern - * @property {string|null} [nameField] ResourceDescriptor nameField - * @property {google.api.ResourceDescriptor.History|null} [history] ResourceDescriptor history - * @property {string|null} [plural] ResourceDescriptor plural - * @property {string|null} [singular] ResourceDescriptor singular - * @property {Array.|null} [style] ResourceDescriptor style + * @interface IHttp + * @property {Array.|null} [rules] Http rules + * @property {boolean|null} [fullyDecodeReservedExpansion] Http fullyDecodeReservedExpansion */ /** - * Constructs a new ResourceDescriptor. + * Constructs a new Http. * @memberof google.api - * @classdesc Represents a ResourceDescriptor. - * @implements IResourceDescriptor + * @classdesc Represents a Http. + * @implements IHttp * @constructor - * @param {google.api.IResourceDescriptor=} [properties] Properties to set + * @param {google.api.IHttp=} [properties] Properties to set */ - function ResourceDescriptor(properties) { - this.pattern = []; - this.style = []; + function Http(properties) { + this.rules = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -54123,167 +54119,91 @@ } /** - * ResourceDescriptor type. - * @member {string} type - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.type = ""; - - /** - * ResourceDescriptor pattern. - * @member {Array.} pattern - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.pattern = $util.emptyArray; - - /** - * ResourceDescriptor nameField. - * @member {string} nameField - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.nameField = ""; - - /** - * ResourceDescriptor history. - * @member {google.api.ResourceDescriptor.History} history - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.history = 0; - - /** - * ResourceDescriptor plural. - * @member {string} plural - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.plural = ""; - - /** - * ResourceDescriptor singular. - * @member {string} singular - * @memberof google.api.ResourceDescriptor + * Http rules. + * @member {Array.} rules + * @memberof google.api.Http * @instance */ - ResourceDescriptor.prototype.singular = ""; + Http.prototype.rules = $util.emptyArray; /** - * ResourceDescriptor style. - * @member {Array.} style - * @memberof google.api.ResourceDescriptor + * Http fullyDecodeReservedExpansion. + * @member {boolean} fullyDecodeReservedExpansion + * @memberof google.api.Http * @instance */ - ResourceDescriptor.prototype.style = $util.emptyArray; + Http.prototype.fullyDecodeReservedExpansion = false; /** - * Creates a new ResourceDescriptor instance using the specified properties. + * Creates a new Http instance using the specified properties. * @function create - * @memberof google.api.ResourceDescriptor + * @memberof google.api.Http * @static - * @param {google.api.IResourceDescriptor=} [properties] Properties to set - * @returns {google.api.ResourceDescriptor} ResourceDescriptor instance + * @param {google.api.IHttp=} [properties] Properties to set + * @returns {google.api.Http} Http instance */ - ResourceDescriptor.create = function create(properties) { - return new ResourceDescriptor(properties); + Http.create = function create(properties) { + return new Http(properties); }; /** - * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. * @function encode - * @memberof google.api.ResourceDescriptor + * @memberof google.api.Http * @static - * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {google.api.IHttp} message Http message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ResourceDescriptor.encode = function encode(message, writer) { + Http.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); - if (message.pattern != null && message.pattern.length) - for (var i = 0; i < message.pattern.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.pattern[i]); - if (message.nameField != null && Object.hasOwnProperty.call(message, "nameField")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.nameField); - if (message.history != null && Object.hasOwnProperty.call(message, "history")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.history); - if (message.plural != null && Object.hasOwnProperty.call(message, "plural")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.plural); - if (message.singular != null && Object.hasOwnProperty.call(message, "singular")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.singular); - if (message.style != null && message.style.length) { - writer.uint32(/* id 10, wireType 2 =*/82).fork(); - for (var i = 0; i < message.style.length; ++i) - writer.int32(message.style[i]); - writer.ldelim(); - } + if (message.rules != null && message.rules.length) + for (var i = 0; i < message.rules.length; ++i) + $root.google.api.HttpRule.encode(message.rules[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.fullyDecodeReservedExpansion != null && Object.hasOwnProperty.call(message, "fullyDecodeReservedExpansion")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fullyDecodeReservedExpansion); return writer; }; /** - * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. * @function encodeDelimited - * @memberof google.api.ResourceDescriptor + * @memberof google.api.Http * @static - * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {google.api.IHttp} message Http message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ResourceDescriptor.encodeDelimited = function encodeDelimited(message, writer) { + Http.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ResourceDescriptor message from the specified reader or buffer. + * Decodes a Http message from the specified reader or buffer. * @function decode - * @memberof google.api.ResourceDescriptor + * @memberof google.api.Http * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @returns {google.api.Http} Http * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ResourceDescriptor.decode = function decode(reader, length) { + Http.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceDescriptor(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Http(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.type = reader.string(); + if (!(message.rules && message.rules.length)) + message.rules = []; + message.rules.push($root.google.api.HttpRule.decode(reader, reader.uint32())); break; case 2: - if (!(message.pattern && message.pattern.length)) - message.pattern = []; - message.pattern.push(reader.string()); - break; - case 3: - message.nameField = reader.string(); - break; - case 4: - message.history = reader.int32(); - break; - case 5: - message.plural = reader.string(); - break; - case 6: - message.singular = reader.string(); - break; - case 10: - if (!(message.style && message.style.length)) - message.style = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.style.push(reader.int32()); - } else - message.style.push(reader.int32()); + message.fullyDecodeReservedExpansion = reader.bool(); break; default: reader.skipType(tag & 7); @@ -54294,246 +54214,143 @@ }; /** - * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. + * Decodes a Http message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.api.ResourceDescriptor + * @memberof google.api.Http * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @returns {google.api.Http} Http * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ResourceDescriptor.decodeDelimited = function decodeDelimited(reader) { + Http.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ResourceDescriptor message. + * Verifies a Http message. * @function verify - * @memberof google.api.ResourceDescriptor + * @memberof google.api.Http * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ResourceDescriptor.verify = function verify(message) { + Http.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.type != null && message.hasOwnProperty("type")) - if (!$util.isString(message.type)) - return "type: string expected"; - if (message.pattern != null && message.hasOwnProperty("pattern")) { - if (!Array.isArray(message.pattern)) - return "pattern: array expected"; - for (var i = 0; i < message.pattern.length; ++i) - if (!$util.isString(message.pattern[i])) - return "pattern: string[] expected"; - } - if (message.nameField != null && message.hasOwnProperty("nameField")) - if (!$util.isString(message.nameField)) - return "nameField: string expected"; - if (message.history != null && message.hasOwnProperty("history")) - switch (message.history) { - default: - return "history: enum value expected"; - case 0: - case 1: - case 2: - break; + if (message.rules != null && message.hasOwnProperty("rules")) { + if (!Array.isArray(message.rules)) + return "rules: array expected"; + for (var i = 0; i < message.rules.length; ++i) { + var error = $root.google.api.HttpRule.verify(message.rules[i]); + if (error) + return "rules." + error; } - if (message.plural != null && message.hasOwnProperty("plural")) - if (!$util.isString(message.plural)) - return "plural: string expected"; - if (message.singular != null && message.hasOwnProperty("singular")) - if (!$util.isString(message.singular)) - return "singular: string expected"; - if (message.style != null && message.hasOwnProperty("style")) { - if (!Array.isArray(message.style)) - return "style: array expected"; - for (var i = 0; i < message.style.length; ++i) - switch (message.style[i]) { - default: - return "style: enum value[] expected"; - case 0: - case 1: - break; - } } + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + if (typeof message.fullyDecodeReservedExpansion !== "boolean") + return "fullyDecodeReservedExpansion: boolean expected"; return null; }; /** - * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. + * Creates a Http message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.api.ResourceDescriptor + * @memberof google.api.Http * @static * @param {Object.} object Plain object - * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @returns {google.api.Http} Http */ - ResourceDescriptor.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.ResourceDescriptor) + Http.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Http) return object; - var message = new $root.google.api.ResourceDescriptor(); - if (object.type != null) - message.type = String(object.type); - if (object.pattern) { - if (!Array.isArray(object.pattern)) - throw TypeError(".google.api.ResourceDescriptor.pattern: array expected"); - message.pattern = []; - for (var i = 0; i < object.pattern.length; ++i) - message.pattern[i] = String(object.pattern[i]); - } - if (object.nameField != null) - message.nameField = String(object.nameField); - switch (object.history) { - case "HISTORY_UNSPECIFIED": - case 0: - message.history = 0; - break; - case "ORIGINALLY_SINGLE_PATTERN": - case 1: - message.history = 1; - break; - case "FUTURE_MULTI_PATTERN": - case 2: - message.history = 2; - break; - } - if (object.plural != null) - message.plural = String(object.plural); - if (object.singular != null) - message.singular = String(object.singular); - if (object.style) { - if (!Array.isArray(object.style)) - throw TypeError(".google.api.ResourceDescriptor.style: array expected"); - message.style = []; - for (var i = 0; i < object.style.length; ++i) - switch (object.style[i]) { - default: - case "STYLE_UNSPECIFIED": - case 0: - message.style[i] = 0; - break; - case "DECLARATIVE_FRIENDLY": - case 1: - message.style[i] = 1; - break; - } + var message = new $root.google.api.Http(); + if (object.rules) { + if (!Array.isArray(object.rules)) + throw TypeError(".google.api.Http.rules: array expected"); + message.rules = []; + for (var i = 0; i < object.rules.length; ++i) { + if (typeof object.rules[i] !== "object") + throw TypeError(".google.api.Http.rules: object expected"); + message.rules[i] = $root.google.api.HttpRule.fromObject(object.rules[i]); + } } + if (object.fullyDecodeReservedExpansion != null) + message.fullyDecodeReservedExpansion = Boolean(object.fullyDecodeReservedExpansion); return message; }; /** - * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. + * Creates a plain object from a Http message. Also converts values to other types if specified. * @function toObject - * @memberof google.api.ResourceDescriptor + * @memberof google.api.Http * @static - * @param {google.api.ResourceDescriptor} message ResourceDescriptor + * @param {google.api.Http} message Http * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ResourceDescriptor.toObject = function toObject(message, options) { + Http.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) { - object.pattern = []; - object.style = []; - } - if (options.defaults) { - object.type = ""; - object.nameField = ""; - object.history = options.enums === String ? "HISTORY_UNSPECIFIED" : 0; - object.plural = ""; - object.singular = ""; - } - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; - if (message.pattern && message.pattern.length) { - object.pattern = []; - for (var j = 0; j < message.pattern.length; ++j) - object.pattern[j] = message.pattern[j]; - } - if (message.nameField != null && message.hasOwnProperty("nameField")) - object.nameField = message.nameField; - if (message.history != null && message.hasOwnProperty("history")) - object.history = options.enums === String ? $root.google.api.ResourceDescriptor.History[message.history] : message.history; - if (message.plural != null && message.hasOwnProperty("plural")) - object.plural = message.plural; - if (message.singular != null && message.hasOwnProperty("singular")) - object.singular = message.singular; - if (message.style && message.style.length) { - object.style = []; - for (var j = 0; j < message.style.length; ++j) - object.style[j] = options.enums === String ? $root.google.api.ResourceDescriptor.Style[message.style[j]] : message.style[j]; + if (options.arrays || options.defaults) + object.rules = []; + if (options.defaults) + object.fullyDecodeReservedExpansion = false; + if (message.rules && message.rules.length) { + object.rules = []; + for (var j = 0; j < message.rules.length; ++j) + object.rules[j] = $root.google.api.HttpRule.toObject(message.rules[j], options); } + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + object.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion; return object; }; /** - * Converts this ResourceDescriptor to JSON. + * Converts this Http to JSON. * @function toJSON - * @memberof google.api.ResourceDescriptor + * @memberof google.api.Http * @instance * @returns {Object.} JSON object */ - ResourceDescriptor.prototype.toJSON = function toJSON() { + Http.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - /** - * History enum. - * @name google.api.ResourceDescriptor.History - * @enum {number} - * @property {number} HISTORY_UNSPECIFIED=0 HISTORY_UNSPECIFIED value - * @property {number} ORIGINALLY_SINGLE_PATTERN=1 ORIGINALLY_SINGLE_PATTERN value - * @property {number} FUTURE_MULTI_PATTERN=2 FUTURE_MULTI_PATTERN value - */ - ResourceDescriptor.History = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "HISTORY_UNSPECIFIED"] = 0; - values[valuesById[1] = "ORIGINALLY_SINGLE_PATTERN"] = 1; - values[valuesById[2] = "FUTURE_MULTI_PATTERN"] = 2; - return values; - })(); - - /** - * Style enum. - * @name google.api.ResourceDescriptor.Style - * @enum {number} - * @property {number} STYLE_UNSPECIFIED=0 STYLE_UNSPECIFIED value - * @property {number} DECLARATIVE_FRIENDLY=1 DECLARATIVE_FRIENDLY value - */ - ResourceDescriptor.Style = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STYLE_UNSPECIFIED"] = 0; - values[valuesById[1] = "DECLARATIVE_FRIENDLY"] = 1; - return values; - })(); - - return ResourceDescriptor; + return Http; })(); - api.ResourceReference = (function() { + api.HttpRule = (function() { /** - * Properties of a ResourceReference. + * Properties of a HttpRule. * @memberof google.api - * @interface IResourceReference - * @property {string|null} [type] ResourceReference type - * @property {string|null} [childType] ResourceReference childType + * @interface IHttpRule + * @property {string|null} [selector] HttpRule selector + * @property {string|null} [get] HttpRule get + * @property {string|null} [put] HttpRule put + * @property {string|null} [post] HttpRule post + * @property {string|null} ["delete"] HttpRule delete + * @property {string|null} [patch] HttpRule patch + * @property {google.api.ICustomHttpPattern|null} [custom] HttpRule custom + * @property {string|null} [body] HttpRule body + * @property {string|null} [responseBody] HttpRule responseBody + * @property {Array.|null} [additionalBindings] HttpRule additionalBindings */ /** - * Constructs a new ResourceReference. + * Constructs a new HttpRule. * @memberof google.api - * @classdesc Represents a ResourceReference. - * @implements IResourceReference + * @classdesc Represents a HttpRule. + * @implements IHttpRule * @constructor - * @param {google.api.IResourceReference=} [properties] Properties to set + * @param {google.api.IHttpRule=} [properties] Properties to set */ - function ResourceReference(properties) { + function HttpRule(properties) { + this.additionalBindings = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -54541,88 +54358,209 @@ } /** - * ResourceReference type. - * @member {string} type - * @memberof google.api.ResourceReference + * HttpRule selector. + * @member {string} selector + * @memberof google.api.HttpRule * @instance */ - ResourceReference.prototype.type = ""; + HttpRule.prototype.selector = ""; /** - * ResourceReference childType. - * @member {string} childType - * @memberof google.api.ResourceReference + * HttpRule get. + * @member {string|null|undefined} get + * @memberof google.api.HttpRule * @instance */ - ResourceReference.prototype.childType = ""; + HttpRule.prototype.get = null; /** - * Creates a new ResourceReference instance using the specified properties. + * HttpRule put. + * @member {string|null|undefined} put + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.put = null; + + /** + * HttpRule post. + * @member {string|null|undefined} post + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.post = null; + + /** + * HttpRule delete. + * @member {string|null|undefined} delete + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype["delete"] = null; + + /** + * HttpRule patch. + * @member {string|null|undefined} patch + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.patch = null; + + /** + * HttpRule custom. + * @member {google.api.ICustomHttpPattern|null|undefined} custom + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.custom = null; + + /** + * HttpRule body. + * @member {string} body + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.body = ""; + + /** + * HttpRule responseBody. + * @member {string} responseBody + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.responseBody = ""; + + /** + * HttpRule additionalBindings. + * @member {Array.} additionalBindings + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.additionalBindings = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * HttpRule pattern. + * @member {"get"|"put"|"post"|"delete"|"patch"|"custom"|undefined} pattern + * @memberof google.api.HttpRule + * @instance + */ + Object.defineProperty(HttpRule.prototype, "pattern", { + get: $util.oneOfGetter($oneOfFields = ["get", "put", "post", "delete", "patch", "custom"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new HttpRule instance using the specified properties. * @function create - * @memberof google.api.ResourceReference + * @memberof google.api.HttpRule * @static - * @param {google.api.IResourceReference=} [properties] Properties to set - * @returns {google.api.ResourceReference} ResourceReference instance + * @param {google.api.IHttpRule=} [properties] Properties to set + * @returns {google.api.HttpRule} HttpRule instance */ - ResourceReference.create = function create(properties) { - return new ResourceReference(properties); + HttpRule.create = function create(properties) { + return new HttpRule(properties); }; /** - * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. * @function encode - * @memberof google.api.ResourceReference + * @memberof google.api.HttpRule * @static - * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ResourceReference.encode = function encode(message, writer) { + HttpRule.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); - if (message.childType != null && Object.hasOwnProperty.call(message, "childType")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.childType); + if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); + if (message.get != null && Object.hasOwnProperty.call(message, "get")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.get); + if (message.put != null && Object.hasOwnProperty.call(message, "put")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.put); + if (message.post != null && Object.hasOwnProperty.call(message, "post")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.post); + if (message["delete"] != null && Object.hasOwnProperty.call(message, "delete")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message["delete"]); + if (message.patch != null && Object.hasOwnProperty.call(message, "patch")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.patch); + if (message.body != null && Object.hasOwnProperty.call(message, "body")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.body); + if (message.custom != null && Object.hasOwnProperty.call(message, "custom")) + $root.google.api.CustomHttpPattern.encode(message.custom, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.additionalBindings != null && message.additionalBindings.length) + for (var i = 0; i < message.additionalBindings.length; ++i) + $root.google.api.HttpRule.encode(message.additionalBindings[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.responseBody != null && Object.hasOwnProperty.call(message, "responseBody")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.responseBody); return writer; }; /** - * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. * @function encodeDelimited - * @memberof google.api.ResourceReference + * @memberof google.api.HttpRule * @static - * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ResourceReference.encodeDelimited = function encodeDelimited(message, writer) { + HttpRule.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ResourceReference message from the specified reader or buffer. + * Decodes a HttpRule message from the specified reader or buffer. * @function decode - * @memberof google.api.ResourceReference + * @memberof google.api.HttpRule * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.api.ResourceReference} ResourceReference + * @returns {google.api.HttpRule} HttpRule * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ResourceReference.decode = function decode(reader, length) { + HttpRule.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceReference(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.HttpRule(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.type = reader.string(); + message.selector = reader.string(); break; case 2: - message.childType = reader.string(); + message.get = reader.string(); + break; + case 3: + message.put = reader.string(); + break; + case 4: + message.post = reader.string(); + break; + case 5: + message["delete"] = reader.string(); + break; + case 6: + message.patch = reader.string(); + break; + case 8: + message.custom = $root.google.api.CustomHttpPattern.decode(reader, reader.uint32()); + break; + case 7: + message.body = reader.string(); + break; + case 12: + message.responseBody = reader.string(); + break; + case 11: + if (!(message.additionalBindings && message.additionalBindings.length)) + message.additionalBindings = []; + message.additionalBindings.push($root.google.api.HttpRule.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -54633,118 +54571,240 @@ }; /** - * Decodes a ResourceReference message from the specified reader or buffer, length delimited. + * Decodes a HttpRule message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.api.ResourceReference + * @memberof google.api.HttpRule * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.ResourceReference} ResourceReference + * @returns {google.api.HttpRule} HttpRule * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ResourceReference.decodeDelimited = function decodeDelimited(reader) { + HttpRule.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ResourceReference message. + * Verifies a HttpRule message. * @function verify - * @memberof google.api.ResourceReference + * @memberof google.api.HttpRule * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ResourceReference.verify = function verify(message) { + HttpRule.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.type != null && message.hasOwnProperty("type")) - if (!$util.isString(message.type)) - return "type: string expected"; - if (message.childType != null && message.hasOwnProperty("childType")) - if (!$util.isString(message.childType)) - return "childType: string expected"; + var properties = {}; + if (message.selector != null && message.hasOwnProperty("selector")) + if (!$util.isString(message.selector)) + return "selector: string expected"; + if (message.get != null && message.hasOwnProperty("get")) { + properties.pattern = 1; + if (!$util.isString(message.get)) + return "get: string expected"; + } + if (message.put != null && message.hasOwnProperty("put")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.put)) + return "put: string expected"; + } + if (message.post != null && message.hasOwnProperty("post")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.post)) + return "post: string expected"; + } + if (message["delete"] != null && message.hasOwnProperty("delete")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message["delete"])) + return "delete: string expected"; + } + if (message.patch != null && message.hasOwnProperty("patch")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.patch)) + return "patch: string expected"; + } + if (message.custom != null && message.hasOwnProperty("custom")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + { + var error = $root.google.api.CustomHttpPattern.verify(message.custom); + if (error) + return "custom." + error; + } + } + if (message.body != null && message.hasOwnProperty("body")) + if (!$util.isString(message.body)) + return "body: string expected"; + if (message.responseBody != null && message.hasOwnProperty("responseBody")) + if (!$util.isString(message.responseBody)) + return "responseBody: string expected"; + if (message.additionalBindings != null && message.hasOwnProperty("additionalBindings")) { + if (!Array.isArray(message.additionalBindings)) + return "additionalBindings: array expected"; + for (var i = 0; i < message.additionalBindings.length; ++i) { + var error = $root.google.api.HttpRule.verify(message.additionalBindings[i]); + if (error) + return "additionalBindings." + error; + } + } return null; }; /** - * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. + * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.api.ResourceReference + * @memberof google.api.HttpRule * @static * @param {Object.} object Plain object - * @returns {google.api.ResourceReference} ResourceReference + * @returns {google.api.HttpRule} HttpRule */ - ResourceReference.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.ResourceReference) + HttpRule.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.HttpRule) return object; - var message = new $root.google.api.ResourceReference(); - if (object.type != null) - message.type = String(object.type); - if (object.childType != null) - message.childType = String(object.childType); + var message = new $root.google.api.HttpRule(); + if (object.selector != null) + message.selector = String(object.selector); + if (object.get != null) + message.get = String(object.get); + if (object.put != null) + message.put = String(object.put); + if (object.post != null) + message.post = String(object.post); + if (object["delete"] != null) + message["delete"] = String(object["delete"]); + if (object.patch != null) + message.patch = String(object.patch); + if (object.custom != null) { + if (typeof object.custom !== "object") + throw TypeError(".google.api.HttpRule.custom: object expected"); + message.custom = $root.google.api.CustomHttpPattern.fromObject(object.custom); + } + if (object.body != null) + message.body = String(object.body); + if (object.responseBody != null) + message.responseBody = String(object.responseBody); + if (object.additionalBindings) { + if (!Array.isArray(object.additionalBindings)) + throw TypeError(".google.api.HttpRule.additionalBindings: array expected"); + message.additionalBindings = []; + for (var i = 0; i < object.additionalBindings.length; ++i) { + if (typeof object.additionalBindings[i] !== "object") + throw TypeError(".google.api.HttpRule.additionalBindings: object expected"); + message.additionalBindings[i] = $root.google.api.HttpRule.fromObject(object.additionalBindings[i]); + } + } return message; }; /** - * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. + * Creates a plain object from a HttpRule message. Also converts values to other types if specified. * @function toObject - * @memberof google.api.ResourceReference + * @memberof google.api.HttpRule * @static - * @param {google.api.ResourceReference} message ResourceReference + * @param {google.api.HttpRule} message HttpRule * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ResourceReference.toObject = function toObject(message, options) { + HttpRule.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.additionalBindings = []; if (options.defaults) { - object.type = ""; - object.childType = ""; + object.selector = ""; + object.body = ""; + object.responseBody = ""; } - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; - if (message.childType != null && message.hasOwnProperty("childType")) - object.childType = message.childType; + if (message.selector != null && message.hasOwnProperty("selector")) + object.selector = message.selector; + if (message.get != null && message.hasOwnProperty("get")) { + object.get = message.get; + if (options.oneofs) + object.pattern = "get"; + } + if (message.put != null && message.hasOwnProperty("put")) { + object.put = message.put; + if (options.oneofs) + object.pattern = "put"; + } + if (message.post != null && message.hasOwnProperty("post")) { + object.post = message.post; + if (options.oneofs) + object.pattern = "post"; + } + if (message["delete"] != null && message.hasOwnProperty("delete")) { + object["delete"] = message["delete"]; + if (options.oneofs) + object.pattern = "delete"; + } + if (message.patch != null && message.hasOwnProperty("patch")) { + object.patch = message.patch; + if (options.oneofs) + object.pattern = "patch"; + } + if (message.body != null && message.hasOwnProperty("body")) + object.body = message.body; + if (message.custom != null && message.hasOwnProperty("custom")) { + object.custom = $root.google.api.CustomHttpPattern.toObject(message.custom, options); + if (options.oneofs) + object.pattern = "custom"; + } + if (message.additionalBindings && message.additionalBindings.length) { + object.additionalBindings = []; + for (var j = 0; j < message.additionalBindings.length; ++j) + object.additionalBindings[j] = $root.google.api.HttpRule.toObject(message.additionalBindings[j], options); + } + if (message.responseBody != null && message.hasOwnProperty("responseBody")) + object.responseBody = message.responseBody; return object; }; /** - * Converts this ResourceReference to JSON. + * Converts this HttpRule to JSON. * @function toJSON - * @memberof google.api.ResourceReference + * @memberof google.api.HttpRule * @instance * @returns {Object.} JSON object */ - ResourceReference.prototype.toJSON = function toJSON() { + HttpRule.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ResourceReference; + return HttpRule; })(); - api.Http = (function() { + api.CustomHttpPattern = (function() { /** - * Properties of a Http. + * Properties of a CustomHttpPattern. * @memberof google.api - * @interface IHttp - * @property {Array.|null} [rules] Http rules - * @property {boolean|null} [fullyDecodeReservedExpansion] Http fullyDecodeReservedExpansion + * @interface ICustomHttpPattern + * @property {string|null} [kind] CustomHttpPattern kind + * @property {string|null} [path] CustomHttpPattern path */ /** - * Constructs a new Http. + * Constructs a new CustomHttpPattern. * @memberof google.api - * @classdesc Represents a Http. - * @implements IHttp + * @classdesc Represents a CustomHttpPattern. + * @implements ICustomHttpPattern * @constructor - * @param {google.api.IHttp=} [properties] Properties to set + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set */ - function Http(properties) { - this.rules = []; + function CustomHttpPattern(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -54752,91 +54812,88 @@ } /** - * Http rules. - * @member {Array.} rules - * @memberof google.api.Http + * CustomHttpPattern kind. + * @member {string} kind + * @memberof google.api.CustomHttpPattern * @instance */ - Http.prototype.rules = $util.emptyArray; + CustomHttpPattern.prototype.kind = ""; /** - * Http fullyDecodeReservedExpansion. - * @member {boolean} fullyDecodeReservedExpansion - * @memberof google.api.Http + * CustomHttpPattern path. + * @member {string} path + * @memberof google.api.CustomHttpPattern * @instance */ - Http.prototype.fullyDecodeReservedExpansion = false; + CustomHttpPattern.prototype.path = ""; /** - * Creates a new Http instance using the specified properties. + * Creates a new CustomHttpPattern instance using the specified properties. * @function create - * @memberof google.api.Http + * @memberof google.api.CustomHttpPattern * @static - * @param {google.api.IHttp=} [properties] Properties to set - * @returns {google.api.Http} Http instance + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + * @returns {google.api.CustomHttpPattern} CustomHttpPattern instance */ - Http.create = function create(properties) { - return new Http(properties); + CustomHttpPattern.create = function create(properties) { + return new CustomHttpPattern(properties); }; /** - * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. * @function encode - * @memberof google.api.Http + * @memberof google.api.CustomHttpPattern * @static - * @param {google.api.IHttp} message Http message or plain object to encode + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Http.encode = function encode(message, writer) { + CustomHttpPattern.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.rules != null && message.rules.length) - for (var i = 0; i < message.rules.length; ++i) - $root.google.api.HttpRule.encode(message.rules[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.fullyDecodeReservedExpansion != null && Object.hasOwnProperty.call(message, "fullyDecodeReservedExpansion")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fullyDecodeReservedExpansion); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); + if (message.path != null && Object.hasOwnProperty.call(message, "path")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.path); return writer; }; /** - * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. + * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. * @function encodeDelimited - * @memberof google.api.Http + * @memberof google.api.CustomHttpPattern * @static - * @param {google.api.IHttp} message Http message or plain object to encode + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Http.encodeDelimited = function encodeDelimited(message, writer) { + CustomHttpPattern.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Http message from the specified reader or buffer. + * Decodes a CustomHttpPattern message from the specified reader or buffer. * @function decode - * @memberof google.api.Http + * @memberof google.api.CustomHttpPattern * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.api.Http} Http + * @returns {google.api.CustomHttpPattern} CustomHttpPattern * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Http.decode = function decode(reader, length) { + CustomHttpPattern.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Http(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CustomHttpPattern(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - if (!(message.rules && message.rules.length)) - message.rules = []; - message.rules.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + message.kind = reader.string(); break; case 2: - message.fullyDecodeReservedExpansion = reader.bool(); + message.path = reader.string(); break; default: reader.skipType(tag & 7); @@ -54847,143 +54904,150 @@ }; /** - * Decodes a Http message from the specified reader or buffer, length delimited. + * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.api.Http + * @memberof google.api.CustomHttpPattern * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.Http} Http + * @returns {google.api.CustomHttpPattern} CustomHttpPattern * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Http.decodeDelimited = function decodeDelimited(reader) { + CustomHttpPattern.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Http message. + * Verifies a CustomHttpPattern message. * @function verify - * @memberof google.api.Http + * @memberof google.api.CustomHttpPattern * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Http.verify = function verify(message) { + CustomHttpPattern.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.rules != null && message.hasOwnProperty("rules")) { - if (!Array.isArray(message.rules)) - return "rules: array expected"; - for (var i = 0; i < message.rules.length; ++i) { - var error = $root.google.api.HttpRule.verify(message.rules[i]); - if (error) - return "rules." + error; - } - } - if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) - if (typeof message.fullyDecodeReservedExpansion !== "boolean") - return "fullyDecodeReservedExpansion: boolean expected"; + if (message.kind != null && message.hasOwnProperty("kind")) + if (!$util.isString(message.kind)) + return "kind: string expected"; + if (message.path != null && message.hasOwnProperty("path")) + if (!$util.isString(message.path)) + return "path: string expected"; return null; }; /** - * Creates a Http message from a plain object. Also converts values to their respective internal types. + * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.api.Http + * @memberof google.api.CustomHttpPattern * @static * @param {Object.} object Plain object - * @returns {google.api.Http} Http + * @returns {google.api.CustomHttpPattern} CustomHttpPattern */ - Http.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.Http) + CustomHttpPattern.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CustomHttpPattern) return object; - var message = new $root.google.api.Http(); - if (object.rules) { - if (!Array.isArray(object.rules)) - throw TypeError(".google.api.Http.rules: array expected"); - message.rules = []; - for (var i = 0; i < object.rules.length; ++i) { - if (typeof object.rules[i] !== "object") - throw TypeError(".google.api.Http.rules: object expected"); - message.rules[i] = $root.google.api.HttpRule.fromObject(object.rules[i]); - } - } - if (object.fullyDecodeReservedExpansion != null) - message.fullyDecodeReservedExpansion = Boolean(object.fullyDecodeReservedExpansion); + var message = new $root.google.api.CustomHttpPattern(); + if (object.kind != null) + message.kind = String(object.kind); + if (object.path != null) + message.path = String(object.path); return message; }; /** - * Creates a plain object from a Http message. Also converts values to other types if specified. + * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. * @function toObject - * @memberof google.api.Http + * @memberof google.api.CustomHttpPattern * @static - * @param {google.api.Http} message Http + * @param {google.api.CustomHttpPattern} message CustomHttpPattern * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Http.toObject = function toObject(message, options) { + CustomHttpPattern.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.rules = []; - if (options.defaults) - object.fullyDecodeReservedExpansion = false; - if (message.rules && message.rules.length) { - object.rules = []; - for (var j = 0; j < message.rules.length; ++j) - object.rules[j] = $root.google.api.HttpRule.toObject(message.rules[j], options); + if (options.defaults) { + object.kind = ""; + object.path = ""; } - if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) - object.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion; + if (message.kind != null && message.hasOwnProperty("kind")) + object.kind = message.kind; + if (message.path != null && message.hasOwnProperty("path")) + object.path = message.path; return object; }; /** - * Converts this Http to JSON. + * Converts this CustomHttpPattern to JSON. * @function toJSON - * @memberof google.api.Http + * @memberof google.api.CustomHttpPattern * @instance * @returns {Object.} JSON object */ - Http.prototype.toJSON = function toJSON() { + CustomHttpPattern.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return Http; + return CustomHttpPattern; })(); - api.HttpRule = (function() { + /** + * FieldBehavior enum. + * @name google.api.FieldBehavior + * @enum {number} + * @property {number} FIELD_BEHAVIOR_UNSPECIFIED=0 FIELD_BEHAVIOR_UNSPECIFIED value + * @property {number} OPTIONAL=1 OPTIONAL value + * @property {number} REQUIRED=2 REQUIRED value + * @property {number} OUTPUT_ONLY=3 OUTPUT_ONLY value + * @property {number} INPUT_ONLY=4 INPUT_ONLY value + * @property {number} IMMUTABLE=5 IMMUTABLE value + * @property {number} UNORDERED_LIST=6 UNORDERED_LIST value + * @property {number} NON_EMPTY_DEFAULT=7 NON_EMPTY_DEFAULT value + */ + api.FieldBehavior = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FIELD_BEHAVIOR_UNSPECIFIED"] = 0; + values[valuesById[1] = "OPTIONAL"] = 1; + values[valuesById[2] = "REQUIRED"] = 2; + values[valuesById[3] = "OUTPUT_ONLY"] = 3; + values[valuesById[4] = "INPUT_ONLY"] = 4; + values[valuesById[5] = "IMMUTABLE"] = 5; + values[valuesById[6] = "UNORDERED_LIST"] = 6; + values[valuesById[7] = "NON_EMPTY_DEFAULT"] = 7; + return values; + })(); + + api.ResourceDescriptor = (function() { /** - * Properties of a HttpRule. + * Properties of a ResourceDescriptor. * @memberof google.api - * @interface IHttpRule - * @property {string|null} [selector] HttpRule selector - * @property {string|null} [get] HttpRule get - * @property {string|null} [put] HttpRule put - * @property {string|null} [post] HttpRule post - * @property {string|null} ["delete"] HttpRule delete - * @property {string|null} [patch] HttpRule patch - * @property {google.api.ICustomHttpPattern|null} [custom] HttpRule custom - * @property {string|null} [body] HttpRule body - * @property {string|null} [responseBody] HttpRule responseBody - * @property {Array.|null} [additionalBindings] HttpRule additionalBindings + * @interface IResourceDescriptor + * @property {string|null} [type] ResourceDescriptor type + * @property {Array.|null} [pattern] ResourceDescriptor pattern + * @property {string|null} [nameField] ResourceDescriptor nameField + * @property {google.api.ResourceDescriptor.History|null} [history] ResourceDescriptor history + * @property {string|null} [plural] ResourceDescriptor plural + * @property {string|null} [singular] ResourceDescriptor singular + * @property {Array.|null} [style] ResourceDescriptor style */ /** - * Constructs a new HttpRule. + * Constructs a new ResourceDescriptor. * @memberof google.api - * @classdesc Represents a HttpRule. - * @implements IHttpRule + * @classdesc Represents a ResourceDescriptor. + * @implements IResourceDescriptor * @constructor - * @param {google.api.IHttpRule=} [properties] Properties to set + * @param {google.api.IResourceDescriptor=} [properties] Properties to set */ - function HttpRule(properties) { - this.additionalBindings = []; + function ResourceDescriptor(properties) { + this.pattern = []; + this.style = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -54991,209 +55055,167 @@ } /** - * HttpRule selector. - * @member {string} selector - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.selector = ""; - - /** - * HttpRule get. - * @member {string|null|undefined} get - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.get = null; - - /** - * HttpRule put. - * @member {string|null|undefined} put - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.put = null; - - /** - * HttpRule post. - * @member {string|null|undefined} post - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.post = null; - - /** - * HttpRule delete. - * @member {string|null|undefined} delete - * @memberof google.api.HttpRule + * ResourceDescriptor type. + * @member {string} type + * @memberof google.api.ResourceDescriptor * @instance */ - HttpRule.prototype["delete"] = null; + ResourceDescriptor.prototype.type = ""; /** - * HttpRule patch. - * @member {string|null|undefined} patch - * @memberof google.api.HttpRule + * ResourceDescriptor pattern. + * @member {Array.} pattern + * @memberof google.api.ResourceDescriptor * @instance */ - HttpRule.prototype.patch = null; + ResourceDescriptor.prototype.pattern = $util.emptyArray; /** - * HttpRule custom. - * @member {google.api.ICustomHttpPattern|null|undefined} custom - * @memberof google.api.HttpRule + * ResourceDescriptor nameField. + * @member {string} nameField + * @memberof google.api.ResourceDescriptor * @instance */ - HttpRule.prototype.custom = null; + ResourceDescriptor.prototype.nameField = ""; /** - * HttpRule body. - * @member {string} body - * @memberof google.api.HttpRule + * ResourceDescriptor history. + * @member {google.api.ResourceDescriptor.History} history + * @memberof google.api.ResourceDescriptor * @instance */ - HttpRule.prototype.body = ""; + ResourceDescriptor.prototype.history = 0; /** - * HttpRule responseBody. - * @member {string} responseBody - * @memberof google.api.HttpRule + * ResourceDescriptor plural. + * @member {string} plural + * @memberof google.api.ResourceDescriptor * @instance */ - HttpRule.prototype.responseBody = ""; + ResourceDescriptor.prototype.plural = ""; /** - * HttpRule additionalBindings. - * @member {Array.} additionalBindings - * @memberof google.api.HttpRule + * ResourceDescriptor singular. + * @member {string} singular + * @memberof google.api.ResourceDescriptor * @instance */ - HttpRule.prototype.additionalBindings = $util.emptyArray; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + ResourceDescriptor.prototype.singular = ""; /** - * HttpRule pattern. - * @member {"get"|"put"|"post"|"delete"|"patch"|"custom"|undefined} pattern - * @memberof google.api.HttpRule + * ResourceDescriptor style. + * @member {Array.} style + * @memberof google.api.ResourceDescriptor * @instance */ - Object.defineProperty(HttpRule.prototype, "pattern", { - get: $util.oneOfGetter($oneOfFields = ["get", "put", "post", "delete", "patch", "custom"]), - set: $util.oneOfSetter($oneOfFields) - }); + ResourceDescriptor.prototype.style = $util.emptyArray; /** - * Creates a new HttpRule instance using the specified properties. + * Creates a new ResourceDescriptor instance using the specified properties. * @function create - * @memberof google.api.HttpRule + * @memberof google.api.ResourceDescriptor * @static - * @param {google.api.IHttpRule=} [properties] Properties to set - * @returns {google.api.HttpRule} HttpRule instance + * @param {google.api.IResourceDescriptor=} [properties] Properties to set + * @returns {google.api.ResourceDescriptor} ResourceDescriptor instance */ - HttpRule.create = function create(properties) { - return new HttpRule(properties); + ResourceDescriptor.create = function create(properties) { + return new ResourceDescriptor(properties); }; /** - * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. * @function encode - * @memberof google.api.HttpRule + * @memberof google.api.ResourceDescriptor * @static - * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - HttpRule.encode = function encode(message, writer) { + ResourceDescriptor.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); - if (message.get != null && Object.hasOwnProperty.call(message, "get")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.get); - if (message.put != null && Object.hasOwnProperty.call(message, "put")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.put); - if (message.post != null && Object.hasOwnProperty.call(message, "post")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.post); - if (message["delete"] != null && Object.hasOwnProperty.call(message, "delete")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message["delete"]); - if (message.patch != null && Object.hasOwnProperty.call(message, "patch")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.patch); - if (message.body != null && Object.hasOwnProperty.call(message, "body")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.body); - if (message.custom != null && Object.hasOwnProperty.call(message, "custom")) - $root.google.api.CustomHttpPattern.encode(message.custom, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.additionalBindings != null && message.additionalBindings.length) - for (var i = 0; i < message.additionalBindings.length; ++i) - $root.google.api.HttpRule.encode(message.additionalBindings[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - if (message.responseBody != null && Object.hasOwnProperty.call(message, "responseBody")) - writer.uint32(/* id 12, wireType 2 =*/98).string(message.responseBody); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.pattern != null && message.pattern.length) + for (var i = 0; i < message.pattern.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pattern[i]); + if (message.nameField != null && Object.hasOwnProperty.call(message, "nameField")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nameField); + if (message.history != null && Object.hasOwnProperty.call(message, "history")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.history); + if (message.plural != null && Object.hasOwnProperty.call(message, "plural")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.plural); + if (message.singular != null && Object.hasOwnProperty.call(message, "singular")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.singular); + if (message.style != null && message.style.length) { + writer.uint32(/* id 10, wireType 2 =*/82).fork(); + for (var i = 0; i < message.style.length; ++i) + writer.int32(message.style[i]); + writer.ldelim(); + } return writer; }; /** - * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. * @function encodeDelimited - * @memberof google.api.HttpRule + * @memberof google.api.ResourceDescriptor * @static - * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - HttpRule.encodeDelimited = function encodeDelimited(message, writer) { + ResourceDescriptor.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a HttpRule message from the specified reader or buffer. + * Decodes a ResourceDescriptor message from the specified reader or buffer. * @function decode - * @memberof google.api.HttpRule + * @memberof google.api.ResourceDescriptor * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.api.HttpRule} HttpRule + * @returns {google.api.ResourceDescriptor} ResourceDescriptor * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - HttpRule.decode = function decode(reader, length) { + ResourceDescriptor.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.HttpRule(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceDescriptor(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.selector = reader.string(); + message.type = reader.string(); break; case 2: - message.get = reader.string(); + if (!(message.pattern && message.pattern.length)) + message.pattern = []; + message.pattern.push(reader.string()); break; case 3: - message.put = reader.string(); + message.nameField = reader.string(); break; case 4: - message.post = reader.string(); + message.history = reader.int32(); break; case 5: - message["delete"] = reader.string(); + message.plural = reader.string(); break; case 6: - message.patch = reader.string(); - break; - case 8: - message.custom = $root.google.api.CustomHttpPattern.decode(reader, reader.uint32()); - break; - case 7: - message.body = reader.string(); - break; - case 12: - message.responseBody = reader.string(); + message.singular = reader.string(); break; - case 11: - if (!(message.additionalBindings && message.additionalBindings.length)) - message.additionalBindings = []; - message.additionalBindings.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + case 10: + if (!(message.style && message.style.length)) + message.style = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.style.push(reader.int32()); + } else + message.style.push(reader.int32()); break; default: reader.skipType(tag & 7); @@ -55204,240 +55226,246 @@ }; /** - * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.api.HttpRule + * @memberof google.api.ResourceDescriptor * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.HttpRule} HttpRule + * @returns {google.api.ResourceDescriptor} ResourceDescriptor * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - HttpRule.decodeDelimited = function decodeDelimited(reader) { + ResourceDescriptor.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a HttpRule message. + * Verifies a ResourceDescriptor message. * @function verify - * @memberof google.api.HttpRule + * @memberof google.api.ResourceDescriptor * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - HttpRule.verify = function verify(message) { + ResourceDescriptor.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.selector != null && message.hasOwnProperty("selector")) - if (!$util.isString(message.selector)) - return "selector: string expected"; - if (message.get != null && message.hasOwnProperty("get")) { - properties.pattern = 1; - if (!$util.isString(message.get)) - return "get: string expected"; - } - if (message.put != null && message.hasOwnProperty("put")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - if (!$util.isString(message.put)) - return "put: string expected"; - } - if (message.post != null && message.hasOwnProperty("post")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - if (!$util.isString(message.post)) - return "post: string expected"; - } - if (message["delete"] != null && message.hasOwnProperty("delete")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - if (!$util.isString(message["delete"])) - return "delete: string expected"; - } - if (message.patch != null && message.hasOwnProperty("patch")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - if (!$util.isString(message.patch)) - return "patch: string expected"; - } - if (message.custom != null && message.hasOwnProperty("custom")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - { - var error = $root.google.api.CustomHttpPattern.verify(message.custom); - if (error) - return "custom." + error; - } + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.pattern != null && message.hasOwnProperty("pattern")) { + if (!Array.isArray(message.pattern)) + return "pattern: array expected"; + for (var i = 0; i < message.pattern.length; ++i) + if (!$util.isString(message.pattern[i])) + return "pattern: string[] expected"; } - if (message.body != null && message.hasOwnProperty("body")) - if (!$util.isString(message.body)) - return "body: string expected"; - if (message.responseBody != null && message.hasOwnProperty("responseBody")) - if (!$util.isString(message.responseBody)) - return "responseBody: string expected"; - if (message.additionalBindings != null && message.hasOwnProperty("additionalBindings")) { - if (!Array.isArray(message.additionalBindings)) - return "additionalBindings: array expected"; - for (var i = 0; i < message.additionalBindings.length; ++i) { - var error = $root.google.api.HttpRule.verify(message.additionalBindings[i]); - if (error) - return "additionalBindings." + error; + if (message.nameField != null && message.hasOwnProperty("nameField")) + if (!$util.isString(message.nameField)) + return "nameField: string expected"; + if (message.history != null && message.hasOwnProperty("history")) + switch (message.history) { + default: + return "history: enum value expected"; + case 0: + case 1: + case 2: + break; } + if (message.plural != null && message.hasOwnProperty("plural")) + if (!$util.isString(message.plural)) + return "plural: string expected"; + if (message.singular != null && message.hasOwnProperty("singular")) + if (!$util.isString(message.singular)) + return "singular: string expected"; + if (message.style != null && message.hasOwnProperty("style")) { + if (!Array.isArray(message.style)) + return "style: array expected"; + for (var i = 0; i < message.style.length; ++i) + switch (message.style[i]) { + default: + return "style: enum value[] expected"; + case 0: + case 1: + break; + } } return null; }; /** - * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. + * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.api.HttpRule + * @memberof google.api.ResourceDescriptor * @static * @param {Object.} object Plain object - * @returns {google.api.HttpRule} HttpRule + * @returns {google.api.ResourceDescriptor} ResourceDescriptor */ - HttpRule.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.HttpRule) + ResourceDescriptor.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceDescriptor) return object; - var message = new $root.google.api.HttpRule(); - if (object.selector != null) - message.selector = String(object.selector); - if (object.get != null) - message.get = String(object.get); - if (object.put != null) - message.put = String(object.put); - if (object.post != null) - message.post = String(object.post); - if (object["delete"] != null) - message["delete"] = String(object["delete"]); - if (object.patch != null) - message.patch = String(object.patch); - if (object.custom != null) { - if (typeof object.custom !== "object") - throw TypeError(".google.api.HttpRule.custom: object expected"); - message.custom = $root.google.api.CustomHttpPattern.fromObject(object.custom); + var message = new $root.google.api.ResourceDescriptor(); + if (object.type != null) + message.type = String(object.type); + if (object.pattern) { + if (!Array.isArray(object.pattern)) + throw TypeError(".google.api.ResourceDescriptor.pattern: array expected"); + message.pattern = []; + for (var i = 0; i < object.pattern.length; ++i) + message.pattern[i] = String(object.pattern[i]); } - if (object.body != null) - message.body = String(object.body); - if (object.responseBody != null) - message.responseBody = String(object.responseBody); - if (object.additionalBindings) { - if (!Array.isArray(object.additionalBindings)) - throw TypeError(".google.api.HttpRule.additionalBindings: array expected"); - message.additionalBindings = []; - for (var i = 0; i < object.additionalBindings.length; ++i) { - if (typeof object.additionalBindings[i] !== "object") - throw TypeError(".google.api.HttpRule.additionalBindings: object expected"); - message.additionalBindings[i] = $root.google.api.HttpRule.fromObject(object.additionalBindings[i]); - } + if (object.nameField != null) + message.nameField = String(object.nameField); + switch (object.history) { + case "HISTORY_UNSPECIFIED": + case 0: + message.history = 0; + break; + case "ORIGINALLY_SINGLE_PATTERN": + case 1: + message.history = 1; + break; + case "FUTURE_MULTI_PATTERN": + case 2: + message.history = 2; + break; + } + if (object.plural != null) + message.plural = String(object.plural); + if (object.singular != null) + message.singular = String(object.singular); + if (object.style) { + if (!Array.isArray(object.style)) + throw TypeError(".google.api.ResourceDescriptor.style: array expected"); + message.style = []; + for (var i = 0; i < object.style.length; ++i) + switch (object.style[i]) { + default: + case "STYLE_UNSPECIFIED": + case 0: + message.style[i] = 0; + break; + case "DECLARATIVE_FRIENDLY": + case 1: + message.style[i] = 1; + break; + } } return message; }; /** - * Creates a plain object from a HttpRule message. Also converts values to other types if specified. + * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. * @function toObject - * @memberof google.api.HttpRule + * @memberof google.api.ResourceDescriptor * @static - * @param {google.api.HttpRule} message HttpRule + * @param {google.api.ResourceDescriptor} message ResourceDescriptor * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - HttpRule.toObject = function toObject(message, options) { + ResourceDescriptor.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.additionalBindings = []; - if (options.defaults) { - object.selector = ""; - object.body = ""; - object.responseBody = ""; - } - if (message.selector != null && message.hasOwnProperty("selector")) - object.selector = message.selector; - if (message.get != null && message.hasOwnProperty("get")) { - object.get = message.get; - if (options.oneofs) - object.pattern = "get"; - } - if (message.put != null && message.hasOwnProperty("put")) { - object.put = message.put; - if (options.oneofs) - object.pattern = "put"; - } - if (message.post != null && message.hasOwnProperty("post")) { - object.post = message.post; - if (options.oneofs) - object.pattern = "post"; - } - if (message["delete"] != null && message.hasOwnProperty("delete")) { - object["delete"] = message["delete"]; - if (options.oneofs) - object.pattern = "delete"; + if (options.arrays || options.defaults) { + object.pattern = []; + object.style = []; } - if (message.patch != null && message.hasOwnProperty("patch")) { - object.patch = message.patch; - if (options.oneofs) - object.pattern = "patch"; + if (options.defaults) { + object.type = ""; + object.nameField = ""; + object.history = options.enums === String ? "HISTORY_UNSPECIFIED" : 0; + object.plural = ""; + object.singular = ""; } - if (message.body != null && message.hasOwnProperty("body")) - object.body = message.body; - if (message.custom != null && message.hasOwnProperty("custom")) { - object.custom = $root.google.api.CustomHttpPattern.toObject(message.custom, options); - if (options.oneofs) - object.pattern = "custom"; + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.pattern && message.pattern.length) { + object.pattern = []; + for (var j = 0; j < message.pattern.length; ++j) + object.pattern[j] = message.pattern[j]; } - if (message.additionalBindings && message.additionalBindings.length) { - object.additionalBindings = []; - for (var j = 0; j < message.additionalBindings.length; ++j) - object.additionalBindings[j] = $root.google.api.HttpRule.toObject(message.additionalBindings[j], options); + if (message.nameField != null && message.hasOwnProperty("nameField")) + object.nameField = message.nameField; + if (message.history != null && message.hasOwnProperty("history")) + object.history = options.enums === String ? $root.google.api.ResourceDescriptor.History[message.history] : message.history; + if (message.plural != null && message.hasOwnProperty("plural")) + object.plural = message.plural; + if (message.singular != null && message.hasOwnProperty("singular")) + object.singular = message.singular; + if (message.style && message.style.length) { + object.style = []; + for (var j = 0; j < message.style.length; ++j) + object.style[j] = options.enums === String ? $root.google.api.ResourceDescriptor.Style[message.style[j]] : message.style[j]; } - if (message.responseBody != null && message.hasOwnProperty("responseBody")) - object.responseBody = message.responseBody; return object; }; /** - * Converts this HttpRule to JSON. + * Converts this ResourceDescriptor to JSON. * @function toJSON - * @memberof google.api.HttpRule + * @memberof google.api.ResourceDescriptor * @instance * @returns {Object.} JSON object */ - HttpRule.prototype.toJSON = function toJSON() { + ResourceDescriptor.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return HttpRule; + /** + * History enum. + * @name google.api.ResourceDescriptor.History + * @enum {number} + * @property {number} HISTORY_UNSPECIFIED=0 HISTORY_UNSPECIFIED value + * @property {number} ORIGINALLY_SINGLE_PATTERN=1 ORIGINALLY_SINGLE_PATTERN value + * @property {number} FUTURE_MULTI_PATTERN=2 FUTURE_MULTI_PATTERN value + */ + ResourceDescriptor.History = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "HISTORY_UNSPECIFIED"] = 0; + values[valuesById[1] = "ORIGINALLY_SINGLE_PATTERN"] = 1; + values[valuesById[2] = "FUTURE_MULTI_PATTERN"] = 2; + return values; + })(); + + /** + * Style enum. + * @name google.api.ResourceDescriptor.Style + * @enum {number} + * @property {number} STYLE_UNSPECIFIED=0 STYLE_UNSPECIFIED value + * @property {number} DECLARATIVE_FRIENDLY=1 DECLARATIVE_FRIENDLY value + */ + ResourceDescriptor.Style = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STYLE_UNSPECIFIED"] = 0; + values[valuesById[1] = "DECLARATIVE_FRIENDLY"] = 1; + return values; + })(); + + return ResourceDescriptor; })(); - api.CustomHttpPattern = (function() { + api.ResourceReference = (function() { /** - * Properties of a CustomHttpPattern. + * Properties of a ResourceReference. * @memberof google.api - * @interface ICustomHttpPattern - * @property {string|null} [kind] CustomHttpPattern kind - * @property {string|null} [path] CustomHttpPattern path + * @interface IResourceReference + * @property {string|null} [type] ResourceReference type + * @property {string|null} [childType] ResourceReference childType */ /** - * Constructs a new CustomHttpPattern. + * Constructs a new ResourceReference. * @memberof google.api - * @classdesc Represents a CustomHttpPattern. - * @implements ICustomHttpPattern + * @classdesc Represents a ResourceReference. + * @implements IResourceReference * @constructor - * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + * @param {google.api.IResourceReference=} [properties] Properties to set */ - function CustomHttpPattern(properties) { + function ResourceReference(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -55445,88 +55473,88 @@ } /** - * CustomHttpPattern kind. - * @member {string} kind - * @memberof google.api.CustomHttpPattern + * ResourceReference type. + * @member {string} type + * @memberof google.api.ResourceReference * @instance */ - CustomHttpPattern.prototype.kind = ""; + ResourceReference.prototype.type = ""; /** - * CustomHttpPattern path. - * @member {string} path - * @memberof google.api.CustomHttpPattern + * ResourceReference childType. + * @member {string} childType + * @memberof google.api.ResourceReference * @instance */ - CustomHttpPattern.prototype.path = ""; + ResourceReference.prototype.childType = ""; /** - * Creates a new CustomHttpPattern instance using the specified properties. + * Creates a new ResourceReference instance using the specified properties. * @function create - * @memberof google.api.CustomHttpPattern + * @memberof google.api.ResourceReference * @static - * @param {google.api.ICustomHttpPattern=} [properties] Properties to set - * @returns {google.api.CustomHttpPattern} CustomHttpPattern instance + * @param {google.api.IResourceReference=} [properties] Properties to set + * @returns {google.api.ResourceReference} ResourceReference instance */ - CustomHttpPattern.create = function create(properties) { - return new CustomHttpPattern(properties); + ResourceReference.create = function create(properties) { + return new ResourceReference(properties); }; /** - * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. * @function encode - * @memberof google.api.CustomHttpPattern + * @memberof google.api.ResourceReference * @static - * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CustomHttpPattern.encode = function encode(message, writer) { + ResourceReference.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); - if (message.path != null && Object.hasOwnProperty.call(message, "path")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.path); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.childType != null && Object.hasOwnProperty.call(message, "childType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.childType); return writer; }; /** - * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. * @function encodeDelimited - * @memberof google.api.CustomHttpPattern + * @memberof google.api.ResourceReference * @static - * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CustomHttpPattern.encodeDelimited = function encodeDelimited(message, writer) { + ResourceReference.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CustomHttpPattern message from the specified reader or buffer. + * Decodes a ResourceReference message from the specified reader or buffer. * @function decode - * @memberof google.api.CustomHttpPattern + * @memberof google.api.ResourceReference * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @returns {google.api.ResourceReference} ResourceReference * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CustomHttpPattern.decode = function decode(reader, length) { + ResourceReference.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CustomHttpPattern(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceReference(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.kind = reader.string(); + message.type = reader.string(); break; case 2: - message.path = reader.string(); + message.childType = reader.string(); break; default: reader.skipType(tag & 7); @@ -55537,96 +55565,96 @@ }; /** - * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * Decodes a ResourceReference message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.api.CustomHttpPattern + * @memberof google.api.ResourceReference * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @returns {google.api.ResourceReference} ResourceReference * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CustomHttpPattern.decodeDelimited = function decodeDelimited(reader) { + ResourceReference.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CustomHttpPattern message. + * Verifies a ResourceReference message. * @function verify - * @memberof google.api.CustomHttpPattern + * @memberof google.api.ResourceReference * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CustomHttpPattern.verify = function verify(message) { + ResourceReference.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.kind != null && message.hasOwnProperty("kind")) - if (!$util.isString(message.kind)) - return "kind: string expected"; - if (message.path != null && message.hasOwnProperty("path")) - if (!$util.isString(message.path)) - return "path: string expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.childType != null && message.hasOwnProperty("childType")) + if (!$util.isString(message.childType)) + return "childType: string expected"; return null; }; /** - * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.api.CustomHttpPattern + * @memberof google.api.ResourceReference * @static * @param {Object.} object Plain object - * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @returns {google.api.ResourceReference} ResourceReference */ - CustomHttpPattern.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.CustomHttpPattern) + ResourceReference.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceReference) return object; - var message = new $root.google.api.CustomHttpPattern(); - if (object.kind != null) - message.kind = String(object.kind); - if (object.path != null) - message.path = String(object.path); + var message = new $root.google.api.ResourceReference(); + if (object.type != null) + message.type = String(object.type); + if (object.childType != null) + message.childType = String(object.childType); return message; }; /** - * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. + * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. * @function toObject - * @memberof google.api.CustomHttpPattern + * @memberof google.api.ResourceReference * @static - * @param {google.api.CustomHttpPattern} message CustomHttpPattern + * @param {google.api.ResourceReference} message ResourceReference * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CustomHttpPattern.toObject = function toObject(message, options) { + ResourceReference.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.kind = ""; - object.path = ""; + object.type = ""; + object.childType = ""; } - if (message.kind != null && message.hasOwnProperty("kind")) - object.kind = message.kind; - if (message.path != null && message.hasOwnProperty("path")) - object.path = message.path; + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.childType != null && message.hasOwnProperty("childType")) + object.childType = message.childType; return object; }; /** - * Converts this CustomHttpPattern to JSON. + * Converts this ResourceReference to JSON. * @function toJSON - * @memberof google.api.CustomHttpPattern + * @memberof google.api.ResourceReference * @instance * @returns {Object.} JSON object */ - CustomHttpPattern.prototype.toJSON = function toJSON() { + ResourceReference.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return CustomHttpPattern; + return ResourceReference; })(); return api; @@ -62355,8 +62383,8 @@ * @property {boolean|null} [deprecated] MethodOptions deprecated * @property {google.protobuf.MethodOptions.IdempotencyLevel|null} [idempotencyLevel] MethodOptions idempotencyLevel * @property {Array.|null} [uninterpretedOption] MethodOptions uninterpretedOption - * @property {Array.|null} [".google.api.methodSignature"] MethodOptions .google.api.methodSignature * @property {google.api.IHttpRule|null} [".google.api.http"] MethodOptions .google.api.http + * @property {Array.|null} [".google.api.methodSignature"] MethodOptions .google.api.methodSignature */ /** @@ -62401,20 +62429,20 @@ MethodOptions.prototype.uninterpretedOption = $util.emptyArray; /** - * MethodOptions .google.api.methodSignature. - * @member {Array.} .google.api.methodSignature + * MethodOptions .google.api.http. + * @member {google.api.IHttpRule|null|undefined} .google.api.http * @memberof google.protobuf.MethodOptions * @instance */ - MethodOptions.prototype[".google.api.methodSignature"] = $util.emptyArray; + MethodOptions.prototype[".google.api.http"] = null; /** - * MethodOptions .google.api.http. - * @member {google.api.IHttpRule|null|undefined} .google.api.http + * MethodOptions .google.api.methodSignature. + * @member {Array.} .google.api.methodSignature * @memberof google.protobuf.MethodOptions * @instance */ - MethodOptions.prototype[".google.api.http"] = null; + MethodOptions.prototype[".google.api.methodSignature"] = $util.emptyArray; /** * Creates a new MethodOptions instance using the specified properties. @@ -62497,14 +62525,14 @@ message.uninterpretedOption = []; message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); break; + case 72295728: + message[".google.api.http"] = $root.google.api.HttpRule.decode(reader, reader.uint32()); + break; case 1051: if (!(message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length)) message[".google.api.methodSignature"] = []; message[".google.api.methodSignature"].push(reader.string()); break; - case 72295728: - message[".google.api.http"] = $root.google.api.HttpRule.decode(reader, reader.uint32()); - break; default: reader.skipType(tag & 7); break; @@ -62561,6 +62589,11 @@ return "uninterpretedOption." + error; } } + if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) { + var error = $root.google.api.HttpRule.verify(message[".google.api.http"]); + if (error) + return ".google.api.http." + error; + } if (message[".google.api.methodSignature"] != null && message.hasOwnProperty(".google.api.methodSignature")) { if (!Array.isArray(message[".google.api.methodSignature"])) return ".google.api.methodSignature: array expected"; @@ -62568,11 +62601,6 @@ if (!$util.isString(message[".google.api.methodSignature"][i])) return ".google.api.methodSignature: string[] expected"; } - if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) { - var error = $root.google.api.HttpRule.verify(message[".google.api.http"]); - if (error) - return ".google.api.http." + error; - } return null; }; @@ -62614,6 +62642,11 @@ message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); } } + if (object[".google.api.http"] != null) { + if (typeof object[".google.api.http"] !== "object") + throw TypeError(".google.protobuf.MethodOptions..google.api.http: object expected"); + message[".google.api.http"] = $root.google.api.HttpRule.fromObject(object[".google.api.http"]); + } if (object[".google.api.methodSignature"]) { if (!Array.isArray(object[".google.api.methodSignature"])) throw TypeError(".google.protobuf.MethodOptions..google.api.methodSignature: array expected"); @@ -62621,11 +62654,6 @@ for (var i = 0; i < object[".google.api.methodSignature"].length; ++i) message[".google.api.methodSignature"][i] = String(object[".google.api.methodSignature"][i]); } - if (object[".google.api.http"] != null) { - if (typeof object[".google.api.http"] !== "object") - throw TypeError(".google.protobuf.MethodOptions..google.api.http: object expected"); - message[".google.api.http"] = $root.google.api.HttpRule.fromObject(object[".google.api.http"]); - } return message; }; diff --git a/protos/protos.json b/protos/protos.json index 43133dde..f931460a 100644 --- a/protos/protos.json +++ b/protos/protos.json @@ -1136,6 +1136,8 @@ "TEXT_UTF8": 5, "WORD_DOCUMENT": 7, "PDF": 8, + "POWERPOINT_DOCUMENT": 9, + "EXCEL_DOCUMENT": 10, "AVRO": 11, "CSV": 12, "TSV": 13 @@ -3215,6 +3217,13 @@ } }, "nested": { + "TransformationResultCode": { + "values": { + "TRANSFORMATION_RESULT_CODE_UNSPECIFIED": 0, + "SUCCESS": 1, + "ERROR": 2 + } + }, "SummaryResult": { "fields": { "count": { @@ -3230,13 +3239,6 @@ "id": 3 } } - }, - "TransformationResultCode": { - "values": { - "TRANSFORMATION_RESULT_CODE_UNSPECIFIED": 0, - "SUCCESS": 1, - "ERROR": 2 - } } } }, @@ -4483,6 +4485,16 @@ } } }, + "Likelihood": { + "values": { + "LIKELIHOOD_UNSPECIFIED": 0, + "VERY_UNLIKELY": 1, + "UNLIKELY": 2, + "POSSIBLE": 3, + "LIKELY": 4, + "VERY_LIKELY": 5 + } + }, "StoredType": { "fields": { "name": { @@ -4495,16 +4507,6 @@ } } }, - "Likelihood": { - "values": { - "LIKELIHOOD_UNSPECIFIED": 0, - "VERY_UNLIKELY": 1, - "UNLIKELY": 2, - "POSSIBLE": 3, - "LIKELY": 4, - "VERY_LIKELY": 5 - } - }, "CustomInfoType": { "oneofs": { "type": { @@ -4712,6 +4714,21 @@ } } }, + "FileType": { + "values": { + "FILE_TYPE_UNSPECIFIED": 0, + "BINARY_FILE": 1, + "TEXT_FILE": 2, + "IMAGE": 3, + "WORD": 5, + "PDF": 6, + "AVRO": 7, + "CSV": 8, + "TSV": 9, + "POWERPOINT": 11, + "EXCEL": 12 + } + }, "CloudStorageRegexFileSet": { "fields": { "bucketName": { @@ -4896,19 +4913,6 @@ } } }, - "FileType": { - "values": { - "FILE_TYPE_UNSPECIFIED": 0, - "BINARY_FILE": 1, - "TEXT_FILE": 2, - "IMAGE": 3, - "WORD": 5, - "PDF": 6, - "AVRO": 7, - "CSV": 8, - "TSV": 9 - } - }, "HybridOptions": { "fields": { "description": { @@ -5070,12 +5074,99 @@ "options": { "go_package": "google.golang.org/genproto/googleapis/api/annotations;annotations", "java_multiple_files": true, - "java_outer_classname": "HttpProto", + "java_outer_classname": "ResourceProto", "java_package": "com.google.api", "objc_class_prefix": "GAPI", "cc_enable_arenas": true }, "nested": { + "http": { + "type": "HttpRule", + "id": 72295728, + "extend": "google.protobuf.MethodOptions" + }, + "Http": { + "fields": { + "rules": { + "rule": "repeated", + "type": "HttpRule", + "id": 1 + }, + "fullyDecodeReservedExpansion": { + "type": "bool", + "id": 2 + } + } + }, + "HttpRule": { + "oneofs": { + "pattern": { + "oneof": [ + "get", + "put", + "post", + "delete", + "patch", + "custom" + ] + } + }, + "fields": { + "selector": { + "type": "string", + "id": 1 + }, + "get": { + "type": "string", + "id": 2 + }, + "put": { + "type": "string", + "id": 3 + }, + "post": { + "type": "string", + "id": 4 + }, + "delete": { + "type": "string", + "id": 5 + }, + "patch": { + "type": "string", + "id": 6 + }, + "custom": { + "type": "CustomHttpPattern", + "id": 8 + }, + "body": { + "type": "string", + "id": 7 + }, + "responseBody": { + "type": "string", + "id": 12 + }, + "additionalBindings": { + "rule": "repeated", + "type": "HttpRule", + "id": 11 + } + } + }, + "CustomHttpPattern": { + "fields": { + "kind": { + "type": "string", + "id": 1 + }, + "path": { + "type": "string", + "id": 2 + } + } + }, "methodSignature": { "rule": "repeated", "type": "string", @@ -5186,93 +5277,6 @@ "id": 2 } } - }, - "http": { - "type": "HttpRule", - "id": 72295728, - "extend": "google.protobuf.MethodOptions" - }, - "Http": { - "fields": { - "rules": { - "rule": "repeated", - "type": "HttpRule", - "id": 1 - }, - "fullyDecodeReservedExpansion": { - "type": "bool", - "id": 2 - } - } - }, - "HttpRule": { - "oneofs": { - "pattern": { - "oneof": [ - "get", - "put", - "post", - "delete", - "patch", - "custom" - ] - } - }, - "fields": { - "selector": { - "type": "string", - "id": 1 - }, - "get": { - "type": "string", - "id": 2 - }, - "put": { - "type": "string", - "id": 3 - }, - "post": { - "type": "string", - "id": 4 - }, - "delete": { - "type": "string", - "id": 5 - }, - "patch": { - "type": "string", - "id": 6 - }, - "custom": { - "type": "CustomHttpPattern", - "id": 8 - }, - "body": { - "type": "string", - "id": 7 - }, - "responseBody": { - "type": "string", - "id": 12 - }, - "additionalBindings": { - "rule": "repeated", - "type": "HttpRule", - "id": 11 - } - } - }, - "CustomHttpPattern": { - "fields": { - "kind": { - "type": "string", - "id": 1 - }, - "path": { - "type": "string", - "id": 2 - } - } } } },