From 04cc5e8826fce1f4881769c08cfff394ee891d86 Mon Sep 17 00:00:00 2001 From: sofisl <55454395+sofisl@users.noreply.github.com> Date: Wed, 6 Jul 2022 01:55:37 -0700 Subject: [PATCH] feat: add node mono repo post processor (#1471) * feat: add node mono repo post processor --- docker/owlbot/nodejs_mono_repo/Dockerfile | 55 + .../owlbot/nodejs_mono_repo/cloudbuild.yaml | 21 + docker/owlbot/nodejs_mono_repo/entrypoint.sh | 22 + synthtool/gcp/common.py | 29 +- .../node_mono_repo_library/.eslintignore | 7 + .../node_mono_repo_library/.eslintrc.json | 3 + .../node_mono_repo_library/.gitattributes | 4 + .../node_mono_repo_library/.mocharc.js | 29 + .../templates/node_mono_repo_library/.nycrc | 24 + .../node_mono_repo_library/.prettierignore | 6 + .../node_mono_repo_library/.prettierrc.js | 17 + .../node_mono_repo_library/CODE_OF_CONDUCT.md | 94 + .../node_mono_repo_library/CONTRIBUTING.md | 76 + .../templates/node_mono_repo_library/LICENSE | 202 + .../node_mono_repo_library/README.md | 174 + .../node_mono_repo_library/samples/README.md | 66 + synthtool/languages/node_mono_repo.py | 377 + .../owl-bot-staging/dlp/v2/README.md | 1 + .../dlp/v2/linkinator.config.json | 10 + .../owl-bot-staging/dlp/v2/package.json | 64 + .../v2/protos/google/privacy/dlp/v2/dlp.proto | 4379 + .../google/privacy/dlp/v2/storage.proto | 740 + .../owl-bot-staging/dlp/v2/src/index.ts | 27 + .../dlp/v2/src/v2/dlp_service_client.ts | 5246 ++ .../v2/src/v2/dlp_service_client_config.json | 196 + .../dlp/v2/src/v2/dlp_service_proto_list.json | 4 + .../dlp/v2/src/v2/gapic_metadata.json | 383 + .../owl-bot-staging/dlp/v2/src/v2/index.ts | 19 + .../system-test/fixtures/sample/src/index.js | 27 + .../system-test/fixtures/sample/src/index.ts | 32 + .../dlp/v2/system-test/install.ts | 49 + .../dlp/v2/test/gapic_dlp_service_v2.ts | 4524 ++ .../owl-bot-staging/dlp/v2/tsconfig.json | 19 + .../owl-bot-staging/dlp/v2/webpack.config.js | 64 + .../packages/dlp/.OwlBot.yaml | 23 + .../packages/dlp/.eslintignore | 6 + .../packages/dlp/.eslintrc.json | 3 + .../packages/dlp/.gitattributes | 4 + .../packages/dlp/.gitignore | 14 + .../packages/dlp/.jsdoc.js | 55 + .../packages/dlp/.mocharc.js | 29 + .../packages/dlp/.nycrc | 24 + .../packages/dlp/.prettierignore | 6 + .../packages/dlp/.prettierrc.js | 17 + .../packages/dlp/.readme-partials.yml | 4 + .../packages/dlp/.repo-metadata.json | 14 + .../packages/dlp/.trampolinerc | 51 + .../packages/dlp/CHANGELOG.md | 399 + .../packages/dlp/CODE_OF_CONDUCT.md | 94 + .../packages/dlp/CONTRIBUTING.md | 76 + .../packages/dlp/LICENSE | 202 + .../packages/dlp/README.md | 226 + .../packages/dlp/api-extractor.json | 369 + .../packages/dlp/linkinator.config.json | 10 + .../packages/dlp/package.json | 72 + .../google/cloud/common_resources.proto | 52 + .../protos/google/privacy/dlp/v2/dlp.proto | 4379 + .../google/privacy/dlp/v2/storage.proto | 740 + .../packages/dlp/protos/protos.d.ts | 26343 +++++++ .../packages/dlp/protos/protos.js | 65776 ++++++++++++++++ .../packages/dlp/protos/protos.json | 6246 ++ .../packages/dlp/renovate.json | 19 + .../packages/dlp/samples/.eslintrc.yml | 5 + .../packages/dlp/samples/.gitignore | 3 + .../packages/dlp/samples/README.md | 574 + .../dlp/samples/categoricalRiskAnalysis.js | 160 + .../dlp/samples/createInspectTemplate.js | 102 + .../packages/dlp/samples/createTrigger.js | 138 + .../dlp/samples/deidentifyWithDateShift.js | 191 + .../packages/dlp/samples/deidentifyWithFpe.js | 101 + .../dlp/samples/deidentifyWithMask.js | 80 + .../dlp/samples/deidentifyWithReplacement.js | 76 + .../dlp/samples/deleteInspectTemplate.js | 55 + .../packages/dlp/samples/deleteJob.js | 59 + .../packages/dlp/samples/deleteTrigger.js | 54 + .../packages/dlp/samples/inspectBigQuery.js | 195 + .../packages/dlp/samples/inspectDatastore.js | 198 + .../packages/dlp/samples/inspectFile.js | 143 + .../packages/dlp/samples/inspectGCSFile.js | 187 + .../packages/dlp/samples/inspectString.js | 134 + .../dlp/samples/kAnonymityAnalysis.js | 165 + .../dlp/samples/kMapEstimationAnalysis.js | 179 + .../dlp/samples/lDiversityAnalysis.js | 180 + .../dlp/samples/listInspectTemplates.js | 74 + .../packages/dlp/samples/listJobs.js | 62 + .../packages/dlp/samples/listTriggers.js | 69 + .../packages/dlp/samples/metadata.js | 60 + .../dlp/samples/numericalRiskAnalysis.js | 161 + .../packages/dlp/samples/package.json | 30 + .../packages/dlp/samples/quickstart.js | 91 + .../packages/dlp/samples/redactImage.js | 96 + .../packages/dlp/samples/redactText.js | 80 + .../packages/dlp/samples/reidentifyWithFpe.js | 103 + .../dlp/samples/resources/accounts.txt | 1 + .../packages/dlp/samples/resources/dates.csv | 5 + .../dlp/samples/resources/harmless.txt | 1 + .../packages/dlp/samples/resources/test.png | Bin 0 -> 31282 bytes .../packages/dlp/samples/resources/test.txt | 1 + .../dlp/samples/system-test/deid.test.js | 121 + .../dlp/samples/system-test/inspect.test.js | 282 + .../dlp/samples/system-test/jobs.test.js | 158 + .../dlp/samples/system-test/metadata.test.js | 42 + .../samples/system-test/quickstart.test.js | 35 + .../dlp/samples/system-test/redact.test.js | 135 + .../resources/date-shift-context.expected.csv | 5 + .../redact-multiple-types.expected.png | Bin 0 -> 15869 bytes .../resources/redact-single-type.expected.png | Bin 0 -> 21318 bytes .../dlp/samples/system-test/risk.test.js | 208 + .../dlp/samples/system-test/temp.result.csv | 5 + .../dlp/samples/system-test/templates.test.js | 103 + .../dlp/samples/system-test/triggers.test.js | 91 + .../packages/dlp/src/index.ts | 29 + .../packages/dlp/src/service_proto_list.json | 1 + .../packages/dlp/src/v2/dlp_service_client.ts | 6109 ++ .../dlp/src/v2/dlp_service_client_config.json | 196 + .../dlp/src/v2/dlp_service_proto_list.json | 4 + .../packages/dlp/src/v2/gapic_metadata.json | 383 + .../packages/dlp/src/v2/index.ts | 19 + .../dlp/system-test/dlp_service_smoke_test.ts | 49 + .../system-test/fixtures/sample/src/index.js | 26 + .../system-test/fixtures/sample/src/index.ts | 32 + .../packages/dlp/system-test/install.ts | 51 + .../packages/dlp/test/gapic_dlp_service_v2.ts | 6256 ++ .../packages/dlp/tsconfig.json | 19 + .../packages/dlp/webpack.config.js | 64 + tests/test_node_mono_repo.py | 329 + 126 files changed, 140807 insertions(+), 1 deletion(-) create mode 100644 docker/owlbot/nodejs_mono_repo/Dockerfile create mode 100644 docker/owlbot/nodejs_mono_repo/cloudbuild.yaml create mode 100644 docker/owlbot/nodejs_mono_repo/entrypoint.sh create mode 100644 synthtool/gcp/templates/node_mono_repo_library/.eslintignore create mode 100644 synthtool/gcp/templates/node_mono_repo_library/.eslintrc.json create mode 100644 synthtool/gcp/templates/node_mono_repo_library/.gitattributes create mode 100644 synthtool/gcp/templates/node_mono_repo_library/.mocharc.js create mode 100644 synthtool/gcp/templates/node_mono_repo_library/.nycrc create mode 100644 synthtool/gcp/templates/node_mono_repo_library/.prettierignore create mode 100644 synthtool/gcp/templates/node_mono_repo_library/.prettierrc.js create mode 100644 synthtool/gcp/templates/node_mono_repo_library/CODE_OF_CONDUCT.md create mode 100644 synthtool/gcp/templates/node_mono_repo_library/CONTRIBUTING.md create mode 100644 synthtool/gcp/templates/node_mono_repo_library/LICENSE create mode 100644 synthtool/gcp/templates/node_mono_repo_library/README.md create mode 100644 synthtool/gcp/templates/node_mono_repo_library/samples/README.md create mode 100644 synthtool/languages/node_mono_repo.py create mode 100644 tests/fixtures/nodejs_mono_repo_with_staging/owl-bot-staging/dlp/v2/README.md create mode 100644 tests/fixtures/nodejs_mono_repo_with_staging/owl-bot-staging/dlp/v2/linkinator.config.json create mode 100644 tests/fixtures/nodejs_mono_repo_with_staging/owl-bot-staging/dlp/v2/package.json create mode 100644 tests/fixtures/nodejs_mono_repo_with_staging/owl-bot-staging/dlp/v2/protos/google/privacy/dlp/v2/dlp.proto create mode 100644 tests/fixtures/nodejs_mono_repo_with_staging/owl-bot-staging/dlp/v2/protos/google/privacy/dlp/v2/storage.proto create mode 100644 tests/fixtures/nodejs_mono_repo_with_staging/owl-bot-staging/dlp/v2/src/index.ts create mode 100644 tests/fixtures/nodejs_mono_repo_with_staging/owl-bot-staging/dlp/v2/src/v2/dlp_service_client.ts create mode 100644 tests/fixtures/nodejs_mono_repo_with_staging/owl-bot-staging/dlp/v2/src/v2/dlp_service_client_config.json create mode 100644 tests/fixtures/nodejs_mono_repo_with_staging/owl-bot-staging/dlp/v2/src/v2/dlp_service_proto_list.json create mode 100644 tests/fixtures/nodejs_mono_repo_with_staging/owl-bot-staging/dlp/v2/src/v2/gapic_metadata.json create mode 100644 tests/fixtures/nodejs_mono_repo_with_staging/owl-bot-staging/dlp/v2/src/v2/index.ts create mode 100644 tests/fixtures/nodejs_mono_repo_with_staging/owl-bot-staging/dlp/v2/system-test/fixtures/sample/src/index.js create mode 100644 tests/fixtures/nodejs_mono_repo_with_staging/owl-bot-staging/dlp/v2/system-test/fixtures/sample/src/index.ts create mode 100644 tests/fixtures/nodejs_mono_repo_with_staging/owl-bot-staging/dlp/v2/system-test/install.ts create mode 100644 tests/fixtures/nodejs_mono_repo_with_staging/owl-bot-staging/dlp/v2/test/gapic_dlp_service_v2.ts create mode 100644 tests/fixtures/nodejs_mono_repo_with_staging/owl-bot-staging/dlp/v2/tsconfig.json create mode 100644 tests/fixtures/nodejs_mono_repo_with_staging/owl-bot-staging/dlp/v2/webpack.config.js create mode 100644 tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/.OwlBot.yaml create mode 100644 tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/.eslintignore create mode 100644 tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/.eslintrc.json create mode 100644 tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/.gitattributes create mode 100644 tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/.gitignore create mode 100644 tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/.jsdoc.js create mode 100644 tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/.mocharc.js create mode 100644 tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/.nycrc create mode 100644 tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/.prettierignore create mode 100644 tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/.prettierrc.js create mode 100644 tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/.readme-partials.yml create mode 100644 tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/.repo-metadata.json create mode 100644 tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/.trampolinerc create mode 100644 tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/CHANGELOG.md create mode 100644 tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/CODE_OF_CONDUCT.md create mode 100644 tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/CONTRIBUTING.md create mode 100644 tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/LICENSE create mode 100644 tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/README.md create mode 100644 tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/api-extractor.json create mode 100644 tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/linkinator.config.json create mode 100644 tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/package.json create mode 100644 tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/protos/google/cloud/common_resources.proto create mode 100644 tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/protos/google/privacy/dlp/v2/dlp.proto create mode 100644 tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/protos/google/privacy/dlp/v2/storage.proto create mode 100644 tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/protos/protos.d.ts create mode 100644 tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/protos/protos.js create mode 100644 tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/protos/protos.json create mode 100644 tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/renovate.json create mode 100644 tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/.eslintrc.yml create mode 100644 tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/.gitignore create mode 100644 tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/README.md create mode 100644 tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/categoricalRiskAnalysis.js create mode 100644 tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/createInspectTemplate.js create mode 100644 tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/createTrigger.js create mode 100644 tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/deidentifyWithDateShift.js create mode 100644 tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/deidentifyWithFpe.js create mode 100644 tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/deidentifyWithMask.js create mode 100644 tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/deidentifyWithReplacement.js create mode 100644 tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/deleteInspectTemplate.js create mode 100644 tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/deleteJob.js create mode 100644 tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/deleteTrigger.js create mode 100644 tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/inspectBigQuery.js create mode 100644 tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/inspectDatastore.js create mode 100644 tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/inspectFile.js create mode 100644 tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/inspectGCSFile.js create mode 100644 tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/inspectString.js create mode 100644 tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/kAnonymityAnalysis.js create mode 100644 tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/kMapEstimationAnalysis.js create mode 100644 tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/lDiversityAnalysis.js create mode 100644 tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/listInspectTemplates.js create mode 100644 tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/listJobs.js create mode 100644 tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/listTriggers.js create mode 100644 tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/metadata.js create mode 100644 tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/numericalRiskAnalysis.js create mode 100644 tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/package.json create mode 100644 tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/quickstart.js create mode 100644 tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/redactImage.js create mode 100644 tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/redactText.js create mode 100644 tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/reidentifyWithFpe.js create mode 100644 tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/resources/accounts.txt create mode 100644 tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/resources/dates.csv create mode 100644 tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/resources/harmless.txt create mode 100644 tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/resources/test.png create mode 100644 tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/resources/test.txt create mode 100644 tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/system-test/deid.test.js create mode 100644 tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/system-test/inspect.test.js create mode 100644 tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/system-test/jobs.test.js create mode 100644 tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/system-test/metadata.test.js create mode 100644 tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/system-test/quickstart.test.js create mode 100644 tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/system-test/redact.test.js create mode 100644 tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/system-test/resources/date-shift-context.expected.csv create mode 100644 tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/system-test/resources/redact-multiple-types.expected.png create mode 100644 tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/system-test/resources/redact-single-type.expected.png create mode 100644 tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/system-test/risk.test.js create mode 100644 tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/system-test/temp.result.csv create mode 100644 tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/system-test/templates.test.js create mode 100644 tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/system-test/triggers.test.js create mode 100644 tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/src/index.ts create mode 100644 tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/src/service_proto_list.json create mode 100644 tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/src/v2/dlp_service_client.ts create mode 100644 tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/src/v2/dlp_service_client_config.json create mode 100644 tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/src/v2/dlp_service_proto_list.json create mode 100644 tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/src/v2/gapic_metadata.json create mode 100644 tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/src/v2/index.ts create mode 100644 tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/system-test/dlp_service_smoke_test.ts create mode 100644 tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/system-test/fixtures/sample/src/index.js create mode 100644 tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/system-test/fixtures/sample/src/index.ts create mode 100644 tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/system-test/install.ts create mode 100644 tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/test/gapic_dlp_service_v2.ts create mode 100644 tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/tsconfig.json create mode 100644 tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/webpack.config.js create mode 100644 tests/test_node_mono_repo.py diff --git a/docker/owlbot/nodejs_mono_repo/Dockerfile b/docker/owlbot/nodejs_mono_repo/Dockerfile new file mode 100644 index 000000000..1e4859e8e --- /dev/null +++ b/docker/owlbot/nodejs_mono_repo/Dockerfile @@ -0,0 +1,55 @@ +# 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. + +# Version 0.2.0 + +# build from the root of this repo: +# docker build -t gcr.io/repo-automation-bots/owlbot-nodejs -f docker/owlbot/nodejs/Dockerfile . +FROM python:3.10.5-buster + +WORKDIR / + +###################### Install nodejs. +RUN curl -sL https://deb.nodesource.com/setup_15.x | bash - +RUN apt-get install -y nodejs + +###################### Install synthtool's requirements. +COPY requirements.txt /synthtool/requirements.txt +RUN pip install -r /synthtool/requirements.txt + +# Put synthtool in the PYTHONPATH so owlbot.py scripts will find it. +ENV PYTHONPATH="/synthtool" + +# Tell synthtool to pull templates from this docker image instead of from +# the live repo. +ENV SYNTHTOOL_TEMPLATES="/synthtool/synthtool/gcp/templates" + +# Copy synthtool. +COPY synthtool /synthtool/synthtool +COPY docker /synthtool/docker +COPY post-processor-changes.txt /post-processor-changes.txt + +# Update permissions so non-root users won't see errors. +RUN find /synthtool -exec chmod a+r {} \; +RUN find /synthtool -type d -exec chmod a+x {} \; + +# Install dependencies used for post processing: +# * gts/typescript are used for linting. +# * google-gax is used for compiling protos. +RUN cd /synthtool && mkdir node_modules && npm i gts@3.1.0 google-gax@2.29.1 typescript@3.9.9 \ + chalk@4.1.2 escodegen@2.0.0 espree@7.3.1 estraverse@5.2.0 glob@7.2.0 jsdoc@3.6.7 \ + minimist@1.2.5 semver@7.3.5 tmp@0.2.1 uglify-js@3.14.2 + +ENTRYPOINT [ "/bin/bash" ] +CMD [ "/synthtool/docker/owlbot/nodejs_mono_repo/entrypoint.sh" ] \ No newline at end of file diff --git a/docker/owlbot/nodejs_mono_repo/cloudbuild.yaml b/docker/owlbot/nodejs_mono_repo/cloudbuild.yaml new file mode 100644 index 000000000..bf48ffb74 --- /dev/null +++ b/docker/owlbot/nodejs_mono_repo/cloudbuild.yaml @@ -0,0 +1,21 @@ +steps: + # Write the latest commit message to a file in the workspace. + - name: 'gcr.io/cloud-builders/git' + entrypoint: '/bin/sh' + args: + - '-c' + - 'git log -1 --format="%s%n%n%b%nSource-Link: https://github.com/googleapis/synthtool/commit/%H" > post-processor-changes.txt' + # Build the docker image. + - name: 'gcr.io/cloud-builders/docker' + args: [ 'build', + '-t', 'gcr.io/repo-automation-bots/owlbot-nodejs-mono-repo:$SHORT_SHA', + '-t', 'gcr.io/repo-automation-bots/owlbot-nodejs-mono-repo:latest', + '-t', 'gcr.io/cloud-devrel-public-resources/owlbot-nodejs-mono-repo:$SHORT_SHA', + '-t', 'gcr.io/cloud-devrel-public-resources/owlbot-nodejs-mono-repo:latest', + '-f', 'docker/owlbot/nodejs-mono-repo/Dockerfile', '.' ] + # Push the docker image. +images: + - gcr.io/repo-automation-bots/owlbot-nodejs-mono-repo:$SHORT_SHA + - gcr.io/repo-automation-bots/owlbot-nodejs-mono-repo:latest + - gcr.io/cloud-devrel-public-resources/owlbot-nodejs-mono-repo:$SHORT_SHA + - gcr.io/cloud-devrel-public-resources/owlbot-nodejs-mono-repo:latest diff --git a/docker/owlbot/nodejs_mono_repo/entrypoint.sh b/docker/owlbot/nodejs_mono_repo/entrypoint.sh new file mode 100644 index 000000000..4525846db --- /dev/null +++ b/docker/owlbot/nodejs_mono_repo/entrypoint.sh @@ -0,0 +1,22 @@ +#!/bin/bash +# 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. + +set -ex + +if [ -f owlbot.py ]; then + python owlbot.py +else + python -m synthtool.languages.node_mono_repo +fi \ No newline at end of file diff --git a/synthtool/gcp/common.py b/synthtool/gcp/common.py index 622591d47..469c63787 100644 --- a/synthtool/gcp/common.py +++ b/synthtool/gcp/common.py @@ -24,7 +24,7 @@ from synthtool import shell, _tracked_paths from synthtool.gcp import partials -from synthtool.languages import node +from synthtool.languages import node, node_mono_repo from synthtool.log import logger from synthtool.sources import git, templates @@ -326,6 +326,33 @@ def node_library(self, **kwargs) -> Path: return self._generic_library("node_library", **kwargs) + def node_mono_repo_library(self, relative_dir, **kwargs) -> Path: + # TODO: once we've migrated all Node.js repos to either having + # .repo-metadata.json, or excluding README.md, we can remove this. + if not os.path.exists(Path(relative_dir, "/.repo-metadata.json").resolve()): + self.excludes.append("README.md") + if "samples/README.md" not in self.excludes: + self.excludes.append("samples/README.md") + + kwargs["metadata"] = node_mono_repo.template_metadata(relative_dir) + + ignore_src_index = [ + "yes" for f in self.excludes if fnmatch.fnmatch("src/index.ts", f) + ] + # generate root-level `src/index.ts` to export multiple versions and its default clients + if ( + "versions" in kwargs + and "default_version" in kwargs + and not ignore_src_index + ): + node_mono_repo.generate_index_ts( + versions=kwargs["versions"], + default_version=kwargs["default_version"], + relative_dir=relative_dir, + ) + + return self._generic_library("node_mono_repo_library", **kwargs) + def php_library(self, **kwargs) -> Path: return self._generic_library("php_library", **kwargs) diff --git a/synthtool/gcp/templates/node_mono_repo_library/.eslintignore b/synthtool/gcp/templates/node_mono_repo_library/.eslintignore new file mode 100644 index 000000000..ea5b04aeb --- /dev/null +++ b/synthtool/gcp/templates/node_mono_repo_library/.eslintignore @@ -0,0 +1,7 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ +samples/generated/ diff --git a/synthtool/gcp/templates/node_mono_repo_library/.eslintrc.json b/synthtool/gcp/templates/node_mono_repo_library/.eslintrc.json new file mode 100644 index 000000000..782153495 --- /dev/null +++ b/synthtool/gcp/templates/node_mono_repo_library/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/gts" +} diff --git a/synthtool/gcp/templates/node_mono_repo_library/.gitattributes b/synthtool/gcp/templates/node_mono_repo_library/.gitattributes new file mode 100644 index 000000000..33739cb74 --- /dev/null +++ b/synthtool/gcp/templates/node_mono_repo_library/.gitattributes @@ -0,0 +1,4 @@ +*.ts text eol=lf +*.js text eol=lf +protos/* linguist-generated +**/api-extractor.json linguist-language=JSON-with-Comments diff --git a/synthtool/gcp/templates/node_mono_repo_library/.mocharc.js b/synthtool/gcp/templates/node_mono_repo_library/.mocharc.js new file mode 100644 index 000000000..0b600509b --- /dev/null +++ b/synthtool/gcp/templates/node_mono_repo_library/.mocharc.js @@ -0,0 +1,29 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// 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. +const config = { + "enable-source-maps": true, + "throw-deprecation": true, + "timeout": 10000, + "recursive": true +} +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/synthtool/gcp/templates/node_mono_repo_library/.nycrc b/synthtool/gcp/templates/node_mono_repo_library/.nycrc new file mode 100644 index 000000000..b18d5472b --- /dev/null +++ b/synthtool/gcp/templates/node_mono_repo_library/.nycrc @@ -0,0 +1,24 @@ +{ + "report-dir": "./.coverage", + "reporter": ["text", "lcov"], + "exclude": [ + "**/*-test", + "**/.coverage", + "**/apis", + "**/benchmark", + "**/conformance", + "**/docs", + "**/samples", + "**/scripts", + "**/protos", + "**/test", + "**/*.d.ts", + ".jsdoc.js", + "**/.jsdoc.js", + "karma.conf.js", + "webpack-tests.config.js", + "webpack.config.js" + ], + "exclude-after-remap": false, + "all": true +} diff --git a/synthtool/gcp/templates/node_mono_repo_library/.prettierignore b/synthtool/gcp/templates/node_mono_repo_library/.prettierignore new file mode 100644 index 000000000..9340ad9b8 --- /dev/null +++ b/synthtool/gcp/templates/node_mono_repo_library/.prettierignore @@ -0,0 +1,6 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ diff --git a/synthtool/gcp/templates/node_mono_repo_library/.prettierrc.js b/synthtool/gcp/templates/node_mono_repo_library/.prettierrc.js new file mode 100644 index 000000000..d1b95106f --- /dev/null +++ b/synthtool/gcp/templates/node_mono_repo_library/.prettierrc.js @@ -0,0 +1,17 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +module.exports = { + ...require('gts/.prettierrc.json') +} diff --git a/synthtool/gcp/templates/node_mono_repo_library/CODE_OF_CONDUCT.md b/synthtool/gcp/templates/node_mono_repo_library/CODE_OF_CONDUCT.md new file mode 100644 index 000000000..2add2547a --- /dev/null +++ b/synthtool/gcp/templates/node_mono_repo_library/CODE_OF_CONDUCT.md @@ -0,0 +1,94 @@ + +# Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, gender identity and expression, level of +experience, education, socio-economic status, nationality, personal appearance, +race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or + advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions that are +not aligned to this Code of Conduct, or to ban temporarily or permanently any +contributor for other behaviors that they deem inappropriate, threatening, +offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +This Code of Conduct also applies outside the project spaces when the Project +Steward has a reasonable belief that an individual's behavior may have a +negative impact on the project or its community. + +## Conflict Resolution + +We do not believe that all conflict is bad; healthy debate and disagreement +often yield positive results. However, it is never okay to be disrespectful or +to engage in behavior that violates the project’s code of conduct. + +If you see someone violating the code of conduct, you are encouraged to address +the behavior directly with those involved. Many issues can be resolved quickly +and easily, and this gives people more control over the outcome of their +dispute. If you are unable to resolve the matter for any reason, or if the +behavior is threatening or harassing, report it. We are dedicated to providing +an environment where participants feel welcome and safe. + +Reports should be directed to *googleapis-stewards@google.com*, the +Project Steward(s) for *Google Cloud Client Libraries*. It is the Project Steward’s duty to +receive and address reported violations of the code of conduct. They will then +work with a committee consisting of representatives from the Open Source +Programs Office and the Google Open Source Strategy team. If for any reason you +are uncomfortable reaching out to the Project Steward, please email +opensource@google.com. + +We will investigate every complaint, but you may not receive a direct response. +We will use our discretion in determining when and how to follow up on reported +incidents, which may range from not taking action to permanent expulsion from +the project and project-sponsored spaces. We will notify the accused of the +report and provide them an opportunity to discuss it before any action is taken. +The identity of the reporter will be omitted from the details of the report +supplied to the accused. In potentially harmful situations, such as ongoing +harassment or threats to anyone's safety, we may take action without notice. + +## Attribution + +This Code of Conduct is adapted from the Contributor Covenant, version 1.4, +available at +https://www.contributor-covenant.org/version/1/4/code-of-conduct.html \ No newline at end of file diff --git a/synthtool/gcp/templates/node_mono_repo_library/CONTRIBUTING.md b/synthtool/gcp/templates/node_mono_repo_library/CONTRIBUTING.md new file mode 100644 index 000000000..e8f43fd39 --- /dev/null +++ b/synthtool/gcp/templates/node_mono_repo_library/CONTRIBUTING.md @@ -0,0 +1,76 @@ +# How to become a contributor and submit your own code + +**Table of contents** + +* [Contributor License Agreements](#contributor-license-agreements) +* [Contributing a patch](#contributing-a-patch) +* [Running the tests](#running-the-tests) +* [Releasing the library](#releasing-the-library) + +## Contributor License Agreements + +We'd love to accept your sample apps and patches! Before we can take them, we +have to jump a couple of legal hurdles. + +Please fill out either the individual or corporate Contributor License Agreement +(CLA). + + * If you are an individual writing original source code and you're sure you + own the intellectual property, then you'll need to sign an [individual CLA](https://developers.google.com/open-source/cla/individual). + * If you work for a company that wants to allow you to contribute your work, + then you'll need to sign a [corporate CLA](https://developers.google.com/open-source/cla/corporate). + +Follow either of the two links above to access the appropriate CLA and +instructions for how to sign and return it. Once we receive it, we'll be able to +accept your pull requests. + +## Contributing A Patch + +1. Submit an issue describing your proposed change to the repo in question. +1. The repo owner will respond to your issue promptly. +1. If your proposed change is accepted, and you haven't already done so, sign a + Contributor License Agreement (see details above). +1. Fork the desired repo, develop and test your code changes. +1. Ensure that your code adheres to the existing style in the code to which + you are contributing. +1. Ensure that your code has an appropriate set of tests which all pass. +1. Title your pull request following [Conventional Commits](https://www.conventionalcommits.org/) styling. +1. Submit a pull request. + +### Before you begin + +1. [Select or create a Cloud Platform project][projects].{% if metadata['repo']['requires_billing'] %} +1. [Enable billing for your project][billing].{% endif %} {% if metadata['repo']['api_id'] %} +1. [Enable the {{ metadata['repo']['name_pretty'] }} API][enable_api]. {% endif %} +1. [Set up authentication with a service account][auth] so you can access the + API from your local workstation. + + +## Running the tests + +1. [Prepare your environment for Node.js setup][setup]. + +1. Install dependencies: + + npm install + +1. Run the tests: + + # Run unit tests. + npm test + + # Run sample integration tests. + npm run samples-test + + # Run all system tests. + npm run system-test + +1. Lint (and maybe fix) any changes: + + npm run fix + +[setup]: https://cloud.google.com/nodejs/docs/setup +[projects]: https://console.cloud.google.com/project +[billing]: https://support.google.com/cloud/answer/6293499#enable-billing +{% if metadata['repo']['api_id'] %}[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid={{ metadata['repo']['api_id'] }}{% endif %} +[auth]: https://cloud.google.com/docs/authentication/getting-started \ No newline at end of file diff --git a/synthtool/gcp/templates/node_mono_repo_library/LICENSE b/synthtool/gcp/templates/node_mono_repo_library/LICENSE new file mode 100644 index 000000000..d64569567 --- /dev/null +++ b/synthtool/gcp/templates/node_mono_repo_library/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + 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. diff --git a/synthtool/gcp/templates/node_mono_repo_library/README.md b/synthtool/gcp/templates/node_mono_repo_library/README.md new file mode 100644 index 000000000..e5a6fa5f2 --- /dev/null +++ b/synthtool/gcp/templates/node_mono_repo_library/README.md @@ -0,0 +1,174 @@ +[//]: # "This README.md file is auto-generated, all changes to this file will be lost." +[//]: # "To regenerate it, use `python -m synthtool`." +Google Cloud Platform logo + +{% if 'partials' in metadata and metadata['partials']['title'] -%} +{{ metadata['partials']['title'] }} +{% else -%} +# [{{ metadata['repo']['name_pretty'] }}: {{ metadata['repo']['language']|language_pretty }} Client](https://github.com/{{ metadata['repo']['repo'] }}) +{%- endif %} + +{{ metadata['repo']['release_level']|release_quality_badge }} +[![npm version](https://img.shields.io/npm/v/{{ metadata['name'] }}.svg)](https://www.npmjs.org/package/{{ metadata['name'] }}) + +{% if metadata['deprecated'] %} +| :warning: Deprecated Module | +| --- | +| This library is **deprecated**. {{ metadata['deprecated'] }} | +{% endif %} + +{% if 'partials' in metadata and metadata['partials']['introduction'] %} +{{ metadata['partials']['introduction'] }} +{% else %} +{{ metadata['description'] }} +{% endif %} + +A comprehensive list of changes in each version may be found in +[the CHANGELOG](https://github.com/{{ metadata['repo']['repo'] }}/blob/{{metadata['repo']['default_branch']}}/CHANGELOG.md). + +{% if metadata['repo']['client_documentation'] %}* [{{ metadata['repo']['name_pretty'] }} {{ metadata['repo']['language']|language_pretty }} Client API Reference][client-docs]{% endif %} +{% if metadata['repo']['product_documentation'] %}* [{{ metadata['repo']['name_pretty'] }} Documentation][product-docs]{% endif %} +* [github.com/{{ metadata['repo']['repo'] }}](https://github.com/{{ metadata['repo']['repo'] }}) + +Read more about the client libraries for Cloud APIs, including the older +Google APIs Client Libraries, in [Client Libraries Explained][explained]. + +[explained]: https://cloud.google.com/apis/docs/client-libraries-explained + +**Table of contents:** + + +* [Quickstart](#quickstart) +{% if metadata['repo']['api_id'] %} * [Before you begin](#before-you-begin){% endif %} + * [Installing the client library](#installing-the-client-library) +{% if metadata['quickstart'] %} * [Using the client library](#using-the-client-library){% endif %} +{% if metadata['samples']|length %}* [Samples](#samples){% endif %} +* [Versioning](#versioning) +* [Contributing](#contributing) +* [License](#license) + +## Quickstart +{% if metadata['repo']['api_id'] %} +### Before you begin + +1. [Select or create a Cloud Platform project][projects].{% if metadata['repo']['requires_billing'] %} +1. [Enable billing for your project][billing].{% endif %} +1. [Enable the {{ metadata['repo']['name_pretty'] }} API][enable_api]. +1. [Set up authentication with a service account][auth] so you can access the + API from your local workstation. +{% endif %} +### Installing the client library + +```bash +{{ metadata['lib_install_cmd'] }} +``` + +{% if metadata['quickstart'] %} +### Using the client library + +```{{ metadata['repo']['language']|syntax_highlighter }} +{{ metadata['quickstart'] }} +``` +{% endif %}{% if 'partials' in metadata and metadata['partials']['body'] %}{{ metadata['partials']['body'] }}{% endif %} + +{% if metadata['samples']|length %} +## Samples + +Samples are in the [`samples/`](https://github.com/{{ metadata['repo']['repo'] }}/tree/{{ metadata['repo']['default_branch'] }}/samples) directory. Each sample's `README.md` has instructions for running its sample. + +| Sample | Source Code | Try it | +| --------------------------- | --------------------------------- | ------ | +{% for sample in metadata['samples'] %}| {{ sample.title }} | [source code](https://github.com/{{ metadata['repo']['repo'] }}/blob/{{ metadata['repo']['default_branch'] }}/{{ sample.file }}) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/{{ metadata['repo']['repo'] }}&page=editor&open_in_editor={{ sample.file }},samples/README.md) | +{% endfor %} +{% endif %} +{% if metadata['repo']['client_documentation'] %} +The [{{ metadata['repo']['name_pretty'] }} {{ metadata['repo']['language']|language_pretty }} Client API Reference][client-docs] documentation +also contains samples. +{% endif %} +## Supported Node.js Versions + +Our client libraries follow the [Node.js release schedule](https://nodejs.org/en/about/releases/). +Libraries are compatible with all current _active_ and _maintenance_ versions of +Node.js. +If you are using an end-of-life version of Node.js, we recommend that you update +as soon as possible to an actively supported LTS version. + +Google's client libraries support legacy versions of Node.js runtimes on a +best-efforts basis with the following warnings: + +* Legacy versions are not tested in continuous integration. +* Some security patches and features cannot be backported. +* Dependencies cannot be kept up-to-date. + +Client libraries targeting some end-of-life versions of Node.js are available, and +can be installed through npm [dist-tags](https://docs.npmjs.com/cli/dist-tag). +The dist-tags follow the naming convention `legacy-(version)`. +For example, `{{ metadata['lib_install_cmd'] }}@legacy-8` installs client libraries +for versions compatible with Node.js 8. + +## Versioning + +This library follows [Semantic Versioning](http://semver.org/). + +{% if metadata['repo']['release_level'] == 'ga' %} +This library is considered to be **General Availability (GA)**. This means it +is stable; the code surface will not change in backwards-incompatible ways +unless absolutely necessary (e.g. because of critical security issues) or with +an extensive deprecation period. Issues and requests against **GA** libraries +are addressed with the highest priority. +{% endif %} +{% if metadata['repo']['release_level'] == 'stable' %} +This library is considered to be **stable**. The code surface will not change in backwards-incompatible ways +unless absolutely necessary (e.g. because of critical security issues) or with +an extensive deprecation period. Issues and requests against **stable** libraries +are addressed with the highest priority. +{% endif %} +{% if metadata['repo']['release_level'] == 'beta' %} +This library is considered to be in **beta**. This means it is expected to be +mostly stable while we work toward a general availability release; however, +complete stability is not guaranteed. We will address issues and requests +against beta libraries with a high priority. +{% endif %} +{% if metadata['repo']['release_level'] == 'alpha' %} +This library is considered to be in **alpha**. This means it is still a +work-in-progress and under active development. Any release is subject to +backwards-incompatible changes at any time. +{% endif %} +{% if metadata['release_level'] == 'deprecated' %} +This library is **deprecated**. This means that it is no longer being +actively maintained and the only updates the library will receive will +be for critical security issues. {% if metadata['deprecated'] %}{{ metadata['deprecated'] }}{% endif %} +{% endif %} +{% if metadata['repo']['release_level'] == 'preview' %} +This library is considered to be in **preview**. This means it is still a +work-in-progress and under active development. Any release is subject to +backwards-incompatible changes at any time. +{% endif %} + +More Information: [Google Cloud Platform Launch Stages][launch_stages] + +[launch_stages]: https://cloud.google.com/terms/launch-stages + +## Contributing + +Contributions welcome! See the [Contributing Guide](https://github.com/{{ metadata['repo']['repo'] }}/blob/{{ metadata['repo']['default_branch'] }}/CONTRIBUTING.md). + +Please note that this `README.md`, the `samples/README.md`, +and a variety of configuration files in this repository (including `.nycrc` and `tsconfig.json`) +are generated from a central template. To edit one of these files, make an edit +to its templates in +[directory](https://github.com/googleapis/synthtool). + +## License + +Apache Version 2.0 + +See [LICENSE](https://github.com/{{ metadata['repo']['repo'] }}/blob/{{ metadata['repo']['default_branch'] }}/LICENSE) + +{% if metadata['repo']['client_documentation'] %}[client-docs]: {{ metadata['repo']['client_documentation'] }}{% endif %} +{% if metadata['repo']['product_documentation'] %}[product-docs]: {{ metadata['repo']['product_documentation'] }}{% endif %} +[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png +[projects]: https://console.cloud.google.com/project +[billing]: https://support.google.com/cloud/answer/6293499#enable-billing +{% if metadata['repo']['api_id'] %}[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid={{ metadata['repo']['api_id'] }}{% endif %} +[auth]: https://cloud.google.com/docs/authentication/getting-started diff --git a/synthtool/gcp/templates/node_mono_repo_library/samples/README.md b/synthtool/gcp/templates/node_mono_repo_library/samples/README.md new file mode 100644 index 000000000..d7d698549 --- /dev/null +++ b/synthtool/gcp/templates/node_mono_repo_library/samples/README.md @@ -0,0 +1,66 @@ +[//]: # "This README.md file is auto-generated, all changes to this file will be lost." +[//]: # "To regenerate it, use `python -m synthtool`." +Google Cloud Platform logo + +{% if 'partials' in metadata and metadata['partials']['title'] -%} +{{ metadata['partials']['title'] }} Samples +{% else -%} +# [{{ metadata['repo']['name_pretty'] }}: {{ metadata['repo']['language']|language_pretty }} Samples](https://github.com/{{ metadata['repo']['repo'] }}) +{%- endif %} + +[![Open in Cloud Shell][shell_img]][shell_link] + +{% if metadata['partials'] and metadata['partials']['introduction'] %}{{ metadata['partials']['introduction'] }}{% endif %} + +## Table of Contents + +* [Before you begin](#before-you-begin) +* [Samples](#samples){% if metadata['samples']|length %}{% for sample in metadata['samples'] %} + * [{{ sample.title }}](#{{ sample.title|slugify }}){% endfor %}{% endif %} + +## Before you begin + +Before running the samples, make sure you've followed the steps outlined in +[Using the client library](https://github.com/{{ metadata['repo']['repo'] }}#using-the-client-library). + +{% if 'partials' in metadata and metadata['partials']['samples_body'] %}{{ metadata['partials']['samples_body'] }} + +{% endif -%} + +`cd samples` + +`npm install` + +`cd ..` + +## Samples +{% if metadata['samples']|length %} +{% for sample in metadata['samples'] %} + +### {{sample.title}} + +{%- if 'description' in sample %} + +{{ sample.description }} + +{%- endif %} + +View the [source code](https://github.com/{{ metadata['repo']['repo'] }}/blob/{{ metadata['repo']['default_branch'] }}/{{ sample.file }}). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/{{ metadata['repo']['repo'] }}&page=editor&open_in_editor={{ sample.file }},samples/README.md) + +__Usage:__ + + +{% if 'usage' in sample %}`{{ sample.usage }}`{% else %}`node {{ sample.file }}`{% endif %} + +{% if not loop.last %} +----- +{% endif %} + +{% endfor %} +{% endif %} + +[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png +[shell_link]: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/{{ metadata['repo']['repo'] }}&page=editor&open_in_editor=samples/README.md +[product-docs]: {{ metadata['repo']['product_documentation'] }} diff --git a/synthtool/languages/node_mono_repo.py b/synthtool/languages/node_mono_repo.py new file mode 100644 index 000000000..05464fbf0 --- /dev/null +++ b/synthtool/languages/node_mono_repo.py @@ -0,0 +1,377 @@ +# Copyright 2018 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import json +from jinja2 import FileSystemLoader, Environment +from pathlib import Path +import re +from synthtool import _tracked_paths, gcp, shell, transforms +from synthtool.gcp import samples, snippets +from synthtool.log import logger +from synthtool.sources import git +from typing import Any, Dict, List, Optional, Callable +import logging +import shutil +from synthtool.languages import common + + +_REQUIRED_FIELDS = ["name", "repository", "engines"] +_TOOLS_DIRECTORY = "/synthtool" +_GENERATED_SAMPLES_DIRECTORY = "./samples/generated" + + +def read_metadata(relative_dir: str): + """ + read package name and repository in package.json from a Node library. + + Returns: + data - package.json file as a dict. + """ + with open(Path(relative_dir, "./package.json").resolve()) as f: + data = json.load(f) + + if not all(key in data for key in _REQUIRED_FIELDS): + raise RuntimeError( + f"package.json is missing required fields {_REQUIRED_FIELDS}" + ) + + repo = git.parse_repo_url(data["repository"]) + + data["repository"] = f'{repo["owner"]}/{repo["name"]}' + data["repository_name"] = repo["name"] + data["lib_install_cmd"] = f'npm install {data["name"]}' + engines_field = re.search(r"([0-9][0-9])", data["engines"]["node"]) + assert engines_field is not None + data["engine"] = engines_field.group() + + return data + + +def template_metadata(relative_dir: str) -> Dict[str, Any]: + """Load node specific template metadata. + + Returns: + Dictionary of metadata. Includes the entire parsed contents of the package.json file if + present. Other expected fields: + * quickstart (str): Contents of the quickstart snippet if available, otherwise, "" + * samples (List[Dict[str, str]]): List of available samples. See synthtool.gcp.samples.all_samples() + """ + metadata = {} + try: + metadata = read_metadata(relative_dir) + except FileNotFoundError: + pass + + all_samples = samples.all_samples([str(Path(relative_dir, "samples/*.js"))]) + + # quickstart.js sample is special - only include it in the samples list if there is + # a quickstart snippet present in the file + quickstart_snippets = list( + snippets.all_snippets_from_file( + str(Path(relative_dir, "samples/quickstart.js").resolve()) + ).values() + ) + metadata["quickstart"] = quickstart_snippets[0] if quickstart_snippets else "" + metadata["samples"] = list( + filter( + lambda sample: sample["file"] != "samples/quickstart.js" + or metadata["quickstart"], + all_samples, + ) + ) + return metadata + + +def extract_clients(filePath: Path) -> List[str]: + """ + parse the client name from index.ts file + + Args: + filePath: the path of index.ts. + Returns: + Array of client name string extract from index.ts file. + """ + with open(filePath, "r") as fh: + content = fh.read() + return re.findall(r"\{(.*Client)\}", content) + + +def generate_index_ts( + versions: List[str], default_version: str, relative_dir: str +) -> None: + """ + generate src/index.ts to export the client name and versions in the client library. + + Args: + versions: the list of versions, like: ['v1', 'v1beta1', ...] + default_version: a stable version provided by API producer. It must exist in argument versions. + Return: + True/False: return true if successfully generate src/index.ts, vice versa. + """ + # sanitizer the input arguments + if len(versions) < 1: + err_msg = ( + "List of version can't be empty, it must contain default version at least." + ) + logger.error(err_msg) + raise AttributeError(err_msg) + if default_version not in versions: + err_msg = f"Version {versions} must contain default version {default_version}." + logger.error(err_msg) + raise AttributeError(err_msg) + + # To make sure the output is always deterministic. + versions = sorted(versions) + + # compose default version's index.ts file path + versioned_index_ts_path = ( + Path(relative_dir) / Path("src") / default_version / "index.ts" + ) + clients = extract_clients(versioned_index_ts_path) + if not clients: + err_msg = f"No client is exported in the default version's({default_version}) index.ts ." + logger.error(err_msg) + raise AttributeError(err_msg) + + # compose template directory + template_path = ( + Path(__file__).parent.parent / "gcp" / "templates" / "node_split_library" + ) + template_loader = FileSystemLoader(searchpath=str(template_path)) + template_env = Environment(loader=template_loader, keep_trailing_newline=True) + TEMPLATE_FILE = "index.ts.j2" + index_template = template_env.get_template(TEMPLATE_FILE) + # render index.ts content + output_text = index_template.render( + versions=versions, default_version=default_version, clients=clients + ) + with open(Path(relative_dir, "src/index.ts").resolve(), "w") as fh: + fh.write(output_text) + logger.info("successfully generate `src/index.ts`") + + +def install(hide_output=False): + """ + Installs all dependencies for the current Node.js library. + """ + logger.debug("Installing dependencies...") + shell.run(["npm", "install"], hide_output=hide_output) + + +def fix(hide_output=False): + """ + Fixes the formatting in the current Node.js library. + Before running fix script, run prelint to install extra dependencies + for samples, but do not fail if it does not succeed. + """ + logger.debug("Running prelint...") + shell.run(["npm", "run", "prelint"], check=False, hide_output=hide_output) + logger.debug("Running fix...") + shell.run(["npm", "run", "fix"], hide_output=hide_output) + + +def fix_hermetic(hide_output=False): + """ + Fixes the formatting in the current Node.js library. It assumes that gts + is already installed in a well known location on disk: + """ + logger.debug("Copy eslint config") + shell.run( + ["cp", "-r", f"{_TOOLS_DIRECTORY}/node_modules", "."], + check=True, + hide_output=hide_output, + ) + logger.debug("Running fix...") + shell.run( + [f"{_TOOLS_DIRECTORY}/node_modules/.bin/gts", "fix"], + check=False, + hide_output=hide_output, + ) + + +def compile_protos(hide_output=False): + """ + Compiles protos into .json, .js, and .d.ts files using + compileProtos script from google-gax. + """ + logger.debug("Compiling protos...") + shell.run(["npx", "compileProtos", "src"], hide_output=hide_output) + + +def compile_protos_hermetic(hide_output=False): + """ + Compiles protos into .json, .js, and .d.ts files using + compileProtos script from google-gax. + """ + logger.debug("Compiling protos...") + shell.run( + [f"{_TOOLS_DIRECTORY}/node_modules/.bin/compileProtos", "src"], + check=True, + hide_output=hide_output, + ) + + +def postprocess_gapic_library(hide_output=False): + logger.debug("Post-processing GAPIC library...") + install(hide_output=hide_output) + fix(hide_output=hide_output) + compile_protos(hide_output=hide_output) + logger.debug("Post-processing completed") + + +def postprocess_gapic_library_hermetic(hide_output=False): + logger.debug("Post-processing GAPIC library...") + fix_hermetic(hide_output=hide_output) + compile_protos_hermetic(hide_output=hide_output) + logger.debug("Post-processing completed") + + +default_staging_excludes = ["README.md", "package.json", "src/index.ts"] +default_templates_excludes: List[str] = [] + + +def _noop(library: Path) -> None: + pass + + +def walk_through_owlbot_dirs(dir: Path): + """ + Walks through all API packages in google-cloud-node/packages + + Returns: + A list of client libs + """ + owlbot_dirs = [] + for path_object in dir.glob("packages/**/.OwlBot.yaml"): + if path_object.is_file(): + owlbot_dirs.append(str(Path(path_object).parents[0])) + + return owlbot_dirs + + +def owlbot_main( + relative_dir, + template_path: Optional[Path] = None, + staging_excludes: Optional[List[str]] = None, + templates_excludes: Optional[List[str]] = None, + patch_staging: Callable[[Path], None] = _noop, +) -> None: + """Copies files from staging and template directories into current working dir. + + Args: + template_path: path to template directory; omit except in tests. + staging_excludes: paths to ignore when copying from the staging directory + templates_excludes: paths to ignore when copying generated templates + patch_staging: callback function runs on each staging directory before + copying it into repo root. Add your regular expression substitution code + here. + + When there is no owlbot.py file, run this function instead. Also, when an + owlbot.py file is necessary, the first statement of owlbot.py should probably + call this function. + + Depends on owl-bot copying into a staging directory, so your .Owlbot.yaml should + look a lot like this: + + docker: + image: gcr.io/repo-automation-bots/owlbot-nodejs:latest + + deep-remove-regex: + - /owl-bot-staging + + deep-copy-regex: + - source: /google/cloud/video/transcoder/(.*)/.*-nodejs/(.*) + dest: /owl-bot-staging/$1/$2 + + Also, this function requires a default_version in your .repo-metadata.json. Ex: + "default_version": "v1", + """ + if staging_excludes is None: + staging_excludes = default_staging_excludes + if templates_excludes is None: + templates_excludes = default_templates_excludes + + logging.basicConfig(level=logging.DEBUG) + # Load the default version defined in .repo-metadata.json. + default_version = json.load( + open(Path(relative_dir, ".repo-metadata.json").resolve(), "rt") + ).get("default_version") + staging = Path("owl-bot-staging", Path(relative_dir).name).resolve() + s_copy = transforms.move + if default_version is None: + logger.info("No default version found in .repo-metadata.json. Ok.") + elif staging.is_dir(): + logger.info(f"Copying files from staging directory ${staging}.") + # Collect the subdirectories of the staging directory. + versions = [v.name for v in staging.iterdir() if v.is_dir()] + # Reorder the versions so the default version always comes last. + versions = [v for v in versions if v != default_version] + [default_version] + logger.info(f"Collected versions ${versions} from ${staging}") + + # Copy each version directory into the root. + for version in versions: + library = staging / version + _tracked_paths.add(library) + patch_staging(library) + s_copy([library], destination=relative_dir, excludes=staging_excludes) + # The staging directory should never be merged into the main branch. + shutil.rmtree(staging) + else: + # Collect the subdirectories of the src directory. + src = Path(Path(relative_dir), "src").resolve() + versions = [v.name for v in src.iterdir() if v.is_dir()] + # Reorder the versions so the default version always comes last. + versions = [v for v in versions if v != default_version] + [default_version] + logger.info(f"Collected versions ${versions} from ${src}") + + common_templates = gcp.CommonTemplates(template_path) + common_templates.excludes.extend(templates_excludes) + if default_version: + templates = common_templates.node_mono_repo_library( + relative_dir=relative_dir, + source_location="build/src", + versions=versions, + default_version=default_version, + ) + s_copy([templates], destination=relative_dir, excludes=templates_excludes) + postprocess_gapic_library_hermetic() + else: + templates = common_templates.node_mono_repo_library( + relative_dir=relative_dir, source_location="build/src" + ) + s_copy([templates], destination=relative_dir, excludes=templates_excludes) + + library_version = template_metadata(str(Path(relative_dir))).get("version") + if library_version: + common.update_library_version( + library_version, + str(Path(relative_dir, _GENERATED_SAMPLES_DIRECTORY).resolve()), + ) + + +def owlbot_entrypoint( + template_path: Optional[Path] = None, + staging_excludes: Optional[List[str]] = None, + templates_excludes: Optional[List[str]] = None, + patch_staging: Callable[[Path], None] = _noop, +): + owlbot_dirs = walk_through_owlbot_dirs(Path.cwd()) + for dir in owlbot_dirs: + owlbot_main( + dir, template_path, staging_excludes, templates_excludes, patch_staging + ) + + +if __name__ == "__main__": + owlbot_entrypoint() diff --git a/tests/fixtures/nodejs_mono_repo_with_staging/owl-bot-staging/dlp/v2/README.md b/tests/fixtures/nodejs_mono_repo_with_staging/owl-bot-staging/dlp/v2/README.md new file mode 100644 index 000000000..cb63619c6 --- /dev/null +++ b/tests/fixtures/nodejs_mono_repo_with_staging/owl-bot-staging/dlp/v2/README.md @@ -0,0 +1 @@ +Dlp: Nodejs Client diff --git a/tests/fixtures/nodejs_mono_repo_with_staging/owl-bot-staging/dlp/v2/linkinator.config.json b/tests/fixtures/nodejs_mono_repo_with_staging/owl-bot-staging/dlp/v2/linkinator.config.json new file mode 100644 index 000000000..29a223b6d --- /dev/null +++ b/tests/fixtures/nodejs_mono_repo_with_staging/owl-bot-staging/dlp/v2/linkinator.config.json @@ -0,0 +1,10 @@ +{ + "recurse": true, + "skip": [ + "https://codecov.io/gh/googleapis/", + "www.googleapis.com", + "img.shields.io" + ], + "silent": true, + "concurrency": 10 +} diff --git a/tests/fixtures/nodejs_mono_repo_with_staging/owl-bot-staging/dlp/v2/package.json b/tests/fixtures/nodejs_mono_repo_with_staging/owl-bot-staging/dlp/v2/package.json new file mode 100644 index 000000000..d4d9a739e --- /dev/null +++ b/tests/fixtures/nodejs_mono_repo_with_staging/owl-bot-staging/dlp/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.10.3" + }, + "devDependencies": { + "@types/mocha": "^8.2.1", + "@types/node": "^14.14.32", + "@types/sinon": "^9.0.11", + "c8": "^7.6.0", + "gts": "^3.1.0", + "jsdoc": "^3.6.6", + "jsdoc-fresh": "^1.0.2", + "jsdoc-region-tag": "^1.0.6", + "linkinator": "^2.13.6", + "mocha": "^8.3.1", + "null-loader": "^4.0.1", + "pack-n-play": "^1.0.0-2", + "sinon": "^9.2.4", + "ts-loader": "^8.0.17", + "typescript": "^4.2.3", + "webpack": "^5.24.4", + "webpack-cli": "^4.5.0" + }, + "engines": { + "node": ">=v10.24.0" + } +} diff --git a/tests/fixtures/nodejs_mono_repo_with_staging/owl-bot-staging/dlp/v2/protos/google/privacy/dlp/v2/dlp.proto b/tests/fixtures/nodejs_mono_repo_with_staging/owl-bot-staging/dlp/v2/protos/google/privacy/dlp/v2/dlp.proto new file mode 100644 index 000000000..3fb0c2193 --- /dev/null +++ b/tests/fixtures/nodejs_mono_repo_with_staging/owl-bot-staging/dlp/v2/protos/google/privacy/dlp/v2/dlp.proto @@ -0,0 +1,4379 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// 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/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"; +import "google/api/annotations.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: "*" + } + }; + 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: "*" + } + }; + 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. + // Early access feature is in a pre-release state and might change or have + // limited support. For more information, see + // https://cloud.google.com/products#product-launch-stages. + 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/*}" + } + }; + 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" + } + }; + 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/*}" + } + }; + 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" + } + }; + 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. + // Early access feature is in a pre-release state and might change or have + // limited support. For more information, see + // https://cloud.google.com/products#product-launch-stages. + 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. + // Early access feature is in a pre-release state and might change or have + // limited support. For more information, see + // https://cloud.google.com/products#product-launch-stages. + 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. + 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. + FindingLimits limits = 3; + + // When true, a contextual quote from the data that triggered a finding is + // included in the response; see Finding.quote. + bool include_quote = 4; + + // When true, excludes type information of the findings. + 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. + 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. + 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; + + // 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-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" + }]; +} + +// 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. + // Early access feature is in a pre-release state and might change or have + // limited support. For more information, see + // https://cloud.google.com/products#product-launch-stages. + HybridInspectStatistics hybrid_stats = 7; + } + + // The configuration used for this job. + RequestedOptions requested_options = 2; + + // A summary of the outcome of this inspect 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 + 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; + } +} + +// 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. + 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 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}, i.e if lower_bound = 10 and upper_bound = 20 +// all values that are within this bucket will be replaced with "10-20". +// +// This can be used on data of type: double, long. +// +// If the bound Value type differs from the type of data +// being transformed, we will first attempt converting the type of the data to +// be transformed to match the type of the bound before comparing. +// +// See https://cloud.google.com/dlp/docs/concepts-bucketing to learn more. +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 KMS). +// When using KMS to wrap/unwrap DEKs, be sure to set an appropriate +// IAM policy on the KMS CryptoKey (KEK) to ensure an attacker cannot +// unwrap the data crypto key. +message CryptoKey { + // Sources of crypto keys. + oneof source { + // Transient crypto key + TransientCryptoKey transient = 1; + + // Unwrapped crypto key + UnwrappedCryptoKey unwrapped = 2; + + // Kms wrapped key + 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/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 +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. + 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 { + // 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; + } + + // 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; + + // 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 triggeredJobs. +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. + // Early access feature is in a pre-release state and might change or have + // limited support. For more information, see + // https://cloud.google.com/products#product-launch-stages. + 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 Cloud Data Catalog. Labels summarizing the + // results of the DlpJob will be applied to the entry for the resource scanned + // in Cloud Data Catalog. Any labels previously written by another DlpJob will + // be deleted. InfoType naming patterns are strictly enforced when using this + // feature. Note that the findings will be persisted in Cloud Data Catalog + // storage and are governed by Data Catalog service-specific policy, see + // https://cloud.google.com/terms/service-terms + // Only a single instance of this action can be specified and only allowed if + // all resources being scanned are BigQuery tables. + // Compatible with: Inspect + 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 { + // Set to control what and how to inspect. + InspectJobConfig inspect_job = 2; + + // Set to choose what metric to calculate. + 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 jobs: + // - `status` - HEALTHY|PAUSED|CANCELLED + // - `inspected_storage` - DATASTORE|CLOUD_STORAGE|BIGQUERY + // - 'last_run_time` - RFC 3339 formatted timestamp, surrounded by + // quotation marks. Nanoseconds are ignored. + // - 'error_count' - Number of errors that have occurred while running. + // * The operator must be `=` or `!=` for status and inspected_storage. + // + // Examples: + // + // * inspected_storage = cloud_storage AND status = HEALTHY + // * inspected_storage = cloud_storage OR inspected_storage = bigquery + // * inspected_storage = cloud_storage AND (state = PAUSED OR state = HEALTHY) + // * last_run_time > \"2017-12-12T00:00:00+00:00\" + // + // The length of this field should be no more than 500 characters. + string filter = 5; + + // 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; +} + +// Options describing which parts of the provided content should be scanned. +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 { + // Unused + DLP_JOB_TYPE_UNSPECIFIED = 0; + + // The job inspected Google Cloud for sensitive data. + INSPECT_JOB = 1; + + // The job executed a Risk Analysis computation. + RISK_ANALYSIS_JOB = 2; +} + +// 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/tests/fixtures/nodejs_mono_repo_with_staging/owl-bot-staging/dlp/v2/protos/google/privacy/dlp/v2/storage.proto b/tests/fixtures/nodejs_mono_repo_with_staging/owl-bot-staging/dlp/v2/protos/google/privacy/dlp/v2/storage.proto new file mode 100644 index 000000000..6ded28b16 --- /dev/null +++ b/tests/fixtures/nodejs_mono_repo_with_staging/owl-bot-staging/dlp/v2/protos/google/privacy/dlp/v2/storage.proto @@ -0,0 +1,740 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// 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"; +import "google/api/annotations.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; +} + +// 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 { + // 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; +} + +// 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; +} + +// 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. + 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. + 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; +} + +// 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. + // Early access feature is in a pre-release state and might change or have + // limited support. For more information, see + // https://cloud.google.com/products#product-launch-stages. + HybridOptions hybrid_options = 9; + } + + 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, brf, c, cc, cpp, csv, cxx, c++, cs, css, dart, eml, go, h, hh, hpp, + // hxx, h++, hs, html, htm, shtml, shtm, xhtml, lhs, ini, java, js, json, + // ocaml, md, mkd, markdown, m, ml, mli, pl, pm, php, phtml, pht, py, pyw, + // rb, rbw, rs, rc, scala, sh, sql, tex, txt, text, tsv, vcard, vcs, wml, + // xml, xsl, xsd, yml, yaml. + TEXT_FILE = 2; + + // Included file extensions: + // bmp, gif, jpg, jpeg, jpe, png. + // bytes_limit_per_file has no effect on image files. + // Image 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 { + // 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/tests/fixtures/nodejs_mono_repo_with_staging/owl-bot-staging/dlp/v2/src/index.ts b/tests/fixtures/nodejs_mono_repo_with_staging/owl-bot-staging/dlp/v2/src/index.ts new file mode 100644 index 000000000..13be31a28 --- /dev/null +++ b/tests/fixtures/nodejs_mono_repo_with_staging/owl-bot-staging/dlp/v2/src/index.ts @@ -0,0 +1,27 @@ +// 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. +// +// ** 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} + +// This file originated in the staging directory. \ No newline at end of file diff --git a/tests/fixtures/nodejs_mono_repo_with_staging/owl-bot-staging/dlp/v2/src/v2/dlp_service_client.ts b/tests/fixtures/nodejs_mono_repo_with_staging/owl-bot-staging/dlp/v2/src/v2/dlp_service_client.ts new file mode 100644 index 000000000..43fc2bba1 --- /dev/null +++ b/tests/fixtures/nodejs_mono_repo_with_staging/owl-bot-staging/dlp/v2/src/v2/dlp_service_client.ts @@ -0,0 +1,5246 @@ +// 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. +// +// ** 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 * as path from 'path'; + +import { Transform } from 'stream'; +import { RequestType } from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; +/** + * 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 _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: {}, + }; + 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; + 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 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}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + // For Node.js, pass the path to JSON proto file. + // For browsers, pass the JSON content. + + const nodejsProtoPath = path.join(__dirname, '..', '..', 'protos', 'protos.json'); + this._protos = this._gaxGrpc.loadProto( + opts.fallback ? + // eslint-disable-next-line @typescript-eslint/no-var-requires + require("../../protos/protos.json") : + nodejsProtoPath + ); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + 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 = {}; + } + + /** + * 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) 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 -- + // ------------------- + 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; +/** + * 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 + * const [response] = await client.inspectContent(request); + */ + 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); + } + 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; +/** + * 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 + * const [response] = await client.redactImage(request); + */ + 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); + } + 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; +/** + * 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 + * const [response] = await client.deidentifyContent(request); + */ + 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); + } + 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; +/** + * 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 + * const [response] = await client.reidentifyContent(request); + */ + 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); + } + 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; +/** + * 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 + * const [response] = await client.listInfoTypes(request); + */ + 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); + } + 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; +/** + * 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 + * const [response] = await client.createInspectTemplate(request); + */ + 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); + } + 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; +/** + * 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 + * const [response] = await client.updateInspectTemplate(request); + */ + 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); + } + 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; +/** + * 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 + * const [response] = await client.getInspectTemplate(request); + */ + 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); + } + 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; +/** + * 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 + * const [response] = await client.deleteInspectTemplate(request); + */ + 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); + } + 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; +/** + * 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 + * const [response] = await client.createDeidentifyTemplate(request); + */ + 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); + } + 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; +/** + * 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 + * const [response] = await client.updateDeidentifyTemplate(request); + */ + 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); + } + 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; +/** + * 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 + * const [response] = await client.getDeidentifyTemplate(request); + */ + 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); + } + 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; +/** + * 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 + * const [response] = await client.deleteDeidentifyTemplate(request); + */ + 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); + } + 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; +/** + * 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 + * const [response] = await client.createJobTrigger(request); + */ + 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); + } + 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; +/** + * 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 + * const [response] = await client.updateJobTrigger(request); + */ + 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); + } + 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; +/** + * 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. + * Early access feature is in a pre-release state and might change or have + * limited support. For more information, see + * https://cloud.google.com/products#product-launch-stages. + * + * @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 + * const [response] = await client.hybridInspectJobTrigger(request); + */ + 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); + } + 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; +/** + * 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 + * const [response] = await client.getJobTrigger(request); + */ + 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); + } + 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; +/** + * 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 + * const [response] = await client.deleteJobTrigger(request); + */ + 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); + } + 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; +/** + * 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 + * const [response] = await client.activateJobTrigger(request); + */ + 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); + } + 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; +/** + * 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 + * Set to control what and how to inspect. + * @param {google.privacy.dlp.v2.RiskAnalysisJobConfig} request.riskJob + * Set to choose what metric to calculate. + * @param {string} request.jobId + * The job id can contain uppercase and lowercase letters, + * numbers, and hyphens; that is, it must match the regular + * expression: `[a-zA-Z\d-_]+`. The maximum length is 100 + * characters. Can be empty to allow the system to generate one. + * @param {string} request.locationId + * 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 + * const [response] = await client.createDlpJob(request); + */ + 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); + } + 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; +/** + * 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 + * const [response] = await client.getDlpJob(request); + */ + 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); + } + 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; +/** + * 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 + * const [response] = await client.deleteDlpJob(request); + */ + 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); + } + 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; +/** + * 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 + * const [response] = await client.cancelDlpJob(request); + */ + 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); + } + 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; +/** + * 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 + * const [response] = await client.createStoredInfoType(request); + */ + 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); + } + 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; +/** + * 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 + * const [response] = await client.updateStoredInfoType(request); + */ + 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); + } + 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; +/** + * 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 + * const [response] = await client.getStoredInfoType(request); + */ + 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); + } + 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; +/** + * 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 + * const [response] = await client.deleteStoredInfoType(request); + */ + 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); + } + 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; +/** + * Inspect hybrid content and store findings to a job. + * To review the findings inspect the job. Inspection will occur + * asynchronously. + * Early access feature is in a pre-release state and might change or have + * limited support. For more information, see + * https://cloud.google.com/products#product-launch-stages. + * + * @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 + * const [response] = await client.hybridInspectDlpJob(request); + */ + 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); + } + 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; +/** + * Finish a running hybrid DlpJob. Triggers the finalization steps and running + * of any enabled actions that have not yet run. + * Early access feature is in a pre-release state and might change or have + * limited support. For more information, see + * https://cloud.google.com/products#product-launch-stages. + * + * @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 + * const [response] = await client.finishDlpJob(request); + */ + 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); + } + + 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; +/** + * 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, + 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 callSettings = new gax.CallSettings(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 + * const iterable = client.listInspectTemplatesAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + 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 || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.listInspectTemplates.asyncIterate( + this.innerApiCalls['listInspectTemplates'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + 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; +/** + * 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, + 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 callSettings = new gax.CallSettings(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 + * const iterable = client.listDeidentifyTemplatesAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + 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 || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.listDeidentifyTemplates.asyncIterate( + this.innerApiCalls['listDeidentifyTemplates'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + 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; +/** + * 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 jobs: + * - `status` - HEALTHY|PAUSED|CANCELLED + * - `inspected_storage` - DATASTORE|CLOUD_STORAGE|BIGQUERY + * - 'last_run_time` - RFC 3339 formatted timestamp, surrounded by + * quotation marks. Nanoseconds are ignored. + * - 'error_count' - Number of errors that have occurred while running. + * * The operator must be `=` or `!=` for status and inspected_storage. + * + * Examples: + * + * * inspected_storage = cloud_storage AND status = HEALTHY + * * inspected_storage = cloud_storage OR inspected_storage = bigquery + * * inspected_storage = cloud_storage AND (state = PAUSED OR state = HEALTHY) + * * last_run_time > \"2017-12-12T00:00:00+00:00\" + * + * The length of this field should be no more than 500 characters. + * @param {string} request.locationId + * 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, + 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 jobs: + * - `status` - HEALTHY|PAUSED|CANCELLED + * - `inspected_storage` - DATASTORE|CLOUD_STORAGE|BIGQUERY + * - 'last_run_time` - RFC 3339 formatted timestamp, surrounded by + * quotation marks. Nanoseconds are ignored. + * - 'error_count' - Number of errors that have occurred while running. + * * The operator must be `=` or `!=` for status and inspected_storage. + * + * Examples: + * + * * inspected_storage = cloud_storage AND status = HEALTHY + * * inspected_storage = cloud_storage OR inspected_storage = bigquery + * * inspected_storage = cloud_storage AND (state = PAUSED OR state = HEALTHY) + * * last_run_time > \"2017-12-12T00:00:00+00:00\" + * + * The length of this field should be no more than 500 characters. + * @param {string} request.locationId + * 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 callSettings = new gax.CallSettings(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 jobs: + * - `status` - HEALTHY|PAUSED|CANCELLED + * - `inspected_storage` - DATASTORE|CLOUD_STORAGE|BIGQUERY + * - 'last_run_time` - RFC 3339 formatted timestamp, surrounded by + * quotation marks. Nanoseconds are ignored. + * - 'error_count' - Number of errors that have occurred while running. + * * The operator must be `=` or `!=` for status and inspected_storage. + * + * Examples: + * + * * inspected_storage = cloud_storage AND status = HEALTHY + * * inspected_storage = cloud_storage OR inspected_storage = bigquery + * * inspected_storage = cloud_storage AND (state = PAUSED OR state = HEALTHY) + * * last_run_time > \"2017-12-12T00:00:00+00:00\" + * + * The length of this field should be no more than 500 characters. + * @param {string} request.locationId + * 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 + * const iterable = client.listJobTriggersAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + 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 || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.listJobTriggers.asyncIterate( + this.innerApiCalls['listJobTriggers'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + 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; +/** + * 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, + 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 callSettings = new gax.CallSettings(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 + * const iterable = client.listDlpJobsAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + 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 || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.listDlpJobs.asyncIterate( + this.innerApiCalls['listDlpJobs'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + 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; +/** + * 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, + 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 callSettings = new gax.CallSettings(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 + * const iterable = client.listStoredInfoTypesAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + 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 || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(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 { + this.initialize(); + if (!this._terminated) { + return this.dlpServiceStub!.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/tests/fixtures/nodejs_mono_repo_with_staging/owl-bot-staging/dlp/v2/src/v2/dlp_service_client_config.json b/tests/fixtures/nodejs_mono_repo_with_staging/owl-bot-staging/dlp/v2/src/v2/dlp_service_client_config.json new file mode 100644 index 000000000..bcdbe63fe --- /dev/null +++ b/tests/fixtures/nodejs_mono_repo_with_staging/owl-bot-staging/dlp/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/tests/fixtures/nodejs_mono_repo_with_staging/owl-bot-staging/dlp/v2/src/v2/dlp_service_proto_list.json b/tests/fixtures/nodejs_mono_repo_with_staging/owl-bot-staging/dlp/v2/src/v2/dlp_service_proto_list.json new file mode 100644 index 000000000..482924bde --- /dev/null +++ b/tests/fixtures/nodejs_mono_repo_with_staging/owl-bot-staging/dlp/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/tests/fixtures/nodejs_mono_repo_with_staging/owl-bot-staging/dlp/v2/src/v2/gapic_metadata.json b/tests/fixtures/nodejs_mono_repo_with_staging/owl-bot-staging/dlp/v2/src/v2/gapic_metadata.json new file mode 100644 index 000000000..e82d006d6 --- /dev/null +++ b/tests/fixtures/nodejs_mono_repo_with_staging/owl-bot-staging/dlp/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/tests/fixtures/nodejs_mono_repo_with_staging/owl-bot-staging/dlp/v2/src/v2/index.ts b/tests/fixtures/nodejs_mono_repo_with_staging/owl-bot-staging/dlp/v2/src/v2/index.ts new file mode 100644 index 000000000..2e558b1cf --- /dev/null +++ b/tests/fixtures/nodejs_mono_repo_with_staging/owl-bot-staging/dlp/v2/src/v2/index.ts @@ -0,0 +1,19 @@ +// 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. +// +// ** 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/tests/fixtures/nodejs_mono_repo_with_staging/owl-bot-staging/dlp/v2/system-test/fixtures/sample/src/index.js b/tests/fixtures/nodejs_mono_repo_with_staging/owl-bot-staging/dlp/v2/system-test/fixtures/sample/src/index.js new file mode 100644 index 000000000..e29c33569 --- /dev/null +++ b/tests/fixtures/nodejs_mono_repo_with_staging/owl-bot-staging/dlp/v2/system-test/fixtures/sample/src/index.js @@ -0,0 +1,27 @@ +// 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. +// +// ** 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/tests/fixtures/nodejs_mono_repo_with_staging/owl-bot-staging/dlp/v2/system-test/fixtures/sample/src/index.ts b/tests/fixtures/nodejs_mono_repo_with_staging/owl-bot-staging/dlp/v2/system-test/fixtures/sample/src/index.ts new file mode 100644 index 000000000..56e734bc1 --- /dev/null +++ b/tests/fixtures/nodejs_mono_repo_with_staging/owl-bot-staging/dlp/v2/system-test/fixtures/sample/src/index.ts @@ -0,0 +1,32 @@ +// 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. +// +// ** 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/tests/fixtures/nodejs_mono_repo_with_staging/owl-bot-staging/dlp/v2/system-test/install.ts b/tests/fixtures/nodejs_mono_repo_with_staging/owl-bot-staging/dlp/v2/system-test/install.ts new file mode 100644 index 000000000..1f850b522 --- /dev/null +++ b/tests/fixtures/nodejs_mono_repo_with_staging/owl-bot-staging/dlp/v2/system-test/install.ts @@ -0,0 +1,49 @@ +// 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. +// +// ** 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/tests/fixtures/nodejs_mono_repo_with_staging/owl-bot-staging/dlp/v2/test/gapic_dlp_service_v2.ts b/tests/fixtures/nodejs_mono_repo_with_staging/owl-bot-staging/dlp/v2/test/gapic_dlp_service_v2.ts new file mode 100644 index 000000000..c4c610fc1 --- /dev/null +++ b/tests/fixtures/nodejs_mono_repo_with_staging/owl-bot-staging/dlp/v2/test/gapic_dlp_service_v2.ts @@ -0,0 +1,4524 @@ +// 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. +// +// ** 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', () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + client.close(); + }); + + 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)); + }); + }); + + 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)); + }); + }); + + 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)); + }); + }); + + 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)); + }); + }); + + 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)); + }); + }); + + 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)); + }); + }); + + 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)); + }); + }); + + 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)); + }); + }); + + 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)); + }); + }); + + 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)); + }); + }); + + 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)); + }); + }); + + 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)); + }); + }); + + 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)); + }); + }); + + 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)); + }); + }); + + 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)); + }); + }); + + 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)); + }); + }); + + 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)); + }); + }); + + 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)); + }); + }); + + 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)); + }); + }); + + 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)); + }); + }); + + 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)); + }); + }); + + 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)); + }); + }); + + 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)); + }); + }); + + 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)); + }); + }); + + 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)); + }); + }); + + 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)); + }); + }); + + 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)); + }); + }); + + 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)); + }); + }); + + 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)); + }); + }); + + 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/tests/fixtures/nodejs_mono_repo_with_staging/owl-bot-staging/dlp/v2/tsconfig.json b/tests/fixtures/nodejs_mono_repo_with_staging/owl-bot-staging/dlp/v2/tsconfig.json new file mode 100644 index 000000000..c78f1c884 --- /dev/null +++ b/tests/fixtures/nodejs_mono_repo_with_staging/owl-bot-staging/dlp/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/tests/fixtures/nodejs_mono_repo_with_staging/owl-bot-staging/dlp/v2/webpack.config.js b/tests/fixtures/nodejs_mono_repo_with_staging/owl-bot-staging/dlp/v2/webpack.config.js new file mode 100644 index 000000000..4eaa37156 --- /dev/null +++ b/tests/fixtures/nodejs_mono_repo_with_staging/owl-bot-staging/dlp/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', +}; diff --git a/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/.OwlBot.yaml b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/.OwlBot.yaml new file mode 100644 index 000000000..8e121ba68 --- /dev/null +++ b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/.OwlBot.yaml @@ -0,0 +1,23 @@ +# 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 +# +# 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. +docker: + image: gcr.io/repo-automation-bots/owlbot-nodejs:latest + +deep-remove-regex: + - /owl-bot-staging + +deep-copy-regex: + - source: /google/privacy/dlp/(.*)/.*-nodejs/(.*) + dest: /owl-bot-staging/dlp/$1/$2 + diff --git a/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/.eslintignore b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/.eslintignore new file mode 100644 index 000000000..9340ad9b8 --- /dev/null +++ b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/.eslintignore @@ -0,0 +1,6 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ diff --git a/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/.eslintrc.json b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/.eslintrc.json new file mode 100644 index 000000000..782153495 --- /dev/null +++ b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/gts" +} diff --git a/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/.gitattributes b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/.gitattributes new file mode 100644 index 000000000..33739cb74 --- /dev/null +++ b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/.gitattributes @@ -0,0 +1,4 @@ +*.ts text eol=lf +*.js text eol=lf +protos/* linguist-generated +**/api-extractor.json linguist-language=JSON-with-Comments diff --git a/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/.gitignore b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/.gitignore new file mode 100644 index 000000000..5d32b2378 --- /dev/null +++ b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/.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/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/.jsdoc.js b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/.jsdoc.js new file mode 100644 index 000000000..797d40d19 --- /dev/null +++ b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/.jsdoc.js @@ -0,0 +1,55 @@ +// 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. +// +// ** 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 2021 Google LLC', + includeDate: false, + sourceFiles: false, + systemName: '@google-cloud/dlp', + theme: 'lumen', + default: { + outputSourceFiles: false + } + }, + markdown: { + idInHeadings: true + } +}; diff --git a/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/.mocharc.js b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/.mocharc.js new file mode 100644 index 000000000..0b600509b --- /dev/null +++ b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/.mocharc.js @@ -0,0 +1,29 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// 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. +const config = { + "enable-source-maps": true, + "throw-deprecation": true, + "timeout": 10000, + "recursive": true +} +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/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/.nycrc b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/.nycrc new file mode 100644 index 000000000..b18d5472b --- /dev/null +++ b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/.nycrc @@ -0,0 +1,24 @@ +{ + "report-dir": "./.coverage", + "reporter": ["text", "lcov"], + "exclude": [ + "**/*-test", + "**/.coverage", + "**/apis", + "**/benchmark", + "**/conformance", + "**/docs", + "**/samples", + "**/scripts", + "**/protos", + "**/test", + "**/*.d.ts", + ".jsdoc.js", + "**/.jsdoc.js", + "karma.conf.js", + "webpack-tests.config.js", + "webpack.config.js" + ], + "exclude-after-remap": false, + "all": true +} diff --git a/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/.prettierignore b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/.prettierignore new file mode 100644 index 000000000..9340ad9b8 --- /dev/null +++ b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/.prettierignore @@ -0,0 +1,6 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ diff --git a/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/.prettierrc.js b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/.prettierrc.js new file mode 100644 index 000000000..d1b95106f --- /dev/null +++ b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/.prettierrc.js @@ -0,0 +1,17 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +module.exports = { + ...require('gts/.prettierrc.json') +} diff --git a/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/.readme-partials.yml b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/.readme-partials.yml new file mode 100644 index 000000000..99f553664 --- /dev/null +++ b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/.readme-partials.yml @@ -0,0 +1,4 @@ +introduction: |- + The [Data Loss Prevention API](https://cloud.google.com/dlp/docs/) provides programmatic access to a + powerful detection engine for personally identifiable information and other privacy-sensitive + data in unstructured data streams. diff --git a/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/.repo-metadata.json b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/.repo-metadata.json new file mode 100644 index 000000000..9ec11a208 --- /dev/null +++ b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/.repo-metadata.json @@ -0,0 +1,14 @@ +{ + "client_documentation": "https://googleapis.dev/nodejs/dlp/latest", + "api_id": "dlp.googleapis.com", + "distribution_name": "@google-cloud/dlp", + "release_level": "stable", + "default_version": "v2", + "language": "nodejs", + "name_pretty": "Cloud Data Loss Prevention", + "repo": "googleapis/nodejs-dlp", + "product_documentation": "https://cloud.google.com/dlp/docs/", + "requires_billing": true, + "name": "dlp", + "issue_tracker": "https://issuetracker.google.com/savedsearches/5548083" +} diff --git a/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/.trampolinerc b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/.trampolinerc new file mode 100644 index 000000000..164613b9e --- /dev/null +++ b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/.trampolinerc @@ -0,0 +1,51 @@ +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# 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. + +# Template for .trampolinerc + +# Add required env vars here. +required_envvars+=( +) + +# Add env vars which are passed down into the container here. +pass_down_envvars+=( + "AUTORELEASE_PR" +) + +# Prevent unintentional override on the default image. +if [[ "${TRAMPOLINE_IMAGE_UPLOAD:-false}" == "true" ]] && \ + [[ -z "${TRAMPOLINE_IMAGE:-}" ]]; then + echo "Please set TRAMPOLINE_IMAGE if you want to upload the Docker image." + exit 1 +fi + +# Define the default value if it makes sense. +if [[ -z "${TRAMPOLINE_IMAGE_UPLOAD:-}" ]]; then + TRAMPOLINE_IMAGE_UPLOAD="" +fi + +if [[ -z "${TRAMPOLINE_IMAGE:-}" ]]; then + TRAMPOLINE_IMAGE="" +fi + +if [[ -z "${TRAMPOLINE_DOCKERFILE:-}" ]]; then + TRAMPOLINE_DOCKERFILE="" +fi + +if [[ -z "${TRAMPOLINE_BUILD_FILE:-}" ]]; then + TRAMPOLINE_BUILD_FILE="" +fi + +# Secret Manager secrets. +source ${PROJECT_ROOT}/.kokoro/populate-secrets.sh diff --git a/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/CHANGELOG.md b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/CHANGELOG.md new file mode 100644 index 000000000..b20038d83 --- /dev/null +++ b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/CHANGELOG.md @@ -0,0 +1,399 @@ +# Changelog + +[npm history][1] + +[1]: https://www.npmjs.com/package/PACKAGE NAME?activeTab=versions + +## [3.1.0](https://www.github.com/googleapis/nodejs-dlp/compare/v3.0.6...v3.1.0) (2021-01-09) + + +### Features + +* adds style enumeration ([#569](https://www.github.com/googleapis/nodejs-dlp/issues/569)) ([3c8acf2](https://www.github.com/googleapis/nodejs-dlp/commit/3c8acf24523f2b130abc48bb18927ccac6cb6c3a)) + +### [3.0.6](https://www.github.com/googleapis/nodejs-dlp/compare/v3.0.5...v3.0.6) (2020-11-25) + + +### Bug Fixes + +* **window:** check for fetch on window ([8d9d49f](https://www.github.com/googleapis/nodejs-dlp/commit/8d9d49f9d9fbfec291ca0c3cf1bef64870cc8e3d)) + +### [3.0.5](https://www.github.com/googleapis/nodejs-dlp/compare/v3.0.4...v3.0.5) (2020-11-07) + + +### Bug Fixes + +* do not modify options object, use defaultScopes ([#560](https://www.github.com/googleapis/nodejs-dlp/issues/560)) ([5b29b1d](https://www.github.com/googleapis/nodejs-dlp/commit/5b29b1df9205e4f59a48c31f9ce6a2e2a9f18936)) + +### [3.0.4](https://www.github.com/googleapis/nodejs-dlp/compare/v3.0.3...v3.0.4) (2020-10-15) + + +### Bug Fixes + +* retrieve job config for risk analysis jobs; docs: clarify timespan config for BigQuery and Datastore. ([#547](https://www.github.com/googleapis/nodejs-dlp/issues/547)) ([3b25dd6](https://www.github.com/googleapis/nodejs-dlp/commit/3b25dd66350ca5729ddebe48f0a3718b756633ae)) + +### [3.0.3](https://www.github.com/googleapis/nodejs-dlp/compare/v3.0.2...v3.0.3) (2020-09-12) + + +### Bug Fixes + +* **deps:** update dependency yargs to v16 ([#536](https://www.github.com/googleapis/nodejs-dlp/issues/536)) ([39db29a](https://www.github.com/googleapis/nodejs-dlp/commit/39db29adcef20b7baed4b8a4351d12bcf2bc605f)) + +### [3.0.2](https://www.github.com/googleapis/nodejs-dlp/compare/v3.0.1...v3.0.2) (2020-07-15) + + +### Bug Fixes + +* **samples:** include locations/global in parent field ([#488](https://www.github.com/googleapis/nodejs-dlp/issues/488)) ([a5ec2f3](https://www.github.com/googleapis/nodejs-dlp/commit/a5ec2f3baafbc770336596bdfe4737b61aba947e)) + +### [3.0.1](https://www.github.com/googleapis/nodejs-dlp/compare/v3.0.0...v3.0.1) (2020-06-15) + + +### Bug Fixes + +* proper fallback option handling ([#486](https://www.github.com/googleapis/nodejs-dlp/issues/486)) ([11cd656](https://www.github.com/googleapis/nodejs-dlp/commit/11cd656e3d980d8bf87f045f4cd22379134b6e44)) + +## [3.0.0](https://www.github.com/googleapis/nodejs-dlp/compare/v2.2.0...v3.0.0) (2020-05-26) + + +### ⚠ BREAKING CHANGES + +* The library now supports Node.js v10+. The last version to support Node.js v8 is tagged legacy-8 on NPM. + +### Features + +* adds missing fields to Finding and adds support for hybrid jobs ([#435](https://www.github.com/googleapis/nodejs-dlp/issues/435)) ([3643d02](https://www.github.com/googleapis/nodejs-dlp/commit/3643d0218cabecd40bd04c86bc51d3fa3be21666)) +* drop node8 support, support for async iterators ([#440](https://www.github.com/googleapis/nodejs-dlp/issues/440)) ([82a2091](https://www.github.com/googleapis/nodejs-dlp/commit/82a2091f8c948b303c03629ecf77dc8cefb3248c)) + + +### Bug Fixes + +* embedding location into parent ([#476](https://www.github.com/googleapis/nodejs-dlp/issues/476)) ([9308a6a](https://www.github.com/googleapis/nodejs-dlp/commit/9308a6ace48a4128def4a408f18a75b0d74a359a)), closes [#474](https://www.github.com/googleapis/nodejs-dlp/issues/474) +* regen protos and tests, fix formatting ([#467](https://www.github.com/googleapis/nodejs-dlp/issues/467)) ([9924817](https://www.github.com/googleapis/nodejs-dlp/commit/9924817d39a4eec302d461092c3d8f3c292dcc17)) +* remove eslint, update gax, fix generated protos, run the generator ([#449](https://www.github.com/googleapis/nodejs-dlp/issues/449)) ([e00c5da](https://www.github.com/googleapis/nodejs-dlp/commit/e00c5dac055785dd361bf51d587e2a174f3d40a6)) +* sample inspect customInfoTypes infoType name ([#439](https://www.github.com/googleapis/nodejs-dlp/issues/439)) ([07ef721](https://www.github.com/googleapis/nodejs-dlp/commit/07ef72156567d3fe8318fc95fe187dd2f3868516)) +* support request params {key} with no =value ([#463](https://www.github.com/googleapis/nodejs-dlp/issues/463)) ([e3ef1c6](https://www.github.com/googleapis/nodejs-dlp/commit/e3ef1c69529775d16984fc381e6af47a13264b99)) +* synth.py clean up for multiple version ([#469](https://www.github.com/googleapis/nodejs-dlp/issues/469)) ([5f2cb9b](https://www.github.com/googleapis/nodejs-dlp/commit/5f2cb9ba9e6d8957cda0bd8495a72f96dcabd9c2)) +* **deps:** update dependency @google-cloud/pubsub to v2 ([#475](https://www.github.com/googleapis/nodejs-dlp/issues/475)) ([b6ce129](https://www.github.com/googleapis/nodejs-dlp/commit/b6ce1297fa179dc0a8cc9b97797acb2e05d22574)) + +## [2.2.0](https://www.github.com/googleapis/nodejs-dlp/compare/v2.1.0...v2.2.0) (2020-03-06) + + +### Features + +* deferred client initialization ([#420](https://www.github.com/googleapis/nodejs-dlp/issues/420)) ([a37da40](https://www.github.com/googleapis/nodejs-dlp/commit/a37da4095bab94a8d3539c67e9fcda4620d6e3a1)) + +## [2.1.0](https://www.github.com/googleapis/nodejs-dlp/compare/v2.0.1...v2.1.0) (2020-02-29) + + +### Features + +* export protos in src/index.ts ([dc75b9e](https://www.github.com/googleapis/nodejs-dlp/commit/dc75b9e104378f001f819086c434f574341e5b92)) + +### [2.0.1](https://www.github.com/googleapis/nodejs-dlp/compare/v2.0.0...v2.0.1) (2020-02-12) + + +### Bug Fixes + +* pass x-goog-request-params header for streaming calls ([ad49a5b](https://www.github.com/googleapis/nodejs-dlp/commit/ad49a5b645e65d256f7db5804e4410692952dc3a)) + +## [2.0.0](https://www.github.com/googleapis/nodejs-dlp/compare/v1.9.0...v2.0.0) (2020-01-28) + + +### ⚠ BREAKING CHANGES + +* move to typescript code generation (#393) + +### Features + +* move to typescript code generation ([#393](https://www.github.com/googleapis/nodejs-dlp/issues/393)) ([67e0811](https://www.github.com/googleapis/nodejs-dlp/commit/67e08118c6c64e525b9ac1e7363353acf1cb0875)) + +## [1.9.0](https://www.github.com/googleapis/nodejs-dlp/compare/v1.8.0...v1.9.0) (2019-12-30) + + +### Features + +* introduces locationId ([745f3c1](https://www.github.com/googleapis/nodejs-dlp/commit/745f3c1112e8968dd088e8c5cd90863ecbad6679)) + +## [1.8.0](https://www.github.com/googleapis/nodejs-dlp/compare/v1.7.1...v1.8.0) (2019-12-05) + + +### Features + +* add plural and singular resource descriptor ([#365](https://www.github.com/googleapis/nodejs-dlp/issues/365)) ([29e876b](https://www.github.com/googleapis/nodejs-dlp/commit/29e876b70c39d0e4533d151132139c52ad8767fe)) + + +### Bug Fixes + +* **deps:** pin TypeScript below 3.7.0 ([346b756](https://www.github.com/googleapis/nodejs-dlp/commit/346b7564e7b97c77ede1483207b83faef3aae6c1)) +* **docs:** bump release level to GA ([#363](https://www.github.com/googleapis/nodejs-dlp/issues/363)) ([67dfc81](https://www.github.com/googleapis/nodejs-dlp/commit/67dfc816ec097b91248a0a9f63e39d25c90c5647)) + +### [1.7.1](https://www.github.com/googleapis/nodejs-dlp/compare/v1.7.0...v1.7.1) (2019-11-18) + + +### Bug Fixes + +* **deps:** update dependency yargs to v15 ([#361](https://www.github.com/googleapis/nodejs-dlp/issues/361)) ([884c89e](https://www.github.com/googleapis/nodejs-dlp/commit/884c89e4f01fa66fe86c33a6d1d5b5fa4c9c94e2)) + +## [1.7.0](https://www.github.com/googleapis/nodejs-dlp/compare/v1.6.1...v1.7.0) (2019-11-14) + + +### Features + +* add support for publishToStackdriver field ([#358](https://www.github.com/googleapis/nodejs-dlp/issues/358)) ([5e5a384](https://www.github.com/googleapis/nodejs-dlp/commit/5e5a384a6ee122f7fd3bf07e04892dd70d748897)) + + +### Bug Fixes + +* **docs:** snippets are now replaced in jsdoc comments ([#357](https://www.github.com/googleapis/nodejs-dlp/issues/357)) ([678fad7](https://www.github.com/googleapis/nodejs-dlp/commit/678fad7dbe3d0c3255de61edd253b02947e2f9ab)) + +### [1.6.1](https://www.github.com/googleapis/nodejs-dlp/compare/v1.6.0...v1.6.1) (2019-10-22) + + +### Bug Fixes + +* **deps:** bump google-gax to 1.7.5 ([#351](https://www.github.com/googleapis/nodejs-dlp/issues/351)) ([bd3d7de](https://www.github.com/googleapis/nodejs-dlp/commit/bd3d7de8bbaa8d3ce88420fd6ecf7d0483283bf8)) + +## [1.6.0](https://www.github.com/googleapis/nodejs-dlp/compare/v1.5.0...v1.6.0) (2019-10-08) + + +### Bug Fixes + +* **deps:** update dependency @google-cloud/pubsub to v1 ([#339](https://www.github.com/googleapis/nodejs-dlp/issues/339)) ([7b44459](https://www.github.com/googleapis/nodejs-dlp/commit/7b44459)) +* use compatible version of google-gax ([37f3b5b](https://www.github.com/googleapis/nodejs-dlp/commit/37f3b5b)) + + +### Features + +* .d.ts for protos ([#342](https://www.github.com/googleapis/nodejs-dlp/issues/342)) ([1eea5f5](https://www.github.com/googleapis/nodejs-dlp/commit/1eea5f5)) + +## [1.5.0](https://www.github.com/googleapis/nodejs-dlp/compare/v1.4.0...v1.5.0) (2019-09-12) + + +### Bug Fixes + +* **deps:** update dependency yargs to v14 ([#328](https://www.github.com/googleapis/nodejs-dlp/issues/328)) ([92e53b9](https://www.github.com/googleapis/nodejs-dlp/commit/92e53b9)) + + +### Features + +* load protos from JSON, grpc-fallback support ([#330](https://www.github.com/googleapis/nodejs-dlp/issues/330)) ([9403ebe](https://www.github.com/googleapis/nodejs-dlp/commit/9403ebe)) + +## [1.4.0](https://www.github.com/googleapis/nodejs-dlp/compare/v1.3.1...v1.4.0) (2019-07-09) + + +### Features + +* add DataCatalog action to DlpJobs ([#317](https://www.github.com/googleapis/nodejs-dlp/issues/317)) ([92d0252](https://www.github.com/googleapis/nodejs-dlp/commit/92d0252)) + +### [1.3.1](https://www.github.com/googleapis/nodejs-dlp/compare/v1.3.0...v1.3.1) (2019-06-26) + + +### Bug Fixes + +* **docs:** link to reference docs section on googleapis.dev ([#313](https://www.github.com/googleapis/nodejs-dlp/issues/313)) ([3a7b991](https://www.github.com/googleapis/nodejs-dlp/commit/3a7b991)) + +## [1.3.0](https://www.github.com/googleapis/nodejs-dlp/compare/v1.2.1...v1.3.0) (2019-06-19) + + +### Features + +* add avro support ([#310](https://www.github.com/googleapis/nodejs-dlp/issues/310)) ([ac4f6d9](https://www.github.com/googleapis/nodejs-dlp/commit/ac4f6d9)) + +### [1.2.1](https://www.github.com/googleapis/nodejs-dlp/compare/v1.2.0...v1.2.1) (2019-06-16) + + +### Bug Fixes + +* **docs:** move to new client docs URL ([#306](https://www.github.com/googleapis/nodejs-dlp/issues/306)) ([c2c018d](https://www.github.com/googleapis/nodejs-dlp/commit/c2c018d)) + +## [1.2.0](https://www.github.com/googleapis/nodejs-dlp/compare/v1.1.0...v1.2.0) (2019-06-06) + + +### Features + +* add statistics about storedInfoType version ([#301](https://www.github.com/googleapis/nodejs-dlp/issues/301)) ([4482d02](https://www.github.com/googleapis/nodejs-dlp/commit/4482d02)) +* support apiEndpoint override in client constructor ([#299](https://www.github.com/googleapis/nodejs-dlp/issues/299)) ([663545c](https://www.github.com/googleapis/nodejs-dlp/commit/663545c)) + +## [1.1.0](https://www.github.com/googleapis/nodejs-dlp/compare/v1.0.0...v1.1.0) (2019-05-28) + + +### Features + +* auto-generate READMEs, add .repo-metdata.json ([#293](https://www.github.com/googleapis/nodejs-dlp/issues/293)) ([6895e23](https://www.github.com/googleapis/nodejs-dlp/commit/6895e23)) + +## [1.0.0](https://www.github.com/googleapis/nodejs-dlp/compare/v0.12.0...v1.0.0) (2019-05-20) + + +### ⚠ BREAKING CHANGES + +* upgrade engines field to >=8.10.0 (#272) + +### Bug Fixes + +* DEADLINE_EXCEEDED no longer treated as idempotent and retried ([1a0000c](https://www.github.com/googleapis/nodejs-dlp/commit/1a0000c)) +* DEADLINE_EXCEEDED retry code is idempotent ([#281](https://www.github.com/googleapis/nodejs-dlp/issues/281)) ([9c00cf6](https://www.github.com/googleapis/nodejs-dlp/commit/9c00cf6)) +* **deps:** update dependency @google-cloud/pubsub to ^0.29.0 ([#283](https://www.github.com/googleapis/nodejs-dlp/issues/283)) ([b1f9ee1](https://www.github.com/googleapis/nodejs-dlp/commit/b1f9ee1)) +* **deps:** update dependency google-gax to ^0.26.0 ([#270](https://www.github.com/googleapis/nodejs-dlp/issues/270)) ([68258a6](https://www.github.com/googleapis/nodejs-dlp/commit/68258a6)) +* **deps:** update dependency google-gax to v1 ([#280](https://www.github.com/googleapis/nodejs-dlp/issues/280)) ([2cbb997](https://www.github.com/googleapis/nodejs-dlp/commit/2cbb997)) + + +### Build System + +* upgrade engines field to >=8.10.0 ([#272](https://www.github.com/googleapis/nodejs-dlp/issues/272)) ([233e814](https://www.github.com/googleapis/nodejs-dlp/commit/233e814)) + +## v0.12.0 + +04-26-2019 12:39 PDT + +### New Features + +- feat: add x-goog-request-params header +- feat: add deterministic encryption ([#263](https://github.com/googleapis/nodejs-dlp/pull/263)) + +## v0.11.0 + +03-12-2019 15:22 PDT + +Greetings! This release has a few new features, bug fixes, and doc updates. Enjoy! + +### New Features +- feat: add support for triggers and matching types ([#243](https://github.com/googleapis/nodejs-dlp/pull/243)) + +### Bug Fixes +- fix: throw on invalid credentials ([#238](https://github.com/googleapis/nodejs-dlp/pull/238)) + +### Dependencies +- fix(deps): update dependency google-gax to ^0.25.0 ([#226](https://github.com/googleapis/nodejs-dlp/pull/226)) + +### Documentation +- docs: update links in contrib guide ([#240](https://github.com/googleapis/nodejs-dlp/pull/240)) +- docs: move CONTRIBUTING.md to root ([#231](https://github.com/googleapis/nodejs-dlp/pull/231)) +- docs: update samples in comments ([#230](https://github.com/googleapis/nodejs-dlp/pull/230)) +- docs: update contributing path in README ([#232](https://github.com/googleapis/nodejs-dlp/pull/232)) +- docs: add lint/fix example to contributing guide ([#228](https://github.com/googleapis/nodejs-dlp/pull/228)) + +### Internal / Testing Changes +- fix(deps): update dependency @google-cloud/pubsub to ^0.28.0 ([#253](https://github.com/googleapis/nodejs-dlp/pull/253)) +- refactor: update json import paths ([#254](https://github.com/googleapis/nodejs-dlp/pull/254)) +- build: Add docuploader credentials to node publish jobs ([#251](https://github.com/googleapis/nodejs-dlp/pull/251)) +- build: use node10 to run samples-test, system-test etc ([#250](https://github.com/googleapis/nodejs-dlp/pull/250)) +- chore: update release config and proto formatting +- chore: sync latest proto docs ([#245](https://github.com/googleapis/nodejs-dlp/pull/245)) +- fix(test): increase minLikelihood option threshold to VERY_LIKELY ([#248](https://github.com/googleapis/nodejs-dlp/pull/248)) +- chore(deps): update dependency mocha to v6 +- fix(deps): update dependency yargs to v13 ([#235](https://github.com/googleapis/nodejs-dlp/pull/235)) +- build: use linkinator for docs test ([#239](https://github.com/googleapis/nodejs-dlp/pull/239)) +- refactor: modernize the sample tests ([#237](https://github.com/googleapis/nodejs-dlp/pull/237)) +- build: create docs test npm scripts ([#234](https://github.com/googleapis/nodejs-dlp/pull/234)) +- build: test using @grpc/grpc-js in CI ([#233](https://github.com/googleapis/nodejs-dlp/pull/233)) +- chore(deps): update dependency eslint-config-prettier to v4 ([#223](https://github.com/googleapis/nodejs-dlp/pull/223)) +- chore: update the copyright date in the header. ([#224](https://github.com/googleapis/nodejs-dlp/pull/224)) +- build: ignore googleapis.com in doc link check ([#220](https://github.com/googleapis/nodejs-dlp/pull/220)) +- build: check broken links in generated docs ([#213](https://github.com/googleapis/nodejs-dlp/pull/213)) +- fix(samples-test): increase likelihood threshold ([#222](https://github.com/googleapis/nodejs-dlp/pull/222)) + +## v0.10.0 + +01-04-2019 15:04 PST + +### New Features +- feat: add excluded field field for storage ([#169](https://github.com/googleapis/nodejs-dlp/pull/169)) +- feat: add support for storedInfoTypes ([#157](https://github.com/googleapis/nodejs-dlp/pull/157)) +- feat: add CloudStorageRegexFileSet ([#153](https://github.com/googleapis/nodejs-dlp/pull/153)) +- feat: add sorting and ordering of results ([#147](https://github.com/googleapis/nodejs-dlp/pull/147)) + +### Dependencies +- fix(deps): update dependency @google-cloud/pubsub to ^0.22.0 ([#192](https://github.com/googleapis/nodejs-dlp/pull/192)) +- fix(deps): update dependency @google-cloud/pubsub to ^0.21.0 ([#183](https://github.com/googleapis/nodejs-dlp/pull/183)) +- fix(deps): update dependency google-gax to ^0.22.0 ([#182](https://github.com/googleapis/nodejs-dlp/pull/182)) +- chore(deps): update dependency @google-cloud/nodejs-repo-tools to v3 ([#180](https://github.com/googleapis/nodejs-dlp/pull/180)) +- chore(deps): update dependency eslint-plugin-node to v8 ([#170](https://github.com/googleapis/nodejs-dlp/pull/170)) +- chore(deps): update dependency eslint-plugin-prettier to v3 ([#151](https://github.com/googleapis/nodejs-dlp/pull/151)) +- fix(deps): update dependency @google-cloud/pubsub to ^0.20.0 ([#137](https://github.com/googleapis/nodejs-dlp/pull/137)) +- fix(deps): update dependency google-gax to ^0.20.0 ([#138](https://github.com/googleapis/nodejs-dlp/pull/138)) + +### Documentation +- samples: Added custom dictionary and regex code samples ([#204](https://github.com/googleapis/nodejs-dlp/pull/204)) +- refactor(samples): convert sample tests from ava to mocha ([#186](https://github.com/googleapis/nodejs-dlp/pull/186)) +- docs: update readme badges ([#194](https://github.com/googleapis/nodejs-dlp/pull/194)) +- docs(samples): samples to use async/await ([#190](https://github.com/googleapis/nodejs-dlp/pull/190)) + +### Internal / Testing Changes +- nit: reordered gRPC message types ([#214](https://github.com/googleapis/nodejs-dlp/pull/214)) +- tests: construct pubsub properly ([#143](https://github.com/googleapis/nodejs-dlp/pull/143)) +- chore(build): inject yoshi automation key ([#209](https://github.com/googleapis/nodejs-dlp/pull/209)) +- chore: update nyc and eslint configs ([#208](https://github.com/googleapis/nodejs-dlp/pull/208)) +- chore: fix publish.sh permission +x ([#206](https://github.com/googleapis/nodejs-dlp/pull/206)) +- fix(build): fix Kokoro release script ([#205](https://github.com/googleapis/nodejs-dlp/pull/205)) +- build: add Kokoro configs for autorelease ([#203](https://github.com/googleapis/nodejs-dlp/pull/203)) +- chore: add synth.metadata ([#201](https://github.com/googleapis/nodejs-dlp/pull/201)) +- chore: always nyc report before calling codecov ([#199](https://github.com/googleapis/nodejs-dlp/pull/199)) +- chore: nyc ignore build/test by default ([#198](https://github.com/googleapis/nodejs-dlp/pull/198)) +- chore: update license file ([#196](https://github.com/googleapis/nodejs-dlp/pull/196)) +- fix(build): fix system key decryption ([#191](https://github.com/googleapis/nodejs-dlp/pull/191)) +- build: fix the lint rules ([#187](https://github.com/googleapis/nodejs-dlp/pull/187)) +- chore: update eslintignore config ([#181](https://github.com/googleapis/nodejs-dlp/pull/181)) +- chore: drop contributors from multiple places ([#179](https://github.com/googleapis/nodejs-dlp/pull/179)) +- chore: use latest npm on Windows ([#178](https://github.com/googleapis/nodejs-dlp/pull/178)) +- chore: update CircleCI config ([#177](https://github.com/googleapis/nodejs-dlp/pull/177)) +- chore: include build in eslintignore ([#174](https://github.com/googleapis/nodejs-dlp/pull/174)) +- chore: update issue templates ([#168](https://github.com/googleapis/nodejs-dlp/pull/168)) +- chore: remove old issue template ([#166](https://github.com/googleapis/nodejs-dlp/pull/166)) +- build: run tests on node11 ([#165](https://github.com/googleapis/nodejs-dlp/pull/165)) +- chores(build): do not collect sponge.xml from windows builds ([#164](https://github.com/googleapis/nodejs-dlp/pull/164)) +- chores(build): run codecov on continuous builds ([#163](https://github.com/googleapis/nodejs-dlp/pull/163)) +- chore: update new issue template ([#162](https://github.com/googleapis/nodejs-dlp/pull/162)) +- build: fix codecov uploading on Kokoro ([#156](https://github.com/googleapis/nodejs-dlp/pull/156)) +- Update kokoro config ([#152](https://github.com/googleapis/nodejs-dlp/pull/152)) +- build: prevent system/sample-test from leaking credentials +- test: remove appveyor config ([#146](https://github.com/googleapis/nodejs-dlp/pull/146)) +- Update the kokoro config ([#145](https://github.com/googleapis/nodejs-dlp/pull/145)) +- Fix the linter ([#142](https://github.com/googleapis/nodejs-dlp/pull/142)) +- Enable prefer-const in the eslint config ([#141](https://github.com/googleapis/nodejs-dlp/pull/141)) +- Enable no-var in eslint ([#140](https://github.com/googleapis/nodejs-dlp/pull/140)) +- Switch to let/const ([#139](https://github.com/googleapis/nodejs-dlp/pull/139)) + +## v0.9.0 + +### New Features +- Bring in new feature: + - StoredInfoTypes + +### Dependencies +- chore(deps): update dependency eslint-config-prettier to v3 (#110) +- chore(deps): lock file maintenance (#104) +- chore(deps): lock file maintenance (#103) +- fix(deps): update dependency google-gax to ^0.18.0 (#100) +- chore(deps): lock file maintenance (#99) +- chore(deps): lock file maintenance (#94) +- chore(deps): update dependency eslint-plugin-node to v7 (#91) +- chore(deps): lock file maintenance (#90) + +### Documentation +- doc: add missing namespace (#108) +- DLP sample: Add autoPopulateTimespan option for creating job triggers. (#64) +- feat: Add code samples for DLP text redaction (#61) + +### Internal / Testing Changes +- Update synth.py (#112) +- test: use strictEqual in tests (#92) +- chore: do not use npm ci (#107) +- chore: ignore package-lock.json (#105) +- chore: update renovate config (#102) +- remove that whitespace (#101) +- chore: move mocha options to mocha.opts (#97) +- chore: add node templates to synth.py (#95) +- fix: requiring samples/ node engine >7.6 because async/await was used (#93) + +## v0.8.0 + +### BREAKING CHANGE +- fix: drop support for node.js 4.x and 9.x (#81) + +### Documentation +- docs: export google.privacy.* namespace instead of google.cloud.* so rpc doc links work (#80) + +### Internal / Testing Changes +- chore(build): use `npm ci` instead of `npm install` (#86) +- chore: really delete node4 and node9 (#83) diff --git a/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/CODE_OF_CONDUCT.md b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/CODE_OF_CONDUCT.md new file mode 100644 index 000000000..2add2547a --- /dev/null +++ b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/CODE_OF_CONDUCT.md @@ -0,0 +1,94 @@ + +# Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, gender identity and expression, level of +experience, education, socio-economic status, nationality, personal appearance, +race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or + advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions that are +not aligned to this Code of Conduct, or to ban temporarily or permanently any +contributor for other behaviors that they deem inappropriate, threatening, +offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +This Code of Conduct also applies outside the project spaces when the Project +Steward has a reasonable belief that an individual's behavior may have a +negative impact on the project or its community. + +## Conflict Resolution + +We do not believe that all conflict is bad; healthy debate and disagreement +often yield positive results. However, it is never okay to be disrespectful or +to engage in behavior that violates the project’s code of conduct. + +If you see someone violating the code of conduct, you are encouraged to address +the behavior directly with those involved. Many issues can be resolved quickly +and easily, and this gives people more control over the outcome of their +dispute. If you are unable to resolve the matter for any reason, or if the +behavior is threatening or harassing, report it. We are dedicated to providing +an environment where participants feel welcome and safe. + +Reports should be directed to *googleapis-stewards@google.com*, the +Project Steward(s) for *Google Cloud Client Libraries*. It is the Project Steward’s duty to +receive and address reported violations of the code of conduct. They will then +work with a committee consisting of representatives from the Open Source +Programs Office and the Google Open Source Strategy team. If for any reason you +are uncomfortable reaching out to the Project Steward, please email +opensource@google.com. + +We will investigate every complaint, but you may not receive a direct response. +We will use our discretion in determining when and how to follow up on reported +incidents, which may range from not taking action to permanent expulsion from +the project and project-sponsored spaces. We will notify the accused of the +report and provide them an opportunity to discuss it before any action is taken. +The identity of the reporter will be omitted from the details of the report +supplied to the accused. In potentially harmful situations, such as ongoing +harassment or threats to anyone's safety, we may take action without notice. + +## Attribution + +This Code of Conduct is adapted from the Contributor Covenant, version 1.4, +available at +https://www.contributor-covenant.org/version/1/4/code-of-conduct.html \ No newline at end of file diff --git a/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/CONTRIBUTING.md b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/CONTRIBUTING.md new file mode 100644 index 000000000..167fbe1bc --- /dev/null +++ b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/CONTRIBUTING.md @@ -0,0 +1,76 @@ +# How to become a contributor and submit your own code + +**Table of contents** + +* [Contributor License Agreements](#contributor-license-agreements) +* [Contributing a patch](#contributing-a-patch) +* [Running the tests](#running-the-tests) +* [Releasing the library](#releasing-the-library) + +## Contributor License Agreements + +We'd love to accept your sample apps and patches! Before we can take them, we +have to jump a couple of legal hurdles. + +Please fill out either the individual or corporate Contributor License Agreement +(CLA). + + * If you are an individual writing original source code and you're sure you + own the intellectual property, then you'll need to sign an [individual CLA](https://developers.google.com/open-source/cla/individual). + * If you work for a company that wants to allow you to contribute your work, + then you'll need to sign a [corporate CLA](https://developers.google.com/open-source/cla/corporate). + +Follow either of the two links above to access the appropriate CLA and +instructions for how to sign and return it. Once we receive it, we'll be able to +accept your pull requests. + +## Contributing A Patch + +1. Submit an issue describing your proposed change to the repo in question. +1. The repo owner will respond to your issue promptly. +1. If your proposed change is accepted, and you haven't already done so, sign a + Contributor License Agreement (see details above). +1. Fork the desired repo, develop and test your code changes. +1. Ensure that your code adheres to the existing style in the code to which + you are contributing. +1. Ensure that your code has an appropriate set of tests which all pass. +1. Title your pull request following [Conventional Commits](https://www.conventionalcommits.org/) styling. +1. Submit a pull request. + +### Before you begin + +1. [Select or create a Cloud Platform project][projects]. +1. [Enable billing for your project][billing]. +1. [Enable the Cloud Data Loss Prevention API][enable_api]. +1. [Set up authentication with a service account][auth] so you can access the + API from your local workstation. + + +## Running the tests + +1. [Prepare your environment for Node.js setup][setup]. + +1. Install dependencies: + + npm install + +1. Run the tests: + + # Run unit tests. + npm test + + # Run sample integration tests. + npm run samples-test + + # Run all system tests. + npm run system-test + +1. Lint (and maybe fix) any changes: + + npm run fix + +[setup]: https://cloud.google.com/nodejs/docs/setup +[projects]: https://console.cloud.google.com/project +[billing]: https://support.google.com/cloud/answer/6293499#enable-billing +[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=dlp.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started \ No newline at end of file diff --git a/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/LICENSE b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/LICENSE new file mode 100644 index 000000000..d64569567 --- /dev/null +++ b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + 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. diff --git a/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/README.md b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/README.md new file mode 100644 index 000000000..52019f59e --- /dev/null +++ b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/README.md @@ -0,0 +1,226 @@ +[//]: # "This README.md file is auto-generated, all changes to this file will be lost." +[//]: # "To regenerate it, use `python -m synthtool`." +Google Cloud Platform logo + +# [Cloud Data Loss Prevention: Node.js Client](https://github.com/googleapis/nodejs-dlp) + +[![release level](https://img.shields.io/badge/release%20level-general%20availability%20%28GA%29-brightgreen.svg?style=flat)](https://cloud.google.com/terms/launch-stages) +[![npm version](https://img.shields.io/npm/v/@google-cloud/dlp.svg)](https://www.npmjs.org/package/@google-cloud/dlp) +[![codecov](https://img.shields.io/codecov/c/github/googleapis/nodejs-dlp/master.svg?style=flat)](https://codecov.io/gh/googleapis/nodejs-dlp) + + + + +The [Data Loss Prevention API](https://cloud.google.com/dlp/docs/) provides programmatic access to a +powerful detection engine for personally identifiable information and other privacy-sensitive +data in unstructured data streams. + + +A comprehensive list of changes in each version may be found in +[the CHANGELOG](https://github.com/googleapis/nodejs-dlp/blob/master/CHANGELOG.md). + +* [Cloud Data Loss Prevention Node.js Client API Reference][client-docs] +* [Cloud Data Loss Prevention Documentation][product-docs] +* [github.com/googleapis/nodejs-dlp](https://github.com/googleapis/nodejs-dlp) + +Read more about the client libraries for Cloud APIs, including the older +Google APIs Client Libraries, in [Client Libraries Explained][explained]. + +[explained]: https://cloud.google.com/apis/docs/client-libraries-explained + +**Table of contents:** + + +* [Quickstart](#quickstart) + * [Before you begin](#before-you-begin) + * [Installing the client library](#installing-the-client-library) + * [Using the client library](#using-the-client-library) +* [Samples](#samples) +* [Versioning](#versioning) +* [Contributing](#contributing) +* [License](#license) + +## Quickstart + +### Before you begin + +1. [Select or create a Cloud Platform project][projects]. +1. [Enable billing for your project][billing]. +1. [Enable the Cloud Data Loss Prevention API][enable_api]. +1. [Set up authentication with a service account][auth] so you can access the + API from your local workstation. + +### Installing the client library + +```bash +npm install @google-cloud/dlp +``` + + +### Using the client library + +```javascript + +// Instantiates a client +const dlp = new DLP.DlpServiceClient(); + +// The string to inspect +const string = 'Robert Frost'; + +// The project ID to run the API call under +// const projectId = 'my-project'; + +async function quickStart() { + // The minimum likelihood required before returning a match + const minLikelihood = 'LIKELIHOOD_UNSPECIFIED'; + + // The maximum number of findings to report (0 = server maximum) + const maxFindings = 0; + + // The infoTypes of information to match + const infoTypes = [{name: 'PERSON_NAME'}, {name: 'US_STATE'}]; + + // Whether to include the matching string + const includeQuote = true; + + // Construct item to inspect + const item = {value: string}; + + // Construct request + const request = { + parent: `projects/${projectId}/locations/global`, + inspectConfig: { + infoTypes: infoTypes, + minLikelihood: minLikelihood, + limits: { + maxFindingsPerRequest: maxFindings, + }, + includeQuote: includeQuote, + }, + item: item, + }; + + // Run request + const [response] = await dlp.inspectContent(request); + const findings = response.result.findings; + if (findings.length > 0) { + console.log('Findings:'); + findings.forEach(finding => { + if (includeQuote) { + console.log(`\tQuote: ${finding.quote}`); + } + console.log(`\tInfo type: ${finding.infoType.name}`); + console.log(`\tLikelihood: ${finding.likelihood}`); + }); + } else { + console.log('No findings.'); + } +} +quickStart(); + +``` + + + +## Samples + +Samples are in the [`samples/`](https://github.com/googleapis/nodejs-dlp/tree/master/samples) directory. Each sample's `README.md` has instructions for running its sample. + +| Sample | Source Code | Try it | +| --------------------------- | --------------------------------- | ------ | +| Categorical Risk Analysis | [source code](https://github.com/googleapis/nodejs-dlp/blob/master/samples/categoricalRiskAnalysis.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-dlp&page=editor&open_in_editor=samples/categoricalRiskAnalysis.js,samples/README.md) | +| Inspect Templates | [source code](https://github.com/googleapis/nodejs-dlp/blob/master/samples/createInspectTemplate.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-dlp&page=editor&open_in_editor=samples/createInspectTemplate.js,samples/README.md) | +| Job Triggers | [source code](https://github.com/googleapis/nodejs-dlp/blob/master/samples/createTrigger.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-dlp&page=editor&open_in_editor=samples/createTrigger.js,samples/README.md) | +| Deidentify with Date Shift | [source code](https://github.com/googleapis/nodejs-dlp/blob/master/samples/deidentifyWithDateShift.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-dlp&page=editor&open_in_editor=samples/deidentifyWithDateShift.js,samples/README.md) | +| Deidentify with FPE | [source code](https://github.com/googleapis/nodejs-dlp/blob/master/samples/deidentifyWithFpe.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-dlp&page=editor&open_in_editor=samples/deidentifyWithFpe.js,samples/README.md) | +| Deidentify with Mask | [source code](https://github.com/googleapis/nodejs-dlp/blob/master/samples/deidentifyWithMask.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-dlp&page=editor&open_in_editor=samples/deidentifyWithMask.js,samples/README.md) | +| Deidentify with Replacement | [source code](https://github.com/googleapis/nodejs-dlp/blob/master/samples/deidentifyWithReplacement.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-dlp&page=editor&open_in_editor=samples/deidentifyWithReplacement.js,samples/README.md) | +| Delete Inspect Templates | [source code](https://github.com/googleapis/nodejs-dlp/blob/master/samples/deleteInspectTemplate.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-dlp&page=editor&open_in_editor=samples/deleteInspectTemplate.js,samples/README.md) | +| Delete Job | [source code](https://github.com/googleapis/nodejs-dlp/blob/master/samples/deleteJob.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-dlp&page=editor&open_in_editor=samples/deleteJob.js,samples/README.md) | +| Delete Trigger | [source code](https://github.com/googleapis/nodejs-dlp/blob/master/samples/deleteTrigger.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-dlp&page=editor&open_in_editor=samples/deleteTrigger.js,samples/README.md) | +| Inspect Bigquery | [source code](https://github.com/googleapis/nodejs-dlp/blob/master/samples/inspectBigQuery.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-dlp&page=editor&open_in_editor=samples/inspectBigQuery.js,samples/README.md) | +| Inspect Datastore | [source code](https://github.com/googleapis/nodejs-dlp/blob/master/samples/inspectDatastore.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-dlp&page=editor&open_in_editor=samples/inspectDatastore.js,samples/README.md) | +| Inspect File | [source code](https://github.com/googleapis/nodejs-dlp/blob/master/samples/inspectFile.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-dlp&page=editor&open_in_editor=samples/inspectFile.js,samples/README.md) | +| Inspect GCS File | [source code](https://github.com/googleapis/nodejs-dlp/blob/master/samples/inspectGCSFile.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-dlp&page=editor&open_in_editor=samples/inspectGCSFile.js,samples/README.md) | +| Inspects strings | [source code](https://github.com/googleapis/nodejs-dlp/blob/master/samples/inspectString.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-dlp&page=editor&open_in_editor=samples/inspectString.js,samples/README.md) | +| kAnonymity Analysis | [source code](https://github.com/googleapis/nodejs-dlp/blob/master/samples/kAnonymityAnalysis.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-dlp&page=editor&open_in_editor=samples/kAnonymityAnalysis.js,samples/README.md) | +| kMap Estimation Analysis | [source code](https://github.com/googleapis/nodejs-dlp/blob/master/samples/kMapEstimationAnalysis.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-dlp&page=editor&open_in_editor=samples/kMapEstimationAnalysis.js,samples/README.md) | +| l Diversity Analysis | [source code](https://github.com/googleapis/nodejs-dlp/blob/master/samples/lDiversityAnalysis.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-dlp&page=editor&open_in_editor=samples/lDiversityAnalysis.js,samples/README.md) | +| List Inspect Templates | [source code](https://github.com/googleapis/nodejs-dlp/blob/master/samples/listInspectTemplates.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-dlp&page=editor&open_in_editor=samples/listInspectTemplates.js,samples/README.md) | +| List jobs | [source code](https://github.com/googleapis/nodejs-dlp/blob/master/samples/listJobs.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-dlp&page=editor&open_in_editor=samples/listJobs.js,samples/README.md) | +| List Triggers | [source code](https://github.com/googleapis/nodejs-dlp/blob/master/samples/listTriggers.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-dlp&page=editor&open_in_editor=samples/listTriggers.js,samples/README.md) | +| Metadata | [source code](https://github.com/googleapis/nodejs-dlp/blob/master/samples/metadata.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-dlp&page=editor&open_in_editor=samples/metadata.js,samples/README.md) | +| Numerical Risk Analysis | [source code](https://github.com/googleapis/nodejs-dlp/blob/master/samples/numericalRiskAnalysis.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-dlp&page=editor&open_in_editor=samples/numericalRiskAnalysis.js,samples/README.md) | +| Quickstart | [source code](https://github.com/googleapis/nodejs-dlp/blob/master/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-dlp&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) | +| Redact Image | [source code](https://github.com/googleapis/nodejs-dlp/blob/master/samples/redactImage.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-dlp&page=editor&open_in_editor=samples/redactImage.js,samples/README.md) | +| Redact Text | [source code](https://github.com/googleapis/nodejs-dlp/blob/master/samples/redactText.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-dlp&page=editor&open_in_editor=samples/redactText.js,samples/README.md) | +| Reidentify with FPE | [source code](https://github.com/googleapis/nodejs-dlp/blob/master/samples/reidentifyWithFpe.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-dlp&page=editor&open_in_editor=samples/reidentifyWithFpe.js,samples/README.md) | + + + +The [Cloud Data Loss Prevention Node.js Client API Reference][client-docs] documentation +also contains samples. + +## Supported Node.js Versions + +Our client libraries follow the [Node.js release schedule](https://nodejs.org/en/about/releases/). +Libraries are compatible with all current _active_ and _maintenance_ versions of +Node.js. + +Client libraries targeting some end-of-life versions of Node.js are available, and +can be installed via npm [dist-tags](https://docs.npmjs.com/cli/dist-tag). +The dist-tags follow the naming convention `legacy-(version)`. + +_Legacy Node.js versions are supported as a best effort:_ + +* Legacy versions will not be tested in continuous integration. +* Some security patches may not be able to be backported. +* Dependencies will not be kept up-to-date, and features will not be backported. + +#### Legacy tags available + +* `legacy-8`: install client libraries from this dist-tag for versions + compatible with Node.js 8. + +## Versioning + +This library follows [Semantic Versioning](http://semver.org/). + + +This library is considered to be **General Availability (GA)**. This means it +is stable; the code surface will not change in backwards-incompatible ways +unless absolutely necessary (e.g. because of critical security issues) or with +an extensive deprecation period. Issues and requests against **GA** libraries +are addressed with the highest priority. + + + + + +More Information: [Google Cloud Platform Launch Stages][launch_stages] + +[launch_stages]: https://cloud.google.com/terms/launch-stages + +## Contributing + +Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/nodejs-dlp/blob/master/CONTRIBUTING.md). + +Please note that this `README.md`, the `samples/README.md`, +and a variety of configuration files in this repository (including `.nycrc` and `tsconfig.json`) +are generated from a central template. To edit one of these files, make an edit +to its template in this +[directory](https://github.com/googleapis/synthtool/tree/master/synthtool/gcp/templates/node_library). + +## License + +Apache Version 2.0 + +See [LICENSE](https://github.com/googleapis/nodejs-dlp/blob/master/LICENSE) + +[client-docs]: https://googleapis.dev/nodejs/dlp/latest +[product-docs]: https://cloud.google.com/dlp/docs/ +[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png +[projects]: https://console.cloud.google.com/project +[billing]: https://support.google.com/cloud/answer/6293499#enable-billing +[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=dlp.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started diff --git a/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/api-extractor.json b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/api-extractor.json new file mode 100644 index 000000000..de228294b --- /dev/null +++ b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/api-extractor.json @@ -0,0 +1,369 @@ +/** + * Config file for API Extractor. For more info, please visit: https://api-extractor.com + */ +{ + "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", + + /** + * Optionally specifies another JSON config file that this file extends from. This provides a way for + * standard settings to be shared across multiple projects. + * + * If the path starts with "./" or "../", the path is resolved relative to the folder of the file that contains + * the "extends" field. Otherwise, the first path segment is interpreted as an NPM package name, and will be + * resolved using NodeJS require(). + * + * SUPPORTED TOKENS: none + * DEFAULT VALUE: "" + */ + // "extends": "./shared/api-extractor-base.json" + // "extends": "my-package/include/api-extractor-base.json" + + /** + * Determines the "" token that can be used with other config file settings. The project folder + * typically contains the tsconfig.json and package.json config files, but the path is user-defined. + * + * The path is resolved relative to the folder of the config file that contains the setting. + * + * The default value for "projectFolder" is the token "", which means the folder is determined by traversing + * parent folders, starting from the folder containing api-extractor.json, and stopping at the first folder + * that contains a tsconfig.json file. If a tsconfig.json file cannot be found in this way, then an error + * will be reported. + * + * SUPPORTED TOKENS: + * DEFAULT VALUE: "" + */ + // "projectFolder": "..", + + /** + * (REQUIRED) Specifies the .d.ts file to be used as the starting point for analysis. API Extractor + * analyzes the symbols exported by this module. + * + * The file extension must be ".d.ts" and not ".ts". + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * SUPPORTED TOKENS: , , + */ + "mainEntryPointFilePath": "/protos/protos.d.ts", + + /** + * A list of NPM package names whose exports should be treated as part of this package. + * + * For example, suppose that Webpack is used to generate a distributed bundle for the project "library1", + * and another NPM package "library2" is embedded in this bundle. Some types from library2 may become part + * of the exported API for library1, but by default API Extractor would generate a .d.ts rollup that explicitly + * imports library2. To avoid this, we can specify: + * + * "bundledPackages": [ "library2" ], + * + * This would direct API Extractor to embed those types directly in the .d.ts rollup, as if they had been + * local files for library1. + */ + "bundledPackages": [ ], + + /** + * Determines how the TypeScript compiler engine will be invoked by API Extractor. + */ + "compiler": { + /** + * Specifies the path to the tsconfig.json file to be used by API Extractor when analyzing the project. + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * Note: This setting will be ignored if "overrideTsconfig" is used. + * + * SUPPORTED TOKENS: , , + * DEFAULT VALUE: "/tsconfig.json" + */ + // "tsconfigFilePath": "/tsconfig.json", + + /** + * Provides a compiler configuration that will be used instead of reading the tsconfig.json file from disk. + * The object must conform to the TypeScript tsconfig schema: + * + * http://json.schemastore.org/tsconfig + * + * If omitted, then the tsconfig.json file will be read from the "projectFolder". + * + * DEFAULT VALUE: no overrideTsconfig section + */ + // "overrideTsconfig": { + // . . . + // } + + /** + * This option causes the compiler to be invoked with the --skipLibCheck option. This option is not recommended + * and may cause API Extractor to produce incomplete or incorrect declarations, but it may be required when + * dependencies contain declarations that are incompatible with the TypeScript engine that API Extractor uses + * for its analysis. Where possible, the underlying issue should be fixed rather than relying on skipLibCheck. + * + * DEFAULT VALUE: false + */ + // "skipLibCheck": true, + }, + + /** + * Configures how the API report file (*.api.md) will be generated. + */ + "apiReport": { + /** + * (REQUIRED) Whether to generate an API report. + */ + "enabled": true, + + /** + * The filename for the API report files. It will be combined with "reportFolder" or "reportTempFolder" to produce + * a full file path. + * + * The file extension should be ".api.md", and the string should not contain a path separator such as "\" or "/". + * + * SUPPORTED TOKENS: , + * DEFAULT VALUE: ".api.md" + */ + // "reportFileName": ".api.md", + + /** + * Specifies the folder where the API report file is written. The file name portion is determined by + * the "reportFileName" setting. + * + * The API report file is normally tracked by Git. Changes to it can be used to trigger a branch policy, + * e.g. for an API review. + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * SUPPORTED TOKENS: , , + * DEFAULT VALUE: "/etc/" + */ + // "reportFolder": "/etc/", + + /** + * Specifies the folder where the temporary report file is written. The file name portion is determined by + * the "reportFileName" setting. + * + * After the temporary file is written to disk, it is compared with the file in the "reportFolder". + * If they are different, a production build will fail. + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * SUPPORTED TOKENS: , , + * DEFAULT VALUE: "/temp/" + */ + // "reportTempFolder": "/temp/" + }, + + /** + * Configures how the doc model file (*.api.json) will be generated. + */ + "docModel": { + /** + * (REQUIRED) Whether to generate a doc model file. + */ + "enabled": true, + + /** + * The output path for the doc model file. The file extension should be ".api.json". + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * SUPPORTED TOKENS: , , + * DEFAULT VALUE: "/temp/.api.json" + */ + // "apiJsonFilePath": "/temp/.api.json" + }, + + /** + * Configures how the .d.ts rollup file will be generated. + */ + "dtsRollup": { + /** + * (REQUIRED) Whether to generate the .d.ts rollup file. + */ + "enabled": true, + + /** + * Specifies the output path for a .d.ts rollup file to be generated without any trimming. + * This file will include all declarations that are exported by the main entry point. + * + * If the path is an empty string, then this file will not be written. + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * SUPPORTED TOKENS: , , + * DEFAULT VALUE: "/dist/.d.ts" + */ + // "untrimmedFilePath": "/dist/.d.ts", + + /** + * Specifies the output path for a .d.ts rollup file to be generated with trimming for a "beta" release. + * This file will include only declarations that are marked as "@public" or "@beta". + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * SUPPORTED TOKENS: , , + * DEFAULT VALUE: "" + */ + // "betaTrimmedFilePath": "/dist/-beta.d.ts", + + + /** + * Specifies the output path for a .d.ts rollup file to be generated with trimming for a "public" release. + * This file will include only declarations that are marked as "@public". + * + * If the path is an empty string, then this file will not be written. + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * SUPPORTED TOKENS: , , + * DEFAULT VALUE: "" + */ + // "publicTrimmedFilePath": "/dist/-public.d.ts", + + /** + * When a declaration is trimmed, by default it will be replaced by a code comment such as + * "Excluded from this release type: exampleMember". Set "omitTrimmingComments" to true to remove the + * declaration completely. + * + * DEFAULT VALUE: false + */ + // "omitTrimmingComments": true + }, + + /** + * Configures how the tsdoc-metadata.json file will be generated. + */ + "tsdocMetadata": { + /** + * Whether to generate the tsdoc-metadata.json file. + * + * DEFAULT VALUE: true + */ + // "enabled": true, + + /** + * Specifies where the TSDoc metadata file should be written. + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * The default value is "", which causes the path to be automatically inferred from the "tsdocMetadata", + * "typings" or "main" fields of the project's package.json. If none of these fields are set, the lookup + * falls back to "tsdoc-metadata.json" in the package folder. + * + * SUPPORTED TOKENS: , , + * DEFAULT VALUE: "" + */ + // "tsdocMetadataFilePath": "/dist/tsdoc-metadata.json" + }, + + /** + * Specifies what type of newlines API Extractor should use when writing output files. By default, the output files + * will be written with Windows-style newlines. To use POSIX-style newlines, specify "lf" instead. + * To use the OS's default newline kind, specify "os". + * + * DEFAULT VALUE: "crlf" + */ + // "newlineKind": "crlf", + + /** + * Configures how API Extractor reports error and warning messages produced during analysis. + * + * There are three sources of messages: compiler messages, API Extractor messages, and TSDoc messages. + */ + "messages": { + /** + * Configures handling of diagnostic messages reported by the TypeScript compiler engine while analyzing + * the input .d.ts files. + * + * TypeScript message identifiers start with "TS" followed by an integer. For example: "TS2551" + * + * DEFAULT VALUE: A single "default" entry with logLevel=warning. + */ + "compilerMessageReporting": { + /** + * Configures the default routing for messages that don't match an explicit rule in this table. + */ + "default": { + /** + * Specifies whether the message should be written to the the tool's output log. Note that + * the "addToApiReportFile" property may supersede this option. + * + * Possible values: "error", "warning", "none" + * + * Errors cause the build to fail and return a nonzero exit code. Warnings cause a production build fail + * and return a nonzero exit code. For a non-production build (e.g. when "api-extractor run" includes + * the "--local" option), the warning is displayed but the build will not fail. + * + * DEFAULT VALUE: "warning" + */ + "logLevel": "warning", + + /** + * When addToApiReportFile is true: If API Extractor is configured to write an API report file (.api.md), + * then the message will be written inside that file; otherwise, the message is instead logged according to + * the "logLevel" option. + * + * DEFAULT VALUE: false + */ + // "addToApiReportFile": false + }, + + // "TS2551": { + // "logLevel": "warning", + // "addToApiReportFile": true + // }, + // + // . . . + }, + + /** + * Configures handling of messages reported by API Extractor during its analysis. + * + * API Extractor message identifiers start with "ae-". For example: "ae-extra-release-tag" + * + * DEFAULT VALUE: See api-extractor-defaults.json for the complete table of extractorMessageReporting mappings + */ + "extractorMessageReporting": { + "default": { + "logLevel": "warning", + // "addToApiReportFile": false + }, + + // "ae-extra-release-tag": { + // "logLevel": "warning", + // "addToApiReportFile": true + // }, + // + // . . . + }, + + /** + * Configures handling of messages reported by the TSDoc parser when analyzing code comments. + * + * TSDoc message identifiers start with "tsdoc-". For example: "tsdoc-link-tag-unescaped-text" + * + * DEFAULT VALUE: A single "default" entry with logLevel=warning. + */ + "tsdocMessageReporting": { + "default": { + "logLevel": "warning", + // "addToApiReportFile": false + } + + // "tsdoc-link-tag-unescaped-text": { + // "logLevel": "warning", + // "addToApiReportFile": true + // }, + // + // . . . + } + } + +} diff --git a/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/linkinator.config.json b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/linkinator.config.json new file mode 100644 index 000000000..29a223b6d --- /dev/null +++ b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/linkinator.config.json @@ -0,0 +1,10 @@ +{ + "recurse": true, + "skip": [ + "https://codecov.io/gh/googleapis/", + "www.googleapis.com", + "img.shields.io" + ], + "silent": true, + "concurrency": 10 +} diff --git a/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/package.json b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/package.json new file mode 100644 index 000000000..cad6b92c5 --- /dev/null +++ b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/package.json @@ -0,0 +1,72 @@ +{ + "name": "@google-cloud/dlp", + "description": "DLP API client for Node.js", + "version": "3.1.0", + "license": "Apache-2.0", + "author": "Google Inc", + "engines": { + "node": ">=10" + }, + "repository": "googleapis/nodejs-dlp", + "main": "build/src/index.js", + "files": [ + "build/protos", + "build/src" + ], + "keywords": [ + "google apis client", + "google api client", + "google apis", + "google api", + "google", + "google cloud platform", + "google cloud", + "cloud", + "google dlp", + "dlp", + "DLP API" + ], + "scripts": { + "test": "c8 mocha build/test", + "samples-test": "cd samples/ && npm link ../ && npm install && npm test && cd ../", + "system-test": "mocha build/system-test", + "docs": "jsdoc -c .jsdoc.js", + "lint": "gts check", + "fix": "gts fix", + "docs-test": "linkinator docs", + "clean": "gts clean", + "compile": "tsc -p . && cp -r protos build/", + "compile-protos": "compileProtos src", + "predocs-test": "npm run docs", + "prepare": "npm run compile-protos && npm run compile", + "prelint": "cd samples; npm link ../; npm install", + "precompile": "gts clean", + "api-extractor": "api-extractor run --local", + "api-documenter": "api-documenter yaml --input-folder=temp" + }, + "dependencies": { + "google-gax": "^2.9.2", + "protobufjs": "^6.8.0" + }, + "devDependencies": { + "@types/mocha": "^8.0.0", + "@types/node": "^12.0.0", + "@types/sinon": "^9.0.0", + "c8": "^7.0.0", + "gts": "^2.0.0", + "jsdoc": "^3.5.5", + "jsdoc-fresh": "^1.0.1", + "jsdoc-region-tag": "^1.0.2", + "linkinator": "^2.0.0", + "mocha": "^8.0.0", + "null-loader": "^4.0.0", + "pack-n-play": "^1.0.0-2", + "sinon": "^10.0.0", + "ts-loader": "^8.0.0", + "typescript": "^3.8.3", + "webpack": "^5.0.0", + "webpack-cli": "^4.0.0", + "@microsoft/api-documenter": "^7.8.10", + "@microsoft/api-extractor": "^7.8.10" + } +} diff --git a/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/protos/google/cloud/common_resources.proto b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/protos/google/cloud/common_resources.proto new file mode 100644 index 000000000..56c9f800d --- /dev/null +++ b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/protos/google/cloud/common_resources.proto @@ -0,0 +1,52 @@ +// Copyright 2019 Google LLC. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// This file contains stub messages for common resources in GCP. +// It is not intended to be directly generated, and is instead used by +// other tooling to be able to match common resource patterns. +syntax = "proto3"; + +package google.cloud; + +import "google/api/resource.proto"; + + +option (google.api.resource_definition) = { + type: "cloudresourcemanager.googleapis.com/Project" + pattern: "projects/{project}" +}; + + +option (google.api.resource_definition) = { + type: "cloudresourcemanager.googleapis.com/Organization" + pattern: "organizations/{organization}" +}; + + +option (google.api.resource_definition) = { + type: "cloudresourcemanager.googleapis.com/Folder" + pattern: "folders/{folder}" +}; + + +option (google.api.resource_definition) = { + type: "cloudbilling.googleapis.com/BillingAccount" + pattern: "billingAccounts/{billing_account}" +}; + +option (google.api.resource_definition) = { + type: "locations.googleapis.com/Location" + pattern: "projects/{project}/locations/{location}" +}; + diff --git a/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/protos/google/privacy/dlp/v2/dlp.proto b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/protos/google/privacy/dlp/v2/dlp.proto new file mode 100644 index 000000000..3fb0c2193 --- /dev/null +++ b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/protos/google/privacy/dlp/v2/dlp.proto @@ -0,0 +1,4379 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// 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/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"; +import "google/api/annotations.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: "*" + } + }; + 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: "*" + } + }; + 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. + // Early access feature is in a pre-release state and might change or have + // limited support. For more information, see + // https://cloud.google.com/products#product-launch-stages. + 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/*}" + } + }; + 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" + } + }; + 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/*}" + } + }; + 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" + } + }; + 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. + // Early access feature is in a pre-release state and might change or have + // limited support. For more information, see + // https://cloud.google.com/products#product-launch-stages. + 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. + // Early access feature is in a pre-release state and might change or have + // limited support. For more information, see + // https://cloud.google.com/products#product-launch-stages. + 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. + 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. + FindingLimits limits = 3; + + // When true, a contextual quote from the data that triggered a finding is + // included in the response; see Finding.quote. + bool include_quote = 4; + + // When true, excludes type information of the findings. + 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. + 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. + 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; + + // 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-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" + }]; +} + +// 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. + // Early access feature is in a pre-release state and might change or have + // limited support. For more information, see + // https://cloud.google.com/products#product-launch-stages. + HybridInspectStatistics hybrid_stats = 7; + } + + // The configuration used for this job. + RequestedOptions requested_options = 2; + + // A summary of the outcome of this inspect 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 + 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; + } +} + +// 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. + 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 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}, i.e if lower_bound = 10 and upper_bound = 20 +// all values that are within this bucket will be replaced with "10-20". +// +// This can be used on data of type: double, long. +// +// If the bound Value type differs from the type of data +// being transformed, we will first attempt converting the type of the data to +// be transformed to match the type of the bound before comparing. +// +// See https://cloud.google.com/dlp/docs/concepts-bucketing to learn more. +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 KMS). +// When using KMS to wrap/unwrap DEKs, be sure to set an appropriate +// IAM policy on the KMS CryptoKey (KEK) to ensure an attacker cannot +// unwrap the data crypto key. +message CryptoKey { + // Sources of crypto keys. + oneof source { + // Transient crypto key + TransientCryptoKey transient = 1; + + // Unwrapped crypto key + UnwrappedCryptoKey unwrapped = 2; + + // Kms wrapped key + 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/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 +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. + 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 { + // 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; + } + + // 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; + + // 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 triggeredJobs. +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. + // Early access feature is in a pre-release state and might change or have + // limited support. For more information, see + // https://cloud.google.com/products#product-launch-stages. + 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 Cloud Data Catalog. Labels summarizing the + // results of the DlpJob will be applied to the entry for the resource scanned + // in Cloud Data Catalog. Any labels previously written by another DlpJob will + // be deleted. InfoType naming patterns are strictly enforced when using this + // feature. Note that the findings will be persisted in Cloud Data Catalog + // storage and are governed by Data Catalog service-specific policy, see + // https://cloud.google.com/terms/service-terms + // Only a single instance of this action can be specified and only allowed if + // all resources being scanned are BigQuery tables. + // Compatible with: Inspect + 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 { + // Set to control what and how to inspect. + InspectJobConfig inspect_job = 2; + + // Set to choose what metric to calculate. + 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 jobs: + // - `status` - HEALTHY|PAUSED|CANCELLED + // - `inspected_storage` - DATASTORE|CLOUD_STORAGE|BIGQUERY + // - 'last_run_time` - RFC 3339 formatted timestamp, surrounded by + // quotation marks. Nanoseconds are ignored. + // - 'error_count' - Number of errors that have occurred while running. + // * The operator must be `=` or `!=` for status and inspected_storage. + // + // Examples: + // + // * inspected_storage = cloud_storage AND status = HEALTHY + // * inspected_storage = cloud_storage OR inspected_storage = bigquery + // * inspected_storage = cloud_storage AND (state = PAUSED OR state = HEALTHY) + // * last_run_time > \"2017-12-12T00:00:00+00:00\" + // + // The length of this field should be no more than 500 characters. + string filter = 5; + + // 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; +} + +// Options describing which parts of the provided content should be scanned. +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 { + // Unused + DLP_JOB_TYPE_UNSPECIFIED = 0; + + // The job inspected Google Cloud for sensitive data. + INSPECT_JOB = 1; + + // The job executed a Risk Analysis computation. + RISK_ANALYSIS_JOB = 2; +} + +// 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/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/protos/google/privacy/dlp/v2/storage.proto b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/protos/google/privacy/dlp/v2/storage.proto new file mode 100644 index 000000000..6ded28b16 --- /dev/null +++ b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/protos/google/privacy/dlp/v2/storage.proto @@ -0,0 +1,740 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// 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"; +import "google/api/annotations.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; +} + +// 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 { + // 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; +} + +// 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; +} + +// 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. + 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. + 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; +} + +// 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. + // Early access feature is in a pre-release state and might change or have + // limited support. For more information, see + // https://cloud.google.com/products#product-launch-stages. + HybridOptions hybrid_options = 9; + } + + 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, brf, c, cc, cpp, csv, cxx, c++, cs, css, dart, eml, go, h, hh, hpp, + // hxx, h++, hs, html, htm, shtml, shtm, xhtml, lhs, ini, java, js, json, + // ocaml, md, mkd, markdown, m, ml, mli, pl, pm, php, phtml, pht, py, pyw, + // rb, rbw, rs, rc, scala, sh, sql, tex, txt, text, tsv, vcard, vcs, wml, + // xml, xsl, xsd, yml, yaml. + TEXT_FILE = 2; + + // Included file extensions: + // bmp, gif, jpg, jpeg, jpe, png. + // bytes_limit_per_file has no effect on image files. + // Image 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 { + // 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/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/protos/protos.d.ts b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/protos/protos.d.ts new file mode 100644 index 000000000..adb842f3b --- /dev/null +++ b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/protos/protos.d.ts @@ -0,0 +1,26343 @@ +// 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 +// +// 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. + +import * as Long from "long"; +import {protobuf as $protobuf} from "google-gax"; +/** Namespace google. */ +export namespace google { + + /** Namespace privacy. */ + namespace privacy { + + /** Namespace dlp. */ + namespace dlp { + + /** Namespace v2. */ + namespace v2 { + + /** Represents a DlpService */ + class DlpService extends $protobuf.rpc.Service { + + /** + * Constructs a new DlpService service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new DlpService service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): DlpService; + + /** + * Calls InspectContent. + * @param request InspectContentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and InspectContentResponse + */ + public inspectContent(request: google.privacy.dlp.v2.IInspectContentRequest, callback: google.privacy.dlp.v2.DlpService.InspectContentCallback): void; + + /** + * Calls InspectContent. + * @param request InspectContentRequest message or plain object + * @returns Promise + */ + public inspectContent(request: google.privacy.dlp.v2.IInspectContentRequest): Promise; + + /** + * Calls RedactImage. + * @param request RedactImageRequest message or plain object + * @param callback Node-style callback called with the error, if any, and RedactImageResponse + */ + public redactImage(request: google.privacy.dlp.v2.IRedactImageRequest, callback: google.privacy.dlp.v2.DlpService.RedactImageCallback): void; + + /** + * Calls RedactImage. + * @param request RedactImageRequest message or plain object + * @returns Promise + */ + public redactImage(request: google.privacy.dlp.v2.IRedactImageRequest): Promise; + + /** + * Calls DeidentifyContent. + * @param request DeidentifyContentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and DeidentifyContentResponse + */ + public deidentifyContent(request: google.privacy.dlp.v2.IDeidentifyContentRequest, callback: google.privacy.dlp.v2.DlpService.DeidentifyContentCallback): void; + + /** + * Calls DeidentifyContent. + * @param request DeidentifyContentRequest message or plain object + * @returns Promise + */ + public deidentifyContent(request: google.privacy.dlp.v2.IDeidentifyContentRequest): Promise; + + /** + * Calls ReidentifyContent. + * @param request ReidentifyContentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ReidentifyContentResponse + */ + public reidentifyContent(request: google.privacy.dlp.v2.IReidentifyContentRequest, callback: google.privacy.dlp.v2.DlpService.ReidentifyContentCallback): void; + + /** + * Calls ReidentifyContent. + * @param request ReidentifyContentRequest message or plain object + * @returns Promise + */ + public reidentifyContent(request: google.privacy.dlp.v2.IReidentifyContentRequest): Promise; + + /** + * Calls ListInfoTypes. + * @param request ListInfoTypesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListInfoTypesResponse + */ + public listInfoTypes(request: google.privacy.dlp.v2.IListInfoTypesRequest, callback: google.privacy.dlp.v2.DlpService.ListInfoTypesCallback): void; + + /** + * Calls ListInfoTypes. + * @param request ListInfoTypesRequest message or plain object + * @returns Promise + */ + public listInfoTypes(request: google.privacy.dlp.v2.IListInfoTypesRequest): Promise; + + /** + * Calls CreateInspectTemplate. + * @param request CreateInspectTemplateRequest message or plain object + * @param callback Node-style callback called with the error, if any, and InspectTemplate + */ + public createInspectTemplate(request: google.privacy.dlp.v2.ICreateInspectTemplateRequest, callback: google.privacy.dlp.v2.DlpService.CreateInspectTemplateCallback): void; + + /** + * Calls CreateInspectTemplate. + * @param request CreateInspectTemplateRequest message or plain object + * @returns Promise + */ + public createInspectTemplate(request: google.privacy.dlp.v2.ICreateInspectTemplateRequest): Promise; + + /** + * Calls UpdateInspectTemplate. + * @param request UpdateInspectTemplateRequest message or plain object + * @param callback Node-style callback called with the error, if any, and InspectTemplate + */ + public updateInspectTemplate(request: google.privacy.dlp.v2.IUpdateInspectTemplateRequest, callback: google.privacy.dlp.v2.DlpService.UpdateInspectTemplateCallback): void; + + /** + * Calls UpdateInspectTemplate. + * @param request UpdateInspectTemplateRequest message or plain object + * @returns Promise + */ + public updateInspectTemplate(request: google.privacy.dlp.v2.IUpdateInspectTemplateRequest): Promise; + + /** + * Calls GetInspectTemplate. + * @param request GetInspectTemplateRequest message or plain object + * @param callback Node-style callback called with the error, if any, and InspectTemplate + */ + public getInspectTemplate(request: google.privacy.dlp.v2.IGetInspectTemplateRequest, callback: google.privacy.dlp.v2.DlpService.GetInspectTemplateCallback): void; + + /** + * Calls GetInspectTemplate. + * @param request GetInspectTemplateRequest message or plain object + * @returns Promise + */ + public getInspectTemplate(request: google.privacy.dlp.v2.IGetInspectTemplateRequest): Promise; + + /** + * Calls ListInspectTemplates. + * @param request ListInspectTemplatesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListInspectTemplatesResponse + */ + public listInspectTemplates(request: google.privacy.dlp.v2.IListInspectTemplatesRequest, callback: google.privacy.dlp.v2.DlpService.ListInspectTemplatesCallback): void; + + /** + * Calls ListInspectTemplates. + * @param request ListInspectTemplatesRequest message or plain object + * @returns Promise + */ + public listInspectTemplates(request: google.privacy.dlp.v2.IListInspectTemplatesRequest): Promise; + + /** + * Calls DeleteInspectTemplate. + * @param request DeleteInspectTemplateRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteInspectTemplate(request: google.privacy.dlp.v2.IDeleteInspectTemplateRequest, callback: google.privacy.dlp.v2.DlpService.DeleteInspectTemplateCallback): void; + + /** + * Calls DeleteInspectTemplate. + * @param request DeleteInspectTemplateRequest message or plain object + * @returns Promise + */ + public deleteInspectTemplate(request: google.privacy.dlp.v2.IDeleteInspectTemplateRequest): Promise; + + /** + * Calls CreateDeidentifyTemplate. + * @param request CreateDeidentifyTemplateRequest message or plain object + * @param callback Node-style callback called with the error, if any, and DeidentifyTemplate + */ + public createDeidentifyTemplate(request: google.privacy.dlp.v2.ICreateDeidentifyTemplateRequest, callback: google.privacy.dlp.v2.DlpService.CreateDeidentifyTemplateCallback): void; + + /** + * Calls CreateDeidentifyTemplate. + * @param request CreateDeidentifyTemplateRequest message or plain object + * @returns Promise + */ + public createDeidentifyTemplate(request: google.privacy.dlp.v2.ICreateDeidentifyTemplateRequest): Promise; + + /** + * Calls UpdateDeidentifyTemplate. + * @param request UpdateDeidentifyTemplateRequest message or plain object + * @param callback Node-style callback called with the error, if any, and DeidentifyTemplate + */ + public updateDeidentifyTemplate(request: google.privacy.dlp.v2.IUpdateDeidentifyTemplateRequest, callback: google.privacy.dlp.v2.DlpService.UpdateDeidentifyTemplateCallback): void; + + /** + * Calls UpdateDeidentifyTemplate. + * @param request UpdateDeidentifyTemplateRequest message or plain object + * @returns Promise + */ + public updateDeidentifyTemplate(request: google.privacy.dlp.v2.IUpdateDeidentifyTemplateRequest): Promise; + + /** + * Calls GetDeidentifyTemplate. + * @param request GetDeidentifyTemplateRequest message or plain object + * @param callback Node-style callback called with the error, if any, and DeidentifyTemplate + */ + public getDeidentifyTemplate(request: google.privacy.dlp.v2.IGetDeidentifyTemplateRequest, callback: google.privacy.dlp.v2.DlpService.GetDeidentifyTemplateCallback): void; + + /** + * Calls GetDeidentifyTemplate. + * @param request GetDeidentifyTemplateRequest message or plain object + * @returns Promise + */ + public getDeidentifyTemplate(request: google.privacy.dlp.v2.IGetDeidentifyTemplateRequest): Promise; + + /** + * Calls ListDeidentifyTemplates. + * @param request ListDeidentifyTemplatesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListDeidentifyTemplatesResponse + */ + public listDeidentifyTemplates(request: google.privacy.dlp.v2.IListDeidentifyTemplatesRequest, callback: google.privacy.dlp.v2.DlpService.ListDeidentifyTemplatesCallback): void; + + /** + * Calls ListDeidentifyTemplates. + * @param request ListDeidentifyTemplatesRequest message or plain object + * @returns Promise + */ + public listDeidentifyTemplates(request: google.privacy.dlp.v2.IListDeidentifyTemplatesRequest): Promise; + + /** + * Calls DeleteDeidentifyTemplate. + * @param request DeleteDeidentifyTemplateRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteDeidentifyTemplate(request: google.privacy.dlp.v2.IDeleteDeidentifyTemplateRequest, callback: google.privacy.dlp.v2.DlpService.DeleteDeidentifyTemplateCallback): void; + + /** + * Calls DeleteDeidentifyTemplate. + * @param request DeleteDeidentifyTemplateRequest message or plain object + * @returns Promise + */ + public deleteDeidentifyTemplate(request: google.privacy.dlp.v2.IDeleteDeidentifyTemplateRequest): Promise; + + /** + * Calls CreateJobTrigger. + * @param request CreateJobTriggerRequest message or plain object + * @param callback Node-style callback called with the error, if any, and JobTrigger + */ + public createJobTrigger(request: google.privacy.dlp.v2.ICreateJobTriggerRequest, callback: google.privacy.dlp.v2.DlpService.CreateJobTriggerCallback): void; + + /** + * Calls CreateJobTrigger. + * @param request CreateJobTriggerRequest message or plain object + * @returns Promise + */ + public createJobTrigger(request: google.privacy.dlp.v2.ICreateJobTriggerRequest): Promise; + + /** + * Calls UpdateJobTrigger. + * @param request UpdateJobTriggerRequest message or plain object + * @param callback Node-style callback called with the error, if any, and JobTrigger + */ + public updateJobTrigger(request: google.privacy.dlp.v2.IUpdateJobTriggerRequest, callback: google.privacy.dlp.v2.DlpService.UpdateJobTriggerCallback): void; + + /** + * Calls UpdateJobTrigger. + * @param request UpdateJobTriggerRequest message or plain object + * @returns Promise + */ + public updateJobTrigger(request: google.privacy.dlp.v2.IUpdateJobTriggerRequest): Promise; + + /** + * Calls HybridInspectJobTrigger. + * @param request HybridInspectJobTriggerRequest message or plain object + * @param callback Node-style callback called with the error, if any, and HybridInspectResponse + */ + public hybridInspectJobTrigger(request: google.privacy.dlp.v2.IHybridInspectJobTriggerRequest, callback: google.privacy.dlp.v2.DlpService.HybridInspectJobTriggerCallback): void; + + /** + * Calls HybridInspectJobTrigger. + * @param request HybridInspectJobTriggerRequest message or plain object + * @returns Promise + */ + public hybridInspectJobTrigger(request: google.privacy.dlp.v2.IHybridInspectJobTriggerRequest): Promise; + + /** + * Calls GetJobTrigger. + * @param request GetJobTriggerRequest message or plain object + * @param callback Node-style callback called with the error, if any, and JobTrigger + */ + public getJobTrigger(request: google.privacy.dlp.v2.IGetJobTriggerRequest, callback: google.privacy.dlp.v2.DlpService.GetJobTriggerCallback): void; + + /** + * Calls GetJobTrigger. + * @param request GetJobTriggerRequest message or plain object + * @returns Promise + */ + public getJobTrigger(request: google.privacy.dlp.v2.IGetJobTriggerRequest): Promise; + + /** + * Calls ListJobTriggers. + * @param request ListJobTriggersRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListJobTriggersResponse + */ + public listJobTriggers(request: google.privacy.dlp.v2.IListJobTriggersRequest, callback: google.privacy.dlp.v2.DlpService.ListJobTriggersCallback): void; + + /** + * Calls ListJobTriggers. + * @param request ListJobTriggersRequest message or plain object + * @returns Promise + */ + public listJobTriggers(request: google.privacy.dlp.v2.IListJobTriggersRequest): Promise; + + /** + * Calls DeleteJobTrigger. + * @param request DeleteJobTriggerRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteJobTrigger(request: google.privacy.dlp.v2.IDeleteJobTriggerRequest, callback: google.privacy.dlp.v2.DlpService.DeleteJobTriggerCallback): void; + + /** + * Calls DeleteJobTrigger. + * @param request DeleteJobTriggerRequest message or plain object + * @returns Promise + */ + public deleteJobTrigger(request: google.privacy.dlp.v2.IDeleteJobTriggerRequest): Promise; + + /** + * Calls ActivateJobTrigger. + * @param request ActivateJobTriggerRequest message or plain object + * @param callback Node-style callback called with the error, if any, and DlpJob + */ + public activateJobTrigger(request: google.privacy.dlp.v2.IActivateJobTriggerRequest, callback: google.privacy.dlp.v2.DlpService.ActivateJobTriggerCallback): void; + + /** + * Calls ActivateJobTrigger. + * @param request ActivateJobTriggerRequest message or plain object + * @returns Promise + */ + public activateJobTrigger(request: google.privacy.dlp.v2.IActivateJobTriggerRequest): Promise; + + /** + * Calls CreateDlpJob. + * @param request CreateDlpJobRequest message or plain object + * @param callback Node-style callback called with the error, if any, and DlpJob + */ + public createDlpJob(request: google.privacy.dlp.v2.ICreateDlpJobRequest, callback: google.privacy.dlp.v2.DlpService.CreateDlpJobCallback): void; + + /** + * Calls CreateDlpJob. + * @param request CreateDlpJobRequest message or plain object + * @returns Promise + */ + public createDlpJob(request: google.privacy.dlp.v2.ICreateDlpJobRequest): Promise; + + /** + * Calls ListDlpJobs. + * @param request ListDlpJobsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListDlpJobsResponse + */ + public listDlpJobs(request: google.privacy.dlp.v2.IListDlpJobsRequest, callback: google.privacy.dlp.v2.DlpService.ListDlpJobsCallback): void; + + /** + * Calls ListDlpJobs. + * @param request ListDlpJobsRequest message or plain object + * @returns Promise + */ + public listDlpJobs(request: google.privacy.dlp.v2.IListDlpJobsRequest): Promise; + + /** + * Calls GetDlpJob. + * @param request GetDlpJobRequest message or plain object + * @param callback Node-style callback called with the error, if any, and DlpJob + */ + public getDlpJob(request: google.privacy.dlp.v2.IGetDlpJobRequest, callback: google.privacy.dlp.v2.DlpService.GetDlpJobCallback): void; + + /** + * Calls GetDlpJob. + * @param request GetDlpJobRequest message or plain object + * @returns Promise + */ + public getDlpJob(request: google.privacy.dlp.v2.IGetDlpJobRequest): Promise; + + /** + * Calls DeleteDlpJob. + * @param request DeleteDlpJobRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteDlpJob(request: google.privacy.dlp.v2.IDeleteDlpJobRequest, callback: google.privacy.dlp.v2.DlpService.DeleteDlpJobCallback): void; + + /** + * Calls DeleteDlpJob. + * @param request DeleteDlpJobRequest message or plain object + * @returns Promise + */ + public deleteDlpJob(request: google.privacy.dlp.v2.IDeleteDlpJobRequest): Promise; + + /** + * Calls CancelDlpJob. + * @param request CancelDlpJobRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public cancelDlpJob(request: google.privacy.dlp.v2.ICancelDlpJobRequest, callback: google.privacy.dlp.v2.DlpService.CancelDlpJobCallback): void; + + /** + * Calls CancelDlpJob. + * @param request CancelDlpJobRequest message or plain object + * @returns Promise + */ + public cancelDlpJob(request: google.privacy.dlp.v2.ICancelDlpJobRequest): Promise; + + /** + * Calls CreateStoredInfoType. + * @param request CreateStoredInfoTypeRequest message or plain object + * @param callback Node-style callback called with the error, if any, and StoredInfoType + */ + public createStoredInfoType(request: google.privacy.dlp.v2.ICreateStoredInfoTypeRequest, callback: google.privacy.dlp.v2.DlpService.CreateStoredInfoTypeCallback): void; + + /** + * Calls CreateStoredInfoType. + * @param request CreateStoredInfoTypeRequest message or plain object + * @returns Promise + */ + public createStoredInfoType(request: google.privacy.dlp.v2.ICreateStoredInfoTypeRequest): Promise; + + /** + * Calls UpdateStoredInfoType. + * @param request UpdateStoredInfoTypeRequest message or plain object + * @param callback Node-style callback called with the error, if any, and StoredInfoType + */ + public updateStoredInfoType(request: google.privacy.dlp.v2.IUpdateStoredInfoTypeRequest, callback: google.privacy.dlp.v2.DlpService.UpdateStoredInfoTypeCallback): void; + + /** + * Calls UpdateStoredInfoType. + * @param request UpdateStoredInfoTypeRequest message or plain object + * @returns Promise + */ + public updateStoredInfoType(request: google.privacy.dlp.v2.IUpdateStoredInfoTypeRequest): Promise; + + /** + * Calls GetStoredInfoType. + * @param request GetStoredInfoTypeRequest message or plain object + * @param callback Node-style callback called with the error, if any, and StoredInfoType + */ + public getStoredInfoType(request: google.privacy.dlp.v2.IGetStoredInfoTypeRequest, callback: google.privacy.dlp.v2.DlpService.GetStoredInfoTypeCallback): void; + + /** + * Calls GetStoredInfoType. + * @param request GetStoredInfoTypeRequest message or plain object + * @returns Promise + */ + public getStoredInfoType(request: google.privacy.dlp.v2.IGetStoredInfoTypeRequest): Promise; + + /** + * Calls ListStoredInfoTypes. + * @param request ListStoredInfoTypesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListStoredInfoTypesResponse + */ + public listStoredInfoTypes(request: google.privacy.dlp.v2.IListStoredInfoTypesRequest, callback: google.privacy.dlp.v2.DlpService.ListStoredInfoTypesCallback): void; + + /** + * Calls ListStoredInfoTypes. + * @param request ListStoredInfoTypesRequest message or plain object + * @returns Promise + */ + public listStoredInfoTypes(request: google.privacy.dlp.v2.IListStoredInfoTypesRequest): Promise; + + /** + * Calls DeleteStoredInfoType. + * @param request DeleteStoredInfoTypeRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteStoredInfoType(request: google.privacy.dlp.v2.IDeleteStoredInfoTypeRequest, callback: google.privacy.dlp.v2.DlpService.DeleteStoredInfoTypeCallback): void; + + /** + * Calls DeleteStoredInfoType. + * @param request DeleteStoredInfoTypeRequest message or plain object + * @returns Promise + */ + public deleteStoredInfoType(request: google.privacy.dlp.v2.IDeleteStoredInfoTypeRequest): Promise; + + /** + * Calls HybridInspectDlpJob. + * @param request HybridInspectDlpJobRequest message or plain object + * @param callback Node-style callback called with the error, if any, and HybridInspectResponse + */ + public hybridInspectDlpJob(request: google.privacy.dlp.v2.IHybridInspectDlpJobRequest, callback: google.privacy.dlp.v2.DlpService.HybridInspectDlpJobCallback): void; + + /** + * Calls HybridInspectDlpJob. + * @param request HybridInspectDlpJobRequest message or plain object + * @returns Promise + */ + public hybridInspectDlpJob(request: google.privacy.dlp.v2.IHybridInspectDlpJobRequest): Promise; + + /** + * Calls FinishDlpJob. + * @param request FinishDlpJobRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public finishDlpJob(request: google.privacy.dlp.v2.IFinishDlpJobRequest, callback: google.privacy.dlp.v2.DlpService.FinishDlpJobCallback): void; + + /** + * Calls FinishDlpJob. + * @param request FinishDlpJobRequest message or plain object + * @returns Promise + */ + public finishDlpJob(request: google.privacy.dlp.v2.IFinishDlpJobRequest): Promise; + } + + namespace DlpService { + + /** + * Callback as used by {@link google.privacy.dlp.v2.DlpService#inspectContent}. + * @param error Error, if any + * @param [response] InspectContentResponse + */ + type InspectContentCallback = (error: (Error|null), response?: google.privacy.dlp.v2.InspectContentResponse) => void; + + /** + * Callback as used by {@link google.privacy.dlp.v2.DlpService#redactImage}. + * @param error Error, if any + * @param [response] RedactImageResponse + */ + type RedactImageCallback = (error: (Error|null), response?: google.privacy.dlp.v2.RedactImageResponse) => void; + + /** + * Callback as used by {@link google.privacy.dlp.v2.DlpService#deidentifyContent}. + * @param error Error, if any + * @param [response] DeidentifyContentResponse + */ + type DeidentifyContentCallback = (error: (Error|null), response?: google.privacy.dlp.v2.DeidentifyContentResponse) => void; + + /** + * Callback as used by {@link google.privacy.dlp.v2.DlpService#reidentifyContent}. + * @param error Error, if any + * @param [response] ReidentifyContentResponse + */ + type ReidentifyContentCallback = (error: (Error|null), response?: google.privacy.dlp.v2.ReidentifyContentResponse) => void; + + /** + * Callback as used by {@link google.privacy.dlp.v2.DlpService#listInfoTypes}. + * @param error Error, if any + * @param [response] ListInfoTypesResponse + */ + type ListInfoTypesCallback = (error: (Error|null), response?: google.privacy.dlp.v2.ListInfoTypesResponse) => void; + + /** + * Callback as used by {@link google.privacy.dlp.v2.DlpService#createInspectTemplate}. + * @param error Error, if any + * @param [response] InspectTemplate + */ + type CreateInspectTemplateCallback = (error: (Error|null), response?: google.privacy.dlp.v2.InspectTemplate) => void; + + /** + * Callback as used by {@link google.privacy.dlp.v2.DlpService#updateInspectTemplate}. + * @param error Error, if any + * @param [response] InspectTemplate + */ + type UpdateInspectTemplateCallback = (error: (Error|null), response?: google.privacy.dlp.v2.InspectTemplate) => void; + + /** + * Callback as used by {@link google.privacy.dlp.v2.DlpService#getInspectTemplate}. + * @param error Error, if any + * @param [response] InspectTemplate + */ + type GetInspectTemplateCallback = (error: (Error|null), response?: google.privacy.dlp.v2.InspectTemplate) => void; + + /** + * Callback as used by {@link google.privacy.dlp.v2.DlpService#listInspectTemplates}. + * @param error Error, if any + * @param [response] ListInspectTemplatesResponse + */ + type ListInspectTemplatesCallback = (error: (Error|null), response?: google.privacy.dlp.v2.ListInspectTemplatesResponse) => void; + + /** + * Callback as used by {@link google.privacy.dlp.v2.DlpService#deleteInspectTemplate}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteInspectTemplateCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.privacy.dlp.v2.DlpService#createDeidentifyTemplate}. + * @param error Error, if any + * @param [response] DeidentifyTemplate + */ + type CreateDeidentifyTemplateCallback = (error: (Error|null), response?: google.privacy.dlp.v2.DeidentifyTemplate) => void; + + /** + * Callback as used by {@link google.privacy.dlp.v2.DlpService#updateDeidentifyTemplate}. + * @param error Error, if any + * @param [response] DeidentifyTemplate + */ + type UpdateDeidentifyTemplateCallback = (error: (Error|null), response?: google.privacy.dlp.v2.DeidentifyTemplate) => void; + + /** + * Callback as used by {@link google.privacy.dlp.v2.DlpService#getDeidentifyTemplate}. + * @param error Error, if any + * @param [response] DeidentifyTemplate + */ + type GetDeidentifyTemplateCallback = (error: (Error|null), response?: google.privacy.dlp.v2.DeidentifyTemplate) => void; + + /** + * Callback as used by {@link google.privacy.dlp.v2.DlpService#listDeidentifyTemplates}. + * @param error Error, if any + * @param [response] ListDeidentifyTemplatesResponse + */ + type ListDeidentifyTemplatesCallback = (error: (Error|null), response?: google.privacy.dlp.v2.ListDeidentifyTemplatesResponse) => void; + + /** + * Callback as used by {@link google.privacy.dlp.v2.DlpService#deleteDeidentifyTemplate}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteDeidentifyTemplateCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.privacy.dlp.v2.DlpService#createJobTrigger}. + * @param error Error, if any + * @param [response] JobTrigger + */ + type CreateJobTriggerCallback = (error: (Error|null), response?: google.privacy.dlp.v2.JobTrigger) => void; + + /** + * Callback as used by {@link google.privacy.dlp.v2.DlpService#updateJobTrigger}. + * @param error Error, if any + * @param [response] JobTrigger + */ + type UpdateJobTriggerCallback = (error: (Error|null), response?: google.privacy.dlp.v2.JobTrigger) => void; + + /** + * Callback as used by {@link google.privacy.dlp.v2.DlpService#hybridInspectJobTrigger}. + * @param error Error, if any + * @param [response] HybridInspectResponse + */ + type HybridInspectJobTriggerCallback = (error: (Error|null), response?: google.privacy.dlp.v2.HybridInspectResponse) => void; + + /** + * Callback as used by {@link google.privacy.dlp.v2.DlpService#getJobTrigger}. + * @param error Error, if any + * @param [response] JobTrigger + */ + type GetJobTriggerCallback = (error: (Error|null), response?: google.privacy.dlp.v2.JobTrigger) => void; + + /** + * Callback as used by {@link google.privacy.dlp.v2.DlpService#listJobTriggers}. + * @param error Error, if any + * @param [response] ListJobTriggersResponse + */ + type ListJobTriggersCallback = (error: (Error|null), response?: google.privacy.dlp.v2.ListJobTriggersResponse) => void; + + /** + * Callback as used by {@link google.privacy.dlp.v2.DlpService#deleteJobTrigger}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteJobTriggerCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.privacy.dlp.v2.DlpService#activateJobTrigger}. + * @param error Error, if any + * @param [response] DlpJob + */ + type ActivateJobTriggerCallback = (error: (Error|null), response?: google.privacy.dlp.v2.DlpJob) => void; + + /** + * Callback as used by {@link google.privacy.dlp.v2.DlpService#createDlpJob}. + * @param error Error, if any + * @param [response] DlpJob + */ + type CreateDlpJobCallback = (error: (Error|null), response?: google.privacy.dlp.v2.DlpJob) => void; + + /** + * Callback as used by {@link google.privacy.dlp.v2.DlpService#listDlpJobs}. + * @param error Error, if any + * @param [response] ListDlpJobsResponse + */ + type ListDlpJobsCallback = (error: (Error|null), response?: google.privacy.dlp.v2.ListDlpJobsResponse) => void; + + /** + * Callback as used by {@link google.privacy.dlp.v2.DlpService#getDlpJob}. + * @param error Error, if any + * @param [response] DlpJob + */ + type GetDlpJobCallback = (error: (Error|null), response?: google.privacy.dlp.v2.DlpJob) => void; + + /** + * Callback as used by {@link google.privacy.dlp.v2.DlpService#deleteDlpJob}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteDlpJobCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.privacy.dlp.v2.DlpService#cancelDlpJob}. + * @param error Error, if any + * @param [response] Empty + */ + type CancelDlpJobCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.privacy.dlp.v2.DlpService#createStoredInfoType}. + * @param error Error, if any + * @param [response] StoredInfoType + */ + type CreateStoredInfoTypeCallback = (error: (Error|null), response?: google.privacy.dlp.v2.StoredInfoType) => void; + + /** + * Callback as used by {@link google.privacy.dlp.v2.DlpService#updateStoredInfoType}. + * @param error Error, if any + * @param [response] StoredInfoType + */ + type UpdateStoredInfoTypeCallback = (error: (Error|null), response?: google.privacy.dlp.v2.StoredInfoType) => void; + + /** + * Callback as used by {@link google.privacy.dlp.v2.DlpService#getStoredInfoType}. + * @param error Error, if any + * @param [response] StoredInfoType + */ + type GetStoredInfoTypeCallback = (error: (Error|null), response?: google.privacy.dlp.v2.StoredInfoType) => void; + + /** + * Callback as used by {@link google.privacy.dlp.v2.DlpService#listStoredInfoTypes}. + * @param error Error, if any + * @param [response] ListStoredInfoTypesResponse + */ + type ListStoredInfoTypesCallback = (error: (Error|null), response?: google.privacy.dlp.v2.ListStoredInfoTypesResponse) => void; + + /** + * Callback as used by {@link google.privacy.dlp.v2.DlpService#deleteStoredInfoType}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteStoredInfoTypeCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.privacy.dlp.v2.DlpService#hybridInspectDlpJob}. + * @param error Error, if any + * @param [response] HybridInspectResponse + */ + type HybridInspectDlpJobCallback = (error: (Error|null), response?: google.privacy.dlp.v2.HybridInspectResponse) => void; + + /** + * Callback as used by {@link google.privacy.dlp.v2.DlpService#finishDlpJob}. + * @param error Error, if any + * @param [response] Empty + */ + type FinishDlpJobCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + } + + /** Properties of an ExcludeInfoTypes. */ + interface IExcludeInfoTypes { + + /** ExcludeInfoTypes infoTypes */ + infoTypes?: (google.privacy.dlp.v2.IInfoType[]|null); + } + + /** Represents an ExcludeInfoTypes. */ + class ExcludeInfoTypes implements IExcludeInfoTypes { + + /** + * Constructs a new ExcludeInfoTypes. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.IExcludeInfoTypes); + + /** ExcludeInfoTypes infoTypes. */ + public infoTypes: google.privacy.dlp.v2.IInfoType[]; + + /** + * Creates a new ExcludeInfoTypes instance using the specified properties. + * @param [properties] Properties to set + * @returns ExcludeInfoTypes instance + */ + public static create(properties?: google.privacy.dlp.v2.IExcludeInfoTypes): google.privacy.dlp.v2.ExcludeInfoTypes; + + /** + * Encodes the specified ExcludeInfoTypes message. Does not implicitly {@link google.privacy.dlp.v2.ExcludeInfoTypes.verify|verify} messages. + * @param message ExcludeInfoTypes message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.IExcludeInfoTypes, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExcludeInfoTypes message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.ExcludeInfoTypes.verify|verify} messages. + * @param message ExcludeInfoTypes message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.IExcludeInfoTypes, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExcludeInfoTypes message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExcludeInfoTypes + * @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.privacy.dlp.v2.ExcludeInfoTypes; + + /** + * Decodes an ExcludeInfoTypes message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExcludeInfoTypes + * @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.privacy.dlp.v2.ExcludeInfoTypes; + + /** + * Verifies an ExcludeInfoTypes 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 an ExcludeInfoTypes message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExcludeInfoTypes + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.ExcludeInfoTypes; + + /** + * Creates a plain object from an ExcludeInfoTypes message. Also converts values to other types if specified. + * @param message ExcludeInfoTypes + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.ExcludeInfoTypes, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExcludeInfoTypes to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an ExclusionRule. */ + interface IExclusionRule { + + /** ExclusionRule dictionary */ + dictionary?: (google.privacy.dlp.v2.CustomInfoType.IDictionary|null); + + /** ExclusionRule regex */ + regex?: (google.privacy.dlp.v2.CustomInfoType.IRegex|null); + + /** ExclusionRule excludeInfoTypes */ + excludeInfoTypes?: (google.privacy.dlp.v2.IExcludeInfoTypes|null); + + /** ExclusionRule matchingType */ + matchingType?: (google.privacy.dlp.v2.MatchingType|keyof typeof google.privacy.dlp.v2.MatchingType|null); + } + + /** Represents an ExclusionRule. */ + class ExclusionRule implements IExclusionRule { + + /** + * Constructs a new ExclusionRule. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.IExclusionRule); + + /** ExclusionRule dictionary. */ + public dictionary?: (google.privacy.dlp.v2.CustomInfoType.IDictionary|null); + + /** ExclusionRule regex. */ + public regex?: (google.privacy.dlp.v2.CustomInfoType.IRegex|null); + + /** ExclusionRule excludeInfoTypes. */ + public excludeInfoTypes?: (google.privacy.dlp.v2.IExcludeInfoTypes|null); + + /** ExclusionRule matchingType. */ + public matchingType: (google.privacy.dlp.v2.MatchingType|keyof typeof google.privacy.dlp.v2.MatchingType); + + /** ExclusionRule type. */ + public type?: ("dictionary"|"regex"|"excludeInfoTypes"); + + /** + * Creates a new ExclusionRule instance using the specified properties. + * @param [properties] Properties to set + * @returns ExclusionRule instance + */ + public static create(properties?: google.privacy.dlp.v2.IExclusionRule): google.privacy.dlp.v2.ExclusionRule; + + /** + * Encodes the specified ExclusionRule message. Does not implicitly {@link google.privacy.dlp.v2.ExclusionRule.verify|verify} messages. + * @param message ExclusionRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.IExclusionRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExclusionRule message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.ExclusionRule.verify|verify} messages. + * @param message ExclusionRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.IExclusionRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExclusionRule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExclusionRule + * @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.privacy.dlp.v2.ExclusionRule; + + /** + * Decodes an ExclusionRule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExclusionRule + * @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.privacy.dlp.v2.ExclusionRule; + + /** + * Verifies an ExclusionRule 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 an ExclusionRule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExclusionRule + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.ExclusionRule; + + /** + * Creates a plain object from an ExclusionRule message. Also converts values to other types if specified. + * @param message ExclusionRule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.ExclusionRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExclusionRule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InspectionRule. */ + interface IInspectionRule { + + /** InspectionRule hotwordRule */ + hotwordRule?: (google.privacy.dlp.v2.CustomInfoType.DetectionRule.IHotwordRule|null); + + /** InspectionRule exclusionRule */ + exclusionRule?: (google.privacy.dlp.v2.IExclusionRule|null); + } + + /** Represents an InspectionRule. */ + class InspectionRule implements IInspectionRule { + + /** + * Constructs a new InspectionRule. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.IInspectionRule); + + /** InspectionRule hotwordRule. */ + public hotwordRule?: (google.privacy.dlp.v2.CustomInfoType.DetectionRule.IHotwordRule|null); + + /** InspectionRule exclusionRule. */ + public exclusionRule?: (google.privacy.dlp.v2.IExclusionRule|null); + + /** InspectionRule type. */ + public type?: ("hotwordRule"|"exclusionRule"); + + /** + * Creates a new InspectionRule instance using the specified properties. + * @param [properties] Properties to set + * @returns InspectionRule instance + */ + public static create(properties?: google.privacy.dlp.v2.IInspectionRule): google.privacy.dlp.v2.InspectionRule; + + /** + * Encodes the specified InspectionRule message. Does not implicitly {@link google.privacy.dlp.v2.InspectionRule.verify|verify} messages. + * @param message InspectionRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.IInspectionRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InspectionRule message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.InspectionRule.verify|verify} messages. + * @param message InspectionRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.IInspectionRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InspectionRule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InspectionRule + * @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.privacy.dlp.v2.InspectionRule; + + /** + * Decodes an InspectionRule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InspectionRule + * @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.privacy.dlp.v2.InspectionRule; + + /** + * Verifies an InspectionRule 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 an InspectionRule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InspectionRule + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.InspectionRule; + + /** + * Creates a plain object from an InspectionRule message. Also converts values to other types if specified. + * @param message InspectionRule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.InspectionRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InspectionRule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InspectionRuleSet. */ + interface IInspectionRuleSet { + + /** InspectionRuleSet infoTypes */ + infoTypes?: (google.privacy.dlp.v2.IInfoType[]|null); + + /** InspectionRuleSet rules */ + rules?: (google.privacy.dlp.v2.IInspectionRule[]|null); + } + + /** Represents an InspectionRuleSet. */ + class InspectionRuleSet implements IInspectionRuleSet { + + /** + * Constructs a new InspectionRuleSet. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.IInspectionRuleSet); + + /** InspectionRuleSet infoTypes. */ + public infoTypes: google.privacy.dlp.v2.IInfoType[]; + + /** InspectionRuleSet rules. */ + public rules: google.privacy.dlp.v2.IInspectionRule[]; + + /** + * Creates a new InspectionRuleSet instance using the specified properties. + * @param [properties] Properties to set + * @returns InspectionRuleSet instance + */ + public static create(properties?: google.privacy.dlp.v2.IInspectionRuleSet): google.privacy.dlp.v2.InspectionRuleSet; + + /** + * Encodes the specified InspectionRuleSet message. Does not implicitly {@link google.privacy.dlp.v2.InspectionRuleSet.verify|verify} messages. + * @param message InspectionRuleSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.IInspectionRuleSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InspectionRuleSet message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.InspectionRuleSet.verify|verify} messages. + * @param message InspectionRuleSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.IInspectionRuleSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InspectionRuleSet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InspectionRuleSet + * @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.privacy.dlp.v2.InspectionRuleSet; + + /** + * Decodes an InspectionRuleSet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InspectionRuleSet + * @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.privacy.dlp.v2.InspectionRuleSet; + + /** + * Verifies an InspectionRuleSet 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 an InspectionRuleSet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InspectionRuleSet + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.InspectionRuleSet; + + /** + * Creates a plain object from an InspectionRuleSet message. Also converts values to other types if specified. + * @param message InspectionRuleSet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.InspectionRuleSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InspectionRuleSet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InspectConfig. */ + interface IInspectConfig { + + /** InspectConfig infoTypes */ + infoTypes?: (google.privacy.dlp.v2.IInfoType[]|null); + + /** InspectConfig minLikelihood */ + minLikelihood?: (google.privacy.dlp.v2.Likelihood|keyof typeof google.privacy.dlp.v2.Likelihood|null); + + /** InspectConfig limits */ + limits?: (google.privacy.dlp.v2.InspectConfig.IFindingLimits|null); + + /** InspectConfig includeQuote */ + includeQuote?: (boolean|null); + + /** InspectConfig excludeInfoTypes */ + excludeInfoTypes?: (boolean|null); + + /** InspectConfig customInfoTypes */ + customInfoTypes?: (google.privacy.dlp.v2.ICustomInfoType[]|null); + + /** InspectConfig contentOptions */ + contentOptions?: (google.privacy.dlp.v2.ContentOption[]|null); + + /** InspectConfig ruleSet */ + ruleSet?: (google.privacy.dlp.v2.IInspectionRuleSet[]|null); + } + + /** Represents an InspectConfig. */ + class InspectConfig implements IInspectConfig { + + /** + * Constructs a new InspectConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.IInspectConfig); + + /** InspectConfig infoTypes. */ + public infoTypes: google.privacy.dlp.v2.IInfoType[]; + + /** InspectConfig minLikelihood. */ + public minLikelihood: (google.privacy.dlp.v2.Likelihood|keyof typeof google.privacy.dlp.v2.Likelihood); + + /** InspectConfig limits. */ + public limits?: (google.privacy.dlp.v2.InspectConfig.IFindingLimits|null); + + /** InspectConfig includeQuote. */ + public includeQuote: boolean; + + /** InspectConfig excludeInfoTypes. */ + public excludeInfoTypes: boolean; + + /** InspectConfig customInfoTypes. */ + public customInfoTypes: google.privacy.dlp.v2.ICustomInfoType[]; + + /** InspectConfig contentOptions. */ + public contentOptions: google.privacy.dlp.v2.ContentOption[]; + + /** InspectConfig ruleSet. */ + public ruleSet: google.privacy.dlp.v2.IInspectionRuleSet[]; + + /** + * Creates a new InspectConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns InspectConfig instance + */ + public static create(properties?: google.privacy.dlp.v2.IInspectConfig): google.privacy.dlp.v2.InspectConfig; + + /** + * Encodes the specified InspectConfig message. Does not implicitly {@link google.privacy.dlp.v2.InspectConfig.verify|verify} messages. + * @param message InspectConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.IInspectConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InspectConfig message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.InspectConfig.verify|verify} messages. + * @param message InspectConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.IInspectConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InspectConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InspectConfig + * @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.privacy.dlp.v2.InspectConfig; + + /** + * Decodes an InspectConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InspectConfig + * @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.privacy.dlp.v2.InspectConfig; + + /** + * Verifies an InspectConfig 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 an InspectConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InspectConfig + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.InspectConfig; + + /** + * Creates a plain object from an InspectConfig message. Also converts values to other types if specified. + * @param message InspectConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.InspectConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InspectConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace InspectConfig { + + /** Properties of a FindingLimits. */ + interface IFindingLimits { + + /** FindingLimits maxFindingsPerItem */ + maxFindingsPerItem?: (number|null); + + /** FindingLimits maxFindingsPerRequest */ + maxFindingsPerRequest?: (number|null); + + /** FindingLimits maxFindingsPerInfoType */ + maxFindingsPerInfoType?: (google.privacy.dlp.v2.InspectConfig.FindingLimits.IInfoTypeLimit[]|null); + } + + /** Represents a FindingLimits. */ + class FindingLimits implements IFindingLimits { + + /** + * Constructs a new FindingLimits. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.InspectConfig.IFindingLimits); + + /** FindingLimits maxFindingsPerItem. */ + public maxFindingsPerItem: number; + + /** FindingLimits maxFindingsPerRequest. */ + public maxFindingsPerRequest: number; + + /** FindingLimits maxFindingsPerInfoType. */ + public maxFindingsPerInfoType: google.privacy.dlp.v2.InspectConfig.FindingLimits.IInfoTypeLimit[]; + + /** + * Creates a new FindingLimits instance using the specified properties. + * @param [properties] Properties to set + * @returns FindingLimits instance + */ + public static create(properties?: google.privacy.dlp.v2.InspectConfig.IFindingLimits): google.privacy.dlp.v2.InspectConfig.FindingLimits; + + /** + * Encodes the specified FindingLimits message. Does not implicitly {@link google.privacy.dlp.v2.InspectConfig.FindingLimits.verify|verify} messages. + * @param message FindingLimits message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.InspectConfig.IFindingLimits, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FindingLimits message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.InspectConfig.FindingLimits.verify|verify} messages. + * @param message FindingLimits message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.InspectConfig.IFindingLimits, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FindingLimits message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FindingLimits + * @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.privacy.dlp.v2.InspectConfig.FindingLimits; + + /** + * Decodes a FindingLimits message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FindingLimits + * @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.privacy.dlp.v2.InspectConfig.FindingLimits; + + /** + * Verifies a FindingLimits 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 FindingLimits message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FindingLimits + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.InspectConfig.FindingLimits; + + /** + * Creates a plain object from a FindingLimits message. Also converts values to other types if specified. + * @param message FindingLimits + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.InspectConfig.FindingLimits, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FindingLimits to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace FindingLimits { + + /** Properties of an InfoTypeLimit. */ + interface IInfoTypeLimit { + + /** InfoTypeLimit infoType */ + infoType?: (google.privacy.dlp.v2.IInfoType|null); + + /** InfoTypeLimit maxFindings */ + maxFindings?: (number|null); + } + + /** Represents an InfoTypeLimit. */ + class InfoTypeLimit implements IInfoTypeLimit { + + /** + * Constructs a new InfoTypeLimit. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.InspectConfig.FindingLimits.IInfoTypeLimit); + + /** InfoTypeLimit infoType. */ + public infoType?: (google.privacy.dlp.v2.IInfoType|null); + + /** InfoTypeLimit maxFindings. */ + public maxFindings: number; + + /** + * Creates a new InfoTypeLimit instance using the specified properties. + * @param [properties] Properties to set + * @returns InfoTypeLimit instance + */ + public static create(properties?: google.privacy.dlp.v2.InspectConfig.FindingLimits.IInfoTypeLimit): google.privacy.dlp.v2.InspectConfig.FindingLimits.InfoTypeLimit; + + /** + * Encodes the specified InfoTypeLimit message. Does not implicitly {@link google.privacy.dlp.v2.InspectConfig.FindingLimits.InfoTypeLimit.verify|verify} messages. + * @param message InfoTypeLimit message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.InspectConfig.FindingLimits.IInfoTypeLimit, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InfoTypeLimit message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.InspectConfig.FindingLimits.InfoTypeLimit.verify|verify} messages. + * @param message InfoTypeLimit message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.InspectConfig.FindingLimits.IInfoTypeLimit, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InfoTypeLimit message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InfoTypeLimit + * @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.privacy.dlp.v2.InspectConfig.FindingLimits.InfoTypeLimit; + + /** + * Decodes an InfoTypeLimit message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InfoTypeLimit + * @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.privacy.dlp.v2.InspectConfig.FindingLimits.InfoTypeLimit; + + /** + * Verifies an InfoTypeLimit 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 an InfoTypeLimit message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InfoTypeLimit + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.InspectConfig.FindingLimits.InfoTypeLimit; + + /** + * Creates a plain object from an InfoTypeLimit message. Also converts values to other types if specified. + * @param message InfoTypeLimit + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.InspectConfig.FindingLimits.InfoTypeLimit, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InfoTypeLimit to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + } + + /** Properties of a ByteContentItem. */ + interface IByteContentItem { + + /** ByteContentItem type */ + type?: (google.privacy.dlp.v2.ByteContentItem.BytesType|keyof typeof google.privacy.dlp.v2.ByteContentItem.BytesType|null); + + /** ByteContentItem data */ + data?: (Uint8Array|string|null); + } + + /** Represents a ByteContentItem. */ + class ByteContentItem implements IByteContentItem { + + /** + * Constructs a new ByteContentItem. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.IByteContentItem); + + /** ByteContentItem type. */ + public type: (google.privacy.dlp.v2.ByteContentItem.BytesType|keyof typeof google.privacy.dlp.v2.ByteContentItem.BytesType); + + /** ByteContentItem data. */ + public data: (Uint8Array|string); + + /** + * Creates a new ByteContentItem instance using the specified properties. + * @param [properties] Properties to set + * @returns ByteContentItem instance + */ + public static create(properties?: google.privacy.dlp.v2.IByteContentItem): google.privacy.dlp.v2.ByteContentItem; + + /** + * Encodes the specified ByteContentItem message. Does not implicitly {@link google.privacy.dlp.v2.ByteContentItem.verify|verify} messages. + * @param message ByteContentItem message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.IByteContentItem, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ByteContentItem message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.ByteContentItem.verify|verify} messages. + * @param message ByteContentItem message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.IByteContentItem, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ByteContentItem message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ByteContentItem + * @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.privacy.dlp.v2.ByteContentItem; + + /** + * Decodes a ByteContentItem message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ByteContentItem + * @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.privacy.dlp.v2.ByteContentItem; + + /** + * Verifies a ByteContentItem 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 ByteContentItem message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ByteContentItem + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.ByteContentItem; + + /** + * Creates a plain object from a ByteContentItem message. Also converts values to other types if specified. + * @param message ByteContentItem + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.ByteContentItem, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ByteContentItem to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace ByteContentItem { + + /** BytesType enum. */ + enum BytesType { + BYTES_TYPE_UNSPECIFIED = 0, + IMAGE = 6, + IMAGE_JPEG = 1, + IMAGE_BMP = 2, + IMAGE_PNG = 3, + IMAGE_SVG = 4, + TEXT_UTF8 = 5, + WORD_DOCUMENT = 7, + PDF = 8, + AVRO = 11, + CSV = 12, + TSV = 13 + } + } + + /** Properties of a ContentItem. */ + interface IContentItem { + + /** ContentItem value */ + value?: (string|null); + + /** ContentItem table */ + table?: (google.privacy.dlp.v2.ITable|null); + + /** ContentItem byteItem */ + byteItem?: (google.privacy.dlp.v2.IByteContentItem|null); + } + + /** Represents a ContentItem. */ + class ContentItem implements IContentItem { + + /** + * Constructs a new ContentItem. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.IContentItem); + + /** ContentItem value. */ + public value: string; + + /** ContentItem table. */ + public table?: (google.privacy.dlp.v2.ITable|null); + + /** ContentItem byteItem. */ + public byteItem?: (google.privacy.dlp.v2.IByteContentItem|null); + + /** ContentItem dataItem. */ + public dataItem?: ("value"|"table"|"byteItem"); + + /** + * Creates a new ContentItem instance using the specified properties. + * @param [properties] Properties to set + * @returns ContentItem instance + */ + public static create(properties?: google.privacy.dlp.v2.IContentItem): google.privacy.dlp.v2.ContentItem; + + /** + * Encodes the specified ContentItem message. Does not implicitly {@link google.privacy.dlp.v2.ContentItem.verify|verify} messages. + * @param message ContentItem message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.IContentItem, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ContentItem message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.ContentItem.verify|verify} messages. + * @param message ContentItem message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.IContentItem, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ContentItem message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ContentItem + * @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.privacy.dlp.v2.ContentItem; + + /** + * Decodes a ContentItem message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ContentItem + * @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.privacy.dlp.v2.ContentItem; + + /** + * Verifies a ContentItem 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 ContentItem message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ContentItem + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.ContentItem; + + /** + * Creates a plain object from a ContentItem message. Also converts values to other types if specified. + * @param message ContentItem + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.ContentItem, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ContentItem to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Table. */ + interface ITable { + + /** Table headers */ + headers?: (google.privacy.dlp.v2.IFieldId[]|null); + + /** Table rows */ + rows?: (google.privacy.dlp.v2.Table.IRow[]|null); + } + + /** Represents a Table. */ + class Table implements ITable { + + /** + * Constructs a new Table. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.ITable); + + /** Table headers. */ + public headers: google.privacy.dlp.v2.IFieldId[]; + + /** Table rows. */ + public rows: google.privacy.dlp.v2.Table.IRow[]; + + /** + * Creates a new Table instance using the specified properties. + * @param [properties] Properties to set + * @returns Table instance + */ + public static create(properties?: google.privacy.dlp.v2.ITable): google.privacy.dlp.v2.Table; + + /** + * Encodes the specified Table message. Does not implicitly {@link google.privacy.dlp.v2.Table.verify|verify} messages. + * @param message Table message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.ITable, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Table message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.Table.verify|verify} messages. + * @param message Table message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.ITable, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Table message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Table + * @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.privacy.dlp.v2.Table; + + /** + * Decodes a Table message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Table + * @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.privacy.dlp.v2.Table; + + /** + * Verifies a Table 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 Table message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Table + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.Table; + + /** + * Creates a plain object from a Table message. Also converts values to other types if specified. + * @param message Table + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.Table, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Table to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace Table { + + /** Properties of a Row. */ + interface IRow { + + /** Row values */ + values?: (google.privacy.dlp.v2.IValue[]|null); + } + + /** Represents a Row. */ + class Row implements IRow { + + /** + * Constructs a new Row. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.Table.IRow); + + /** Row values. */ + public values: google.privacy.dlp.v2.IValue[]; + + /** + * Creates a new Row instance using the specified properties. + * @param [properties] Properties to set + * @returns Row instance + */ + public static create(properties?: google.privacy.dlp.v2.Table.IRow): google.privacy.dlp.v2.Table.Row; + + /** + * Encodes the specified Row message. Does not implicitly {@link google.privacy.dlp.v2.Table.Row.verify|verify} messages. + * @param message Row message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.Table.IRow, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Row message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.Table.Row.verify|verify} messages. + * @param message Row message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.Table.IRow, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Row message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Row + * @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.privacy.dlp.v2.Table.Row; + + /** + * Decodes a Row message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Row + * @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.privacy.dlp.v2.Table.Row; + + /** + * Verifies a Row 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 Row message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Row + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.Table.Row; + + /** + * Creates a plain object from a Row message. Also converts values to other types if specified. + * @param message Row + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.Table.Row, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Row to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of an InspectResult. */ + interface IInspectResult { + + /** InspectResult findings */ + findings?: (google.privacy.dlp.v2.IFinding[]|null); + + /** InspectResult findingsTruncated */ + findingsTruncated?: (boolean|null); + } + + /** Represents an InspectResult. */ + class InspectResult implements IInspectResult { + + /** + * Constructs a new InspectResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.IInspectResult); + + /** InspectResult findings. */ + public findings: google.privacy.dlp.v2.IFinding[]; + + /** InspectResult findingsTruncated. */ + public findingsTruncated: boolean; + + /** + * Creates a new InspectResult instance using the specified properties. + * @param [properties] Properties to set + * @returns InspectResult instance + */ + public static create(properties?: google.privacy.dlp.v2.IInspectResult): google.privacy.dlp.v2.InspectResult; + + /** + * Encodes the specified InspectResult message. Does not implicitly {@link google.privacy.dlp.v2.InspectResult.verify|verify} messages. + * @param message InspectResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.IInspectResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InspectResult message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.InspectResult.verify|verify} messages. + * @param message InspectResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.IInspectResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InspectResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InspectResult + * @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.privacy.dlp.v2.InspectResult; + + /** + * Decodes an InspectResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InspectResult + * @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.privacy.dlp.v2.InspectResult; + + /** + * Verifies an InspectResult 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 an InspectResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InspectResult + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.InspectResult; + + /** + * Creates a plain object from an InspectResult message. Also converts values to other types if specified. + * @param message InspectResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.InspectResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InspectResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Finding. */ + interface IFinding { + + /** Finding name */ + name?: (string|null); + + /** Finding quote */ + quote?: (string|null); + + /** Finding infoType */ + infoType?: (google.privacy.dlp.v2.IInfoType|null); + + /** Finding likelihood */ + likelihood?: (google.privacy.dlp.v2.Likelihood|keyof typeof google.privacy.dlp.v2.Likelihood|null); + + /** Finding location */ + location?: (google.privacy.dlp.v2.ILocation|null); + + /** Finding createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Finding quoteInfo */ + quoteInfo?: (google.privacy.dlp.v2.IQuoteInfo|null); + + /** Finding resourceName */ + resourceName?: (string|null); + + /** Finding triggerName */ + triggerName?: (string|null); + + /** Finding labels */ + labels?: ({ [k: string]: string }|null); + + /** Finding jobCreateTime */ + jobCreateTime?: (google.protobuf.ITimestamp|null); + + /** Finding jobName */ + jobName?: (string|null); + } + + /** Represents a Finding. */ + class Finding implements IFinding { + + /** + * Constructs a new Finding. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.IFinding); + + /** Finding name. */ + public name: string; + + /** Finding quote. */ + public quote: string; + + /** Finding infoType. */ + public infoType?: (google.privacy.dlp.v2.IInfoType|null); + + /** Finding likelihood. */ + public likelihood: (google.privacy.dlp.v2.Likelihood|keyof typeof google.privacy.dlp.v2.Likelihood); + + /** Finding location. */ + public location?: (google.privacy.dlp.v2.ILocation|null); + + /** Finding createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Finding quoteInfo. */ + public quoteInfo?: (google.privacy.dlp.v2.IQuoteInfo|null); + + /** Finding resourceName. */ + public resourceName: string; + + /** Finding triggerName. */ + public triggerName: string; + + /** Finding labels. */ + public labels: { [k: string]: string }; + + /** Finding jobCreateTime. */ + public jobCreateTime?: (google.protobuf.ITimestamp|null); + + /** Finding jobName. */ + public jobName: string; + + /** + * Creates a new Finding instance using the specified properties. + * @param [properties] Properties to set + * @returns Finding instance + */ + public static create(properties?: google.privacy.dlp.v2.IFinding): google.privacy.dlp.v2.Finding; + + /** + * Encodes the specified Finding message. Does not implicitly {@link google.privacy.dlp.v2.Finding.verify|verify} messages. + * @param message Finding message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.IFinding, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Finding message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.Finding.verify|verify} messages. + * @param message Finding message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.IFinding, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Finding message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Finding + * @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.privacy.dlp.v2.Finding; + + /** + * Decodes a Finding message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Finding + * @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.privacy.dlp.v2.Finding; + + /** + * Verifies a Finding 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 Finding message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Finding + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.Finding; + + /** + * Creates a plain object from a Finding message. Also converts values to other types if specified. + * @param message Finding + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.Finding, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Finding to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Location. */ + interface ILocation { + + /** Location byteRange */ + byteRange?: (google.privacy.dlp.v2.IRange|null); + + /** Location codepointRange */ + codepointRange?: (google.privacy.dlp.v2.IRange|null); + + /** Location contentLocations */ + contentLocations?: (google.privacy.dlp.v2.IContentLocation[]|null); + + /** Location container */ + container?: (google.privacy.dlp.v2.IContainer|null); + } + + /** Represents a Location. */ + class Location implements ILocation { + + /** + * Constructs a new Location. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.ILocation); + + /** Location byteRange. */ + public byteRange?: (google.privacy.dlp.v2.IRange|null); + + /** Location codepointRange. */ + public codepointRange?: (google.privacy.dlp.v2.IRange|null); + + /** Location contentLocations. */ + public contentLocations: google.privacy.dlp.v2.IContentLocation[]; + + /** Location container. */ + public container?: (google.privacy.dlp.v2.IContainer|null); + + /** + * Creates a new Location instance using the specified properties. + * @param [properties] Properties to set + * @returns Location instance + */ + public static create(properties?: google.privacy.dlp.v2.ILocation): google.privacy.dlp.v2.Location; + + /** + * Encodes the specified Location message. Does not implicitly {@link google.privacy.dlp.v2.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Location message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Location + * @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.privacy.dlp.v2.Location; + + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Location + * @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.privacy.dlp.v2.Location; + + /** + * Verifies a Location 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 Location message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Location + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.Location; + + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @param message Location + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.Location, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Location to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ContentLocation. */ + interface IContentLocation { + + /** ContentLocation containerName */ + containerName?: (string|null); + + /** ContentLocation recordLocation */ + recordLocation?: (google.privacy.dlp.v2.IRecordLocation|null); + + /** ContentLocation imageLocation */ + imageLocation?: (google.privacy.dlp.v2.IImageLocation|null); + + /** ContentLocation documentLocation */ + documentLocation?: (google.privacy.dlp.v2.IDocumentLocation|null); + + /** ContentLocation metadataLocation */ + metadataLocation?: (google.privacy.dlp.v2.IMetadataLocation|null); + + /** ContentLocation containerTimestamp */ + containerTimestamp?: (google.protobuf.ITimestamp|null); + + /** ContentLocation containerVersion */ + containerVersion?: (string|null); + } + + /** Represents a ContentLocation. */ + class ContentLocation implements IContentLocation { + + /** + * Constructs a new ContentLocation. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.IContentLocation); + + /** ContentLocation containerName. */ + public containerName: string; + + /** ContentLocation recordLocation. */ + public recordLocation?: (google.privacy.dlp.v2.IRecordLocation|null); + + /** ContentLocation imageLocation. */ + public imageLocation?: (google.privacy.dlp.v2.IImageLocation|null); + + /** ContentLocation documentLocation. */ + public documentLocation?: (google.privacy.dlp.v2.IDocumentLocation|null); + + /** ContentLocation metadataLocation. */ + public metadataLocation?: (google.privacy.dlp.v2.IMetadataLocation|null); + + /** ContentLocation containerTimestamp. */ + public containerTimestamp?: (google.protobuf.ITimestamp|null); + + /** ContentLocation containerVersion. */ + public containerVersion: string; + + /** ContentLocation location. */ + public location?: ("recordLocation"|"imageLocation"|"documentLocation"|"metadataLocation"); + + /** + * Creates a new ContentLocation instance using the specified properties. + * @param [properties] Properties to set + * @returns ContentLocation instance + */ + public static create(properties?: google.privacy.dlp.v2.IContentLocation): google.privacy.dlp.v2.ContentLocation; + + /** + * Encodes the specified ContentLocation message. Does not implicitly {@link google.privacy.dlp.v2.ContentLocation.verify|verify} messages. + * @param message ContentLocation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.IContentLocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ContentLocation message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.ContentLocation.verify|verify} messages. + * @param message ContentLocation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.IContentLocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ContentLocation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ContentLocation + * @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.privacy.dlp.v2.ContentLocation; + + /** + * Decodes a ContentLocation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ContentLocation + * @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.privacy.dlp.v2.ContentLocation; + + /** + * Verifies a ContentLocation 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 ContentLocation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ContentLocation + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.ContentLocation; + + /** + * Creates a plain object from a ContentLocation message. Also converts values to other types if specified. + * @param message ContentLocation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.ContentLocation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ContentLocation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a MetadataLocation. */ + interface IMetadataLocation { + + /** MetadataLocation type */ + type?: (google.privacy.dlp.v2.MetadataType|keyof typeof google.privacy.dlp.v2.MetadataType|null); + + /** MetadataLocation storageLabel */ + storageLabel?: (google.privacy.dlp.v2.IStorageMetadataLabel|null); + } + + /** Represents a MetadataLocation. */ + class MetadataLocation implements IMetadataLocation { + + /** + * Constructs a new MetadataLocation. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.IMetadataLocation); + + /** MetadataLocation type. */ + public type: (google.privacy.dlp.v2.MetadataType|keyof typeof google.privacy.dlp.v2.MetadataType); + + /** MetadataLocation storageLabel. */ + public storageLabel?: (google.privacy.dlp.v2.IStorageMetadataLabel|null); + + /** MetadataLocation label. */ + public label?: "storageLabel"; + + /** + * Creates a new MetadataLocation instance using the specified properties. + * @param [properties] Properties to set + * @returns MetadataLocation instance + */ + public static create(properties?: google.privacy.dlp.v2.IMetadataLocation): google.privacy.dlp.v2.MetadataLocation; + + /** + * Encodes the specified MetadataLocation message. Does not implicitly {@link google.privacy.dlp.v2.MetadataLocation.verify|verify} messages. + * @param message MetadataLocation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.IMetadataLocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MetadataLocation message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.MetadataLocation.verify|verify} messages. + * @param message MetadataLocation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.IMetadataLocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MetadataLocation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MetadataLocation + * @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.privacy.dlp.v2.MetadataLocation; + + /** + * Decodes a MetadataLocation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MetadataLocation + * @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.privacy.dlp.v2.MetadataLocation; + + /** + * Verifies a MetadataLocation 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 MetadataLocation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MetadataLocation + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.MetadataLocation; + + /** + * Creates a plain object from a MetadataLocation message. Also converts values to other types if specified. + * @param message MetadataLocation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.MetadataLocation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MetadataLocation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a StorageMetadataLabel. */ + interface IStorageMetadataLabel { + + /** StorageMetadataLabel key */ + key?: (string|null); + } + + /** Represents a StorageMetadataLabel. */ + class StorageMetadataLabel implements IStorageMetadataLabel { + + /** + * Constructs a new StorageMetadataLabel. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.IStorageMetadataLabel); + + /** StorageMetadataLabel key. */ + public key: string; + + /** + * Creates a new StorageMetadataLabel instance using the specified properties. + * @param [properties] Properties to set + * @returns StorageMetadataLabel instance + */ + public static create(properties?: google.privacy.dlp.v2.IStorageMetadataLabel): google.privacy.dlp.v2.StorageMetadataLabel; + + /** + * Encodes the specified StorageMetadataLabel message. Does not implicitly {@link google.privacy.dlp.v2.StorageMetadataLabel.verify|verify} messages. + * @param message StorageMetadataLabel message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.IStorageMetadataLabel, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StorageMetadataLabel message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.StorageMetadataLabel.verify|verify} messages. + * @param message StorageMetadataLabel message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.IStorageMetadataLabel, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StorageMetadataLabel message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StorageMetadataLabel + * @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.privacy.dlp.v2.StorageMetadataLabel; + + /** + * Decodes a StorageMetadataLabel message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StorageMetadataLabel + * @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.privacy.dlp.v2.StorageMetadataLabel; + + /** + * Verifies a StorageMetadataLabel 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 StorageMetadataLabel message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StorageMetadataLabel + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.StorageMetadataLabel; + + /** + * Creates a plain object from a StorageMetadataLabel message. Also converts values to other types if specified. + * @param message StorageMetadataLabel + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.StorageMetadataLabel, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StorageMetadataLabel to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DocumentLocation. */ + interface IDocumentLocation { + + /** DocumentLocation fileOffset */ + fileOffset?: (number|Long|string|null); + } + + /** Represents a DocumentLocation. */ + class DocumentLocation implements IDocumentLocation { + + /** + * Constructs a new DocumentLocation. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.IDocumentLocation); + + /** DocumentLocation fileOffset. */ + public fileOffset: (number|Long|string); + + /** + * Creates a new DocumentLocation instance using the specified properties. + * @param [properties] Properties to set + * @returns DocumentLocation instance + */ + public static create(properties?: google.privacy.dlp.v2.IDocumentLocation): google.privacy.dlp.v2.DocumentLocation; + + /** + * Encodes the specified DocumentLocation message. Does not implicitly {@link google.privacy.dlp.v2.DocumentLocation.verify|verify} messages. + * @param message DocumentLocation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.IDocumentLocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DocumentLocation message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.DocumentLocation.verify|verify} messages. + * @param message DocumentLocation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.IDocumentLocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DocumentLocation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DocumentLocation + * @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.privacy.dlp.v2.DocumentLocation; + + /** + * Decodes a DocumentLocation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DocumentLocation + * @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.privacy.dlp.v2.DocumentLocation; + + /** + * Verifies a DocumentLocation 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 DocumentLocation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DocumentLocation + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.DocumentLocation; + + /** + * Creates a plain object from a DocumentLocation message. Also converts values to other types if specified. + * @param message DocumentLocation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.DocumentLocation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DocumentLocation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a RecordLocation. */ + interface IRecordLocation { + + /** RecordLocation recordKey */ + recordKey?: (google.privacy.dlp.v2.IRecordKey|null); + + /** RecordLocation fieldId */ + fieldId?: (google.privacy.dlp.v2.IFieldId|null); + + /** RecordLocation tableLocation */ + tableLocation?: (google.privacy.dlp.v2.ITableLocation|null); + } + + /** Represents a RecordLocation. */ + class RecordLocation implements IRecordLocation { + + /** + * Constructs a new RecordLocation. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.IRecordLocation); + + /** RecordLocation recordKey. */ + public recordKey?: (google.privacy.dlp.v2.IRecordKey|null); + + /** RecordLocation fieldId. */ + public fieldId?: (google.privacy.dlp.v2.IFieldId|null); + + /** RecordLocation tableLocation. */ + public tableLocation?: (google.privacy.dlp.v2.ITableLocation|null); + + /** + * Creates a new RecordLocation instance using the specified properties. + * @param [properties] Properties to set + * @returns RecordLocation instance + */ + public static create(properties?: google.privacy.dlp.v2.IRecordLocation): google.privacy.dlp.v2.RecordLocation; + + /** + * Encodes the specified RecordLocation message. Does not implicitly {@link google.privacy.dlp.v2.RecordLocation.verify|verify} messages. + * @param message RecordLocation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.IRecordLocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RecordLocation message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.RecordLocation.verify|verify} messages. + * @param message RecordLocation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.IRecordLocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RecordLocation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RecordLocation + * @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.privacy.dlp.v2.RecordLocation; + + /** + * Decodes a RecordLocation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RecordLocation + * @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.privacy.dlp.v2.RecordLocation; + + /** + * Verifies a RecordLocation 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 RecordLocation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RecordLocation + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.RecordLocation; + + /** + * Creates a plain object from a RecordLocation message. Also converts values to other types if specified. + * @param message RecordLocation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.RecordLocation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RecordLocation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a TableLocation. */ + interface ITableLocation { + + /** TableLocation rowIndex */ + rowIndex?: (number|Long|string|null); + } + + /** Represents a TableLocation. */ + class TableLocation implements ITableLocation { + + /** + * Constructs a new TableLocation. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.ITableLocation); + + /** TableLocation rowIndex. */ + public rowIndex: (number|Long|string); + + /** + * Creates a new TableLocation instance using the specified properties. + * @param [properties] Properties to set + * @returns TableLocation instance + */ + public static create(properties?: google.privacy.dlp.v2.ITableLocation): google.privacy.dlp.v2.TableLocation; + + /** + * Encodes the specified TableLocation message. Does not implicitly {@link google.privacy.dlp.v2.TableLocation.verify|verify} messages. + * @param message TableLocation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.ITableLocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TableLocation message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.TableLocation.verify|verify} messages. + * @param message TableLocation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.ITableLocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TableLocation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TableLocation + * @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.privacy.dlp.v2.TableLocation; + + /** + * Decodes a TableLocation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TableLocation + * @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.privacy.dlp.v2.TableLocation; + + /** + * Verifies a TableLocation 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 TableLocation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TableLocation + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.TableLocation; + + /** + * Creates a plain object from a TableLocation message. Also converts values to other types if specified. + * @param message TableLocation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.TableLocation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TableLocation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Container. */ + interface IContainer { + + /** Container type */ + type?: (string|null); + + /** Container projectId */ + projectId?: (string|null); + + /** Container fullPath */ + fullPath?: (string|null); + + /** Container rootPath */ + rootPath?: (string|null); + + /** Container relativePath */ + relativePath?: (string|null); + + /** Container updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Container version */ + version?: (string|null); + } + + /** Represents a Container. */ + class Container implements IContainer { + + /** + * Constructs a new Container. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.IContainer); + + /** Container type. */ + public type: string; + + /** Container projectId. */ + public projectId: string; + + /** Container fullPath. */ + public fullPath: string; + + /** Container rootPath. */ + public rootPath: string; + + /** Container relativePath. */ + public relativePath: string; + + /** Container updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Container version. */ + public version: string; + + /** + * Creates a new Container instance using the specified properties. + * @param [properties] Properties to set + * @returns Container instance + */ + public static create(properties?: google.privacy.dlp.v2.IContainer): google.privacy.dlp.v2.Container; + + /** + * Encodes the specified Container message. Does not implicitly {@link google.privacy.dlp.v2.Container.verify|verify} messages. + * @param message Container message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.IContainer, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Container message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.Container.verify|verify} messages. + * @param message Container message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.IContainer, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Container message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Container + * @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.privacy.dlp.v2.Container; + + /** + * Decodes a Container message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Container + * @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.privacy.dlp.v2.Container; + + /** + * Verifies a Container 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 Container message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Container + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.Container; + + /** + * Creates a plain object from a Container message. Also converts values to other types if specified. + * @param message Container + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.Container, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Container to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Range. */ + interface IRange { + + /** Range start */ + start?: (number|Long|string|null); + + /** Range end */ + end?: (number|Long|string|null); + } + + /** Represents a Range. */ + class Range implements IRange { + + /** + * Constructs a new Range. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.IRange); + + /** Range start. */ + public start: (number|Long|string); + + /** Range end. */ + public end: (number|Long|string); + + /** + * Creates a new Range instance using the specified properties. + * @param [properties] Properties to set + * @returns Range instance + */ + public static create(properties?: google.privacy.dlp.v2.IRange): google.privacy.dlp.v2.Range; + + /** + * Encodes the specified Range message. Does not implicitly {@link google.privacy.dlp.v2.Range.verify|verify} messages. + * @param message Range message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.IRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Range message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.Range.verify|verify} messages. + * @param message Range message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.IRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Range message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Range + * @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.privacy.dlp.v2.Range; + + /** + * Decodes a Range message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Range + * @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.privacy.dlp.v2.Range; + + /** + * Verifies a Range 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 Range message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Range + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.Range; + + /** + * Creates a plain object from a Range message. Also converts values to other types if specified. + * @param message Range + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.Range, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Range to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an ImageLocation. */ + interface IImageLocation { + + /** ImageLocation boundingBoxes */ + boundingBoxes?: (google.privacy.dlp.v2.IBoundingBox[]|null); + } + + /** Represents an ImageLocation. */ + class ImageLocation implements IImageLocation { + + /** + * Constructs a new ImageLocation. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.IImageLocation); + + /** ImageLocation boundingBoxes. */ + public boundingBoxes: google.privacy.dlp.v2.IBoundingBox[]; + + /** + * Creates a new ImageLocation instance using the specified properties. + * @param [properties] Properties to set + * @returns ImageLocation instance + */ + public static create(properties?: google.privacy.dlp.v2.IImageLocation): google.privacy.dlp.v2.ImageLocation; + + /** + * Encodes the specified ImageLocation message. Does not implicitly {@link google.privacy.dlp.v2.ImageLocation.verify|verify} messages. + * @param message ImageLocation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.IImageLocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImageLocation message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.ImageLocation.verify|verify} messages. + * @param message ImageLocation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.IImageLocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImageLocation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImageLocation + * @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.privacy.dlp.v2.ImageLocation; + + /** + * Decodes an ImageLocation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImageLocation + * @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.privacy.dlp.v2.ImageLocation; + + /** + * Verifies an ImageLocation 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 an ImageLocation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImageLocation + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.ImageLocation; + + /** + * Creates a plain object from an ImageLocation message. Also converts values to other types if specified. + * @param message ImageLocation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.ImageLocation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImageLocation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a BoundingBox. */ + interface IBoundingBox { + + /** BoundingBox top */ + top?: (number|null); + + /** BoundingBox left */ + left?: (number|null); + + /** BoundingBox width */ + width?: (number|null); + + /** BoundingBox height */ + height?: (number|null); + } + + /** Represents a BoundingBox. */ + class BoundingBox implements IBoundingBox { + + /** + * Constructs a new BoundingBox. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.IBoundingBox); + + /** BoundingBox top. */ + public top: number; + + /** BoundingBox left. */ + public left: number; + + /** BoundingBox width. */ + public width: number; + + /** BoundingBox height. */ + public height: number; + + /** + * Creates a new BoundingBox instance using the specified properties. + * @param [properties] Properties to set + * @returns BoundingBox instance + */ + public static create(properties?: google.privacy.dlp.v2.IBoundingBox): google.privacy.dlp.v2.BoundingBox; + + /** + * Encodes the specified BoundingBox message. Does not implicitly {@link google.privacy.dlp.v2.BoundingBox.verify|verify} messages. + * @param message BoundingBox message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.IBoundingBox, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BoundingBox message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.BoundingBox.verify|verify} messages. + * @param message BoundingBox message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.IBoundingBox, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BoundingBox message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BoundingBox + * @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.privacy.dlp.v2.BoundingBox; + + /** + * Decodes a BoundingBox message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BoundingBox + * @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.privacy.dlp.v2.BoundingBox; + + /** + * Verifies a BoundingBox 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 BoundingBox message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BoundingBox + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.BoundingBox; + + /** + * Creates a plain object from a BoundingBox message. Also converts values to other types if specified. + * @param message BoundingBox + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.BoundingBox, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BoundingBox to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a RedactImageRequest. */ + interface IRedactImageRequest { + + /** RedactImageRequest parent */ + parent?: (string|null); + + /** RedactImageRequest locationId */ + locationId?: (string|null); + + /** RedactImageRequest inspectConfig */ + inspectConfig?: (google.privacy.dlp.v2.IInspectConfig|null); + + /** RedactImageRequest imageRedactionConfigs */ + imageRedactionConfigs?: (google.privacy.dlp.v2.RedactImageRequest.IImageRedactionConfig[]|null); + + /** RedactImageRequest includeFindings */ + includeFindings?: (boolean|null); + + /** RedactImageRequest byteItem */ + byteItem?: (google.privacy.dlp.v2.IByteContentItem|null); + } + + /** Represents a RedactImageRequest. */ + class RedactImageRequest implements IRedactImageRequest { + + /** + * Constructs a new RedactImageRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.IRedactImageRequest); + + /** RedactImageRequest parent. */ + public parent: string; + + /** RedactImageRequest locationId. */ + public locationId: string; + + /** RedactImageRequest inspectConfig. */ + public inspectConfig?: (google.privacy.dlp.v2.IInspectConfig|null); + + /** RedactImageRequest imageRedactionConfigs. */ + public imageRedactionConfigs: google.privacy.dlp.v2.RedactImageRequest.IImageRedactionConfig[]; + + /** RedactImageRequest includeFindings. */ + public includeFindings: boolean; + + /** RedactImageRequest byteItem. */ + public byteItem?: (google.privacy.dlp.v2.IByteContentItem|null); + + /** + * Creates a new RedactImageRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RedactImageRequest instance + */ + public static create(properties?: google.privacy.dlp.v2.IRedactImageRequest): google.privacy.dlp.v2.RedactImageRequest; + + /** + * Encodes the specified RedactImageRequest message. Does not implicitly {@link google.privacy.dlp.v2.RedactImageRequest.verify|verify} messages. + * @param message RedactImageRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.IRedactImageRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RedactImageRequest message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.RedactImageRequest.verify|verify} messages. + * @param message RedactImageRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.IRedactImageRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RedactImageRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RedactImageRequest + * @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.privacy.dlp.v2.RedactImageRequest; + + /** + * Decodes a RedactImageRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RedactImageRequest + * @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.privacy.dlp.v2.RedactImageRequest; + + /** + * Verifies a RedactImageRequest 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 RedactImageRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RedactImageRequest + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.RedactImageRequest; + + /** + * Creates a plain object from a RedactImageRequest message. Also converts values to other types if specified. + * @param message RedactImageRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.RedactImageRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RedactImageRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace RedactImageRequest { + + /** Properties of an ImageRedactionConfig. */ + interface IImageRedactionConfig { + + /** ImageRedactionConfig infoType */ + infoType?: (google.privacy.dlp.v2.IInfoType|null); + + /** ImageRedactionConfig redactAllText */ + redactAllText?: (boolean|null); + + /** ImageRedactionConfig redactionColor */ + redactionColor?: (google.privacy.dlp.v2.IColor|null); + } + + /** Represents an ImageRedactionConfig. */ + class ImageRedactionConfig implements IImageRedactionConfig { + + /** + * Constructs a new ImageRedactionConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.RedactImageRequest.IImageRedactionConfig); + + /** ImageRedactionConfig infoType. */ + public infoType?: (google.privacy.dlp.v2.IInfoType|null); + + /** ImageRedactionConfig redactAllText. */ + public redactAllText: boolean; + + /** ImageRedactionConfig redactionColor. */ + public redactionColor?: (google.privacy.dlp.v2.IColor|null); + + /** ImageRedactionConfig target. */ + public target?: ("infoType"|"redactAllText"); + + /** + * Creates a new ImageRedactionConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ImageRedactionConfig instance + */ + public static create(properties?: google.privacy.dlp.v2.RedactImageRequest.IImageRedactionConfig): google.privacy.dlp.v2.RedactImageRequest.ImageRedactionConfig; + + /** + * Encodes the specified ImageRedactionConfig message. Does not implicitly {@link google.privacy.dlp.v2.RedactImageRequest.ImageRedactionConfig.verify|verify} messages. + * @param message ImageRedactionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.RedactImageRequest.IImageRedactionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImageRedactionConfig message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.RedactImageRequest.ImageRedactionConfig.verify|verify} messages. + * @param message ImageRedactionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.RedactImageRequest.IImageRedactionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImageRedactionConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImageRedactionConfig + * @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.privacy.dlp.v2.RedactImageRequest.ImageRedactionConfig; + + /** + * Decodes an ImageRedactionConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImageRedactionConfig + * @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.privacy.dlp.v2.RedactImageRequest.ImageRedactionConfig; + + /** + * Verifies an ImageRedactionConfig 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 an ImageRedactionConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImageRedactionConfig + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.RedactImageRequest.ImageRedactionConfig; + + /** + * Creates a plain object from an ImageRedactionConfig message. Also converts values to other types if specified. + * @param message ImageRedactionConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.RedactImageRequest.ImageRedactionConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImageRedactionConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of a Color. */ + interface IColor { + + /** Color red */ + red?: (number|null); + + /** Color green */ + green?: (number|null); + + /** Color blue */ + blue?: (number|null); + } + + /** Represents a Color. */ + class Color implements IColor { + + /** + * Constructs a new Color. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.IColor); + + /** Color red. */ + public red: number; + + /** Color green. */ + public green: number; + + /** Color blue. */ + public blue: number; + + /** + * Creates a new Color instance using the specified properties. + * @param [properties] Properties to set + * @returns Color instance + */ + public static create(properties?: google.privacy.dlp.v2.IColor): google.privacy.dlp.v2.Color; + + /** + * Encodes the specified Color message. Does not implicitly {@link google.privacy.dlp.v2.Color.verify|verify} messages. + * @param message Color message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.IColor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Color message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.Color.verify|verify} messages. + * @param message Color message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.IColor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Color message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Color + * @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.privacy.dlp.v2.Color; + + /** + * Decodes a Color message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Color + * @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.privacy.dlp.v2.Color; + + /** + * Verifies a Color 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 Color message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Color + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.Color; + + /** + * Creates a plain object from a Color message. Also converts values to other types if specified. + * @param message Color + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.Color, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Color to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a RedactImageResponse. */ + interface IRedactImageResponse { + + /** RedactImageResponse redactedImage */ + redactedImage?: (Uint8Array|string|null); + + /** RedactImageResponse extractedText */ + extractedText?: (string|null); + + /** RedactImageResponse inspectResult */ + inspectResult?: (google.privacy.dlp.v2.IInspectResult|null); + } + + /** Represents a RedactImageResponse. */ + class RedactImageResponse implements IRedactImageResponse { + + /** + * Constructs a new RedactImageResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.IRedactImageResponse); + + /** RedactImageResponse redactedImage. */ + public redactedImage: (Uint8Array|string); + + /** RedactImageResponse extractedText. */ + public extractedText: string; + + /** RedactImageResponse inspectResult. */ + public inspectResult?: (google.privacy.dlp.v2.IInspectResult|null); + + /** + * Creates a new RedactImageResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns RedactImageResponse instance + */ + public static create(properties?: google.privacy.dlp.v2.IRedactImageResponse): google.privacy.dlp.v2.RedactImageResponse; + + /** + * Encodes the specified RedactImageResponse message. Does not implicitly {@link google.privacy.dlp.v2.RedactImageResponse.verify|verify} messages. + * @param message RedactImageResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.IRedactImageResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RedactImageResponse message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.RedactImageResponse.verify|verify} messages. + * @param message RedactImageResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.IRedactImageResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RedactImageResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RedactImageResponse + * @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.privacy.dlp.v2.RedactImageResponse; + + /** + * Decodes a RedactImageResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RedactImageResponse + * @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.privacy.dlp.v2.RedactImageResponse; + + /** + * Verifies a RedactImageResponse 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 RedactImageResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RedactImageResponse + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.RedactImageResponse; + + /** + * Creates a plain object from a RedactImageResponse message. Also converts values to other types if specified. + * @param message RedactImageResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.RedactImageResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RedactImageResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeidentifyContentRequest. */ + interface IDeidentifyContentRequest { + + /** DeidentifyContentRequest parent */ + parent?: (string|null); + + /** DeidentifyContentRequest deidentifyConfig */ + deidentifyConfig?: (google.privacy.dlp.v2.IDeidentifyConfig|null); + + /** DeidentifyContentRequest inspectConfig */ + inspectConfig?: (google.privacy.dlp.v2.IInspectConfig|null); + + /** DeidentifyContentRequest item */ + item?: (google.privacy.dlp.v2.IContentItem|null); + + /** DeidentifyContentRequest inspectTemplateName */ + inspectTemplateName?: (string|null); + + /** DeidentifyContentRequest deidentifyTemplateName */ + deidentifyTemplateName?: (string|null); + + /** DeidentifyContentRequest locationId */ + locationId?: (string|null); + } + + /** Represents a DeidentifyContentRequest. */ + class DeidentifyContentRequest implements IDeidentifyContentRequest { + + /** + * Constructs a new DeidentifyContentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.IDeidentifyContentRequest); + + /** DeidentifyContentRequest parent. */ + public parent: string; + + /** DeidentifyContentRequest deidentifyConfig. */ + public deidentifyConfig?: (google.privacy.dlp.v2.IDeidentifyConfig|null); + + /** DeidentifyContentRequest inspectConfig. */ + public inspectConfig?: (google.privacy.dlp.v2.IInspectConfig|null); + + /** DeidentifyContentRequest item. */ + public item?: (google.privacy.dlp.v2.IContentItem|null); + + /** DeidentifyContentRequest inspectTemplateName. */ + public inspectTemplateName: string; + + /** DeidentifyContentRequest deidentifyTemplateName. */ + public deidentifyTemplateName: string; + + /** DeidentifyContentRequest locationId. */ + public locationId: string; + + /** + * Creates a new DeidentifyContentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeidentifyContentRequest instance + */ + public static create(properties?: google.privacy.dlp.v2.IDeidentifyContentRequest): google.privacy.dlp.v2.DeidentifyContentRequest; + + /** + * Encodes the specified DeidentifyContentRequest message. Does not implicitly {@link google.privacy.dlp.v2.DeidentifyContentRequest.verify|verify} messages. + * @param message DeidentifyContentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.IDeidentifyContentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeidentifyContentRequest message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.DeidentifyContentRequest.verify|verify} messages. + * @param message DeidentifyContentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.IDeidentifyContentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeidentifyContentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeidentifyContentRequest + * @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.privacy.dlp.v2.DeidentifyContentRequest; + + /** + * Decodes a DeidentifyContentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeidentifyContentRequest + * @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.privacy.dlp.v2.DeidentifyContentRequest; + + /** + * Verifies a DeidentifyContentRequest 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 DeidentifyContentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeidentifyContentRequest + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.DeidentifyContentRequest; + + /** + * Creates a plain object from a DeidentifyContentRequest message. Also converts values to other types if specified. + * @param message DeidentifyContentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.DeidentifyContentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeidentifyContentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeidentifyContentResponse. */ + interface IDeidentifyContentResponse { + + /** DeidentifyContentResponse item */ + item?: (google.privacy.dlp.v2.IContentItem|null); + + /** DeidentifyContentResponse overview */ + overview?: (google.privacy.dlp.v2.ITransformationOverview|null); + } + + /** Represents a DeidentifyContentResponse. */ + class DeidentifyContentResponse implements IDeidentifyContentResponse { + + /** + * Constructs a new DeidentifyContentResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.IDeidentifyContentResponse); + + /** DeidentifyContentResponse item. */ + public item?: (google.privacy.dlp.v2.IContentItem|null); + + /** DeidentifyContentResponse overview. */ + public overview?: (google.privacy.dlp.v2.ITransformationOverview|null); + + /** + * Creates a new DeidentifyContentResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns DeidentifyContentResponse instance + */ + public static create(properties?: google.privacy.dlp.v2.IDeidentifyContentResponse): google.privacy.dlp.v2.DeidentifyContentResponse; + + /** + * Encodes the specified DeidentifyContentResponse message. Does not implicitly {@link google.privacy.dlp.v2.DeidentifyContentResponse.verify|verify} messages. + * @param message DeidentifyContentResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.IDeidentifyContentResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeidentifyContentResponse message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.DeidentifyContentResponse.verify|verify} messages. + * @param message DeidentifyContentResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.IDeidentifyContentResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeidentifyContentResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeidentifyContentResponse + * @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.privacy.dlp.v2.DeidentifyContentResponse; + + /** + * Decodes a DeidentifyContentResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeidentifyContentResponse + * @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.privacy.dlp.v2.DeidentifyContentResponse; + + /** + * Verifies a DeidentifyContentResponse 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 DeidentifyContentResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeidentifyContentResponse + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.DeidentifyContentResponse; + + /** + * Creates a plain object from a DeidentifyContentResponse message. Also converts values to other types if specified. + * @param message DeidentifyContentResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.DeidentifyContentResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeidentifyContentResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ReidentifyContentRequest. */ + interface IReidentifyContentRequest { + + /** ReidentifyContentRequest parent */ + parent?: (string|null); + + /** ReidentifyContentRequest reidentifyConfig */ + reidentifyConfig?: (google.privacy.dlp.v2.IDeidentifyConfig|null); + + /** ReidentifyContentRequest inspectConfig */ + inspectConfig?: (google.privacy.dlp.v2.IInspectConfig|null); + + /** ReidentifyContentRequest item */ + item?: (google.privacy.dlp.v2.IContentItem|null); + + /** ReidentifyContentRequest inspectTemplateName */ + inspectTemplateName?: (string|null); + + /** ReidentifyContentRequest reidentifyTemplateName */ + reidentifyTemplateName?: (string|null); + + /** ReidentifyContentRequest locationId */ + locationId?: (string|null); + } + + /** Represents a ReidentifyContentRequest. */ + class ReidentifyContentRequest implements IReidentifyContentRequest { + + /** + * Constructs a new ReidentifyContentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.IReidentifyContentRequest); + + /** ReidentifyContentRequest parent. */ + public parent: string; + + /** ReidentifyContentRequest reidentifyConfig. */ + public reidentifyConfig?: (google.privacy.dlp.v2.IDeidentifyConfig|null); + + /** ReidentifyContentRequest inspectConfig. */ + public inspectConfig?: (google.privacy.dlp.v2.IInspectConfig|null); + + /** ReidentifyContentRequest item. */ + public item?: (google.privacy.dlp.v2.IContentItem|null); + + /** ReidentifyContentRequest inspectTemplateName. */ + public inspectTemplateName: string; + + /** ReidentifyContentRequest reidentifyTemplateName. */ + public reidentifyTemplateName: string; + + /** ReidentifyContentRequest locationId. */ + public locationId: string; + + /** + * Creates a new ReidentifyContentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ReidentifyContentRequest instance + */ + public static create(properties?: google.privacy.dlp.v2.IReidentifyContentRequest): google.privacy.dlp.v2.ReidentifyContentRequest; + + /** + * Encodes the specified ReidentifyContentRequest message. Does not implicitly {@link google.privacy.dlp.v2.ReidentifyContentRequest.verify|verify} messages. + * @param message ReidentifyContentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.IReidentifyContentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReidentifyContentRequest message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.ReidentifyContentRequest.verify|verify} messages. + * @param message ReidentifyContentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.IReidentifyContentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReidentifyContentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReidentifyContentRequest + * @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.privacy.dlp.v2.ReidentifyContentRequest; + + /** + * Decodes a ReidentifyContentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReidentifyContentRequest + * @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.privacy.dlp.v2.ReidentifyContentRequest; + + /** + * Verifies a ReidentifyContentRequest 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 ReidentifyContentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReidentifyContentRequest + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.ReidentifyContentRequest; + + /** + * Creates a plain object from a ReidentifyContentRequest message. Also converts values to other types if specified. + * @param message ReidentifyContentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.ReidentifyContentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReidentifyContentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ReidentifyContentResponse. */ + interface IReidentifyContentResponse { + + /** ReidentifyContentResponse item */ + item?: (google.privacy.dlp.v2.IContentItem|null); + + /** ReidentifyContentResponse overview */ + overview?: (google.privacy.dlp.v2.ITransformationOverview|null); + } + + /** Represents a ReidentifyContentResponse. */ + class ReidentifyContentResponse implements IReidentifyContentResponse { + + /** + * Constructs a new ReidentifyContentResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.IReidentifyContentResponse); + + /** ReidentifyContentResponse item. */ + public item?: (google.privacy.dlp.v2.IContentItem|null); + + /** ReidentifyContentResponse overview. */ + public overview?: (google.privacy.dlp.v2.ITransformationOverview|null); + + /** + * Creates a new ReidentifyContentResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ReidentifyContentResponse instance + */ + public static create(properties?: google.privacy.dlp.v2.IReidentifyContentResponse): google.privacy.dlp.v2.ReidentifyContentResponse; + + /** + * Encodes the specified ReidentifyContentResponse message. Does not implicitly {@link google.privacy.dlp.v2.ReidentifyContentResponse.verify|verify} messages. + * @param message ReidentifyContentResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.IReidentifyContentResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReidentifyContentResponse message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.ReidentifyContentResponse.verify|verify} messages. + * @param message ReidentifyContentResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.IReidentifyContentResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReidentifyContentResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReidentifyContentResponse + * @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.privacy.dlp.v2.ReidentifyContentResponse; + + /** + * Decodes a ReidentifyContentResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReidentifyContentResponse + * @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.privacy.dlp.v2.ReidentifyContentResponse; + + /** + * Verifies a ReidentifyContentResponse 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 ReidentifyContentResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReidentifyContentResponse + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.ReidentifyContentResponse; + + /** + * Creates a plain object from a ReidentifyContentResponse message. Also converts values to other types if specified. + * @param message ReidentifyContentResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.ReidentifyContentResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReidentifyContentResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InspectContentRequest. */ + interface IInspectContentRequest { + + /** InspectContentRequest parent */ + parent?: (string|null); + + /** InspectContentRequest inspectConfig */ + inspectConfig?: (google.privacy.dlp.v2.IInspectConfig|null); + + /** InspectContentRequest item */ + item?: (google.privacy.dlp.v2.IContentItem|null); + + /** InspectContentRequest inspectTemplateName */ + inspectTemplateName?: (string|null); + + /** InspectContentRequest locationId */ + locationId?: (string|null); + } + + /** Represents an InspectContentRequest. */ + class InspectContentRequest implements IInspectContentRequest { + + /** + * Constructs a new InspectContentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.IInspectContentRequest); + + /** InspectContentRequest parent. */ + public parent: string; + + /** InspectContentRequest inspectConfig. */ + public inspectConfig?: (google.privacy.dlp.v2.IInspectConfig|null); + + /** InspectContentRequest item. */ + public item?: (google.privacy.dlp.v2.IContentItem|null); + + /** InspectContentRequest inspectTemplateName. */ + public inspectTemplateName: string; + + /** InspectContentRequest locationId. */ + public locationId: string; + + /** + * Creates a new InspectContentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns InspectContentRequest instance + */ + public static create(properties?: google.privacy.dlp.v2.IInspectContentRequest): google.privacy.dlp.v2.InspectContentRequest; + + /** + * Encodes the specified InspectContentRequest message. Does not implicitly {@link google.privacy.dlp.v2.InspectContentRequest.verify|verify} messages. + * @param message InspectContentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.IInspectContentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InspectContentRequest message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.InspectContentRequest.verify|verify} messages. + * @param message InspectContentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.IInspectContentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InspectContentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InspectContentRequest + * @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.privacy.dlp.v2.InspectContentRequest; + + /** + * Decodes an InspectContentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InspectContentRequest + * @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.privacy.dlp.v2.InspectContentRequest; + + /** + * Verifies an InspectContentRequest 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 an InspectContentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InspectContentRequest + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.InspectContentRequest; + + /** + * Creates a plain object from an InspectContentRequest message. Also converts values to other types if specified. + * @param message InspectContentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.InspectContentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InspectContentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InspectContentResponse. */ + interface IInspectContentResponse { + + /** InspectContentResponse result */ + result?: (google.privacy.dlp.v2.IInspectResult|null); + } + + /** Represents an InspectContentResponse. */ + class InspectContentResponse implements IInspectContentResponse { + + /** + * Constructs a new InspectContentResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.IInspectContentResponse); + + /** InspectContentResponse result. */ + public result?: (google.privacy.dlp.v2.IInspectResult|null); + + /** + * Creates a new InspectContentResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns InspectContentResponse instance + */ + public static create(properties?: google.privacy.dlp.v2.IInspectContentResponse): google.privacy.dlp.v2.InspectContentResponse; + + /** + * Encodes the specified InspectContentResponse message. Does not implicitly {@link google.privacy.dlp.v2.InspectContentResponse.verify|verify} messages. + * @param message InspectContentResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.IInspectContentResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InspectContentResponse message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.InspectContentResponse.verify|verify} messages. + * @param message InspectContentResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.IInspectContentResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InspectContentResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InspectContentResponse + * @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.privacy.dlp.v2.InspectContentResponse; + + /** + * Decodes an InspectContentResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InspectContentResponse + * @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.privacy.dlp.v2.InspectContentResponse; + + /** + * Verifies an InspectContentResponse 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 an InspectContentResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InspectContentResponse + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.InspectContentResponse; + + /** + * Creates a plain object from an InspectContentResponse message. Also converts values to other types if specified. + * @param message InspectContentResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.InspectContentResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InspectContentResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an OutputStorageConfig. */ + interface IOutputStorageConfig { + + /** OutputStorageConfig table */ + table?: (google.privacy.dlp.v2.IBigQueryTable|null); + + /** OutputStorageConfig outputSchema */ + outputSchema?: (google.privacy.dlp.v2.OutputStorageConfig.OutputSchema|keyof typeof google.privacy.dlp.v2.OutputStorageConfig.OutputSchema|null); + } + + /** Represents an OutputStorageConfig. */ + class OutputStorageConfig implements IOutputStorageConfig { + + /** + * Constructs a new OutputStorageConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.IOutputStorageConfig); + + /** OutputStorageConfig table. */ + public table?: (google.privacy.dlp.v2.IBigQueryTable|null); + + /** OutputStorageConfig outputSchema. */ + public outputSchema: (google.privacy.dlp.v2.OutputStorageConfig.OutputSchema|keyof typeof google.privacy.dlp.v2.OutputStorageConfig.OutputSchema); + + /** OutputStorageConfig type. */ + public type?: "table"; + + /** + * Creates a new OutputStorageConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns OutputStorageConfig instance + */ + public static create(properties?: google.privacy.dlp.v2.IOutputStorageConfig): google.privacy.dlp.v2.OutputStorageConfig; + + /** + * Encodes the specified OutputStorageConfig message. Does not implicitly {@link google.privacy.dlp.v2.OutputStorageConfig.verify|verify} messages. + * @param message OutputStorageConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.IOutputStorageConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OutputStorageConfig message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.OutputStorageConfig.verify|verify} messages. + * @param message OutputStorageConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.IOutputStorageConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OutputStorageConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OutputStorageConfig + * @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.privacy.dlp.v2.OutputStorageConfig; + + /** + * Decodes an OutputStorageConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OutputStorageConfig + * @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.privacy.dlp.v2.OutputStorageConfig; + + /** + * Verifies an OutputStorageConfig 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 an OutputStorageConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OutputStorageConfig + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.OutputStorageConfig; + + /** + * Creates a plain object from an OutputStorageConfig message. Also converts values to other types if specified. + * @param message OutputStorageConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.OutputStorageConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OutputStorageConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace OutputStorageConfig { + + /** OutputSchema enum. */ + enum OutputSchema { + OUTPUT_SCHEMA_UNSPECIFIED = 0, + BASIC_COLUMNS = 1, + GCS_COLUMNS = 2, + DATASTORE_COLUMNS = 3, + BIG_QUERY_COLUMNS = 4, + ALL_COLUMNS = 5 + } + } + + /** Properties of an InfoTypeStats. */ + interface IInfoTypeStats { + + /** InfoTypeStats infoType */ + infoType?: (google.privacy.dlp.v2.IInfoType|null); + + /** InfoTypeStats count */ + count?: (number|Long|string|null); + } + + /** Represents an InfoTypeStats. */ + class InfoTypeStats implements IInfoTypeStats { + + /** + * Constructs a new InfoTypeStats. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.IInfoTypeStats); + + /** InfoTypeStats infoType. */ + public infoType?: (google.privacy.dlp.v2.IInfoType|null); + + /** InfoTypeStats count. */ + public count: (number|Long|string); + + /** + * Creates a new InfoTypeStats instance using the specified properties. + * @param [properties] Properties to set + * @returns InfoTypeStats instance + */ + public static create(properties?: google.privacy.dlp.v2.IInfoTypeStats): google.privacy.dlp.v2.InfoTypeStats; + + /** + * Encodes the specified InfoTypeStats message. Does not implicitly {@link google.privacy.dlp.v2.InfoTypeStats.verify|verify} messages. + * @param message InfoTypeStats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.IInfoTypeStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InfoTypeStats message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.InfoTypeStats.verify|verify} messages. + * @param message InfoTypeStats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.IInfoTypeStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InfoTypeStats message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InfoTypeStats + * @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.privacy.dlp.v2.InfoTypeStats; + + /** + * Decodes an InfoTypeStats message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InfoTypeStats + * @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.privacy.dlp.v2.InfoTypeStats; + + /** + * Verifies an InfoTypeStats 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 an InfoTypeStats message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InfoTypeStats + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.InfoTypeStats; + + /** + * Creates a plain object from an InfoTypeStats message. Also converts values to other types if specified. + * @param message InfoTypeStats + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.InfoTypeStats, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InfoTypeStats to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InspectDataSourceDetails. */ + interface IInspectDataSourceDetails { + + /** InspectDataSourceDetails requestedOptions */ + requestedOptions?: (google.privacy.dlp.v2.InspectDataSourceDetails.IRequestedOptions|null); + + /** InspectDataSourceDetails result */ + result?: (google.privacy.dlp.v2.InspectDataSourceDetails.IResult|null); + } + + /** Represents an InspectDataSourceDetails. */ + class InspectDataSourceDetails implements IInspectDataSourceDetails { + + /** + * Constructs a new InspectDataSourceDetails. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.IInspectDataSourceDetails); + + /** InspectDataSourceDetails requestedOptions. */ + public requestedOptions?: (google.privacy.dlp.v2.InspectDataSourceDetails.IRequestedOptions|null); + + /** InspectDataSourceDetails result. */ + public result?: (google.privacy.dlp.v2.InspectDataSourceDetails.IResult|null); + + /** + * Creates a new InspectDataSourceDetails instance using the specified properties. + * @param [properties] Properties to set + * @returns InspectDataSourceDetails instance + */ + public static create(properties?: google.privacy.dlp.v2.IInspectDataSourceDetails): google.privacy.dlp.v2.InspectDataSourceDetails; + + /** + * Encodes the specified InspectDataSourceDetails message. Does not implicitly {@link google.privacy.dlp.v2.InspectDataSourceDetails.verify|verify} messages. + * @param message InspectDataSourceDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.IInspectDataSourceDetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InspectDataSourceDetails message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.InspectDataSourceDetails.verify|verify} messages. + * @param message InspectDataSourceDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.IInspectDataSourceDetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InspectDataSourceDetails message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InspectDataSourceDetails + * @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.privacy.dlp.v2.InspectDataSourceDetails; + + /** + * Decodes an InspectDataSourceDetails message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InspectDataSourceDetails + * @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.privacy.dlp.v2.InspectDataSourceDetails; + + /** + * Verifies an InspectDataSourceDetails 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 an InspectDataSourceDetails message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InspectDataSourceDetails + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.InspectDataSourceDetails; + + /** + * Creates a plain object from an InspectDataSourceDetails message. Also converts values to other types if specified. + * @param message InspectDataSourceDetails + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.InspectDataSourceDetails, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InspectDataSourceDetails to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace InspectDataSourceDetails { + + /** Properties of a RequestedOptions. */ + interface IRequestedOptions { + + /** RequestedOptions snapshotInspectTemplate */ + snapshotInspectTemplate?: (google.privacy.dlp.v2.IInspectTemplate|null); + + /** RequestedOptions jobConfig */ + jobConfig?: (google.privacy.dlp.v2.IInspectJobConfig|null); + } + + /** Represents a RequestedOptions. */ + class RequestedOptions implements IRequestedOptions { + + /** + * Constructs a new RequestedOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.InspectDataSourceDetails.IRequestedOptions); + + /** RequestedOptions snapshotInspectTemplate. */ + public snapshotInspectTemplate?: (google.privacy.dlp.v2.IInspectTemplate|null); + + /** RequestedOptions jobConfig. */ + public jobConfig?: (google.privacy.dlp.v2.IInspectJobConfig|null); + + /** + * Creates a new RequestedOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns RequestedOptions instance + */ + public static create(properties?: google.privacy.dlp.v2.InspectDataSourceDetails.IRequestedOptions): google.privacy.dlp.v2.InspectDataSourceDetails.RequestedOptions; + + /** + * Encodes the specified RequestedOptions message. Does not implicitly {@link google.privacy.dlp.v2.InspectDataSourceDetails.RequestedOptions.verify|verify} messages. + * @param message RequestedOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.InspectDataSourceDetails.IRequestedOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RequestedOptions message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.InspectDataSourceDetails.RequestedOptions.verify|verify} messages. + * @param message RequestedOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.InspectDataSourceDetails.IRequestedOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RequestedOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RequestedOptions + * @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.privacy.dlp.v2.InspectDataSourceDetails.RequestedOptions; + + /** + * Decodes a RequestedOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RequestedOptions + * @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.privacy.dlp.v2.InspectDataSourceDetails.RequestedOptions; + + /** + * Verifies a RequestedOptions 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 RequestedOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RequestedOptions + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.InspectDataSourceDetails.RequestedOptions; + + /** + * Creates a plain object from a RequestedOptions message. Also converts values to other types if specified. + * @param message RequestedOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.InspectDataSourceDetails.RequestedOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RequestedOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Result. */ + interface IResult { + + /** Result processedBytes */ + processedBytes?: (number|Long|string|null); + + /** Result totalEstimatedBytes */ + totalEstimatedBytes?: (number|Long|string|null); + + /** Result infoTypeStats */ + infoTypeStats?: (google.privacy.dlp.v2.IInfoTypeStats[]|null); + + /** Result hybridStats */ + hybridStats?: (google.privacy.dlp.v2.IHybridInspectStatistics|null); + } + + /** Represents a Result. */ + class Result implements IResult { + + /** + * Constructs a new Result. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.InspectDataSourceDetails.IResult); + + /** Result processedBytes. */ + public processedBytes: (number|Long|string); + + /** Result totalEstimatedBytes. */ + public totalEstimatedBytes: (number|Long|string); + + /** Result infoTypeStats. */ + public infoTypeStats: google.privacy.dlp.v2.IInfoTypeStats[]; + + /** Result hybridStats. */ + public hybridStats?: (google.privacy.dlp.v2.IHybridInspectStatistics|null); + + /** + * Creates a new Result instance using the specified properties. + * @param [properties] Properties to set + * @returns Result instance + */ + public static create(properties?: google.privacy.dlp.v2.InspectDataSourceDetails.IResult): google.privacy.dlp.v2.InspectDataSourceDetails.Result; + + /** + * Encodes the specified Result message. Does not implicitly {@link google.privacy.dlp.v2.InspectDataSourceDetails.Result.verify|verify} messages. + * @param message Result message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.InspectDataSourceDetails.IResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Result message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.InspectDataSourceDetails.Result.verify|verify} messages. + * @param message Result message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.InspectDataSourceDetails.IResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Result message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Result + * @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.privacy.dlp.v2.InspectDataSourceDetails.Result; + + /** + * Decodes a Result message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Result + * @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.privacy.dlp.v2.InspectDataSourceDetails.Result; + + /** + * Verifies a Result 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 Result message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Result + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.InspectDataSourceDetails.Result; + + /** + * Creates a plain object from a Result message. Also converts values to other types if specified. + * @param message Result + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.InspectDataSourceDetails.Result, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Result to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of a HybridInspectStatistics. */ + interface IHybridInspectStatistics { + + /** HybridInspectStatistics processedCount */ + processedCount?: (number|Long|string|null); + + /** HybridInspectStatistics abortedCount */ + abortedCount?: (number|Long|string|null); + + /** HybridInspectStatistics pendingCount */ + pendingCount?: (number|Long|string|null); + } + + /** Represents a HybridInspectStatistics. */ + class HybridInspectStatistics implements IHybridInspectStatistics { + + /** + * Constructs a new HybridInspectStatistics. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.IHybridInspectStatistics); + + /** HybridInspectStatistics processedCount. */ + public processedCount: (number|Long|string); + + /** HybridInspectStatistics abortedCount. */ + public abortedCount: (number|Long|string); + + /** HybridInspectStatistics pendingCount. */ + public pendingCount: (number|Long|string); + + /** + * Creates a new HybridInspectStatistics instance using the specified properties. + * @param [properties] Properties to set + * @returns HybridInspectStatistics instance + */ + public static create(properties?: google.privacy.dlp.v2.IHybridInspectStatistics): google.privacy.dlp.v2.HybridInspectStatistics; + + /** + * Encodes the specified HybridInspectStatistics message. Does not implicitly {@link google.privacy.dlp.v2.HybridInspectStatistics.verify|verify} messages. + * @param message HybridInspectStatistics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.IHybridInspectStatistics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HybridInspectStatistics message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.HybridInspectStatistics.verify|verify} messages. + * @param message HybridInspectStatistics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.IHybridInspectStatistics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HybridInspectStatistics message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HybridInspectStatistics + * @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.privacy.dlp.v2.HybridInspectStatistics; + + /** + * Decodes a HybridInspectStatistics message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HybridInspectStatistics + * @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.privacy.dlp.v2.HybridInspectStatistics; + + /** + * Verifies a HybridInspectStatistics 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 HybridInspectStatistics message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HybridInspectStatistics + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.HybridInspectStatistics; + + /** + * Creates a plain object from a HybridInspectStatistics message. Also converts values to other types if specified. + * @param message HybridInspectStatistics + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.HybridInspectStatistics, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HybridInspectStatistics to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InfoTypeDescription. */ + interface IInfoTypeDescription { + + /** InfoTypeDescription name */ + name?: (string|null); + + /** InfoTypeDescription displayName */ + displayName?: (string|null); + + /** InfoTypeDescription supportedBy */ + supportedBy?: (google.privacy.dlp.v2.InfoTypeSupportedBy[]|null); + + /** InfoTypeDescription description */ + description?: (string|null); + } + + /** Represents an InfoTypeDescription. */ + class InfoTypeDescription implements IInfoTypeDescription { + + /** + * Constructs a new InfoTypeDescription. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.IInfoTypeDescription); + + /** InfoTypeDescription name. */ + public name: string; + + /** InfoTypeDescription displayName. */ + public displayName: string; + + /** InfoTypeDescription supportedBy. */ + public supportedBy: google.privacy.dlp.v2.InfoTypeSupportedBy[]; + + /** InfoTypeDescription description. */ + public description: string; + + /** + * Creates a new InfoTypeDescription instance using the specified properties. + * @param [properties] Properties to set + * @returns InfoTypeDescription instance + */ + public static create(properties?: google.privacy.dlp.v2.IInfoTypeDescription): google.privacy.dlp.v2.InfoTypeDescription; + + /** + * Encodes the specified InfoTypeDescription message. Does not implicitly {@link google.privacy.dlp.v2.InfoTypeDescription.verify|verify} messages. + * @param message InfoTypeDescription message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.IInfoTypeDescription, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InfoTypeDescription message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.InfoTypeDescription.verify|verify} messages. + * @param message InfoTypeDescription message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.IInfoTypeDescription, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InfoTypeDescription message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InfoTypeDescription + * @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.privacy.dlp.v2.InfoTypeDescription; + + /** + * Decodes an InfoTypeDescription message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InfoTypeDescription + * @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.privacy.dlp.v2.InfoTypeDescription; + + /** + * Verifies an InfoTypeDescription 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 an InfoTypeDescription message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InfoTypeDescription + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.InfoTypeDescription; + + /** + * Creates a plain object from an InfoTypeDescription message. Also converts values to other types if specified. + * @param message InfoTypeDescription + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.InfoTypeDescription, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InfoTypeDescription to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListInfoTypesRequest. */ + interface IListInfoTypesRequest { + + /** ListInfoTypesRequest parent */ + parent?: (string|null); + + /** ListInfoTypesRequest languageCode */ + languageCode?: (string|null); + + /** ListInfoTypesRequest filter */ + filter?: (string|null); + + /** ListInfoTypesRequest locationId */ + locationId?: (string|null); + } + + /** Represents a ListInfoTypesRequest. */ + class ListInfoTypesRequest implements IListInfoTypesRequest { + + /** + * Constructs a new ListInfoTypesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.IListInfoTypesRequest); + + /** ListInfoTypesRequest parent. */ + public parent: string; + + /** ListInfoTypesRequest languageCode. */ + public languageCode: string; + + /** ListInfoTypesRequest filter. */ + public filter: string; + + /** ListInfoTypesRequest locationId. */ + public locationId: string; + + /** + * Creates a new ListInfoTypesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListInfoTypesRequest instance + */ + public static create(properties?: google.privacy.dlp.v2.IListInfoTypesRequest): google.privacy.dlp.v2.ListInfoTypesRequest; + + /** + * Encodes the specified ListInfoTypesRequest message. Does not implicitly {@link google.privacy.dlp.v2.ListInfoTypesRequest.verify|verify} messages. + * @param message ListInfoTypesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.IListInfoTypesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListInfoTypesRequest message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.ListInfoTypesRequest.verify|verify} messages. + * @param message ListInfoTypesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.IListInfoTypesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListInfoTypesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListInfoTypesRequest + * @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.privacy.dlp.v2.ListInfoTypesRequest; + + /** + * Decodes a ListInfoTypesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListInfoTypesRequest + * @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.privacy.dlp.v2.ListInfoTypesRequest; + + /** + * Verifies a ListInfoTypesRequest 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 ListInfoTypesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListInfoTypesRequest + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.ListInfoTypesRequest; + + /** + * Creates a plain object from a ListInfoTypesRequest message. Also converts values to other types if specified. + * @param message ListInfoTypesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.ListInfoTypesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListInfoTypesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListInfoTypesResponse. */ + interface IListInfoTypesResponse { + + /** ListInfoTypesResponse infoTypes */ + infoTypes?: (google.privacy.dlp.v2.IInfoTypeDescription[]|null); + } + + /** Represents a ListInfoTypesResponse. */ + class ListInfoTypesResponse implements IListInfoTypesResponse { + + /** + * Constructs a new ListInfoTypesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.IListInfoTypesResponse); + + /** ListInfoTypesResponse infoTypes. */ + public infoTypes: google.privacy.dlp.v2.IInfoTypeDescription[]; + + /** + * Creates a new ListInfoTypesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListInfoTypesResponse instance + */ + public static create(properties?: google.privacy.dlp.v2.IListInfoTypesResponse): google.privacy.dlp.v2.ListInfoTypesResponse; + + /** + * Encodes the specified ListInfoTypesResponse message. Does not implicitly {@link google.privacy.dlp.v2.ListInfoTypesResponse.verify|verify} messages. + * @param message ListInfoTypesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.IListInfoTypesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListInfoTypesResponse message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.ListInfoTypesResponse.verify|verify} messages. + * @param message ListInfoTypesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.IListInfoTypesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListInfoTypesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListInfoTypesResponse + * @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.privacy.dlp.v2.ListInfoTypesResponse; + + /** + * Decodes a ListInfoTypesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListInfoTypesResponse + * @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.privacy.dlp.v2.ListInfoTypesResponse; + + /** + * Verifies a ListInfoTypesResponse 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 ListInfoTypesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListInfoTypesResponse + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.ListInfoTypesResponse; + + /** + * Creates a plain object from a ListInfoTypesResponse message. Also converts values to other types if specified. + * @param message ListInfoTypesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.ListInfoTypesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListInfoTypesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a RiskAnalysisJobConfig. */ + interface IRiskAnalysisJobConfig { + + /** RiskAnalysisJobConfig privacyMetric */ + privacyMetric?: (google.privacy.dlp.v2.IPrivacyMetric|null); + + /** RiskAnalysisJobConfig sourceTable */ + sourceTable?: (google.privacy.dlp.v2.IBigQueryTable|null); + + /** RiskAnalysisJobConfig actions */ + actions?: (google.privacy.dlp.v2.IAction[]|null); + } + + /** Represents a RiskAnalysisJobConfig. */ + class RiskAnalysisJobConfig implements IRiskAnalysisJobConfig { + + /** + * Constructs a new RiskAnalysisJobConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.IRiskAnalysisJobConfig); + + /** RiskAnalysisJobConfig privacyMetric. */ + public privacyMetric?: (google.privacy.dlp.v2.IPrivacyMetric|null); + + /** RiskAnalysisJobConfig sourceTable. */ + public sourceTable?: (google.privacy.dlp.v2.IBigQueryTable|null); + + /** RiskAnalysisJobConfig actions. */ + public actions: google.privacy.dlp.v2.IAction[]; + + /** + * Creates a new RiskAnalysisJobConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns RiskAnalysisJobConfig instance + */ + public static create(properties?: google.privacy.dlp.v2.IRiskAnalysisJobConfig): google.privacy.dlp.v2.RiskAnalysisJobConfig; + + /** + * Encodes the specified RiskAnalysisJobConfig message. Does not implicitly {@link google.privacy.dlp.v2.RiskAnalysisJobConfig.verify|verify} messages. + * @param message RiskAnalysisJobConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.IRiskAnalysisJobConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RiskAnalysisJobConfig message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.RiskAnalysisJobConfig.verify|verify} messages. + * @param message RiskAnalysisJobConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.IRiskAnalysisJobConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RiskAnalysisJobConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RiskAnalysisJobConfig + * @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.privacy.dlp.v2.RiskAnalysisJobConfig; + + /** + * Decodes a RiskAnalysisJobConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RiskAnalysisJobConfig + * @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.privacy.dlp.v2.RiskAnalysisJobConfig; + + /** + * Verifies a RiskAnalysisJobConfig 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 RiskAnalysisJobConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RiskAnalysisJobConfig + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.RiskAnalysisJobConfig; + + /** + * Creates a plain object from a RiskAnalysisJobConfig message. Also converts values to other types if specified. + * @param message RiskAnalysisJobConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.RiskAnalysisJobConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RiskAnalysisJobConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a QuasiId. */ + interface IQuasiId { + + /** QuasiId field */ + field?: (google.privacy.dlp.v2.IFieldId|null); + + /** QuasiId infoType */ + infoType?: (google.privacy.dlp.v2.IInfoType|null); + + /** QuasiId customTag */ + customTag?: (string|null); + + /** QuasiId inferred */ + inferred?: (google.protobuf.IEmpty|null); + } + + /** Represents a QuasiId. */ + class QuasiId implements IQuasiId { + + /** + * Constructs a new QuasiId. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.IQuasiId); + + /** QuasiId field. */ + public field?: (google.privacy.dlp.v2.IFieldId|null); + + /** QuasiId infoType. */ + public infoType?: (google.privacy.dlp.v2.IInfoType|null); + + /** QuasiId customTag. */ + public customTag: string; + + /** QuasiId inferred. */ + public inferred?: (google.protobuf.IEmpty|null); + + /** QuasiId tag. */ + public tag?: ("infoType"|"customTag"|"inferred"); + + /** + * Creates a new QuasiId instance using the specified properties. + * @param [properties] Properties to set + * @returns QuasiId instance + */ + public static create(properties?: google.privacy.dlp.v2.IQuasiId): google.privacy.dlp.v2.QuasiId; + + /** + * Encodes the specified QuasiId message. Does not implicitly {@link google.privacy.dlp.v2.QuasiId.verify|verify} messages. + * @param message QuasiId message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.IQuasiId, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified QuasiId message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.QuasiId.verify|verify} messages. + * @param message QuasiId message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.IQuasiId, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a QuasiId message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns QuasiId + * @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.privacy.dlp.v2.QuasiId; + + /** + * Decodes a QuasiId message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns QuasiId + * @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.privacy.dlp.v2.QuasiId; + + /** + * Verifies a QuasiId 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 QuasiId message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns QuasiId + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.QuasiId; + + /** + * Creates a plain object from a QuasiId message. Also converts values to other types if specified. + * @param message QuasiId + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.QuasiId, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this QuasiId to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a StatisticalTable. */ + interface IStatisticalTable { + + /** StatisticalTable table */ + table?: (google.privacy.dlp.v2.IBigQueryTable|null); + + /** StatisticalTable quasiIds */ + quasiIds?: (google.privacy.dlp.v2.StatisticalTable.IQuasiIdentifierField[]|null); + + /** StatisticalTable relativeFrequency */ + relativeFrequency?: (google.privacy.dlp.v2.IFieldId|null); + } + + /** Represents a StatisticalTable. */ + class StatisticalTable implements IStatisticalTable { + + /** + * Constructs a new StatisticalTable. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.IStatisticalTable); + + /** StatisticalTable table. */ + public table?: (google.privacy.dlp.v2.IBigQueryTable|null); + + /** StatisticalTable quasiIds. */ + public quasiIds: google.privacy.dlp.v2.StatisticalTable.IQuasiIdentifierField[]; + + /** StatisticalTable relativeFrequency. */ + public relativeFrequency?: (google.privacy.dlp.v2.IFieldId|null); + + /** + * Creates a new StatisticalTable instance using the specified properties. + * @param [properties] Properties to set + * @returns StatisticalTable instance + */ + public static create(properties?: google.privacy.dlp.v2.IStatisticalTable): google.privacy.dlp.v2.StatisticalTable; + + /** + * Encodes the specified StatisticalTable message. Does not implicitly {@link google.privacy.dlp.v2.StatisticalTable.verify|verify} messages. + * @param message StatisticalTable message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.IStatisticalTable, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StatisticalTable message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.StatisticalTable.verify|verify} messages. + * @param message StatisticalTable message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.IStatisticalTable, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StatisticalTable message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StatisticalTable + * @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.privacy.dlp.v2.StatisticalTable; + + /** + * Decodes a StatisticalTable message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StatisticalTable + * @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.privacy.dlp.v2.StatisticalTable; + + /** + * Verifies a StatisticalTable 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 StatisticalTable message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StatisticalTable + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.StatisticalTable; + + /** + * Creates a plain object from a StatisticalTable message. Also converts values to other types if specified. + * @param message StatisticalTable + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.StatisticalTable, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StatisticalTable to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace StatisticalTable { + + /** Properties of a QuasiIdentifierField. */ + interface IQuasiIdentifierField { + + /** QuasiIdentifierField field */ + field?: (google.privacy.dlp.v2.IFieldId|null); + + /** QuasiIdentifierField customTag */ + customTag?: (string|null); + } + + /** Represents a QuasiIdentifierField. */ + class QuasiIdentifierField implements IQuasiIdentifierField { + + /** + * Constructs a new QuasiIdentifierField. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.StatisticalTable.IQuasiIdentifierField); + + /** QuasiIdentifierField field. */ + public field?: (google.privacy.dlp.v2.IFieldId|null); + + /** QuasiIdentifierField customTag. */ + public customTag: string; + + /** + * Creates a new QuasiIdentifierField instance using the specified properties. + * @param [properties] Properties to set + * @returns QuasiIdentifierField instance + */ + public static create(properties?: google.privacy.dlp.v2.StatisticalTable.IQuasiIdentifierField): google.privacy.dlp.v2.StatisticalTable.QuasiIdentifierField; + + /** + * Encodes the specified QuasiIdentifierField message. Does not implicitly {@link google.privacy.dlp.v2.StatisticalTable.QuasiIdentifierField.verify|verify} messages. + * @param message QuasiIdentifierField message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.StatisticalTable.IQuasiIdentifierField, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified QuasiIdentifierField message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.StatisticalTable.QuasiIdentifierField.verify|verify} messages. + * @param message QuasiIdentifierField message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.StatisticalTable.IQuasiIdentifierField, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a QuasiIdentifierField message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns QuasiIdentifierField + * @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.privacy.dlp.v2.StatisticalTable.QuasiIdentifierField; + + /** + * Decodes a QuasiIdentifierField message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns QuasiIdentifierField + * @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.privacy.dlp.v2.StatisticalTable.QuasiIdentifierField; + + /** + * Verifies a QuasiIdentifierField 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 QuasiIdentifierField message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns QuasiIdentifierField + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.StatisticalTable.QuasiIdentifierField; + + /** + * Creates a plain object from a QuasiIdentifierField message. Also converts values to other types if specified. + * @param message QuasiIdentifierField + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.StatisticalTable.QuasiIdentifierField, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this QuasiIdentifierField to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of a PrivacyMetric. */ + interface IPrivacyMetric { + + /** PrivacyMetric numericalStatsConfig */ + numericalStatsConfig?: (google.privacy.dlp.v2.PrivacyMetric.INumericalStatsConfig|null); + + /** PrivacyMetric categoricalStatsConfig */ + categoricalStatsConfig?: (google.privacy.dlp.v2.PrivacyMetric.ICategoricalStatsConfig|null); + + /** PrivacyMetric kAnonymityConfig */ + kAnonymityConfig?: (google.privacy.dlp.v2.PrivacyMetric.IKAnonymityConfig|null); + + /** PrivacyMetric lDiversityConfig */ + lDiversityConfig?: (google.privacy.dlp.v2.PrivacyMetric.ILDiversityConfig|null); + + /** PrivacyMetric kMapEstimationConfig */ + kMapEstimationConfig?: (google.privacy.dlp.v2.PrivacyMetric.IKMapEstimationConfig|null); + + /** PrivacyMetric deltaPresenceEstimationConfig */ + deltaPresenceEstimationConfig?: (google.privacy.dlp.v2.PrivacyMetric.IDeltaPresenceEstimationConfig|null); + } + + /** Represents a PrivacyMetric. */ + class PrivacyMetric implements IPrivacyMetric { + + /** + * Constructs a new PrivacyMetric. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.IPrivacyMetric); + + /** PrivacyMetric numericalStatsConfig. */ + public numericalStatsConfig?: (google.privacy.dlp.v2.PrivacyMetric.INumericalStatsConfig|null); + + /** PrivacyMetric categoricalStatsConfig. */ + public categoricalStatsConfig?: (google.privacy.dlp.v2.PrivacyMetric.ICategoricalStatsConfig|null); + + /** PrivacyMetric kAnonymityConfig. */ + public kAnonymityConfig?: (google.privacy.dlp.v2.PrivacyMetric.IKAnonymityConfig|null); + + /** PrivacyMetric lDiversityConfig. */ + public lDiversityConfig?: (google.privacy.dlp.v2.PrivacyMetric.ILDiversityConfig|null); + + /** PrivacyMetric kMapEstimationConfig. */ + public kMapEstimationConfig?: (google.privacy.dlp.v2.PrivacyMetric.IKMapEstimationConfig|null); + + /** PrivacyMetric deltaPresenceEstimationConfig. */ + public deltaPresenceEstimationConfig?: (google.privacy.dlp.v2.PrivacyMetric.IDeltaPresenceEstimationConfig|null); + + /** PrivacyMetric type. */ + public type?: ("numericalStatsConfig"|"categoricalStatsConfig"|"kAnonymityConfig"|"lDiversityConfig"|"kMapEstimationConfig"|"deltaPresenceEstimationConfig"); + + /** + * Creates a new PrivacyMetric instance using the specified properties. + * @param [properties] Properties to set + * @returns PrivacyMetric instance + */ + public static create(properties?: google.privacy.dlp.v2.IPrivacyMetric): google.privacy.dlp.v2.PrivacyMetric; + + /** + * Encodes the specified PrivacyMetric message. Does not implicitly {@link google.privacy.dlp.v2.PrivacyMetric.verify|verify} messages. + * @param message PrivacyMetric message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.IPrivacyMetric, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PrivacyMetric message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.PrivacyMetric.verify|verify} messages. + * @param message PrivacyMetric message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.IPrivacyMetric, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PrivacyMetric message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PrivacyMetric + * @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.privacy.dlp.v2.PrivacyMetric; + + /** + * Decodes a PrivacyMetric message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PrivacyMetric + * @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.privacy.dlp.v2.PrivacyMetric; + + /** + * Verifies a PrivacyMetric 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 PrivacyMetric message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PrivacyMetric + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.PrivacyMetric; + + /** + * Creates a plain object from a PrivacyMetric message. Also converts values to other types if specified. + * @param message PrivacyMetric + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.PrivacyMetric, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PrivacyMetric to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace PrivacyMetric { + + /** Properties of a NumericalStatsConfig. */ + interface INumericalStatsConfig { + + /** NumericalStatsConfig field */ + field?: (google.privacy.dlp.v2.IFieldId|null); + } + + /** Represents a NumericalStatsConfig. */ + class NumericalStatsConfig implements INumericalStatsConfig { + + /** + * Constructs a new NumericalStatsConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.PrivacyMetric.INumericalStatsConfig); + + /** NumericalStatsConfig field. */ + public field?: (google.privacy.dlp.v2.IFieldId|null); + + /** + * Creates a new NumericalStatsConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns NumericalStatsConfig instance + */ + public static create(properties?: google.privacy.dlp.v2.PrivacyMetric.INumericalStatsConfig): google.privacy.dlp.v2.PrivacyMetric.NumericalStatsConfig; + + /** + * Encodes the specified NumericalStatsConfig message. Does not implicitly {@link google.privacy.dlp.v2.PrivacyMetric.NumericalStatsConfig.verify|verify} messages. + * @param message NumericalStatsConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.PrivacyMetric.INumericalStatsConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NumericalStatsConfig message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.PrivacyMetric.NumericalStatsConfig.verify|verify} messages. + * @param message NumericalStatsConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.PrivacyMetric.INumericalStatsConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NumericalStatsConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NumericalStatsConfig + * @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.privacy.dlp.v2.PrivacyMetric.NumericalStatsConfig; + + /** + * Decodes a NumericalStatsConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NumericalStatsConfig + * @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.privacy.dlp.v2.PrivacyMetric.NumericalStatsConfig; + + /** + * Verifies a NumericalStatsConfig 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 NumericalStatsConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NumericalStatsConfig + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.PrivacyMetric.NumericalStatsConfig; + + /** + * Creates a plain object from a NumericalStatsConfig message. Also converts values to other types if specified. + * @param message NumericalStatsConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.PrivacyMetric.NumericalStatsConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NumericalStatsConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a CategoricalStatsConfig. */ + interface ICategoricalStatsConfig { + + /** CategoricalStatsConfig field */ + field?: (google.privacy.dlp.v2.IFieldId|null); + } + + /** Represents a CategoricalStatsConfig. */ + class CategoricalStatsConfig implements ICategoricalStatsConfig { + + /** + * Constructs a new CategoricalStatsConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.PrivacyMetric.ICategoricalStatsConfig); + + /** CategoricalStatsConfig field. */ + public field?: (google.privacy.dlp.v2.IFieldId|null); + + /** + * Creates a new CategoricalStatsConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns CategoricalStatsConfig instance + */ + public static create(properties?: google.privacy.dlp.v2.PrivacyMetric.ICategoricalStatsConfig): google.privacy.dlp.v2.PrivacyMetric.CategoricalStatsConfig; + + /** + * Encodes the specified CategoricalStatsConfig message. Does not implicitly {@link google.privacy.dlp.v2.PrivacyMetric.CategoricalStatsConfig.verify|verify} messages. + * @param message CategoricalStatsConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.PrivacyMetric.ICategoricalStatsConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CategoricalStatsConfig message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.PrivacyMetric.CategoricalStatsConfig.verify|verify} messages. + * @param message CategoricalStatsConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.PrivacyMetric.ICategoricalStatsConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CategoricalStatsConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CategoricalStatsConfig + * @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.privacy.dlp.v2.PrivacyMetric.CategoricalStatsConfig; + + /** + * Decodes a CategoricalStatsConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CategoricalStatsConfig + * @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.privacy.dlp.v2.PrivacyMetric.CategoricalStatsConfig; + + /** + * Verifies a CategoricalStatsConfig 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 CategoricalStatsConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CategoricalStatsConfig + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.PrivacyMetric.CategoricalStatsConfig; + + /** + * Creates a plain object from a CategoricalStatsConfig message. Also converts values to other types if specified. + * @param message CategoricalStatsConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.PrivacyMetric.CategoricalStatsConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CategoricalStatsConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a KAnonymityConfig. */ + interface IKAnonymityConfig { + + /** KAnonymityConfig quasiIds */ + quasiIds?: (google.privacy.dlp.v2.IFieldId[]|null); + + /** KAnonymityConfig entityId */ + entityId?: (google.privacy.dlp.v2.IEntityId|null); + } + + /** Represents a KAnonymityConfig. */ + class KAnonymityConfig implements IKAnonymityConfig { + + /** + * Constructs a new KAnonymityConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.PrivacyMetric.IKAnonymityConfig); + + /** KAnonymityConfig quasiIds. */ + public quasiIds: google.privacy.dlp.v2.IFieldId[]; + + /** KAnonymityConfig entityId. */ + public entityId?: (google.privacy.dlp.v2.IEntityId|null); + + /** + * Creates a new KAnonymityConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns KAnonymityConfig instance + */ + public static create(properties?: google.privacy.dlp.v2.PrivacyMetric.IKAnonymityConfig): google.privacy.dlp.v2.PrivacyMetric.KAnonymityConfig; + + /** + * Encodes the specified KAnonymityConfig message. Does not implicitly {@link google.privacy.dlp.v2.PrivacyMetric.KAnonymityConfig.verify|verify} messages. + * @param message KAnonymityConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.PrivacyMetric.IKAnonymityConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified KAnonymityConfig message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.PrivacyMetric.KAnonymityConfig.verify|verify} messages. + * @param message KAnonymityConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.PrivacyMetric.IKAnonymityConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a KAnonymityConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns KAnonymityConfig + * @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.privacy.dlp.v2.PrivacyMetric.KAnonymityConfig; + + /** + * Decodes a KAnonymityConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns KAnonymityConfig + * @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.privacy.dlp.v2.PrivacyMetric.KAnonymityConfig; + + /** + * Verifies a KAnonymityConfig 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 KAnonymityConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns KAnonymityConfig + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.PrivacyMetric.KAnonymityConfig; + + /** + * Creates a plain object from a KAnonymityConfig message. Also converts values to other types if specified. + * @param message KAnonymityConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.PrivacyMetric.KAnonymityConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this KAnonymityConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a LDiversityConfig. */ + interface ILDiversityConfig { + + /** LDiversityConfig quasiIds */ + quasiIds?: (google.privacy.dlp.v2.IFieldId[]|null); + + /** LDiversityConfig sensitiveAttribute */ + sensitiveAttribute?: (google.privacy.dlp.v2.IFieldId|null); + } + + /** Represents a LDiversityConfig. */ + class LDiversityConfig implements ILDiversityConfig { + + /** + * Constructs a new LDiversityConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.PrivacyMetric.ILDiversityConfig); + + /** LDiversityConfig quasiIds. */ + public quasiIds: google.privacy.dlp.v2.IFieldId[]; + + /** LDiversityConfig sensitiveAttribute. */ + public sensitiveAttribute?: (google.privacy.dlp.v2.IFieldId|null); + + /** + * Creates a new LDiversityConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns LDiversityConfig instance + */ + public static create(properties?: google.privacy.dlp.v2.PrivacyMetric.ILDiversityConfig): google.privacy.dlp.v2.PrivacyMetric.LDiversityConfig; + + /** + * Encodes the specified LDiversityConfig message. Does not implicitly {@link google.privacy.dlp.v2.PrivacyMetric.LDiversityConfig.verify|verify} messages. + * @param message LDiversityConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.PrivacyMetric.ILDiversityConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LDiversityConfig message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.PrivacyMetric.LDiversityConfig.verify|verify} messages. + * @param message LDiversityConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.PrivacyMetric.ILDiversityConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LDiversityConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LDiversityConfig + * @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.privacy.dlp.v2.PrivacyMetric.LDiversityConfig; + + /** + * Decodes a LDiversityConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LDiversityConfig + * @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.privacy.dlp.v2.PrivacyMetric.LDiversityConfig; + + /** + * Verifies a LDiversityConfig 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 LDiversityConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LDiversityConfig + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.PrivacyMetric.LDiversityConfig; + + /** + * Creates a plain object from a LDiversityConfig message. Also converts values to other types if specified. + * @param message LDiversityConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.PrivacyMetric.LDiversityConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LDiversityConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a KMapEstimationConfig. */ + interface IKMapEstimationConfig { + + /** KMapEstimationConfig quasiIds */ + quasiIds?: (google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.ITaggedField[]|null); + + /** KMapEstimationConfig regionCode */ + regionCode?: (string|null); + + /** KMapEstimationConfig auxiliaryTables */ + auxiliaryTables?: (google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.IAuxiliaryTable[]|null); + } + + /** Represents a KMapEstimationConfig. */ + class KMapEstimationConfig implements IKMapEstimationConfig { + + /** + * Constructs a new KMapEstimationConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.PrivacyMetric.IKMapEstimationConfig); + + /** KMapEstimationConfig quasiIds. */ + public quasiIds: google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.ITaggedField[]; + + /** KMapEstimationConfig regionCode. */ + public regionCode: string; + + /** KMapEstimationConfig auxiliaryTables. */ + public auxiliaryTables: google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.IAuxiliaryTable[]; + + /** + * Creates a new KMapEstimationConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns KMapEstimationConfig instance + */ + public static create(properties?: google.privacy.dlp.v2.PrivacyMetric.IKMapEstimationConfig): google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig; + + /** + * Encodes the specified KMapEstimationConfig message. Does not implicitly {@link google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.verify|verify} messages. + * @param message KMapEstimationConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.PrivacyMetric.IKMapEstimationConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified KMapEstimationConfig message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.verify|verify} messages. + * @param message KMapEstimationConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.PrivacyMetric.IKMapEstimationConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a KMapEstimationConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns KMapEstimationConfig + * @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.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig; + + /** + * Decodes a KMapEstimationConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns KMapEstimationConfig + * @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.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig; + + /** + * Verifies a KMapEstimationConfig 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 KMapEstimationConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns KMapEstimationConfig + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig; + + /** + * Creates a plain object from a KMapEstimationConfig message. Also converts values to other types if specified. + * @param message KMapEstimationConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this KMapEstimationConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace KMapEstimationConfig { + + /** Properties of a TaggedField. */ + interface ITaggedField { + + /** TaggedField field */ + field?: (google.privacy.dlp.v2.IFieldId|null); + + /** TaggedField infoType */ + infoType?: (google.privacy.dlp.v2.IInfoType|null); + + /** TaggedField customTag */ + customTag?: (string|null); + + /** TaggedField inferred */ + inferred?: (google.protobuf.IEmpty|null); + } + + /** Represents a TaggedField. */ + class TaggedField implements ITaggedField { + + /** + * Constructs a new TaggedField. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.ITaggedField); + + /** TaggedField field. */ + public field?: (google.privacy.dlp.v2.IFieldId|null); + + /** TaggedField infoType. */ + public infoType?: (google.privacy.dlp.v2.IInfoType|null); + + /** TaggedField customTag. */ + public customTag: string; + + /** TaggedField inferred. */ + public inferred?: (google.protobuf.IEmpty|null); + + /** TaggedField tag. */ + public tag?: ("infoType"|"customTag"|"inferred"); + + /** + * Creates a new TaggedField instance using the specified properties. + * @param [properties] Properties to set + * @returns TaggedField instance + */ + public static create(properties?: google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.ITaggedField): google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.TaggedField; + + /** + * Encodes the specified TaggedField message. Does not implicitly {@link google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.TaggedField.verify|verify} messages. + * @param message TaggedField message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.ITaggedField, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TaggedField message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.TaggedField.verify|verify} messages. + * @param message TaggedField message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.ITaggedField, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TaggedField message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TaggedField + * @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.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.TaggedField; + + /** + * Decodes a TaggedField message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TaggedField + * @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.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.TaggedField; + + /** + * Verifies a TaggedField 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 TaggedField message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TaggedField + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.TaggedField; + + /** + * Creates a plain object from a TaggedField message. Also converts values to other types if specified. + * @param message TaggedField + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.TaggedField, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TaggedField to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AuxiliaryTable. */ + interface IAuxiliaryTable { + + /** AuxiliaryTable table */ + table?: (google.privacy.dlp.v2.IBigQueryTable|null); + + /** AuxiliaryTable quasiIds */ + quasiIds?: (google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.AuxiliaryTable.IQuasiIdField[]|null); + + /** AuxiliaryTable relativeFrequency */ + relativeFrequency?: (google.privacy.dlp.v2.IFieldId|null); + } + + /** Represents an AuxiliaryTable. */ + class AuxiliaryTable implements IAuxiliaryTable { + + /** + * Constructs a new AuxiliaryTable. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.IAuxiliaryTable); + + /** AuxiliaryTable table. */ + public table?: (google.privacy.dlp.v2.IBigQueryTable|null); + + /** AuxiliaryTable quasiIds. */ + public quasiIds: google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.AuxiliaryTable.IQuasiIdField[]; + + /** AuxiliaryTable relativeFrequency. */ + public relativeFrequency?: (google.privacy.dlp.v2.IFieldId|null); + + /** + * Creates a new AuxiliaryTable instance using the specified properties. + * @param [properties] Properties to set + * @returns AuxiliaryTable instance + */ + public static create(properties?: google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.IAuxiliaryTable): google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.AuxiliaryTable; + + /** + * Encodes the specified AuxiliaryTable message. Does not implicitly {@link google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.AuxiliaryTable.verify|verify} messages. + * @param message AuxiliaryTable message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.IAuxiliaryTable, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AuxiliaryTable message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.AuxiliaryTable.verify|verify} messages. + * @param message AuxiliaryTable message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.IAuxiliaryTable, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AuxiliaryTable message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AuxiliaryTable + * @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.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.AuxiliaryTable; + + /** + * Decodes an AuxiliaryTable message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AuxiliaryTable + * @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.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.AuxiliaryTable; + + /** + * Verifies an AuxiliaryTable 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 an AuxiliaryTable message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AuxiliaryTable + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.AuxiliaryTable; + + /** + * Creates a plain object from an AuxiliaryTable message. Also converts values to other types if specified. + * @param message AuxiliaryTable + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.AuxiliaryTable, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AuxiliaryTable to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace AuxiliaryTable { + + /** Properties of a QuasiIdField. */ + interface IQuasiIdField { + + /** QuasiIdField field */ + field?: (google.privacy.dlp.v2.IFieldId|null); + + /** QuasiIdField customTag */ + customTag?: (string|null); + } + + /** Represents a QuasiIdField. */ + class QuasiIdField implements IQuasiIdField { + + /** + * Constructs a new QuasiIdField. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.AuxiliaryTable.IQuasiIdField); + + /** QuasiIdField field. */ + public field?: (google.privacy.dlp.v2.IFieldId|null); + + /** QuasiIdField customTag. */ + public customTag: string; + + /** + * Creates a new QuasiIdField instance using the specified properties. + * @param [properties] Properties to set + * @returns QuasiIdField instance + */ + public static create(properties?: google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.AuxiliaryTable.IQuasiIdField): google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.AuxiliaryTable.QuasiIdField; + + /** + * Encodes the specified QuasiIdField message. Does not implicitly {@link google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.AuxiliaryTable.QuasiIdField.verify|verify} messages. + * @param message QuasiIdField message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.AuxiliaryTable.IQuasiIdField, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified QuasiIdField message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.AuxiliaryTable.QuasiIdField.verify|verify} messages. + * @param message QuasiIdField message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.AuxiliaryTable.IQuasiIdField, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a QuasiIdField message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns QuasiIdField + * @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.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.AuxiliaryTable.QuasiIdField; + + /** + * Decodes a QuasiIdField message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns QuasiIdField + * @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.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.AuxiliaryTable.QuasiIdField; + + /** + * Verifies a QuasiIdField 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 QuasiIdField message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns QuasiIdField + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.AuxiliaryTable.QuasiIdField; + + /** + * Creates a plain object from a QuasiIdField message. Also converts values to other types if specified. + * @param message QuasiIdField + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.AuxiliaryTable.QuasiIdField, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this QuasiIdField to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + } + + /** Properties of a DeltaPresenceEstimationConfig. */ + interface IDeltaPresenceEstimationConfig { + + /** DeltaPresenceEstimationConfig quasiIds */ + quasiIds?: (google.privacy.dlp.v2.IQuasiId[]|null); + + /** DeltaPresenceEstimationConfig regionCode */ + regionCode?: (string|null); + + /** DeltaPresenceEstimationConfig auxiliaryTables */ + auxiliaryTables?: (google.privacy.dlp.v2.IStatisticalTable[]|null); + } + + /** Represents a DeltaPresenceEstimationConfig. */ + class DeltaPresenceEstimationConfig implements IDeltaPresenceEstimationConfig { + + /** + * Constructs a new DeltaPresenceEstimationConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.PrivacyMetric.IDeltaPresenceEstimationConfig); + + /** DeltaPresenceEstimationConfig quasiIds. */ + public quasiIds: google.privacy.dlp.v2.IQuasiId[]; + + /** DeltaPresenceEstimationConfig regionCode. */ + public regionCode: string; + + /** DeltaPresenceEstimationConfig auxiliaryTables. */ + public auxiliaryTables: google.privacy.dlp.v2.IStatisticalTable[]; + + /** + * Creates a new DeltaPresenceEstimationConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns DeltaPresenceEstimationConfig instance + */ + public static create(properties?: google.privacy.dlp.v2.PrivacyMetric.IDeltaPresenceEstimationConfig): google.privacy.dlp.v2.PrivacyMetric.DeltaPresenceEstimationConfig; + + /** + * Encodes the specified DeltaPresenceEstimationConfig message. Does not implicitly {@link google.privacy.dlp.v2.PrivacyMetric.DeltaPresenceEstimationConfig.verify|verify} messages. + * @param message DeltaPresenceEstimationConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.PrivacyMetric.IDeltaPresenceEstimationConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeltaPresenceEstimationConfig message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.PrivacyMetric.DeltaPresenceEstimationConfig.verify|verify} messages. + * @param message DeltaPresenceEstimationConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.PrivacyMetric.IDeltaPresenceEstimationConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeltaPresenceEstimationConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeltaPresenceEstimationConfig + * @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.privacy.dlp.v2.PrivacyMetric.DeltaPresenceEstimationConfig; + + /** + * Decodes a DeltaPresenceEstimationConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeltaPresenceEstimationConfig + * @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.privacy.dlp.v2.PrivacyMetric.DeltaPresenceEstimationConfig; + + /** + * Verifies a DeltaPresenceEstimationConfig 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 DeltaPresenceEstimationConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeltaPresenceEstimationConfig + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.PrivacyMetric.DeltaPresenceEstimationConfig; + + /** + * Creates a plain object from a DeltaPresenceEstimationConfig message. Also converts values to other types if specified. + * @param message DeltaPresenceEstimationConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.PrivacyMetric.DeltaPresenceEstimationConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeltaPresenceEstimationConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of an AnalyzeDataSourceRiskDetails. */ + interface IAnalyzeDataSourceRiskDetails { + + /** AnalyzeDataSourceRiskDetails requestedPrivacyMetric */ + requestedPrivacyMetric?: (google.privacy.dlp.v2.IPrivacyMetric|null); + + /** AnalyzeDataSourceRiskDetails requestedSourceTable */ + requestedSourceTable?: (google.privacy.dlp.v2.IBigQueryTable|null); + + /** AnalyzeDataSourceRiskDetails numericalStatsResult */ + numericalStatsResult?: (google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.INumericalStatsResult|null); + + /** AnalyzeDataSourceRiskDetails categoricalStatsResult */ + categoricalStatsResult?: (google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.ICategoricalStatsResult|null); + + /** AnalyzeDataSourceRiskDetails kAnonymityResult */ + kAnonymityResult?: (google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.IKAnonymityResult|null); + + /** AnalyzeDataSourceRiskDetails lDiversityResult */ + lDiversityResult?: (google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.ILDiversityResult|null); + + /** AnalyzeDataSourceRiskDetails kMapEstimationResult */ + kMapEstimationResult?: (google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.IKMapEstimationResult|null); + + /** AnalyzeDataSourceRiskDetails deltaPresenceEstimationResult */ + deltaPresenceEstimationResult?: (google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.IDeltaPresenceEstimationResult|null); + + /** AnalyzeDataSourceRiskDetails requestedOptions */ + requestedOptions?: (google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.IRequestedRiskAnalysisOptions|null); + } + + /** Represents an AnalyzeDataSourceRiskDetails. */ + class AnalyzeDataSourceRiskDetails implements IAnalyzeDataSourceRiskDetails { + + /** + * Constructs a new AnalyzeDataSourceRiskDetails. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.IAnalyzeDataSourceRiskDetails); + + /** AnalyzeDataSourceRiskDetails requestedPrivacyMetric. */ + public requestedPrivacyMetric?: (google.privacy.dlp.v2.IPrivacyMetric|null); + + /** AnalyzeDataSourceRiskDetails requestedSourceTable. */ + public requestedSourceTable?: (google.privacy.dlp.v2.IBigQueryTable|null); + + /** AnalyzeDataSourceRiskDetails numericalStatsResult. */ + public numericalStatsResult?: (google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.INumericalStatsResult|null); + + /** AnalyzeDataSourceRiskDetails categoricalStatsResult. */ + public categoricalStatsResult?: (google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.ICategoricalStatsResult|null); + + /** AnalyzeDataSourceRiskDetails kAnonymityResult. */ + public kAnonymityResult?: (google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.IKAnonymityResult|null); + + /** AnalyzeDataSourceRiskDetails lDiversityResult. */ + public lDiversityResult?: (google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.ILDiversityResult|null); + + /** AnalyzeDataSourceRiskDetails kMapEstimationResult. */ + public kMapEstimationResult?: (google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.IKMapEstimationResult|null); + + /** AnalyzeDataSourceRiskDetails deltaPresenceEstimationResult. */ + public deltaPresenceEstimationResult?: (google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.IDeltaPresenceEstimationResult|null); + + /** AnalyzeDataSourceRiskDetails requestedOptions. */ + public requestedOptions?: (google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.IRequestedRiskAnalysisOptions|null); + + /** AnalyzeDataSourceRiskDetails result. */ + public result?: ("numericalStatsResult"|"categoricalStatsResult"|"kAnonymityResult"|"lDiversityResult"|"kMapEstimationResult"|"deltaPresenceEstimationResult"); + + /** + * Creates a new AnalyzeDataSourceRiskDetails instance using the specified properties. + * @param [properties] Properties to set + * @returns AnalyzeDataSourceRiskDetails instance + */ + public static create(properties?: google.privacy.dlp.v2.IAnalyzeDataSourceRiskDetails): google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails; + + /** + * Encodes the specified AnalyzeDataSourceRiskDetails message. Does not implicitly {@link google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.verify|verify} messages. + * @param message AnalyzeDataSourceRiskDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.IAnalyzeDataSourceRiskDetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AnalyzeDataSourceRiskDetails message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.verify|verify} messages. + * @param message AnalyzeDataSourceRiskDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.IAnalyzeDataSourceRiskDetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AnalyzeDataSourceRiskDetails message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AnalyzeDataSourceRiskDetails + * @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.privacy.dlp.v2.AnalyzeDataSourceRiskDetails; + + /** + * Decodes an AnalyzeDataSourceRiskDetails message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AnalyzeDataSourceRiskDetails + * @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.privacy.dlp.v2.AnalyzeDataSourceRiskDetails; + + /** + * Verifies an AnalyzeDataSourceRiskDetails 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 an AnalyzeDataSourceRiskDetails message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AnalyzeDataSourceRiskDetails + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails; + + /** + * Creates a plain object from an AnalyzeDataSourceRiskDetails message. Also converts values to other types if specified. + * @param message AnalyzeDataSourceRiskDetails + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AnalyzeDataSourceRiskDetails to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace AnalyzeDataSourceRiskDetails { + + /** Properties of a NumericalStatsResult. */ + interface INumericalStatsResult { + + /** NumericalStatsResult minValue */ + minValue?: (google.privacy.dlp.v2.IValue|null); + + /** NumericalStatsResult maxValue */ + maxValue?: (google.privacy.dlp.v2.IValue|null); + + /** NumericalStatsResult quantileValues */ + quantileValues?: (google.privacy.dlp.v2.IValue[]|null); + } + + /** Represents a NumericalStatsResult. */ + class NumericalStatsResult implements INumericalStatsResult { + + /** + * Constructs a new NumericalStatsResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.INumericalStatsResult); + + /** NumericalStatsResult minValue. */ + public minValue?: (google.privacy.dlp.v2.IValue|null); + + /** NumericalStatsResult maxValue. */ + public maxValue?: (google.privacy.dlp.v2.IValue|null); + + /** NumericalStatsResult quantileValues. */ + public quantileValues: google.privacy.dlp.v2.IValue[]; + + /** + * Creates a new NumericalStatsResult instance using the specified properties. + * @param [properties] Properties to set + * @returns NumericalStatsResult instance + */ + public static create(properties?: google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.INumericalStatsResult): google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.NumericalStatsResult; + + /** + * Encodes the specified NumericalStatsResult message. Does not implicitly {@link google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.NumericalStatsResult.verify|verify} messages. + * @param message NumericalStatsResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.INumericalStatsResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NumericalStatsResult message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.NumericalStatsResult.verify|verify} messages. + * @param message NumericalStatsResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.INumericalStatsResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NumericalStatsResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NumericalStatsResult + * @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.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.NumericalStatsResult; + + /** + * Decodes a NumericalStatsResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NumericalStatsResult + * @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.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.NumericalStatsResult; + + /** + * Verifies a NumericalStatsResult 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 NumericalStatsResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NumericalStatsResult + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.NumericalStatsResult; + + /** + * Creates a plain object from a NumericalStatsResult message. Also converts values to other types if specified. + * @param message NumericalStatsResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.NumericalStatsResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NumericalStatsResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a CategoricalStatsResult. */ + interface ICategoricalStatsResult { + + /** CategoricalStatsResult valueFrequencyHistogramBuckets */ + valueFrequencyHistogramBuckets?: (google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.CategoricalStatsResult.ICategoricalStatsHistogramBucket[]|null); + } + + /** Represents a CategoricalStatsResult. */ + class CategoricalStatsResult implements ICategoricalStatsResult { + + /** + * Constructs a new CategoricalStatsResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.ICategoricalStatsResult); + + /** CategoricalStatsResult valueFrequencyHistogramBuckets. */ + public valueFrequencyHistogramBuckets: google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.CategoricalStatsResult.ICategoricalStatsHistogramBucket[]; + + /** + * Creates a new CategoricalStatsResult instance using the specified properties. + * @param [properties] Properties to set + * @returns CategoricalStatsResult instance + */ + public static create(properties?: google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.ICategoricalStatsResult): google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.CategoricalStatsResult; + + /** + * Encodes the specified CategoricalStatsResult message. Does not implicitly {@link google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.CategoricalStatsResult.verify|verify} messages. + * @param message CategoricalStatsResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.ICategoricalStatsResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CategoricalStatsResult message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.CategoricalStatsResult.verify|verify} messages. + * @param message CategoricalStatsResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.ICategoricalStatsResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CategoricalStatsResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CategoricalStatsResult + * @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.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.CategoricalStatsResult; + + /** + * Decodes a CategoricalStatsResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CategoricalStatsResult + * @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.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.CategoricalStatsResult; + + /** + * Verifies a CategoricalStatsResult 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 CategoricalStatsResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CategoricalStatsResult + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.CategoricalStatsResult; + + /** + * Creates a plain object from a CategoricalStatsResult message. Also converts values to other types if specified. + * @param message CategoricalStatsResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.CategoricalStatsResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CategoricalStatsResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace CategoricalStatsResult { + + /** Properties of a CategoricalStatsHistogramBucket. */ + interface ICategoricalStatsHistogramBucket { + + /** CategoricalStatsHistogramBucket valueFrequencyLowerBound */ + valueFrequencyLowerBound?: (number|Long|string|null); + + /** CategoricalStatsHistogramBucket valueFrequencyUpperBound */ + valueFrequencyUpperBound?: (number|Long|string|null); + + /** CategoricalStatsHistogramBucket bucketSize */ + bucketSize?: (number|Long|string|null); + + /** CategoricalStatsHistogramBucket bucketValues */ + bucketValues?: (google.privacy.dlp.v2.IValueFrequency[]|null); + + /** CategoricalStatsHistogramBucket bucketValueCount */ + bucketValueCount?: (number|Long|string|null); + } + + /** Represents a CategoricalStatsHistogramBucket. */ + class CategoricalStatsHistogramBucket implements ICategoricalStatsHistogramBucket { + + /** + * Constructs a new CategoricalStatsHistogramBucket. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.CategoricalStatsResult.ICategoricalStatsHistogramBucket); + + /** CategoricalStatsHistogramBucket valueFrequencyLowerBound. */ + public valueFrequencyLowerBound: (number|Long|string); + + /** CategoricalStatsHistogramBucket valueFrequencyUpperBound. */ + public valueFrequencyUpperBound: (number|Long|string); + + /** CategoricalStatsHistogramBucket bucketSize. */ + public bucketSize: (number|Long|string); + + /** CategoricalStatsHistogramBucket bucketValues. */ + public bucketValues: google.privacy.dlp.v2.IValueFrequency[]; + + /** CategoricalStatsHistogramBucket bucketValueCount. */ + public bucketValueCount: (number|Long|string); + + /** + * Creates a new CategoricalStatsHistogramBucket instance using the specified properties. + * @param [properties] Properties to set + * @returns CategoricalStatsHistogramBucket instance + */ + public static create(properties?: google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.CategoricalStatsResult.ICategoricalStatsHistogramBucket): google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.CategoricalStatsResult.CategoricalStatsHistogramBucket; + + /** + * Encodes the specified CategoricalStatsHistogramBucket message. Does not implicitly {@link google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.CategoricalStatsResult.CategoricalStatsHistogramBucket.verify|verify} messages. + * @param message CategoricalStatsHistogramBucket message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.CategoricalStatsResult.ICategoricalStatsHistogramBucket, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CategoricalStatsHistogramBucket message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.CategoricalStatsResult.CategoricalStatsHistogramBucket.verify|verify} messages. + * @param message CategoricalStatsHistogramBucket message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.CategoricalStatsResult.ICategoricalStatsHistogramBucket, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CategoricalStatsHistogramBucket message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CategoricalStatsHistogramBucket + * @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.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.CategoricalStatsResult.CategoricalStatsHistogramBucket; + + /** + * Decodes a CategoricalStatsHistogramBucket message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CategoricalStatsHistogramBucket + * @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.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.CategoricalStatsResult.CategoricalStatsHistogramBucket; + + /** + * Verifies a CategoricalStatsHistogramBucket 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 CategoricalStatsHistogramBucket message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CategoricalStatsHistogramBucket + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.CategoricalStatsResult.CategoricalStatsHistogramBucket; + + /** + * Creates a plain object from a CategoricalStatsHistogramBucket message. Also converts values to other types if specified. + * @param message CategoricalStatsHistogramBucket + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.CategoricalStatsResult.CategoricalStatsHistogramBucket, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CategoricalStatsHistogramBucket to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of a KAnonymityResult. */ + interface IKAnonymityResult { + + /** KAnonymityResult equivalenceClassHistogramBuckets */ + equivalenceClassHistogramBuckets?: (google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResult.IKAnonymityHistogramBucket[]|null); + } + + /** Represents a KAnonymityResult. */ + class KAnonymityResult implements IKAnonymityResult { + + /** + * Constructs a new KAnonymityResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.IKAnonymityResult); + + /** KAnonymityResult equivalenceClassHistogramBuckets. */ + public equivalenceClassHistogramBuckets: google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResult.IKAnonymityHistogramBucket[]; + + /** + * Creates a new KAnonymityResult instance using the specified properties. + * @param [properties] Properties to set + * @returns KAnonymityResult instance + */ + public static create(properties?: google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.IKAnonymityResult): google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResult; + + /** + * Encodes the specified KAnonymityResult message. Does not implicitly {@link google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResult.verify|verify} messages. + * @param message KAnonymityResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.IKAnonymityResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified KAnonymityResult message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResult.verify|verify} messages. + * @param message KAnonymityResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.IKAnonymityResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a KAnonymityResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns KAnonymityResult + * @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.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResult; + + /** + * Decodes a KAnonymityResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns KAnonymityResult + * @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.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResult; + + /** + * Verifies a KAnonymityResult 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 KAnonymityResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns KAnonymityResult + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResult; + + /** + * Creates a plain object from a KAnonymityResult message. Also converts values to other types if specified. + * @param message KAnonymityResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this KAnonymityResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace KAnonymityResult { + + /** Properties of a KAnonymityEquivalenceClass. */ + interface IKAnonymityEquivalenceClass { + + /** KAnonymityEquivalenceClass quasiIdsValues */ + quasiIdsValues?: (google.privacy.dlp.v2.IValue[]|null); + + /** KAnonymityEquivalenceClass equivalenceClassSize */ + equivalenceClassSize?: (number|Long|string|null); + } + + /** Represents a KAnonymityEquivalenceClass. */ + class KAnonymityEquivalenceClass implements IKAnonymityEquivalenceClass { + + /** + * Constructs a new KAnonymityEquivalenceClass. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResult.IKAnonymityEquivalenceClass); + + /** KAnonymityEquivalenceClass quasiIdsValues. */ + public quasiIdsValues: google.privacy.dlp.v2.IValue[]; + + /** KAnonymityEquivalenceClass equivalenceClassSize. */ + public equivalenceClassSize: (number|Long|string); + + /** + * Creates a new KAnonymityEquivalenceClass instance using the specified properties. + * @param [properties] Properties to set + * @returns KAnonymityEquivalenceClass instance + */ + public static create(properties?: google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResult.IKAnonymityEquivalenceClass): google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResult.KAnonymityEquivalenceClass; + + /** + * Encodes the specified KAnonymityEquivalenceClass message. Does not implicitly {@link google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResult.KAnonymityEquivalenceClass.verify|verify} messages. + * @param message KAnonymityEquivalenceClass message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResult.IKAnonymityEquivalenceClass, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified KAnonymityEquivalenceClass message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResult.KAnonymityEquivalenceClass.verify|verify} messages. + * @param message KAnonymityEquivalenceClass message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResult.IKAnonymityEquivalenceClass, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a KAnonymityEquivalenceClass message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns KAnonymityEquivalenceClass + * @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.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResult.KAnonymityEquivalenceClass; + + /** + * Decodes a KAnonymityEquivalenceClass message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns KAnonymityEquivalenceClass + * @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.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResult.KAnonymityEquivalenceClass; + + /** + * Verifies a KAnonymityEquivalenceClass 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 KAnonymityEquivalenceClass message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns KAnonymityEquivalenceClass + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResult.KAnonymityEquivalenceClass; + + /** + * Creates a plain object from a KAnonymityEquivalenceClass message. Also converts values to other types if specified. + * @param message KAnonymityEquivalenceClass + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResult.KAnonymityEquivalenceClass, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this KAnonymityEquivalenceClass to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a KAnonymityHistogramBucket. */ + interface IKAnonymityHistogramBucket { + + /** KAnonymityHistogramBucket equivalenceClassSizeLowerBound */ + equivalenceClassSizeLowerBound?: (number|Long|string|null); + + /** KAnonymityHistogramBucket equivalenceClassSizeUpperBound */ + equivalenceClassSizeUpperBound?: (number|Long|string|null); + + /** KAnonymityHistogramBucket bucketSize */ + bucketSize?: (number|Long|string|null); + + /** KAnonymityHistogramBucket bucketValues */ + bucketValues?: (google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResult.IKAnonymityEquivalenceClass[]|null); + + /** KAnonymityHistogramBucket bucketValueCount */ + bucketValueCount?: (number|Long|string|null); + } + + /** Represents a KAnonymityHistogramBucket. */ + class KAnonymityHistogramBucket implements IKAnonymityHistogramBucket { + + /** + * Constructs a new KAnonymityHistogramBucket. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResult.IKAnonymityHistogramBucket); + + /** KAnonymityHistogramBucket equivalenceClassSizeLowerBound. */ + public equivalenceClassSizeLowerBound: (number|Long|string); + + /** KAnonymityHistogramBucket equivalenceClassSizeUpperBound. */ + public equivalenceClassSizeUpperBound: (number|Long|string); + + /** KAnonymityHistogramBucket bucketSize. */ + public bucketSize: (number|Long|string); + + /** KAnonymityHistogramBucket bucketValues. */ + public bucketValues: google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResult.IKAnonymityEquivalenceClass[]; + + /** KAnonymityHistogramBucket bucketValueCount. */ + public bucketValueCount: (number|Long|string); + + /** + * Creates a new KAnonymityHistogramBucket instance using the specified properties. + * @param [properties] Properties to set + * @returns KAnonymityHistogramBucket instance + */ + public static create(properties?: google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResult.IKAnonymityHistogramBucket): google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResult.KAnonymityHistogramBucket; + + /** + * Encodes the specified KAnonymityHistogramBucket message. Does not implicitly {@link google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResult.KAnonymityHistogramBucket.verify|verify} messages. + * @param message KAnonymityHistogramBucket message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResult.IKAnonymityHistogramBucket, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified KAnonymityHistogramBucket message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResult.KAnonymityHistogramBucket.verify|verify} messages. + * @param message KAnonymityHistogramBucket message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResult.IKAnonymityHistogramBucket, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a KAnonymityHistogramBucket message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns KAnonymityHistogramBucket + * @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.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResult.KAnonymityHistogramBucket; + + /** + * Decodes a KAnonymityHistogramBucket message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns KAnonymityHistogramBucket + * @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.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResult.KAnonymityHistogramBucket; + + /** + * Verifies a KAnonymityHistogramBucket 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 KAnonymityHistogramBucket message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns KAnonymityHistogramBucket + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResult.KAnonymityHistogramBucket; + + /** + * Creates a plain object from a KAnonymityHistogramBucket message. Also converts values to other types if specified. + * @param message KAnonymityHistogramBucket + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResult.KAnonymityHistogramBucket, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this KAnonymityHistogramBucket to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of a LDiversityResult. */ + interface ILDiversityResult { + + /** LDiversityResult sensitiveValueFrequencyHistogramBuckets */ + sensitiveValueFrequencyHistogramBuckets?: (google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.LDiversityResult.ILDiversityHistogramBucket[]|null); + } + + /** Represents a LDiversityResult. */ + class LDiversityResult implements ILDiversityResult { + + /** + * Constructs a new LDiversityResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.ILDiversityResult); + + /** LDiversityResult sensitiveValueFrequencyHistogramBuckets. */ + public sensitiveValueFrequencyHistogramBuckets: google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.LDiversityResult.ILDiversityHistogramBucket[]; + + /** + * Creates a new LDiversityResult instance using the specified properties. + * @param [properties] Properties to set + * @returns LDiversityResult instance + */ + public static create(properties?: google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.ILDiversityResult): google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.LDiversityResult; + + /** + * Encodes the specified LDiversityResult message. Does not implicitly {@link google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.LDiversityResult.verify|verify} messages. + * @param message LDiversityResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.ILDiversityResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LDiversityResult message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.LDiversityResult.verify|verify} messages. + * @param message LDiversityResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.ILDiversityResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LDiversityResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LDiversityResult + * @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.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.LDiversityResult; + + /** + * Decodes a LDiversityResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LDiversityResult + * @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.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.LDiversityResult; + + /** + * Verifies a LDiversityResult 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 LDiversityResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LDiversityResult + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.LDiversityResult; + + /** + * Creates a plain object from a LDiversityResult message. Also converts values to other types if specified. + * @param message LDiversityResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.LDiversityResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LDiversityResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace LDiversityResult { + + /** Properties of a LDiversityEquivalenceClass. */ + interface ILDiversityEquivalenceClass { + + /** LDiversityEquivalenceClass quasiIdsValues */ + quasiIdsValues?: (google.privacy.dlp.v2.IValue[]|null); + + /** LDiversityEquivalenceClass equivalenceClassSize */ + equivalenceClassSize?: (number|Long|string|null); + + /** LDiversityEquivalenceClass numDistinctSensitiveValues */ + numDistinctSensitiveValues?: (number|Long|string|null); + + /** LDiversityEquivalenceClass topSensitiveValues */ + topSensitiveValues?: (google.privacy.dlp.v2.IValueFrequency[]|null); + } + + /** Represents a LDiversityEquivalenceClass. */ + class LDiversityEquivalenceClass implements ILDiversityEquivalenceClass { + + /** + * Constructs a new LDiversityEquivalenceClass. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.LDiversityResult.ILDiversityEquivalenceClass); + + /** LDiversityEquivalenceClass quasiIdsValues. */ + public quasiIdsValues: google.privacy.dlp.v2.IValue[]; + + /** LDiversityEquivalenceClass equivalenceClassSize. */ + public equivalenceClassSize: (number|Long|string); + + /** LDiversityEquivalenceClass numDistinctSensitiveValues. */ + public numDistinctSensitiveValues: (number|Long|string); + + /** LDiversityEquivalenceClass topSensitiveValues. */ + public topSensitiveValues: google.privacy.dlp.v2.IValueFrequency[]; + + /** + * Creates a new LDiversityEquivalenceClass instance using the specified properties. + * @param [properties] Properties to set + * @returns LDiversityEquivalenceClass instance + */ + public static create(properties?: google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.LDiversityResult.ILDiversityEquivalenceClass): google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.LDiversityResult.LDiversityEquivalenceClass; + + /** + * Encodes the specified LDiversityEquivalenceClass message. Does not implicitly {@link google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.LDiversityResult.LDiversityEquivalenceClass.verify|verify} messages. + * @param message LDiversityEquivalenceClass message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.LDiversityResult.ILDiversityEquivalenceClass, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LDiversityEquivalenceClass message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.LDiversityResult.LDiversityEquivalenceClass.verify|verify} messages. + * @param message LDiversityEquivalenceClass message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.LDiversityResult.ILDiversityEquivalenceClass, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LDiversityEquivalenceClass message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LDiversityEquivalenceClass + * @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.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.LDiversityResult.LDiversityEquivalenceClass; + + /** + * Decodes a LDiversityEquivalenceClass message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LDiversityEquivalenceClass + * @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.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.LDiversityResult.LDiversityEquivalenceClass; + + /** + * Verifies a LDiversityEquivalenceClass 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 LDiversityEquivalenceClass message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LDiversityEquivalenceClass + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.LDiversityResult.LDiversityEquivalenceClass; + + /** + * Creates a plain object from a LDiversityEquivalenceClass message. Also converts values to other types if specified. + * @param message LDiversityEquivalenceClass + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.LDiversityResult.LDiversityEquivalenceClass, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LDiversityEquivalenceClass to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a LDiversityHistogramBucket. */ + interface ILDiversityHistogramBucket { + + /** LDiversityHistogramBucket sensitiveValueFrequencyLowerBound */ + sensitiveValueFrequencyLowerBound?: (number|Long|string|null); + + /** LDiversityHistogramBucket sensitiveValueFrequencyUpperBound */ + sensitiveValueFrequencyUpperBound?: (number|Long|string|null); + + /** LDiversityHistogramBucket bucketSize */ + bucketSize?: (number|Long|string|null); + + /** LDiversityHistogramBucket bucketValues */ + bucketValues?: (google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.LDiversityResult.ILDiversityEquivalenceClass[]|null); + + /** LDiversityHistogramBucket bucketValueCount */ + bucketValueCount?: (number|Long|string|null); + } + + /** Represents a LDiversityHistogramBucket. */ + class LDiversityHistogramBucket implements ILDiversityHistogramBucket { + + /** + * Constructs a new LDiversityHistogramBucket. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.LDiversityResult.ILDiversityHistogramBucket); + + /** LDiversityHistogramBucket sensitiveValueFrequencyLowerBound. */ + public sensitiveValueFrequencyLowerBound: (number|Long|string); + + /** LDiversityHistogramBucket sensitiveValueFrequencyUpperBound. */ + public sensitiveValueFrequencyUpperBound: (number|Long|string); + + /** LDiversityHistogramBucket bucketSize. */ + public bucketSize: (number|Long|string); + + /** LDiversityHistogramBucket bucketValues. */ + public bucketValues: google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.LDiversityResult.ILDiversityEquivalenceClass[]; + + /** LDiversityHistogramBucket bucketValueCount. */ + public bucketValueCount: (number|Long|string); + + /** + * Creates a new LDiversityHistogramBucket instance using the specified properties. + * @param [properties] Properties to set + * @returns LDiversityHistogramBucket instance + */ + public static create(properties?: google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.LDiversityResult.ILDiversityHistogramBucket): google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.LDiversityResult.LDiversityHistogramBucket; + + /** + * Encodes the specified LDiversityHistogramBucket message. Does not implicitly {@link google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.LDiversityResult.LDiversityHistogramBucket.verify|verify} messages. + * @param message LDiversityHistogramBucket message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.LDiversityResult.ILDiversityHistogramBucket, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LDiversityHistogramBucket message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.LDiversityResult.LDiversityHistogramBucket.verify|verify} messages. + * @param message LDiversityHistogramBucket message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.LDiversityResult.ILDiversityHistogramBucket, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LDiversityHistogramBucket message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LDiversityHistogramBucket + * @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.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.LDiversityResult.LDiversityHistogramBucket; + + /** + * Decodes a LDiversityHistogramBucket message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LDiversityHistogramBucket + * @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.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.LDiversityResult.LDiversityHistogramBucket; + + /** + * Verifies a LDiversityHistogramBucket 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 LDiversityHistogramBucket message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LDiversityHistogramBucket + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.LDiversityResult.LDiversityHistogramBucket; + + /** + * Creates a plain object from a LDiversityHistogramBucket message. Also converts values to other types if specified. + * @param message LDiversityHistogramBucket + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.LDiversityResult.LDiversityHistogramBucket, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LDiversityHistogramBucket to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of a KMapEstimationResult. */ + interface IKMapEstimationResult { + + /** KMapEstimationResult kMapEstimationHistogram */ + kMapEstimationHistogram?: (google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult.IKMapEstimationHistogramBucket[]|null); + } + + /** Represents a KMapEstimationResult. */ + class KMapEstimationResult implements IKMapEstimationResult { + + /** + * Constructs a new KMapEstimationResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.IKMapEstimationResult); + + /** KMapEstimationResult kMapEstimationHistogram. */ + public kMapEstimationHistogram: google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult.IKMapEstimationHistogramBucket[]; + + /** + * Creates a new KMapEstimationResult instance using the specified properties. + * @param [properties] Properties to set + * @returns KMapEstimationResult instance + */ + public static create(properties?: google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.IKMapEstimationResult): google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult; + + /** + * Encodes the specified KMapEstimationResult message. Does not implicitly {@link google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult.verify|verify} messages. + * @param message KMapEstimationResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.IKMapEstimationResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified KMapEstimationResult message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult.verify|verify} messages. + * @param message KMapEstimationResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.IKMapEstimationResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a KMapEstimationResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns KMapEstimationResult + * @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.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult; + + /** + * Decodes a KMapEstimationResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns KMapEstimationResult + * @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.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult; + + /** + * Verifies a KMapEstimationResult 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 KMapEstimationResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns KMapEstimationResult + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult; + + /** + * Creates a plain object from a KMapEstimationResult message. Also converts values to other types if specified. + * @param message KMapEstimationResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this KMapEstimationResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace KMapEstimationResult { + + /** Properties of a KMapEstimationQuasiIdValues. */ + interface IKMapEstimationQuasiIdValues { + + /** KMapEstimationQuasiIdValues quasiIdsValues */ + quasiIdsValues?: (google.privacy.dlp.v2.IValue[]|null); + + /** KMapEstimationQuasiIdValues estimatedAnonymity */ + estimatedAnonymity?: (number|Long|string|null); + } + + /** Represents a KMapEstimationQuasiIdValues. */ + class KMapEstimationQuasiIdValues implements IKMapEstimationQuasiIdValues { + + /** + * Constructs a new KMapEstimationQuasiIdValues. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult.IKMapEstimationQuasiIdValues); + + /** KMapEstimationQuasiIdValues quasiIdsValues. */ + public quasiIdsValues: google.privacy.dlp.v2.IValue[]; + + /** KMapEstimationQuasiIdValues estimatedAnonymity. */ + public estimatedAnonymity: (number|Long|string); + + /** + * Creates a new KMapEstimationQuasiIdValues instance using the specified properties. + * @param [properties] Properties to set + * @returns KMapEstimationQuasiIdValues instance + */ + public static create(properties?: google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult.IKMapEstimationQuasiIdValues): google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult.KMapEstimationQuasiIdValues; + + /** + * Encodes the specified KMapEstimationQuasiIdValues message. Does not implicitly {@link google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult.KMapEstimationQuasiIdValues.verify|verify} messages. + * @param message KMapEstimationQuasiIdValues message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult.IKMapEstimationQuasiIdValues, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified KMapEstimationQuasiIdValues message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult.KMapEstimationQuasiIdValues.verify|verify} messages. + * @param message KMapEstimationQuasiIdValues message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult.IKMapEstimationQuasiIdValues, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a KMapEstimationQuasiIdValues message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns KMapEstimationQuasiIdValues + * @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.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult.KMapEstimationQuasiIdValues; + + /** + * Decodes a KMapEstimationQuasiIdValues message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns KMapEstimationQuasiIdValues + * @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.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult.KMapEstimationQuasiIdValues; + + /** + * Verifies a KMapEstimationQuasiIdValues 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 KMapEstimationQuasiIdValues message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns KMapEstimationQuasiIdValues + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult.KMapEstimationQuasiIdValues; + + /** + * Creates a plain object from a KMapEstimationQuasiIdValues message. Also converts values to other types if specified. + * @param message KMapEstimationQuasiIdValues + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult.KMapEstimationQuasiIdValues, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this KMapEstimationQuasiIdValues to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a KMapEstimationHistogramBucket. */ + interface IKMapEstimationHistogramBucket { + + /** KMapEstimationHistogramBucket minAnonymity */ + minAnonymity?: (number|Long|string|null); + + /** KMapEstimationHistogramBucket maxAnonymity */ + maxAnonymity?: (number|Long|string|null); + + /** KMapEstimationHistogramBucket bucketSize */ + bucketSize?: (number|Long|string|null); + + /** KMapEstimationHistogramBucket bucketValues */ + bucketValues?: (google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult.IKMapEstimationQuasiIdValues[]|null); + + /** KMapEstimationHistogramBucket bucketValueCount */ + bucketValueCount?: (number|Long|string|null); + } + + /** Represents a KMapEstimationHistogramBucket. */ + class KMapEstimationHistogramBucket implements IKMapEstimationHistogramBucket { + + /** + * Constructs a new KMapEstimationHistogramBucket. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult.IKMapEstimationHistogramBucket); + + /** KMapEstimationHistogramBucket minAnonymity. */ + public minAnonymity: (number|Long|string); + + /** KMapEstimationHistogramBucket maxAnonymity. */ + public maxAnonymity: (number|Long|string); + + /** KMapEstimationHistogramBucket bucketSize. */ + public bucketSize: (number|Long|string); + + /** KMapEstimationHistogramBucket bucketValues. */ + public bucketValues: google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult.IKMapEstimationQuasiIdValues[]; + + /** KMapEstimationHistogramBucket bucketValueCount. */ + public bucketValueCount: (number|Long|string); + + /** + * Creates a new KMapEstimationHistogramBucket instance using the specified properties. + * @param [properties] Properties to set + * @returns KMapEstimationHistogramBucket instance + */ + public static create(properties?: google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult.IKMapEstimationHistogramBucket): google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult.KMapEstimationHistogramBucket; + + /** + * Encodes the specified KMapEstimationHistogramBucket message. Does not implicitly {@link google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult.KMapEstimationHistogramBucket.verify|verify} messages. + * @param message KMapEstimationHistogramBucket message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult.IKMapEstimationHistogramBucket, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified KMapEstimationHistogramBucket message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult.KMapEstimationHistogramBucket.verify|verify} messages. + * @param message KMapEstimationHistogramBucket message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult.IKMapEstimationHistogramBucket, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a KMapEstimationHistogramBucket message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns KMapEstimationHistogramBucket + * @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.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult.KMapEstimationHistogramBucket; + + /** + * Decodes a KMapEstimationHistogramBucket message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns KMapEstimationHistogramBucket + * @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.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult.KMapEstimationHistogramBucket; + + /** + * Verifies a KMapEstimationHistogramBucket 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 KMapEstimationHistogramBucket message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns KMapEstimationHistogramBucket + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult.KMapEstimationHistogramBucket; + + /** + * Creates a plain object from a KMapEstimationHistogramBucket message. Also converts values to other types if specified. + * @param message KMapEstimationHistogramBucket + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult.KMapEstimationHistogramBucket, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this KMapEstimationHistogramBucket to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of a DeltaPresenceEstimationResult. */ + interface IDeltaPresenceEstimationResult { + + /** DeltaPresenceEstimationResult deltaPresenceEstimationHistogram */ + deltaPresenceEstimationHistogram?: (google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.DeltaPresenceEstimationResult.IDeltaPresenceEstimationHistogramBucket[]|null); + } + + /** Represents a DeltaPresenceEstimationResult. */ + class DeltaPresenceEstimationResult implements IDeltaPresenceEstimationResult { + + /** + * Constructs a new DeltaPresenceEstimationResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.IDeltaPresenceEstimationResult); + + /** DeltaPresenceEstimationResult deltaPresenceEstimationHistogram. */ + public deltaPresenceEstimationHistogram: google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.DeltaPresenceEstimationResult.IDeltaPresenceEstimationHistogramBucket[]; + + /** + * Creates a new DeltaPresenceEstimationResult instance using the specified properties. + * @param [properties] Properties to set + * @returns DeltaPresenceEstimationResult instance + */ + public static create(properties?: google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.IDeltaPresenceEstimationResult): google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.DeltaPresenceEstimationResult; + + /** + * Encodes the specified DeltaPresenceEstimationResult message. Does not implicitly {@link google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.DeltaPresenceEstimationResult.verify|verify} messages. + * @param message DeltaPresenceEstimationResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.IDeltaPresenceEstimationResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeltaPresenceEstimationResult message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.DeltaPresenceEstimationResult.verify|verify} messages. + * @param message DeltaPresenceEstimationResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.IDeltaPresenceEstimationResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeltaPresenceEstimationResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeltaPresenceEstimationResult + * @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.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.DeltaPresenceEstimationResult; + + /** + * Decodes a DeltaPresenceEstimationResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeltaPresenceEstimationResult + * @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.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.DeltaPresenceEstimationResult; + + /** + * Verifies a DeltaPresenceEstimationResult 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 DeltaPresenceEstimationResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeltaPresenceEstimationResult + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.DeltaPresenceEstimationResult; + + /** + * Creates a plain object from a DeltaPresenceEstimationResult message. Also converts values to other types if specified. + * @param message DeltaPresenceEstimationResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.DeltaPresenceEstimationResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeltaPresenceEstimationResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace DeltaPresenceEstimationResult { + + /** Properties of a DeltaPresenceEstimationQuasiIdValues. */ + interface IDeltaPresenceEstimationQuasiIdValues { + + /** DeltaPresenceEstimationQuasiIdValues quasiIdsValues */ + quasiIdsValues?: (google.privacy.dlp.v2.IValue[]|null); + + /** DeltaPresenceEstimationQuasiIdValues estimatedProbability */ + estimatedProbability?: (number|null); + } + + /** Represents a DeltaPresenceEstimationQuasiIdValues. */ + class DeltaPresenceEstimationQuasiIdValues implements IDeltaPresenceEstimationQuasiIdValues { + + /** + * Constructs a new DeltaPresenceEstimationQuasiIdValues. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.DeltaPresenceEstimationResult.IDeltaPresenceEstimationQuasiIdValues); + + /** DeltaPresenceEstimationQuasiIdValues quasiIdsValues. */ + public quasiIdsValues: google.privacy.dlp.v2.IValue[]; + + /** DeltaPresenceEstimationQuasiIdValues estimatedProbability. */ + public estimatedProbability: number; + + /** + * Creates a new DeltaPresenceEstimationQuasiIdValues instance using the specified properties. + * @param [properties] Properties to set + * @returns DeltaPresenceEstimationQuasiIdValues instance + */ + public static create(properties?: google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.DeltaPresenceEstimationResult.IDeltaPresenceEstimationQuasiIdValues): google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.DeltaPresenceEstimationResult.DeltaPresenceEstimationQuasiIdValues; + + /** + * Encodes the specified DeltaPresenceEstimationQuasiIdValues message. Does not implicitly {@link google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.DeltaPresenceEstimationResult.DeltaPresenceEstimationQuasiIdValues.verify|verify} messages. + * @param message DeltaPresenceEstimationQuasiIdValues message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.DeltaPresenceEstimationResult.IDeltaPresenceEstimationQuasiIdValues, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeltaPresenceEstimationQuasiIdValues message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.DeltaPresenceEstimationResult.DeltaPresenceEstimationQuasiIdValues.verify|verify} messages. + * @param message DeltaPresenceEstimationQuasiIdValues message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.DeltaPresenceEstimationResult.IDeltaPresenceEstimationQuasiIdValues, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeltaPresenceEstimationQuasiIdValues message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeltaPresenceEstimationQuasiIdValues + * @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.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.DeltaPresenceEstimationResult.DeltaPresenceEstimationQuasiIdValues; + + /** + * Decodes a DeltaPresenceEstimationQuasiIdValues message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeltaPresenceEstimationQuasiIdValues + * @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.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.DeltaPresenceEstimationResult.DeltaPresenceEstimationQuasiIdValues; + + /** + * Verifies a DeltaPresenceEstimationQuasiIdValues 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 DeltaPresenceEstimationQuasiIdValues message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeltaPresenceEstimationQuasiIdValues + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.DeltaPresenceEstimationResult.DeltaPresenceEstimationQuasiIdValues; + + /** + * Creates a plain object from a DeltaPresenceEstimationQuasiIdValues message. Also converts values to other types if specified. + * @param message DeltaPresenceEstimationQuasiIdValues + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.DeltaPresenceEstimationResult.DeltaPresenceEstimationQuasiIdValues, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeltaPresenceEstimationQuasiIdValues to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeltaPresenceEstimationHistogramBucket. */ + interface IDeltaPresenceEstimationHistogramBucket { + + /** DeltaPresenceEstimationHistogramBucket minProbability */ + minProbability?: (number|null); + + /** DeltaPresenceEstimationHistogramBucket maxProbability */ + maxProbability?: (number|null); + + /** DeltaPresenceEstimationHistogramBucket bucketSize */ + bucketSize?: (number|Long|string|null); + + /** DeltaPresenceEstimationHistogramBucket bucketValues */ + bucketValues?: (google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.DeltaPresenceEstimationResult.IDeltaPresenceEstimationQuasiIdValues[]|null); + + /** DeltaPresenceEstimationHistogramBucket bucketValueCount */ + bucketValueCount?: (number|Long|string|null); + } + + /** Represents a DeltaPresenceEstimationHistogramBucket. */ + class DeltaPresenceEstimationHistogramBucket implements IDeltaPresenceEstimationHistogramBucket { + + /** + * Constructs a new DeltaPresenceEstimationHistogramBucket. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.DeltaPresenceEstimationResult.IDeltaPresenceEstimationHistogramBucket); + + /** DeltaPresenceEstimationHistogramBucket minProbability. */ + public minProbability: number; + + /** DeltaPresenceEstimationHistogramBucket maxProbability. */ + public maxProbability: number; + + /** DeltaPresenceEstimationHistogramBucket bucketSize. */ + public bucketSize: (number|Long|string); + + /** DeltaPresenceEstimationHistogramBucket bucketValues. */ + public bucketValues: google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.DeltaPresenceEstimationResult.IDeltaPresenceEstimationQuasiIdValues[]; + + /** DeltaPresenceEstimationHistogramBucket bucketValueCount. */ + public bucketValueCount: (number|Long|string); + + /** + * Creates a new DeltaPresenceEstimationHistogramBucket instance using the specified properties. + * @param [properties] Properties to set + * @returns DeltaPresenceEstimationHistogramBucket instance + */ + public static create(properties?: google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.DeltaPresenceEstimationResult.IDeltaPresenceEstimationHistogramBucket): google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.DeltaPresenceEstimationResult.DeltaPresenceEstimationHistogramBucket; + + /** + * Encodes the specified DeltaPresenceEstimationHistogramBucket message. Does not implicitly {@link google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.DeltaPresenceEstimationResult.DeltaPresenceEstimationHistogramBucket.verify|verify} messages. + * @param message DeltaPresenceEstimationHistogramBucket message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.DeltaPresenceEstimationResult.IDeltaPresenceEstimationHistogramBucket, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeltaPresenceEstimationHistogramBucket message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.DeltaPresenceEstimationResult.DeltaPresenceEstimationHistogramBucket.verify|verify} messages. + * @param message DeltaPresenceEstimationHistogramBucket message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.DeltaPresenceEstimationResult.IDeltaPresenceEstimationHistogramBucket, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeltaPresenceEstimationHistogramBucket message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeltaPresenceEstimationHistogramBucket + * @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.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.DeltaPresenceEstimationResult.DeltaPresenceEstimationHistogramBucket; + + /** + * Decodes a DeltaPresenceEstimationHistogramBucket message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeltaPresenceEstimationHistogramBucket + * @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.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.DeltaPresenceEstimationResult.DeltaPresenceEstimationHistogramBucket; + + /** + * Verifies a DeltaPresenceEstimationHistogramBucket 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 DeltaPresenceEstimationHistogramBucket message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeltaPresenceEstimationHistogramBucket + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.DeltaPresenceEstimationResult.DeltaPresenceEstimationHistogramBucket; + + /** + * Creates a plain object from a DeltaPresenceEstimationHistogramBucket message. Also converts values to other types if specified. + * @param message DeltaPresenceEstimationHistogramBucket + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.DeltaPresenceEstimationResult.DeltaPresenceEstimationHistogramBucket, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeltaPresenceEstimationHistogramBucket to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of a RequestedRiskAnalysisOptions. */ + interface IRequestedRiskAnalysisOptions { + + /** RequestedRiskAnalysisOptions jobConfig */ + jobConfig?: (google.privacy.dlp.v2.IRiskAnalysisJobConfig|null); + } + + /** Represents a RequestedRiskAnalysisOptions. */ + class RequestedRiskAnalysisOptions implements IRequestedRiskAnalysisOptions { + + /** + * Constructs a new RequestedRiskAnalysisOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.IRequestedRiskAnalysisOptions); + + /** RequestedRiskAnalysisOptions jobConfig. */ + public jobConfig?: (google.privacy.dlp.v2.IRiskAnalysisJobConfig|null); + + /** + * Creates a new RequestedRiskAnalysisOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns RequestedRiskAnalysisOptions instance + */ + public static create(properties?: google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.IRequestedRiskAnalysisOptions): google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.RequestedRiskAnalysisOptions; + + /** + * Encodes the specified RequestedRiskAnalysisOptions message. Does not implicitly {@link google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.RequestedRiskAnalysisOptions.verify|verify} messages. + * @param message RequestedRiskAnalysisOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.IRequestedRiskAnalysisOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RequestedRiskAnalysisOptions message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.RequestedRiskAnalysisOptions.verify|verify} messages. + * @param message RequestedRiskAnalysisOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.IRequestedRiskAnalysisOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RequestedRiskAnalysisOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RequestedRiskAnalysisOptions + * @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.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.RequestedRiskAnalysisOptions; + + /** + * Decodes a RequestedRiskAnalysisOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RequestedRiskAnalysisOptions + * @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.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.RequestedRiskAnalysisOptions; + + /** + * Verifies a RequestedRiskAnalysisOptions 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 RequestedRiskAnalysisOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RequestedRiskAnalysisOptions + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.RequestedRiskAnalysisOptions; + + /** + * Creates a plain object from a RequestedRiskAnalysisOptions message. Also converts values to other types if specified. + * @param message RequestedRiskAnalysisOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.RequestedRiskAnalysisOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RequestedRiskAnalysisOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of a ValueFrequency. */ + interface IValueFrequency { + + /** ValueFrequency value */ + value?: (google.privacy.dlp.v2.IValue|null); + + /** ValueFrequency count */ + count?: (number|Long|string|null); + } + + /** Represents a ValueFrequency. */ + class ValueFrequency implements IValueFrequency { + + /** + * Constructs a new ValueFrequency. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.IValueFrequency); + + /** ValueFrequency value. */ + public value?: (google.privacy.dlp.v2.IValue|null); + + /** ValueFrequency count. */ + public count: (number|Long|string); + + /** + * Creates a new ValueFrequency instance using the specified properties. + * @param [properties] Properties to set + * @returns ValueFrequency instance + */ + public static create(properties?: google.privacy.dlp.v2.IValueFrequency): google.privacy.dlp.v2.ValueFrequency; + + /** + * Encodes the specified ValueFrequency message. Does not implicitly {@link google.privacy.dlp.v2.ValueFrequency.verify|verify} messages. + * @param message ValueFrequency message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.IValueFrequency, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ValueFrequency message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.ValueFrequency.verify|verify} messages. + * @param message ValueFrequency message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.IValueFrequency, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ValueFrequency message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ValueFrequency + * @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.privacy.dlp.v2.ValueFrequency; + + /** + * Decodes a ValueFrequency message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ValueFrequency + * @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.privacy.dlp.v2.ValueFrequency; + + /** + * Verifies a ValueFrequency 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 ValueFrequency message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ValueFrequency + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.ValueFrequency; + + /** + * Creates a plain object from a ValueFrequency message. Also converts values to other types if specified. + * @param message ValueFrequency + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.ValueFrequency, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ValueFrequency to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Value. */ + interface IValue { + + /** Value integerValue */ + integerValue?: (number|Long|string|null); + + /** Value floatValue */ + floatValue?: (number|null); + + /** Value stringValue */ + stringValue?: (string|null); + + /** Value booleanValue */ + booleanValue?: (boolean|null); + + /** Value timestampValue */ + timestampValue?: (google.protobuf.ITimestamp|null); + + /** Value timeValue */ + timeValue?: (google.type.ITimeOfDay|null); + + /** Value dateValue */ + dateValue?: (google.type.IDate|null); + + /** Value dayOfWeekValue */ + dayOfWeekValue?: (google.type.DayOfWeek|keyof typeof google.type.DayOfWeek|null); + } + + /** Represents a Value. */ + class Value implements IValue { + + /** + * Constructs a new Value. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.IValue); + + /** Value integerValue. */ + public integerValue: (number|Long|string); + + /** Value floatValue. */ + public floatValue: number; + + /** Value stringValue. */ + public stringValue: string; + + /** Value booleanValue. */ + public booleanValue: boolean; + + /** Value timestampValue. */ + public timestampValue?: (google.protobuf.ITimestamp|null); + + /** Value timeValue. */ + public timeValue?: (google.type.ITimeOfDay|null); + + /** Value dateValue. */ + public dateValue?: (google.type.IDate|null); + + /** Value dayOfWeekValue. */ + public dayOfWeekValue: (google.type.DayOfWeek|keyof typeof google.type.DayOfWeek); + + /** Value type. */ + public type?: ("integerValue"|"floatValue"|"stringValue"|"booleanValue"|"timestampValue"|"timeValue"|"dateValue"|"dayOfWeekValue"); + + /** + * Creates a new Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Value instance + */ + public static create(properties?: google.privacy.dlp.v2.IValue): google.privacy.dlp.v2.Value; + + /** + * Encodes the specified Value message. Does not implicitly {@link google.privacy.dlp.v2.Value.verify|verify} messages. + * @param message Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.IValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Value message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.Value.verify|verify} messages. + * @param message Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.IValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Value + * @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.privacy.dlp.v2.Value; + + /** + * Decodes a Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Value + * @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.privacy.dlp.v2.Value; + + /** + * Verifies a Value 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 Value message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Value + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.Value; + + /** + * Creates a plain object from a Value message. Also converts values to other types if specified. + * @param message Value + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Value to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a QuoteInfo. */ + interface IQuoteInfo { + + /** QuoteInfo dateTime */ + dateTime?: (google.privacy.dlp.v2.IDateTime|null); + } + + /** Represents a QuoteInfo. */ + class QuoteInfo implements IQuoteInfo { + + /** + * Constructs a new QuoteInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.IQuoteInfo); + + /** QuoteInfo dateTime. */ + public dateTime?: (google.privacy.dlp.v2.IDateTime|null); + + /** QuoteInfo parsedQuote. */ + public parsedQuote?: "dateTime"; + + /** + * Creates a new QuoteInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns QuoteInfo instance + */ + public static create(properties?: google.privacy.dlp.v2.IQuoteInfo): google.privacy.dlp.v2.QuoteInfo; + + /** + * Encodes the specified QuoteInfo message. Does not implicitly {@link google.privacy.dlp.v2.QuoteInfo.verify|verify} messages. + * @param message QuoteInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.IQuoteInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified QuoteInfo message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.QuoteInfo.verify|verify} messages. + * @param message QuoteInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.IQuoteInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a QuoteInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns QuoteInfo + * @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.privacy.dlp.v2.QuoteInfo; + + /** + * Decodes a QuoteInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns QuoteInfo + * @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.privacy.dlp.v2.QuoteInfo; + + /** + * Verifies a QuoteInfo 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 QuoteInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns QuoteInfo + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.QuoteInfo; + + /** + * Creates a plain object from a QuoteInfo message. Also converts values to other types if specified. + * @param message QuoteInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.QuoteInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this QuoteInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DateTime. */ + interface IDateTime { + + /** DateTime date */ + date?: (google.type.IDate|null); + + /** DateTime dayOfWeek */ + dayOfWeek?: (google.type.DayOfWeek|keyof typeof google.type.DayOfWeek|null); + + /** DateTime time */ + time?: (google.type.ITimeOfDay|null); + + /** DateTime timeZone */ + timeZone?: (google.privacy.dlp.v2.DateTime.ITimeZone|null); + } + + /** Represents a DateTime. */ + class DateTime implements IDateTime { + + /** + * Constructs a new DateTime. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.IDateTime); + + /** DateTime date. */ + public date?: (google.type.IDate|null); + + /** DateTime dayOfWeek. */ + public dayOfWeek: (google.type.DayOfWeek|keyof typeof google.type.DayOfWeek); + + /** DateTime time. */ + public time?: (google.type.ITimeOfDay|null); + + /** DateTime timeZone. */ + public timeZone?: (google.privacy.dlp.v2.DateTime.ITimeZone|null); + + /** + * Creates a new DateTime instance using the specified properties. + * @param [properties] Properties to set + * @returns DateTime instance + */ + public static create(properties?: google.privacy.dlp.v2.IDateTime): google.privacy.dlp.v2.DateTime; + + /** + * Encodes the specified DateTime message. Does not implicitly {@link google.privacy.dlp.v2.DateTime.verify|verify} messages. + * @param message DateTime message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.IDateTime, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DateTime message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.DateTime.verify|verify} messages. + * @param message DateTime message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.IDateTime, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DateTime message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DateTime + * @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.privacy.dlp.v2.DateTime; + + /** + * Decodes a DateTime message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DateTime + * @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.privacy.dlp.v2.DateTime; + + /** + * Verifies a DateTime 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 DateTime message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DateTime + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.DateTime; + + /** + * Creates a plain object from a DateTime message. Also converts values to other types if specified. + * @param message DateTime + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.DateTime, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DateTime to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace DateTime { + + /** Properties of a TimeZone. */ + interface ITimeZone { + + /** TimeZone offsetMinutes */ + offsetMinutes?: (number|null); + } + + /** Represents a TimeZone. */ + class TimeZone implements ITimeZone { + + /** + * Constructs a new TimeZone. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.DateTime.ITimeZone); + + /** TimeZone offsetMinutes. */ + public offsetMinutes: number; + + /** + * Creates a new TimeZone instance using the specified properties. + * @param [properties] Properties to set + * @returns TimeZone instance + */ + public static create(properties?: google.privacy.dlp.v2.DateTime.ITimeZone): google.privacy.dlp.v2.DateTime.TimeZone; + + /** + * Encodes the specified TimeZone message. Does not implicitly {@link google.privacy.dlp.v2.DateTime.TimeZone.verify|verify} messages. + * @param message TimeZone message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.DateTime.ITimeZone, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TimeZone message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.DateTime.TimeZone.verify|verify} messages. + * @param message TimeZone message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.DateTime.ITimeZone, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TimeZone message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TimeZone + * @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.privacy.dlp.v2.DateTime.TimeZone; + + /** + * Decodes a TimeZone message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TimeZone + * @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.privacy.dlp.v2.DateTime.TimeZone; + + /** + * Verifies a TimeZone 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 TimeZone message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TimeZone + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.DateTime.TimeZone; + + /** + * Creates a plain object from a TimeZone message. Also converts values to other types if specified. + * @param message TimeZone + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.DateTime.TimeZone, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TimeZone to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of a DeidentifyConfig. */ + interface IDeidentifyConfig { + + /** DeidentifyConfig infoTypeTransformations */ + infoTypeTransformations?: (google.privacy.dlp.v2.IInfoTypeTransformations|null); + + /** DeidentifyConfig recordTransformations */ + recordTransformations?: (google.privacy.dlp.v2.IRecordTransformations|null); + + /** DeidentifyConfig transformationErrorHandling */ + transformationErrorHandling?: (google.privacy.dlp.v2.ITransformationErrorHandling|null); + } + + /** Represents a DeidentifyConfig. */ + class DeidentifyConfig implements IDeidentifyConfig { + + /** + * Constructs a new DeidentifyConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.IDeidentifyConfig); + + /** DeidentifyConfig infoTypeTransformations. */ + public infoTypeTransformations?: (google.privacy.dlp.v2.IInfoTypeTransformations|null); + + /** DeidentifyConfig recordTransformations. */ + public recordTransformations?: (google.privacy.dlp.v2.IRecordTransformations|null); + + /** DeidentifyConfig transformationErrorHandling. */ + public transformationErrorHandling?: (google.privacy.dlp.v2.ITransformationErrorHandling|null); + + /** DeidentifyConfig transformation. */ + public transformation?: ("infoTypeTransformations"|"recordTransformations"); + + /** + * Creates a new DeidentifyConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns DeidentifyConfig instance + */ + public static create(properties?: google.privacy.dlp.v2.IDeidentifyConfig): google.privacy.dlp.v2.DeidentifyConfig; + + /** + * Encodes the specified DeidentifyConfig message. Does not implicitly {@link google.privacy.dlp.v2.DeidentifyConfig.verify|verify} messages. + * @param message DeidentifyConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.IDeidentifyConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeidentifyConfig message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.DeidentifyConfig.verify|verify} messages. + * @param message DeidentifyConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.IDeidentifyConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeidentifyConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeidentifyConfig + * @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.privacy.dlp.v2.DeidentifyConfig; + + /** + * Decodes a DeidentifyConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeidentifyConfig + * @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.privacy.dlp.v2.DeidentifyConfig; + + /** + * Verifies a DeidentifyConfig 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 DeidentifyConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeidentifyConfig + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.DeidentifyConfig; + + /** + * Creates a plain object from a DeidentifyConfig message. Also converts values to other types if specified. + * @param message DeidentifyConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.DeidentifyConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeidentifyConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a TransformationErrorHandling. */ + interface ITransformationErrorHandling { + + /** TransformationErrorHandling throwError */ + throwError?: (google.privacy.dlp.v2.TransformationErrorHandling.IThrowError|null); + + /** TransformationErrorHandling leaveUntransformed */ + leaveUntransformed?: (google.privacy.dlp.v2.TransformationErrorHandling.ILeaveUntransformed|null); + } + + /** Represents a TransformationErrorHandling. */ + class TransformationErrorHandling implements ITransformationErrorHandling { + + /** + * Constructs a new TransformationErrorHandling. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.ITransformationErrorHandling); + + /** TransformationErrorHandling throwError. */ + public throwError?: (google.privacy.dlp.v2.TransformationErrorHandling.IThrowError|null); + + /** TransformationErrorHandling leaveUntransformed. */ + public leaveUntransformed?: (google.privacy.dlp.v2.TransformationErrorHandling.ILeaveUntransformed|null); + + /** TransformationErrorHandling mode. */ + public mode?: ("throwError"|"leaveUntransformed"); + + /** + * Creates a new TransformationErrorHandling instance using the specified properties. + * @param [properties] Properties to set + * @returns TransformationErrorHandling instance + */ + public static create(properties?: google.privacy.dlp.v2.ITransformationErrorHandling): google.privacy.dlp.v2.TransformationErrorHandling; + + /** + * Encodes the specified TransformationErrorHandling message. Does not implicitly {@link google.privacy.dlp.v2.TransformationErrorHandling.verify|verify} messages. + * @param message TransformationErrorHandling message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.ITransformationErrorHandling, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TransformationErrorHandling message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.TransformationErrorHandling.verify|verify} messages. + * @param message TransformationErrorHandling message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.ITransformationErrorHandling, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransformationErrorHandling message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TransformationErrorHandling + * @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.privacy.dlp.v2.TransformationErrorHandling; + + /** + * Decodes a TransformationErrorHandling message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TransformationErrorHandling + * @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.privacy.dlp.v2.TransformationErrorHandling; + + /** + * Verifies a TransformationErrorHandling 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 TransformationErrorHandling message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TransformationErrorHandling + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.TransformationErrorHandling; + + /** + * Creates a plain object from a TransformationErrorHandling message. Also converts values to other types if specified. + * @param message TransformationErrorHandling + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.TransformationErrorHandling, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TransformationErrorHandling to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace TransformationErrorHandling { + + /** Properties of a ThrowError. */ + interface IThrowError { + } + + /** Represents a ThrowError. */ + class ThrowError implements IThrowError { + + /** + * Constructs a new ThrowError. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.TransformationErrorHandling.IThrowError); + + /** + * Creates a new ThrowError instance using the specified properties. + * @param [properties] Properties to set + * @returns ThrowError instance + */ + public static create(properties?: google.privacy.dlp.v2.TransformationErrorHandling.IThrowError): google.privacy.dlp.v2.TransformationErrorHandling.ThrowError; + + /** + * Encodes the specified ThrowError message. Does not implicitly {@link google.privacy.dlp.v2.TransformationErrorHandling.ThrowError.verify|verify} messages. + * @param message ThrowError message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.TransformationErrorHandling.IThrowError, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ThrowError message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.TransformationErrorHandling.ThrowError.verify|verify} messages. + * @param message ThrowError message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.TransformationErrorHandling.IThrowError, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ThrowError message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ThrowError + * @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.privacy.dlp.v2.TransformationErrorHandling.ThrowError; + + /** + * Decodes a ThrowError message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ThrowError + * @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.privacy.dlp.v2.TransformationErrorHandling.ThrowError; + + /** + * Verifies a ThrowError 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 ThrowError message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ThrowError + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.TransformationErrorHandling.ThrowError; + + /** + * Creates a plain object from a ThrowError message. Also converts values to other types if specified. + * @param message ThrowError + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.TransformationErrorHandling.ThrowError, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ThrowError to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a LeaveUntransformed. */ + interface ILeaveUntransformed { + } + + /** Represents a LeaveUntransformed. */ + class LeaveUntransformed implements ILeaveUntransformed { + + /** + * Constructs a new LeaveUntransformed. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.TransformationErrorHandling.ILeaveUntransformed); + + /** + * Creates a new LeaveUntransformed instance using the specified properties. + * @param [properties] Properties to set + * @returns LeaveUntransformed instance + */ + public static create(properties?: google.privacy.dlp.v2.TransformationErrorHandling.ILeaveUntransformed): google.privacy.dlp.v2.TransformationErrorHandling.LeaveUntransformed; + + /** + * Encodes the specified LeaveUntransformed message. Does not implicitly {@link google.privacy.dlp.v2.TransformationErrorHandling.LeaveUntransformed.verify|verify} messages. + * @param message LeaveUntransformed message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.TransformationErrorHandling.ILeaveUntransformed, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LeaveUntransformed message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.TransformationErrorHandling.LeaveUntransformed.verify|verify} messages. + * @param message LeaveUntransformed message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.TransformationErrorHandling.ILeaveUntransformed, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LeaveUntransformed message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LeaveUntransformed + * @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.privacy.dlp.v2.TransformationErrorHandling.LeaveUntransformed; + + /** + * Decodes a LeaveUntransformed message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LeaveUntransformed + * @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.privacy.dlp.v2.TransformationErrorHandling.LeaveUntransformed; + + /** + * Verifies a LeaveUntransformed 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 LeaveUntransformed message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LeaveUntransformed + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.TransformationErrorHandling.LeaveUntransformed; + + /** + * Creates a plain object from a LeaveUntransformed message. Also converts values to other types if specified. + * @param message LeaveUntransformed + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.TransformationErrorHandling.LeaveUntransformed, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LeaveUntransformed to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of a PrimitiveTransformation. */ + interface IPrimitiveTransformation { + + /** PrimitiveTransformation replaceConfig */ + replaceConfig?: (google.privacy.dlp.v2.IReplaceValueConfig|null); + + /** PrimitiveTransformation redactConfig */ + redactConfig?: (google.privacy.dlp.v2.IRedactConfig|null); + + /** PrimitiveTransformation characterMaskConfig */ + characterMaskConfig?: (google.privacy.dlp.v2.ICharacterMaskConfig|null); + + /** PrimitiveTransformation cryptoReplaceFfxFpeConfig */ + cryptoReplaceFfxFpeConfig?: (google.privacy.dlp.v2.ICryptoReplaceFfxFpeConfig|null); + + /** PrimitiveTransformation fixedSizeBucketingConfig */ + fixedSizeBucketingConfig?: (google.privacy.dlp.v2.IFixedSizeBucketingConfig|null); + + /** PrimitiveTransformation bucketingConfig */ + bucketingConfig?: (google.privacy.dlp.v2.IBucketingConfig|null); + + /** PrimitiveTransformation replaceWithInfoTypeConfig */ + replaceWithInfoTypeConfig?: (google.privacy.dlp.v2.IReplaceWithInfoTypeConfig|null); + + /** PrimitiveTransformation timePartConfig */ + timePartConfig?: (google.privacy.dlp.v2.ITimePartConfig|null); + + /** PrimitiveTransformation cryptoHashConfig */ + cryptoHashConfig?: (google.privacy.dlp.v2.ICryptoHashConfig|null); + + /** PrimitiveTransformation dateShiftConfig */ + dateShiftConfig?: (google.privacy.dlp.v2.IDateShiftConfig|null); + + /** PrimitiveTransformation cryptoDeterministicConfig */ + cryptoDeterministicConfig?: (google.privacy.dlp.v2.ICryptoDeterministicConfig|null); + } + + /** Represents a PrimitiveTransformation. */ + class PrimitiveTransformation implements IPrimitiveTransformation { + + /** + * Constructs a new PrimitiveTransformation. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.IPrimitiveTransformation); + + /** PrimitiveTransformation replaceConfig. */ + public replaceConfig?: (google.privacy.dlp.v2.IReplaceValueConfig|null); + + /** PrimitiveTransformation redactConfig. */ + public redactConfig?: (google.privacy.dlp.v2.IRedactConfig|null); + + /** PrimitiveTransformation characterMaskConfig. */ + public characterMaskConfig?: (google.privacy.dlp.v2.ICharacterMaskConfig|null); + + /** PrimitiveTransformation cryptoReplaceFfxFpeConfig. */ + public cryptoReplaceFfxFpeConfig?: (google.privacy.dlp.v2.ICryptoReplaceFfxFpeConfig|null); + + /** PrimitiveTransformation fixedSizeBucketingConfig. */ + public fixedSizeBucketingConfig?: (google.privacy.dlp.v2.IFixedSizeBucketingConfig|null); + + /** PrimitiveTransformation bucketingConfig. */ + public bucketingConfig?: (google.privacy.dlp.v2.IBucketingConfig|null); + + /** PrimitiveTransformation replaceWithInfoTypeConfig. */ + public replaceWithInfoTypeConfig?: (google.privacy.dlp.v2.IReplaceWithInfoTypeConfig|null); + + /** PrimitiveTransformation timePartConfig. */ + public timePartConfig?: (google.privacy.dlp.v2.ITimePartConfig|null); + + /** PrimitiveTransformation cryptoHashConfig. */ + public cryptoHashConfig?: (google.privacy.dlp.v2.ICryptoHashConfig|null); + + /** PrimitiveTransformation dateShiftConfig. */ + public dateShiftConfig?: (google.privacy.dlp.v2.IDateShiftConfig|null); + + /** PrimitiveTransformation cryptoDeterministicConfig. */ + public cryptoDeterministicConfig?: (google.privacy.dlp.v2.ICryptoDeterministicConfig|null); + + /** PrimitiveTransformation transformation. */ + public transformation?: ("replaceConfig"|"redactConfig"|"characterMaskConfig"|"cryptoReplaceFfxFpeConfig"|"fixedSizeBucketingConfig"|"bucketingConfig"|"replaceWithInfoTypeConfig"|"timePartConfig"|"cryptoHashConfig"|"dateShiftConfig"|"cryptoDeterministicConfig"); + + /** + * Creates a new PrimitiveTransformation instance using the specified properties. + * @param [properties] Properties to set + * @returns PrimitiveTransformation instance + */ + public static create(properties?: google.privacy.dlp.v2.IPrimitiveTransformation): google.privacy.dlp.v2.PrimitiveTransformation; + + /** + * Encodes the specified PrimitiveTransformation message. Does not implicitly {@link google.privacy.dlp.v2.PrimitiveTransformation.verify|verify} messages. + * @param message PrimitiveTransformation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.IPrimitiveTransformation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PrimitiveTransformation message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.PrimitiveTransformation.verify|verify} messages. + * @param message PrimitiveTransformation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.IPrimitiveTransformation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PrimitiveTransformation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PrimitiveTransformation + * @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.privacy.dlp.v2.PrimitiveTransformation; + + /** + * Decodes a PrimitiveTransformation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PrimitiveTransformation + * @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.privacy.dlp.v2.PrimitiveTransformation; + + /** + * Verifies a PrimitiveTransformation 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 PrimitiveTransformation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PrimitiveTransformation + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.PrimitiveTransformation; + + /** + * Creates a plain object from a PrimitiveTransformation message. Also converts values to other types if specified. + * @param message PrimitiveTransformation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.PrimitiveTransformation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PrimitiveTransformation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a TimePartConfig. */ + interface ITimePartConfig { + + /** TimePartConfig partToExtract */ + partToExtract?: (google.privacy.dlp.v2.TimePartConfig.TimePart|keyof typeof google.privacy.dlp.v2.TimePartConfig.TimePart|null); + } + + /** Represents a TimePartConfig. */ + class TimePartConfig implements ITimePartConfig { + + /** + * Constructs a new TimePartConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.ITimePartConfig); + + /** TimePartConfig partToExtract. */ + public partToExtract: (google.privacy.dlp.v2.TimePartConfig.TimePart|keyof typeof google.privacy.dlp.v2.TimePartConfig.TimePart); + + /** + * Creates a new TimePartConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns TimePartConfig instance + */ + public static create(properties?: google.privacy.dlp.v2.ITimePartConfig): google.privacy.dlp.v2.TimePartConfig; + + /** + * Encodes the specified TimePartConfig message. Does not implicitly {@link google.privacy.dlp.v2.TimePartConfig.verify|verify} messages. + * @param message TimePartConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.ITimePartConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TimePartConfig message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.TimePartConfig.verify|verify} messages. + * @param message TimePartConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.ITimePartConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TimePartConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TimePartConfig + * @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.privacy.dlp.v2.TimePartConfig; + + /** + * Decodes a TimePartConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TimePartConfig + * @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.privacy.dlp.v2.TimePartConfig; + + /** + * Verifies a TimePartConfig 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 TimePartConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TimePartConfig + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.TimePartConfig; + + /** + * Creates a plain object from a TimePartConfig message. Also converts values to other types if specified. + * @param message TimePartConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.TimePartConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TimePartConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace TimePartConfig { + + /** TimePart enum. */ + enum TimePart { + TIME_PART_UNSPECIFIED = 0, + YEAR = 1, + MONTH = 2, + DAY_OF_MONTH = 3, + DAY_OF_WEEK = 4, + WEEK_OF_YEAR = 5, + HOUR_OF_DAY = 6 + } + } + + /** Properties of a CryptoHashConfig. */ + interface ICryptoHashConfig { + + /** CryptoHashConfig cryptoKey */ + cryptoKey?: (google.privacy.dlp.v2.ICryptoKey|null); + } + + /** Represents a CryptoHashConfig. */ + class CryptoHashConfig implements ICryptoHashConfig { + + /** + * Constructs a new CryptoHashConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.ICryptoHashConfig); + + /** CryptoHashConfig cryptoKey. */ + public cryptoKey?: (google.privacy.dlp.v2.ICryptoKey|null); + + /** + * Creates a new CryptoHashConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns CryptoHashConfig instance + */ + public static create(properties?: google.privacy.dlp.v2.ICryptoHashConfig): google.privacy.dlp.v2.CryptoHashConfig; + + /** + * Encodes the specified CryptoHashConfig message. Does not implicitly {@link google.privacy.dlp.v2.CryptoHashConfig.verify|verify} messages. + * @param message CryptoHashConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.ICryptoHashConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CryptoHashConfig message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.CryptoHashConfig.verify|verify} messages. + * @param message CryptoHashConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.ICryptoHashConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CryptoHashConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CryptoHashConfig + * @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.privacy.dlp.v2.CryptoHashConfig; + + /** + * Decodes a CryptoHashConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CryptoHashConfig + * @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.privacy.dlp.v2.CryptoHashConfig; + + /** + * Verifies a CryptoHashConfig 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 CryptoHashConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CryptoHashConfig + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.CryptoHashConfig; + + /** + * Creates a plain object from a CryptoHashConfig message. Also converts values to other types if specified. + * @param message CryptoHashConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.CryptoHashConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CryptoHashConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a CryptoDeterministicConfig. */ + interface ICryptoDeterministicConfig { + + /** CryptoDeterministicConfig cryptoKey */ + cryptoKey?: (google.privacy.dlp.v2.ICryptoKey|null); + + /** CryptoDeterministicConfig surrogateInfoType */ + surrogateInfoType?: (google.privacy.dlp.v2.IInfoType|null); + + /** CryptoDeterministicConfig context */ + context?: (google.privacy.dlp.v2.IFieldId|null); + } + + /** Represents a CryptoDeterministicConfig. */ + class CryptoDeterministicConfig implements ICryptoDeterministicConfig { + + /** + * Constructs a new CryptoDeterministicConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.ICryptoDeterministicConfig); + + /** CryptoDeterministicConfig cryptoKey. */ + public cryptoKey?: (google.privacy.dlp.v2.ICryptoKey|null); + + /** CryptoDeterministicConfig surrogateInfoType. */ + public surrogateInfoType?: (google.privacy.dlp.v2.IInfoType|null); + + /** CryptoDeterministicConfig context. */ + public context?: (google.privacy.dlp.v2.IFieldId|null); + + /** + * Creates a new CryptoDeterministicConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns CryptoDeterministicConfig instance + */ + public static create(properties?: google.privacy.dlp.v2.ICryptoDeterministicConfig): google.privacy.dlp.v2.CryptoDeterministicConfig; + + /** + * Encodes the specified CryptoDeterministicConfig message. Does not implicitly {@link google.privacy.dlp.v2.CryptoDeterministicConfig.verify|verify} messages. + * @param message CryptoDeterministicConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.ICryptoDeterministicConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CryptoDeterministicConfig message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.CryptoDeterministicConfig.verify|verify} messages. + * @param message CryptoDeterministicConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.ICryptoDeterministicConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CryptoDeterministicConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CryptoDeterministicConfig + * @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.privacy.dlp.v2.CryptoDeterministicConfig; + + /** + * Decodes a CryptoDeterministicConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CryptoDeterministicConfig + * @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.privacy.dlp.v2.CryptoDeterministicConfig; + + /** + * Verifies a CryptoDeterministicConfig 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 CryptoDeterministicConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CryptoDeterministicConfig + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.CryptoDeterministicConfig; + + /** + * Creates a plain object from a CryptoDeterministicConfig message. Also converts values to other types if specified. + * @param message CryptoDeterministicConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.CryptoDeterministicConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CryptoDeterministicConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ReplaceValueConfig. */ + interface IReplaceValueConfig { + + /** ReplaceValueConfig newValue */ + newValue?: (google.privacy.dlp.v2.IValue|null); + } + + /** Represents a ReplaceValueConfig. */ + class ReplaceValueConfig implements IReplaceValueConfig { + + /** + * Constructs a new ReplaceValueConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.IReplaceValueConfig); + + /** ReplaceValueConfig newValue. */ + public newValue?: (google.privacy.dlp.v2.IValue|null); + + /** + * Creates a new ReplaceValueConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ReplaceValueConfig instance + */ + public static create(properties?: google.privacy.dlp.v2.IReplaceValueConfig): google.privacy.dlp.v2.ReplaceValueConfig; + + /** + * Encodes the specified ReplaceValueConfig message. Does not implicitly {@link google.privacy.dlp.v2.ReplaceValueConfig.verify|verify} messages. + * @param message ReplaceValueConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.IReplaceValueConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReplaceValueConfig message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.ReplaceValueConfig.verify|verify} messages. + * @param message ReplaceValueConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.IReplaceValueConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReplaceValueConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReplaceValueConfig + * @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.privacy.dlp.v2.ReplaceValueConfig; + + /** + * Decodes a ReplaceValueConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReplaceValueConfig + * @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.privacy.dlp.v2.ReplaceValueConfig; + + /** + * Verifies a ReplaceValueConfig 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 ReplaceValueConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReplaceValueConfig + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.ReplaceValueConfig; + + /** + * Creates a plain object from a ReplaceValueConfig message. Also converts values to other types if specified. + * @param message ReplaceValueConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.ReplaceValueConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReplaceValueConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ReplaceWithInfoTypeConfig. */ + interface IReplaceWithInfoTypeConfig { + } + + /** Represents a ReplaceWithInfoTypeConfig. */ + class ReplaceWithInfoTypeConfig implements IReplaceWithInfoTypeConfig { + + /** + * Constructs a new ReplaceWithInfoTypeConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.IReplaceWithInfoTypeConfig); + + /** + * Creates a new ReplaceWithInfoTypeConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ReplaceWithInfoTypeConfig instance + */ + public static create(properties?: google.privacy.dlp.v2.IReplaceWithInfoTypeConfig): google.privacy.dlp.v2.ReplaceWithInfoTypeConfig; + + /** + * Encodes the specified ReplaceWithInfoTypeConfig message. Does not implicitly {@link google.privacy.dlp.v2.ReplaceWithInfoTypeConfig.verify|verify} messages. + * @param message ReplaceWithInfoTypeConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.IReplaceWithInfoTypeConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReplaceWithInfoTypeConfig message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.ReplaceWithInfoTypeConfig.verify|verify} messages. + * @param message ReplaceWithInfoTypeConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.IReplaceWithInfoTypeConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReplaceWithInfoTypeConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReplaceWithInfoTypeConfig + * @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.privacy.dlp.v2.ReplaceWithInfoTypeConfig; + + /** + * Decodes a ReplaceWithInfoTypeConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReplaceWithInfoTypeConfig + * @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.privacy.dlp.v2.ReplaceWithInfoTypeConfig; + + /** + * Verifies a ReplaceWithInfoTypeConfig 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 ReplaceWithInfoTypeConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReplaceWithInfoTypeConfig + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.ReplaceWithInfoTypeConfig; + + /** + * Creates a plain object from a ReplaceWithInfoTypeConfig message. Also converts values to other types if specified. + * @param message ReplaceWithInfoTypeConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.ReplaceWithInfoTypeConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReplaceWithInfoTypeConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a RedactConfig. */ + interface IRedactConfig { + } + + /** Represents a RedactConfig. */ + class RedactConfig implements IRedactConfig { + + /** + * Constructs a new RedactConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.IRedactConfig); + + /** + * Creates a new RedactConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns RedactConfig instance + */ + public static create(properties?: google.privacy.dlp.v2.IRedactConfig): google.privacy.dlp.v2.RedactConfig; + + /** + * Encodes the specified RedactConfig message. Does not implicitly {@link google.privacy.dlp.v2.RedactConfig.verify|verify} messages. + * @param message RedactConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.IRedactConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RedactConfig message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.RedactConfig.verify|verify} messages. + * @param message RedactConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.IRedactConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RedactConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RedactConfig + * @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.privacy.dlp.v2.RedactConfig; + + /** + * Decodes a RedactConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RedactConfig + * @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.privacy.dlp.v2.RedactConfig; + + /** + * Verifies a RedactConfig 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 RedactConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RedactConfig + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.RedactConfig; + + /** + * Creates a plain object from a RedactConfig message. Also converts values to other types if specified. + * @param message RedactConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.RedactConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RedactConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a CharsToIgnore. */ + interface ICharsToIgnore { + + /** CharsToIgnore charactersToSkip */ + charactersToSkip?: (string|null); + + /** CharsToIgnore commonCharactersToIgnore */ + commonCharactersToIgnore?: (google.privacy.dlp.v2.CharsToIgnore.CommonCharsToIgnore|keyof typeof google.privacy.dlp.v2.CharsToIgnore.CommonCharsToIgnore|null); + } + + /** Represents a CharsToIgnore. */ + class CharsToIgnore implements ICharsToIgnore { + + /** + * Constructs a new CharsToIgnore. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.ICharsToIgnore); + + /** CharsToIgnore charactersToSkip. */ + public charactersToSkip: string; + + /** CharsToIgnore commonCharactersToIgnore. */ + public commonCharactersToIgnore: (google.privacy.dlp.v2.CharsToIgnore.CommonCharsToIgnore|keyof typeof google.privacy.dlp.v2.CharsToIgnore.CommonCharsToIgnore); + + /** CharsToIgnore characters. */ + public characters?: ("charactersToSkip"|"commonCharactersToIgnore"); + + /** + * Creates a new CharsToIgnore instance using the specified properties. + * @param [properties] Properties to set + * @returns CharsToIgnore instance + */ + public static create(properties?: google.privacy.dlp.v2.ICharsToIgnore): google.privacy.dlp.v2.CharsToIgnore; + + /** + * Encodes the specified CharsToIgnore message. Does not implicitly {@link google.privacy.dlp.v2.CharsToIgnore.verify|verify} messages. + * @param message CharsToIgnore message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.ICharsToIgnore, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CharsToIgnore message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.CharsToIgnore.verify|verify} messages. + * @param message CharsToIgnore message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.ICharsToIgnore, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CharsToIgnore message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CharsToIgnore + * @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.privacy.dlp.v2.CharsToIgnore; + + /** + * Decodes a CharsToIgnore message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CharsToIgnore + * @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.privacy.dlp.v2.CharsToIgnore; + + /** + * Verifies a CharsToIgnore 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 CharsToIgnore message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CharsToIgnore + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.CharsToIgnore; + + /** + * Creates a plain object from a CharsToIgnore message. Also converts values to other types if specified. + * @param message CharsToIgnore + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.CharsToIgnore, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CharsToIgnore to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace CharsToIgnore { + + /** CommonCharsToIgnore enum. */ + enum CommonCharsToIgnore { + COMMON_CHARS_TO_IGNORE_UNSPECIFIED = 0, + NUMERIC = 1, + ALPHA_UPPER_CASE = 2, + ALPHA_LOWER_CASE = 3, + PUNCTUATION = 4, + WHITESPACE = 5 + } + } + + /** Properties of a CharacterMaskConfig. */ + interface ICharacterMaskConfig { + + /** CharacterMaskConfig maskingCharacter */ + maskingCharacter?: (string|null); + + /** CharacterMaskConfig numberToMask */ + numberToMask?: (number|null); + + /** CharacterMaskConfig reverseOrder */ + reverseOrder?: (boolean|null); + + /** CharacterMaskConfig charactersToIgnore */ + charactersToIgnore?: (google.privacy.dlp.v2.ICharsToIgnore[]|null); + } + + /** Represents a CharacterMaskConfig. */ + class CharacterMaskConfig implements ICharacterMaskConfig { + + /** + * Constructs a new CharacterMaskConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.ICharacterMaskConfig); + + /** CharacterMaskConfig maskingCharacter. */ + public maskingCharacter: string; + + /** CharacterMaskConfig numberToMask. */ + public numberToMask: number; + + /** CharacterMaskConfig reverseOrder. */ + public reverseOrder: boolean; + + /** CharacterMaskConfig charactersToIgnore. */ + public charactersToIgnore: google.privacy.dlp.v2.ICharsToIgnore[]; + + /** + * Creates a new CharacterMaskConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns CharacterMaskConfig instance + */ + public static create(properties?: google.privacy.dlp.v2.ICharacterMaskConfig): google.privacy.dlp.v2.CharacterMaskConfig; + + /** + * Encodes the specified CharacterMaskConfig message. Does not implicitly {@link google.privacy.dlp.v2.CharacterMaskConfig.verify|verify} messages. + * @param message CharacterMaskConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.ICharacterMaskConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CharacterMaskConfig message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.CharacterMaskConfig.verify|verify} messages. + * @param message CharacterMaskConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.ICharacterMaskConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CharacterMaskConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CharacterMaskConfig + * @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.privacy.dlp.v2.CharacterMaskConfig; + + /** + * Decodes a CharacterMaskConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CharacterMaskConfig + * @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.privacy.dlp.v2.CharacterMaskConfig; + + /** + * Verifies a CharacterMaskConfig 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 CharacterMaskConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CharacterMaskConfig + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.CharacterMaskConfig; + + /** + * Creates a plain object from a CharacterMaskConfig message. Also converts values to other types if specified. + * @param message CharacterMaskConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.CharacterMaskConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CharacterMaskConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a FixedSizeBucketingConfig. */ + interface IFixedSizeBucketingConfig { + + /** FixedSizeBucketingConfig lowerBound */ + lowerBound?: (google.privacy.dlp.v2.IValue|null); + + /** FixedSizeBucketingConfig upperBound */ + upperBound?: (google.privacy.dlp.v2.IValue|null); + + /** FixedSizeBucketingConfig bucketSize */ + bucketSize?: (number|null); + } + + /** Represents a FixedSizeBucketingConfig. */ + class FixedSizeBucketingConfig implements IFixedSizeBucketingConfig { + + /** + * Constructs a new FixedSizeBucketingConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.IFixedSizeBucketingConfig); + + /** FixedSizeBucketingConfig lowerBound. */ + public lowerBound?: (google.privacy.dlp.v2.IValue|null); + + /** FixedSizeBucketingConfig upperBound. */ + public upperBound?: (google.privacy.dlp.v2.IValue|null); + + /** FixedSizeBucketingConfig bucketSize. */ + public bucketSize: number; + + /** + * Creates a new FixedSizeBucketingConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedSizeBucketingConfig instance + */ + public static create(properties?: google.privacy.dlp.v2.IFixedSizeBucketingConfig): google.privacy.dlp.v2.FixedSizeBucketingConfig; + + /** + * Encodes the specified FixedSizeBucketingConfig message. Does not implicitly {@link google.privacy.dlp.v2.FixedSizeBucketingConfig.verify|verify} messages. + * @param message FixedSizeBucketingConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.IFixedSizeBucketingConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FixedSizeBucketingConfig message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.FixedSizeBucketingConfig.verify|verify} messages. + * @param message FixedSizeBucketingConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.IFixedSizeBucketingConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedSizeBucketingConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FixedSizeBucketingConfig + * @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.privacy.dlp.v2.FixedSizeBucketingConfig; + + /** + * Decodes a FixedSizeBucketingConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FixedSizeBucketingConfig + * @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.privacy.dlp.v2.FixedSizeBucketingConfig; + + /** + * Verifies a FixedSizeBucketingConfig 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 FixedSizeBucketingConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FixedSizeBucketingConfig + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.FixedSizeBucketingConfig; + + /** + * Creates a plain object from a FixedSizeBucketingConfig message. Also converts values to other types if specified. + * @param message FixedSizeBucketingConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.FixedSizeBucketingConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FixedSizeBucketingConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a BucketingConfig. */ + interface IBucketingConfig { + + /** BucketingConfig buckets */ + buckets?: (google.privacy.dlp.v2.BucketingConfig.IBucket[]|null); + } + + /** Represents a BucketingConfig. */ + class BucketingConfig implements IBucketingConfig { + + /** + * Constructs a new BucketingConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.IBucketingConfig); + + /** BucketingConfig buckets. */ + public buckets: google.privacy.dlp.v2.BucketingConfig.IBucket[]; + + /** + * Creates a new BucketingConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns BucketingConfig instance + */ + public static create(properties?: google.privacy.dlp.v2.IBucketingConfig): google.privacy.dlp.v2.BucketingConfig; + + /** + * Encodes the specified BucketingConfig message. Does not implicitly {@link google.privacy.dlp.v2.BucketingConfig.verify|verify} messages. + * @param message BucketingConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.IBucketingConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BucketingConfig message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.BucketingConfig.verify|verify} messages. + * @param message BucketingConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.IBucketingConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BucketingConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BucketingConfig + * @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.privacy.dlp.v2.BucketingConfig; + + /** + * Decodes a BucketingConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BucketingConfig + * @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.privacy.dlp.v2.BucketingConfig; + + /** + * Verifies a BucketingConfig 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 BucketingConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BucketingConfig + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.BucketingConfig; + + /** + * Creates a plain object from a BucketingConfig message. Also converts values to other types if specified. + * @param message BucketingConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.BucketingConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BucketingConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace BucketingConfig { + + /** Properties of a Bucket. */ + interface IBucket { + + /** Bucket min */ + min?: (google.privacy.dlp.v2.IValue|null); + + /** Bucket max */ + max?: (google.privacy.dlp.v2.IValue|null); + + /** Bucket replacementValue */ + replacementValue?: (google.privacy.dlp.v2.IValue|null); + } + + /** Represents a Bucket. */ + class Bucket implements IBucket { + + /** + * Constructs a new Bucket. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.BucketingConfig.IBucket); + + /** Bucket min. */ + public min?: (google.privacy.dlp.v2.IValue|null); + + /** Bucket max. */ + public max?: (google.privacy.dlp.v2.IValue|null); + + /** Bucket replacementValue. */ + public replacementValue?: (google.privacy.dlp.v2.IValue|null); + + /** + * Creates a new Bucket instance using the specified properties. + * @param [properties] Properties to set + * @returns Bucket instance + */ + public static create(properties?: google.privacy.dlp.v2.BucketingConfig.IBucket): google.privacy.dlp.v2.BucketingConfig.Bucket; + + /** + * Encodes the specified Bucket message. Does not implicitly {@link google.privacy.dlp.v2.BucketingConfig.Bucket.verify|verify} messages. + * @param message Bucket message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.BucketingConfig.IBucket, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Bucket message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.BucketingConfig.Bucket.verify|verify} messages. + * @param message Bucket message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.BucketingConfig.IBucket, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Bucket message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Bucket + * @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.privacy.dlp.v2.BucketingConfig.Bucket; + + /** + * Decodes a Bucket message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Bucket + * @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.privacy.dlp.v2.BucketingConfig.Bucket; + + /** + * Verifies a Bucket 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 Bucket message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Bucket + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.BucketingConfig.Bucket; + + /** + * Creates a plain object from a Bucket message. Also converts values to other types if specified. + * @param message Bucket + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.BucketingConfig.Bucket, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Bucket to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of a CryptoReplaceFfxFpeConfig. */ + interface ICryptoReplaceFfxFpeConfig { + + /** CryptoReplaceFfxFpeConfig cryptoKey */ + cryptoKey?: (google.privacy.dlp.v2.ICryptoKey|null); + + /** CryptoReplaceFfxFpeConfig context */ + context?: (google.privacy.dlp.v2.IFieldId|null); + + /** CryptoReplaceFfxFpeConfig commonAlphabet */ + commonAlphabet?: (google.privacy.dlp.v2.CryptoReplaceFfxFpeConfig.FfxCommonNativeAlphabet|keyof typeof google.privacy.dlp.v2.CryptoReplaceFfxFpeConfig.FfxCommonNativeAlphabet|null); + + /** CryptoReplaceFfxFpeConfig customAlphabet */ + customAlphabet?: (string|null); + + /** CryptoReplaceFfxFpeConfig radix */ + radix?: (number|null); + + /** CryptoReplaceFfxFpeConfig surrogateInfoType */ + surrogateInfoType?: (google.privacy.dlp.v2.IInfoType|null); + } + + /** Represents a CryptoReplaceFfxFpeConfig. */ + class CryptoReplaceFfxFpeConfig implements ICryptoReplaceFfxFpeConfig { + + /** + * Constructs a new CryptoReplaceFfxFpeConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.ICryptoReplaceFfxFpeConfig); + + /** CryptoReplaceFfxFpeConfig cryptoKey. */ + public cryptoKey?: (google.privacy.dlp.v2.ICryptoKey|null); + + /** CryptoReplaceFfxFpeConfig context. */ + public context?: (google.privacy.dlp.v2.IFieldId|null); + + /** CryptoReplaceFfxFpeConfig commonAlphabet. */ + public commonAlphabet: (google.privacy.dlp.v2.CryptoReplaceFfxFpeConfig.FfxCommonNativeAlphabet|keyof typeof google.privacy.dlp.v2.CryptoReplaceFfxFpeConfig.FfxCommonNativeAlphabet); + + /** CryptoReplaceFfxFpeConfig customAlphabet. */ + public customAlphabet: string; + + /** CryptoReplaceFfxFpeConfig radix. */ + public radix: number; + + /** CryptoReplaceFfxFpeConfig surrogateInfoType. */ + public surrogateInfoType?: (google.privacy.dlp.v2.IInfoType|null); + + /** CryptoReplaceFfxFpeConfig alphabet. */ + public alphabet?: ("commonAlphabet"|"customAlphabet"|"radix"); + + /** + * Creates a new CryptoReplaceFfxFpeConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns CryptoReplaceFfxFpeConfig instance + */ + public static create(properties?: google.privacy.dlp.v2.ICryptoReplaceFfxFpeConfig): google.privacy.dlp.v2.CryptoReplaceFfxFpeConfig; + + /** + * Encodes the specified CryptoReplaceFfxFpeConfig message. Does not implicitly {@link google.privacy.dlp.v2.CryptoReplaceFfxFpeConfig.verify|verify} messages. + * @param message CryptoReplaceFfxFpeConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.ICryptoReplaceFfxFpeConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CryptoReplaceFfxFpeConfig message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.CryptoReplaceFfxFpeConfig.verify|verify} messages. + * @param message CryptoReplaceFfxFpeConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.ICryptoReplaceFfxFpeConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CryptoReplaceFfxFpeConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CryptoReplaceFfxFpeConfig + * @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.privacy.dlp.v2.CryptoReplaceFfxFpeConfig; + + /** + * Decodes a CryptoReplaceFfxFpeConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CryptoReplaceFfxFpeConfig + * @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.privacy.dlp.v2.CryptoReplaceFfxFpeConfig; + + /** + * Verifies a CryptoReplaceFfxFpeConfig 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 CryptoReplaceFfxFpeConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CryptoReplaceFfxFpeConfig + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.CryptoReplaceFfxFpeConfig; + + /** + * Creates a plain object from a CryptoReplaceFfxFpeConfig message. Also converts values to other types if specified. + * @param message CryptoReplaceFfxFpeConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.CryptoReplaceFfxFpeConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CryptoReplaceFfxFpeConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace CryptoReplaceFfxFpeConfig { + + /** FfxCommonNativeAlphabet enum. */ + enum FfxCommonNativeAlphabet { + FFX_COMMON_NATIVE_ALPHABET_UNSPECIFIED = 0, + NUMERIC = 1, + HEXADECIMAL = 2, + UPPER_CASE_ALPHA_NUMERIC = 3, + ALPHA_NUMERIC = 4 + } + } + + /** Properties of a CryptoKey. */ + interface ICryptoKey { + + /** CryptoKey transient */ + transient?: (google.privacy.dlp.v2.ITransientCryptoKey|null); + + /** CryptoKey unwrapped */ + unwrapped?: (google.privacy.dlp.v2.IUnwrappedCryptoKey|null); + + /** CryptoKey kmsWrapped */ + kmsWrapped?: (google.privacy.dlp.v2.IKmsWrappedCryptoKey|null); + } + + /** Represents a CryptoKey. */ + class CryptoKey implements ICryptoKey { + + /** + * Constructs a new CryptoKey. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.ICryptoKey); + + /** CryptoKey transient. */ + public transient?: (google.privacy.dlp.v2.ITransientCryptoKey|null); + + /** CryptoKey unwrapped. */ + public unwrapped?: (google.privacy.dlp.v2.IUnwrappedCryptoKey|null); + + /** CryptoKey kmsWrapped. */ + public kmsWrapped?: (google.privacy.dlp.v2.IKmsWrappedCryptoKey|null); + + /** CryptoKey source. */ + public source?: ("transient"|"unwrapped"|"kmsWrapped"); + + /** + * Creates a new CryptoKey instance using the specified properties. + * @param [properties] Properties to set + * @returns CryptoKey instance + */ + public static create(properties?: google.privacy.dlp.v2.ICryptoKey): google.privacy.dlp.v2.CryptoKey; + + /** + * Encodes the specified CryptoKey message. Does not implicitly {@link google.privacy.dlp.v2.CryptoKey.verify|verify} messages. + * @param message CryptoKey message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.ICryptoKey, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CryptoKey message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.CryptoKey.verify|verify} messages. + * @param message CryptoKey message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.ICryptoKey, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CryptoKey message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CryptoKey + * @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.privacy.dlp.v2.CryptoKey; + + /** + * Decodes a CryptoKey message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CryptoKey + * @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.privacy.dlp.v2.CryptoKey; + + /** + * Verifies a CryptoKey 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 CryptoKey message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CryptoKey + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.CryptoKey; + + /** + * Creates a plain object from a CryptoKey message. Also converts values to other types if specified. + * @param message CryptoKey + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.CryptoKey, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CryptoKey to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a TransientCryptoKey. */ + interface ITransientCryptoKey { + + /** TransientCryptoKey name */ + name?: (string|null); + } + + /** Represents a TransientCryptoKey. */ + class TransientCryptoKey implements ITransientCryptoKey { + + /** + * Constructs a new TransientCryptoKey. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.ITransientCryptoKey); + + /** TransientCryptoKey name. */ + public name: string; + + /** + * Creates a new TransientCryptoKey instance using the specified properties. + * @param [properties] Properties to set + * @returns TransientCryptoKey instance + */ + public static create(properties?: google.privacy.dlp.v2.ITransientCryptoKey): google.privacy.dlp.v2.TransientCryptoKey; + + /** + * Encodes the specified TransientCryptoKey message. Does not implicitly {@link google.privacy.dlp.v2.TransientCryptoKey.verify|verify} messages. + * @param message TransientCryptoKey message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.ITransientCryptoKey, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TransientCryptoKey message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.TransientCryptoKey.verify|verify} messages. + * @param message TransientCryptoKey message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.ITransientCryptoKey, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransientCryptoKey message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TransientCryptoKey + * @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.privacy.dlp.v2.TransientCryptoKey; + + /** + * Decodes a TransientCryptoKey message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TransientCryptoKey + * @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.privacy.dlp.v2.TransientCryptoKey; + + /** + * Verifies a TransientCryptoKey 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 TransientCryptoKey message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TransientCryptoKey + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.TransientCryptoKey; + + /** + * Creates a plain object from a TransientCryptoKey message. Also converts values to other types if specified. + * @param message TransientCryptoKey + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.TransientCryptoKey, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TransientCryptoKey to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an UnwrappedCryptoKey. */ + interface IUnwrappedCryptoKey { + + /** UnwrappedCryptoKey key */ + key?: (Uint8Array|string|null); + } + + /** Represents an UnwrappedCryptoKey. */ + class UnwrappedCryptoKey implements IUnwrappedCryptoKey { + + /** + * Constructs a new UnwrappedCryptoKey. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.IUnwrappedCryptoKey); + + /** UnwrappedCryptoKey key. */ + public key: (Uint8Array|string); + + /** + * Creates a new UnwrappedCryptoKey instance using the specified properties. + * @param [properties] Properties to set + * @returns UnwrappedCryptoKey instance + */ + public static create(properties?: google.privacy.dlp.v2.IUnwrappedCryptoKey): google.privacy.dlp.v2.UnwrappedCryptoKey; + + /** + * Encodes the specified UnwrappedCryptoKey message. Does not implicitly {@link google.privacy.dlp.v2.UnwrappedCryptoKey.verify|verify} messages. + * @param message UnwrappedCryptoKey message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.IUnwrappedCryptoKey, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UnwrappedCryptoKey message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.UnwrappedCryptoKey.verify|verify} messages. + * @param message UnwrappedCryptoKey message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.IUnwrappedCryptoKey, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UnwrappedCryptoKey message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UnwrappedCryptoKey + * @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.privacy.dlp.v2.UnwrappedCryptoKey; + + /** + * Decodes an UnwrappedCryptoKey message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UnwrappedCryptoKey + * @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.privacy.dlp.v2.UnwrappedCryptoKey; + + /** + * Verifies an UnwrappedCryptoKey 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 an UnwrappedCryptoKey message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UnwrappedCryptoKey + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.UnwrappedCryptoKey; + + /** + * Creates a plain object from an UnwrappedCryptoKey message. Also converts values to other types if specified. + * @param message UnwrappedCryptoKey + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.UnwrappedCryptoKey, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UnwrappedCryptoKey to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a KmsWrappedCryptoKey. */ + interface IKmsWrappedCryptoKey { + + /** KmsWrappedCryptoKey wrappedKey */ + wrappedKey?: (Uint8Array|string|null); + + /** KmsWrappedCryptoKey cryptoKeyName */ + cryptoKeyName?: (string|null); + } + + /** Represents a KmsWrappedCryptoKey. */ + class KmsWrappedCryptoKey implements IKmsWrappedCryptoKey { + + /** + * Constructs a new KmsWrappedCryptoKey. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.IKmsWrappedCryptoKey); + + /** KmsWrappedCryptoKey wrappedKey. */ + public wrappedKey: (Uint8Array|string); + + /** KmsWrappedCryptoKey cryptoKeyName. */ + public cryptoKeyName: string; + + /** + * Creates a new KmsWrappedCryptoKey instance using the specified properties. + * @param [properties] Properties to set + * @returns KmsWrappedCryptoKey instance + */ + public static create(properties?: google.privacy.dlp.v2.IKmsWrappedCryptoKey): google.privacy.dlp.v2.KmsWrappedCryptoKey; + + /** + * Encodes the specified KmsWrappedCryptoKey message. Does not implicitly {@link google.privacy.dlp.v2.KmsWrappedCryptoKey.verify|verify} messages. + * @param message KmsWrappedCryptoKey message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.IKmsWrappedCryptoKey, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified KmsWrappedCryptoKey message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.KmsWrappedCryptoKey.verify|verify} messages. + * @param message KmsWrappedCryptoKey message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.IKmsWrappedCryptoKey, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a KmsWrappedCryptoKey message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns KmsWrappedCryptoKey + * @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.privacy.dlp.v2.KmsWrappedCryptoKey; + + /** + * Decodes a KmsWrappedCryptoKey message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns KmsWrappedCryptoKey + * @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.privacy.dlp.v2.KmsWrappedCryptoKey; + + /** + * Verifies a KmsWrappedCryptoKey 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 KmsWrappedCryptoKey message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns KmsWrappedCryptoKey + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.KmsWrappedCryptoKey; + + /** + * Creates a plain object from a KmsWrappedCryptoKey message. Also converts values to other types if specified. + * @param message KmsWrappedCryptoKey + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.KmsWrappedCryptoKey, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this KmsWrappedCryptoKey to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DateShiftConfig. */ + interface IDateShiftConfig { + + /** DateShiftConfig upperBoundDays */ + upperBoundDays?: (number|null); + + /** DateShiftConfig lowerBoundDays */ + lowerBoundDays?: (number|null); + + /** DateShiftConfig context */ + context?: (google.privacy.dlp.v2.IFieldId|null); + + /** DateShiftConfig cryptoKey */ + cryptoKey?: (google.privacy.dlp.v2.ICryptoKey|null); + } + + /** Represents a DateShiftConfig. */ + class DateShiftConfig implements IDateShiftConfig { + + /** + * Constructs a new DateShiftConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.IDateShiftConfig); + + /** DateShiftConfig upperBoundDays. */ + public upperBoundDays: number; + + /** DateShiftConfig lowerBoundDays. */ + public lowerBoundDays: number; + + /** DateShiftConfig context. */ + public context?: (google.privacy.dlp.v2.IFieldId|null); + + /** DateShiftConfig cryptoKey. */ + public cryptoKey?: (google.privacy.dlp.v2.ICryptoKey|null); + + /** DateShiftConfig method. */ + public method?: "cryptoKey"; + + /** + * Creates a new DateShiftConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns DateShiftConfig instance + */ + public static create(properties?: google.privacy.dlp.v2.IDateShiftConfig): google.privacy.dlp.v2.DateShiftConfig; + + /** + * Encodes the specified DateShiftConfig message. Does not implicitly {@link google.privacy.dlp.v2.DateShiftConfig.verify|verify} messages. + * @param message DateShiftConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.IDateShiftConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DateShiftConfig message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.DateShiftConfig.verify|verify} messages. + * @param message DateShiftConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.IDateShiftConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DateShiftConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DateShiftConfig + * @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.privacy.dlp.v2.DateShiftConfig; + + /** + * Decodes a DateShiftConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DateShiftConfig + * @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.privacy.dlp.v2.DateShiftConfig; + + /** + * Verifies a DateShiftConfig 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 DateShiftConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DateShiftConfig + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.DateShiftConfig; + + /** + * Creates a plain object from a DateShiftConfig message. Also converts values to other types if specified. + * @param message DateShiftConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.DateShiftConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DateShiftConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InfoTypeTransformations. */ + interface IInfoTypeTransformations { + + /** InfoTypeTransformations transformations */ + transformations?: (google.privacy.dlp.v2.InfoTypeTransformations.IInfoTypeTransformation[]|null); + } + + /** Represents an InfoTypeTransformations. */ + class InfoTypeTransformations implements IInfoTypeTransformations { + + /** + * Constructs a new InfoTypeTransformations. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.IInfoTypeTransformations); + + /** InfoTypeTransformations transformations. */ + public transformations: google.privacy.dlp.v2.InfoTypeTransformations.IInfoTypeTransformation[]; + + /** + * Creates a new InfoTypeTransformations instance using the specified properties. + * @param [properties] Properties to set + * @returns InfoTypeTransformations instance + */ + public static create(properties?: google.privacy.dlp.v2.IInfoTypeTransformations): google.privacy.dlp.v2.InfoTypeTransformations; + + /** + * Encodes the specified InfoTypeTransformations message. Does not implicitly {@link google.privacy.dlp.v2.InfoTypeTransformations.verify|verify} messages. + * @param message InfoTypeTransformations message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.IInfoTypeTransformations, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InfoTypeTransformations message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.InfoTypeTransformations.verify|verify} messages. + * @param message InfoTypeTransformations message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.IInfoTypeTransformations, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InfoTypeTransformations message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InfoTypeTransformations + * @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.privacy.dlp.v2.InfoTypeTransformations; + + /** + * Decodes an InfoTypeTransformations message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InfoTypeTransformations + * @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.privacy.dlp.v2.InfoTypeTransformations; + + /** + * Verifies an InfoTypeTransformations 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 an InfoTypeTransformations message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InfoTypeTransformations + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.InfoTypeTransformations; + + /** + * Creates a plain object from an InfoTypeTransformations message. Also converts values to other types if specified. + * @param message InfoTypeTransformations + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.InfoTypeTransformations, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InfoTypeTransformations to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace InfoTypeTransformations { + + /** Properties of an InfoTypeTransformation. */ + interface IInfoTypeTransformation { + + /** InfoTypeTransformation infoTypes */ + infoTypes?: (google.privacy.dlp.v2.IInfoType[]|null); + + /** InfoTypeTransformation primitiveTransformation */ + primitiveTransformation?: (google.privacy.dlp.v2.IPrimitiveTransformation|null); + } + + /** Represents an InfoTypeTransformation. */ + class InfoTypeTransformation implements IInfoTypeTransformation { + + /** + * Constructs a new InfoTypeTransformation. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.InfoTypeTransformations.IInfoTypeTransformation); + + /** InfoTypeTransformation infoTypes. */ + public infoTypes: google.privacy.dlp.v2.IInfoType[]; + + /** InfoTypeTransformation primitiveTransformation. */ + public primitiveTransformation?: (google.privacy.dlp.v2.IPrimitiveTransformation|null); + + /** + * Creates a new InfoTypeTransformation instance using the specified properties. + * @param [properties] Properties to set + * @returns InfoTypeTransformation instance + */ + public static create(properties?: google.privacy.dlp.v2.InfoTypeTransformations.IInfoTypeTransformation): google.privacy.dlp.v2.InfoTypeTransformations.InfoTypeTransformation; + + /** + * Encodes the specified InfoTypeTransformation message. Does not implicitly {@link google.privacy.dlp.v2.InfoTypeTransformations.InfoTypeTransformation.verify|verify} messages. + * @param message InfoTypeTransformation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.InfoTypeTransformations.IInfoTypeTransformation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InfoTypeTransformation message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.InfoTypeTransformations.InfoTypeTransformation.verify|verify} messages. + * @param message InfoTypeTransformation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.InfoTypeTransformations.IInfoTypeTransformation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InfoTypeTransformation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InfoTypeTransformation + * @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.privacy.dlp.v2.InfoTypeTransformations.InfoTypeTransformation; + + /** + * Decodes an InfoTypeTransformation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InfoTypeTransformation + * @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.privacy.dlp.v2.InfoTypeTransformations.InfoTypeTransformation; + + /** + * Verifies an InfoTypeTransformation 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 an InfoTypeTransformation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InfoTypeTransformation + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.InfoTypeTransformations.InfoTypeTransformation; + + /** + * Creates a plain object from an InfoTypeTransformation message. Also converts values to other types if specified. + * @param message InfoTypeTransformation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.InfoTypeTransformations.InfoTypeTransformation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InfoTypeTransformation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of a FieldTransformation. */ + interface IFieldTransformation { + + /** FieldTransformation fields */ + fields?: (google.privacy.dlp.v2.IFieldId[]|null); + + /** FieldTransformation condition */ + condition?: (google.privacy.dlp.v2.IRecordCondition|null); + + /** FieldTransformation primitiveTransformation */ + primitiveTransformation?: (google.privacy.dlp.v2.IPrimitiveTransformation|null); + + /** FieldTransformation infoTypeTransformations */ + infoTypeTransformations?: (google.privacy.dlp.v2.IInfoTypeTransformations|null); + } + + /** Represents a FieldTransformation. */ + class FieldTransformation implements IFieldTransformation { + + /** + * Constructs a new FieldTransformation. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.IFieldTransformation); + + /** FieldTransformation fields. */ + public fields: google.privacy.dlp.v2.IFieldId[]; + + /** FieldTransformation condition. */ + public condition?: (google.privacy.dlp.v2.IRecordCondition|null); + + /** FieldTransformation primitiveTransformation. */ + public primitiveTransformation?: (google.privacy.dlp.v2.IPrimitiveTransformation|null); + + /** FieldTransformation infoTypeTransformations. */ + public infoTypeTransformations?: (google.privacy.dlp.v2.IInfoTypeTransformations|null); + + /** FieldTransformation transformation. */ + public transformation?: ("primitiveTransformation"|"infoTypeTransformations"); + + /** + * Creates a new FieldTransformation instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldTransformation instance + */ + public static create(properties?: google.privacy.dlp.v2.IFieldTransformation): google.privacy.dlp.v2.FieldTransformation; + + /** + * Encodes the specified FieldTransformation message. Does not implicitly {@link google.privacy.dlp.v2.FieldTransformation.verify|verify} messages. + * @param message FieldTransformation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.IFieldTransformation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldTransformation message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.FieldTransformation.verify|verify} messages. + * @param message FieldTransformation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.IFieldTransformation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldTransformation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldTransformation + * @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.privacy.dlp.v2.FieldTransformation; + + /** + * Decodes a FieldTransformation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldTransformation + * @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.privacy.dlp.v2.FieldTransformation; + + /** + * Verifies a FieldTransformation 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 FieldTransformation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldTransformation + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.FieldTransformation; + + /** + * Creates a plain object from a FieldTransformation message. Also converts values to other types if specified. + * @param message FieldTransformation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.FieldTransformation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldTransformation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a RecordTransformations. */ + interface IRecordTransformations { + + /** RecordTransformations fieldTransformations */ + fieldTransformations?: (google.privacy.dlp.v2.IFieldTransformation[]|null); + + /** RecordTransformations recordSuppressions */ + recordSuppressions?: (google.privacy.dlp.v2.IRecordSuppression[]|null); + } + + /** Represents a RecordTransformations. */ + class RecordTransformations implements IRecordTransformations { + + /** + * Constructs a new RecordTransformations. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.IRecordTransformations); + + /** RecordTransformations fieldTransformations. */ + public fieldTransformations: google.privacy.dlp.v2.IFieldTransformation[]; + + /** RecordTransformations recordSuppressions. */ + public recordSuppressions: google.privacy.dlp.v2.IRecordSuppression[]; + + /** + * Creates a new RecordTransformations instance using the specified properties. + * @param [properties] Properties to set + * @returns RecordTransformations instance + */ + public static create(properties?: google.privacy.dlp.v2.IRecordTransformations): google.privacy.dlp.v2.RecordTransformations; + + /** + * Encodes the specified RecordTransformations message. Does not implicitly {@link google.privacy.dlp.v2.RecordTransformations.verify|verify} messages. + * @param message RecordTransformations message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.IRecordTransformations, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RecordTransformations message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.RecordTransformations.verify|verify} messages. + * @param message RecordTransformations message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.IRecordTransformations, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RecordTransformations message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RecordTransformations + * @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.privacy.dlp.v2.RecordTransformations; + + /** + * Decodes a RecordTransformations message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RecordTransformations + * @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.privacy.dlp.v2.RecordTransformations; + + /** + * Verifies a RecordTransformations 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 RecordTransformations message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RecordTransformations + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.RecordTransformations; + + /** + * Creates a plain object from a RecordTransformations message. Also converts values to other types if specified. + * @param message RecordTransformations + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.RecordTransformations, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RecordTransformations to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a RecordSuppression. */ + interface IRecordSuppression { + + /** RecordSuppression condition */ + condition?: (google.privacy.dlp.v2.IRecordCondition|null); + } + + /** Represents a RecordSuppression. */ + class RecordSuppression implements IRecordSuppression { + + /** + * Constructs a new RecordSuppression. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.IRecordSuppression); + + /** RecordSuppression condition. */ + public condition?: (google.privacy.dlp.v2.IRecordCondition|null); + + /** + * Creates a new RecordSuppression instance using the specified properties. + * @param [properties] Properties to set + * @returns RecordSuppression instance + */ + public static create(properties?: google.privacy.dlp.v2.IRecordSuppression): google.privacy.dlp.v2.RecordSuppression; + + /** + * Encodes the specified RecordSuppression message. Does not implicitly {@link google.privacy.dlp.v2.RecordSuppression.verify|verify} messages. + * @param message RecordSuppression message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.IRecordSuppression, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RecordSuppression message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.RecordSuppression.verify|verify} messages. + * @param message RecordSuppression message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.IRecordSuppression, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RecordSuppression message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RecordSuppression + * @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.privacy.dlp.v2.RecordSuppression; + + /** + * Decodes a RecordSuppression message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RecordSuppression + * @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.privacy.dlp.v2.RecordSuppression; + + /** + * Verifies a RecordSuppression 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 RecordSuppression message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RecordSuppression + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.RecordSuppression; + + /** + * Creates a plain object from a RecordSuppression message. Also converts values to other types if specified. + * @param message RecordSuppression + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.RecordSuppression, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RecordSuppression to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a RecordCondition. */ + interface IRecordCondition { + + /** RecordCondition expressions */ + expressions?: (google.privacy.dlp.v2.RecordCondition.IExpressions|null); + } + + /** Represents a RecordCondition. */ + class RecordCondition implements IRecordCondition { + + /** + * Constructs a new RecordCondition. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.IRecordCondition); + + /** RecordCondition expressions. */ + public expressions?: (google.privacy.dlp.v2.RecordCondition.IExpressions|null); + + /** + * Creates a new RecordCondition instance using the specified properties. + * @param [properties] Properties to set + * @returns RecordCondition instance + */ + public static create(properties?: google.privacy.dlp.v2.IRecordCondition): google.privacy.dlp.v2.RecordCondition; + + /** + * Encodes the specified RecordCondition message. Does not implicitly {@link google.privacy.dlp.v2.RecordCondition.verify|verify} messages. + * @param message RecordCondition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.IRecordCondition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RecordCondition message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.RecordCondition.verify|verify} messages. + * @param message RecordCondition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.IRecordCondition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RecordCondition message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RecordCondition + * @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.privacy.dlp.v2.RecordCondition; + + /** + * Decodes a RecordCondition message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RecordCondition + * @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.privacy.dlp.v2.RecordCondition; + + /** + * Verifies a RecordCondition 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 RecordCondition message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RecordCondition + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.RecordCondition; + + /** + * Creates a plain object from a RecordCondition message. Also converts values to other types if specified. + * @param message RecordCondition + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.RecordCondition, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RecordCondition to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace RecordCondition { + + /** Properties of a Condition. */ + interface ICondition { + + /** Condition field */ + field?: (google.privacy.dlp.v2.IFieldId|null); + + /** Condition operator */ + operator?: (google.privacy.dlp.v2.RelationalOperator|keyof typeof google.privacy.dlp.v2.RelationalOperator|null); + + /** Condition value */ + value?: (google.privacy.dlp.v2.IValue|null); + } + + /** Represents a Condition. */ + class Condition implements ICondition { + + /** + * Constructs a new Condition. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.RecordCondition.ICondition); + + /** Condition field. */ + public field?: (google.privacy.dlp.v2.IFieldId|null); + + /** Condition operator. */ + public operator: (google.privacy.dlp.v2.RelationalOperator|keyof typeof google.privacy.dlp.v2.RelationalOperator); + + /** Condition value. */ + public value?: (google.privacy.dlp.v2.IValue|null); + + /** + * Creates a new Condition instance using the specified properties. + * @param [properties] Properties to set + * @returns Condition instance + */ + public static create(properties?: google.privacy.dlp.v2.RecordCondition.ICondition): google.privacy.dlp.v2.RecordCondition.Condition; + + /** + * Encodes the specified Condition message. Does not implicitly {@link google.privacy.dlp.v2.RecordCondition.Condition.verify|verify} messages. + * @param message Condition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.RecordCondition.ICondition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Condition message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.RecordCondition.Condition.verify|verify} messages. + * @param message Condition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.RecordCondition.ICondition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Condition message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Condition + * @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.privacy.dlp.v2.RecordCondition.Condition; + + /** + * Decodes a Condition message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Condition + * @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.privacy.dlp.v2.RecordCondition.Condition; + + /** + * Verifies a Condition 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 Condition message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Condition + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.RecordCondition.Condition; + + /** + * Creates a plain object from a Condition message. Also converts values to other types if specified. + * @param message Condition + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.RecordCondition.Condition, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Condition to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Conditions. */ + interface IConditions { + + /** Conditions conditions */ + conditions?: (google.privacy.dlp.v2.RecordCondition.ICondition[]|null); + } + + /** Represents a Conditions. */ + class Conditions implements IConditions { + + /** + * Constructs a new Conditions. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.RecordCondition.IConditions); + + /** Conditions conditions. */ + public conditions: google.privacy.dlp.v2.RecordCondition.ICondition[]; + + /** + * Creates a new Conditions instance using the specified properties. + * @param [properties] Properties to set + * @returns Conditions instance + */ + public static create(properties?: google.privacy.dlp.v2.RecordCondition.IConditions): google.privacy.dlp.v2.RecordCondition.Conditions; + + /** + * Encodes the specified Conditions message. Does not implicitly {@link google.privacy.dlp.v2.RecordCondition.Conditions.verify|verify} messages. + * @param message Conditions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.RecordCondition.IConditions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Conditions message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.RecordCondition.Conditions.verify|verify} messages. + * @param message Conditions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.RecordCondition.IConditions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Conditions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Conditions + * @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.privacy.dlp.v2.RecordCondition.Conditions; + + /** + * Decodes a Conditions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Conditions + * @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.privacy.dlp.v2.RecordCondition.Conditions; + + /** + * Verifies a Conditions 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 Conditions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Conditions + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.RecordCondition.Conditions; + + /** + * Creates a plain object from a Conditions message. Also converts values to other types if specified. + * @param message Conditions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.RecordCondition.Conditions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Conditions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an Expressions. */ + interface IExpressions { + + /** Expressions logicalOperator */ + logicalOperator?: (google.privacy.dlp.v2.RecordCondition.Expressions.LogicalOperator|keyof typeof google.privacy.dlp.v2.RecordCondition.Expressions.LogicalOperator|null); + + /** Expressions conditions */ + conditions?: (google.privacy.dlp.v2.RecordCondition.IConditions|null); + } + + /** Represents an Expressions. */ + class Expressions implements IExpressions { + + /** + * Constructs a new Expressions. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.RecordCondition.IExpressions); + + /** Expressions logicalOperator. */ + public logicalOperator: (google.privacy.dlp.v2.RecordCondition.Expressions.LogicalOperator|keyof typeof google.privacy.dlp.v2.RecordCondition.Expressions.LogicalOperator); + + /** Expressions conditions. */ + public conditions?: (google.privacy.dlp.v2.RecordCondition.IConditions|null); + + /** Expressions type. */ + public type?: "conditions"; + + /** + * Creates a new Expressions instance using the specified properties. + * @param [properties] Properties to set + * @returns Expressions instance + */ + public static create(properties?: google.privacy.dlp.v2.RecordCondition.IExpressions): google.privacy.dlp.v2.RecordCondition.Expressions; + + /** + * Encodes the specified Expressions message. Does not implicitly {@link google.privacy.dlp.v2.RecordCondition.Expressions.verify|verify} messages. + * @param message Expressions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.RecordCondition.IExpressions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Expressions message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.RecordCondition.Expressions.verify|verify} messages. + * @param message Expressions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.RecordCondition.IExpressions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Expressions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Expressions + * @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.privacy.dlp.v2.RecordCondition.Expressions; + + /** + * Decodes an Expressions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Expressions + * @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.privacy.dlp.v2.RecordCondition.Expressions; + + /** + * Verifies an Expressions 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 an Expressions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Expressions + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.RecordCondition.Expressions; + + /** + * Creates a plain object from an Expressions message. Also converts values to other types if specified. + * @param message Expressions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.RecordCondition.Expressions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Expressions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace Expressions { + + /** LogicalOperator enum. */ + enum LogicalOperator { + LOGICAL_OPERATOR_UNSPECIFIED = 0, + AND = 1 + } + } + } + + /** Properties of a TransformationOverview. */ + interface ITransformationOverview { + + /** TransformationOverview transformedBytes */ + transformedBytes?: (number|Long|string|null); + + /** TransformationOverview transformationSummaries */ + transformationSummaries?: (google.privacy.dlp.v2.ITransformationSummary[]|null); + } + + /** Represents a TransformationOverview. */ + class TransformationOverview implements ITransformationOverview { + + /** + * Constructs a new TransformationOverview. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.ITransformationOverview); + + /** TransformationOverview transformedBytes. */ + public transformedBytes: (number|Long|string); + + /** TransformationOverview transformationSummaries. */ + public transformationSummaries: google.privacy.dlp.v2.ITransformationSummary[]; + + /** + * Creates a new TransformationOverview instance using the specified properties. + * @param [properties] Properties to set + * @returns TransformationOverview instance + */ + public static create(properties?: google.privacy.dlp.v2.ITransformationOverview): google.privacy.dlp.v2.TransformationOverview; + + /** + * Encodes the specified TransformationOverview message. Does not implicitly {@link google.privacy.dlp.v2.TransformationOverview.verify|verify} messages. + * @param message TransformationOverview message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.ITransformationOverview, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TransformationOverview message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.TransformationOverview.verify|verify} messages. + * @param message TransformationOverview message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.ITransformationOverview, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransformationOverview message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TransformationOverview + * @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.privacy.dlp.v2.TransformationOverview; + + /** + * Decodes a TransformationOverview message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TransformationOverview + * @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.privacy.dlp.v2.TransformationOverview; + + /** + * Verifies a TransformationOverview 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 TransformationOverview message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TransformationOverview + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.TransformationOverview; + + /** + * Creates a plain object from a TransformationOverview message. Also converts values to other types if specified. + * @param message TransformationOverview + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.TransformationOverview, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TransformationOverview to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a TransformationSummary. */ + interface ITransformationSummary { + + /** TransformationSummary infoType */ + infoType?: (google.privacy.dlp.v2.IInfoType|null); + + /** TransformationSummary field */ + field?: (google.privacy.dlp.v2.IFieldId|null); + + /** TransformationSummary transformation */ + transformation?: (google.privacy.dlp.v2.IPrimitiveTransformation|null); + + /** TransformationSummary fieldTransformations */ + fieldTransformations?: (google.privacy.dlp.v2.IFieldTransformation[]|null); + + /** TransformationSummary recordSuppress */ + recordSuppress?: (google.privacy.dlp.v2.IRecordSuppression|null); + + /** TransformationSummary results */ + results?: (google.privacy.dlp.v2.TransformationSummary.ISummaryResult[]|null); + + /** TransformationSummary transformedBytes */ + transformedBytes?: (number|Long|string|null); + } + + /** Represents a TransformationSummary. */ + class TransformationSummary implements ITransformationSummary { + + /** + * Constructs a new TransformationSummary. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.ITransformationSummary); + + /** TransformationSummary infoType. */ + public infoType?: (google.privacy.dlp.v2.IInfoType|null); + + /** TransformationSummary field. */ + public field?: (google.privacy.dlp.v2.IFieldId|null); + + /** TransformationSummary transformation. */ + public transformation?: (google.privacy.dlp.v2.IPrimitiveTransformation|null); + + /** TransformationSummary fieldTransformations. */ + public fieldTransformations: google.privacy.dlp.v2.IFieldTransformation[]; + + /** TransformationSummary recordSuppress. */ + public recordSuppress?: (google.privacy.dlp.v2.IRecordSuppression|null); + + /** TransformationSummary results. */ + public results: google.privacy.dlp.v2.TransformationSummary.ISummaryResult[]; + + /** TransformationSummary transformedBytes. */ + public transformedBytes: (number|Long|string); + + /** + * Creates a new TransformationSummary instance using the specified properties. + * @param [properties] Properties to set + * @returns TransformationSummary instance + */ + public static create(properties?: google.privacy.dlp.v2.ITransformationSummary): google.privacy.dlp.v2.TransformationSummary; + + /** + * Encodes the specified TransformationSummary message. Does not implicitly {@link google.privacy.dlp.v2.TransformationSummary.verify|verify} messages. + * @param message TransformationSummary message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.ITransformationSummary, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TransformationSummary message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.TransformationSummary.verify|verify} messages. + * @param message TransformationSummary message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.ITransformationSummary, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransformationSummary message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TransformationSummary + * @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.privacy.dlp.v2.TransformationSummary; + + /** + * Decodes a TransformationSummary message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TransformationSummary + * @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.privacy.dlp.v2.TransformationSummary; + + /** + * Verifies a TransformationSummary 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 TransformationSummary message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TransformationSummary + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.TransformationSummary; + + /** + * Creates a plain object from a TransformationSummary message. Also converts values to other types if specified. + * @param message TransformationSummary + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.TransformationSummary, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TransformationSummary to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace TransformationSummary { + + /** Properties of a SummaryResult. */ + interface ISummaryResult { + + /** SummaryResult count */ + count?: (number|Long|string|null); + + /** SummaryResult code */ + code?: (google.privacy.dlp.v2.TransformationSummary.TransformationResultCode|keyof typeof google.privacy.dlp.v2.TransformationSummary.TransformationResultCode|null); + + /** SummaryResult details */ + details?: (string|null); + } + + /** Represents a SummaryResult. */ + class SummaryResult implements ISummaryResult { + + /** + * Constructs a new SummaryResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.TransformationSummary.ISummaryResult); + + /** SummaryResult count. */ + public count: (number|Long|string); + + /** SummaryResult code. */ + public code: (google.privacy.dlp.v2.TransformationSummary.TransformationResultCode|keyof typeof google.privacy.dlp.v2.TransformationSummary.TransformationResultCode); + + /** SummaryResult details. */ + public details: string; + + /** + * Creates a new SummaryResult instance using the specified properties. + * @param [properties] Properties to set + * @returns SummaryResult instance + */ + public static create(properties?: google.privacy.dlp.v2.TransformationSummary.ISummaryResult): google.privacy.dlp.v2.TransformationSummary.SummaryResult; + + /** + * Encodes the specified SummaryResult message. Does not implicitly {@link google.privacy.dlp.v2.TransformationSummary.SummaryResult.verify|verify} messages. + * @param message SummaryResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.TransformationSummary.ISummaryResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SummaryResult message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.TransformationSummary.SummaryResult.verify|verify} messages. + * @param message SummaryResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.TransformationSummary.ISummaryResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SummaryResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SummaryResult + * @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.privacy.dlp.v2.TransformationSummary.SummaryResult; + + /** + * Decodes a SummaryResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SummaryResult + * @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.privacy.dlp.v2.TransformationSummary.SummaryResult; + + /** + * Verifies a SummaryResult 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 SummaryResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SummaryResult + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.TransformationSummary.SummaryResult; + + /** + * Creates a plain object from a SummaryResult message. Also converts values to other types if specified. + * @param message SummaryResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.TransformationSummary.SummaryResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SummaryResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** TransformationResultCode enum. */ + enum TransformationResultCode { + TRANSFORMATION_RESULT_CODE_UNSPECIFIED = 0, + SUCCESS = 1, + ERROR = 2 + } + } + + /** Properties of a Schedule. */ + interface ISchedule { + + /** Schedule recurrencePeriodDuration */ + recurrencePeriodDuration?: (google.protobuf.IDuration|null); + } + + /** Represents a Schedule. */ + class Schedule implements ISchedule { + + /** + * Constructs a new Schedule. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.ISchedule); + + /** Schedule recurrencePeriodDuration. */ + public recurrencePeriodDuration?: (google.protobuf.IDuration|null); + + /** Schedule option. */ + public option?: "recurrencePeriodDuration"; + + /** + * Creates a new Schedule instance using the specified properties. + * @param [properties] Properties to set + * @returns Schedule instance + */ + public static create(properties?: google.privacy.dlp.v2.ISchedule): google.privacy.dlp.v2.Schedule; + + /** + * Encodes the specified Schedule message. Does not implicitly {@link google.privacy.dlp.v2.Schedule.verify|verify} messages. + * @param message Schedule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.ISchedule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Schedule message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.Schedule.verify|verify} messages. + * @param message Schedule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.ISchedule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Schedule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Schedule + * @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.privacy.dlp.v2.Schedule; + + /** + * Decodes a Schedule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Schedule + * @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.privacy.dlp.v2.Schedule; + + /** + * Verifies a Schedule 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 Schedule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Schedule + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.Schedule; + + /** + * Creates a plain object from a Schedule message. Also converts values to other types if specified. + * @param message Schedule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.Schedule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Schedule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Manual. */ + interface IManual { + } + + /** Represents a Manual. */ + class Manual implements IManual { + + /** + * Constructs a new Manual. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.IManual); + + /** + * Creates a new Manual instance using the specified properties. + * @param [properties] Properties to set + * @returns Manual instance + */ + public static create(properties?: google.privacy.dlp.v2.IManual): google.privacy.dlp.v2.Manual; + + /** + * Encodes the specified Manual message. Does not implicitly {@link google.privacy.dlp.v2.Manual.verify|verify} messages. + * @param message Manual message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.IManual, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Manual message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.Manual.verify|verify} messages. + * @param message Manual message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.IManual, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Manual message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Manual + * @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.privacy.dlp.v2.Manual; + + /** + * Decodes a Manual message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Manual + * @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.privacy.dlp.v2.Manual; + + /** + * Verifies a Manual 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 Manual message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Manual + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.Manual; + + /** + * Creates a plain object from a Manual message. Also converts values to other types if specified. + * @param message Manual + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.Manual, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Manual to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InspectTemplate. */ + interface IInspectTemplate { + + /** InspectTemplate name */ + name?: (string|null); + + /** InspectTemplate displayName */ + displayName?: (string|null); + + /** InspectTemplate description */ + description?: (string|null); + + /** InspectTemplate createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** InspectTemplate updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** InspectTemplate inspectConfig */ + inspectConfig?: (google.privacy.dlp.v2.IInspectConfig|null); + } + + /** Represents an InspectTemplate. */ + class InspectTemplate implements IInspectTemplate { + + /** + * Constructs a new InspectTemplate. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.IInspectTemplate); + + /** InspectTemplate name. */ + public name: string; + + /** InspectTemplate displayName. */ + public displayName: string; + + /** InspectTemplate description. */ + public description: string; + + /** InspectTemplate createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** InspectTemplate updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** InspectTemplate inspectConfig. */ + public inspectConfig?: (google.privacy.dlp.v2.IInspectConfig|null); + + /** + * Creates a new InspectTemplate instance using the specified properties. + * @param [properties] Properties to set + * @returns InspectTemplate instance + */ + public static create(properties?: google.privacy.dlp.v2.IInspectTemplate): google.privacy.dlp.v2.InspectTemplate; + + /** + * Encodes the specified InspectTemplate message. Does not implicitly {@link google.privacy.dlp.v2.InspectTemplate.verify|verify} messages. + * @param message InspectTemplate message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.IInspectTemplate, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InspectTemplate message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.InspectTemplate.verify|verify} messages. + * @param message InspectTemplate message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.IInspectTemplate, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InspectTemplate message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InspectTemplate + * @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.privacy.dlp.v2.InspectTemplate; + + /** + * Decodes an InspectTemplate message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InspectTemplate + * @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.privacy.dlp.v2.InspectTemplate; + + /** + * Verifies an InspectTemplate 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 an InspectTemplate message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InspectTemplate + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.InspectTemplate; + + /** + * Creates a plain object from an InspectTemplate message. Also converts values to other types if specified. + * @param message InspectTemplate + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.InspectTemplate, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InspectTemplate to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeidentifyTemplate. */ + interface IDeidentifyTemplate { + + /** DeidentifyTemplate name */ + name?: (string|null); + + /** DeidentifyTemplate displayName */ + displayName?: (string|null); + + /** DeidentifyTemplate description */ + description?: (string|null); + + /** DeidentifyTemplate createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** DeidentifyTemplate updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** DeidentifyTemplate deidentifyConfig */ + deidentifyConfig?: (google.privacy.dlp.v2.IDeidentifyConfig|null); + } + + /** Represents a DeidentifyTemplate. */ + class DeidentifyTemplate implements IDeidentifyTemplate { + + /** + * Constructs a new DeidentifyTemplate. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.IDeidentifyTemplate); + + /** DeidentifyTemplate name. */ + public name: string; + + /** DeidentifyTemplate displayName. */ + public displayName: string; + + /** DeidentifyTemplate description. */ + public description: string; + + /** DeidentifyTemplate createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** DeidentifyTemplate updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** DeidentifyTemplate deidentifyConfig. */ + public deidentifyConfig?: (google.privacy.dlp.v2.IDeidentifyConfig|null); + + /** + * Creates a new DeidentifyTemplate instance using the specified properties. + * @param [properties] Properties to set + * @returns DeidentifyTemplate instance + */ + public static create(properties?: google.privacy.dlp.v2.IDeidentifyTemplate): google.privacy.dlp.v2.DeidentifyTemplate; + + /** + * Encodes the specified DeidentifyTemplate message. Does not implicitly {@link google.privacy.dlp.v2.DeidentifyTemplate.verify|verify} messages. + * @param message DeidentifyTemplate message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.IDeidentifyTemplate, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeidentifyTemplate message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.DeidentifyTemplate.verify|verify} messages. + * @param message DeidentifyTemplate message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.IDeidentifyTemplate, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeidentifyTemplate message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeidentifyTemplate + * @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.privacy.dlp.v2.DeidentifyTemplate; + + /** + * Decodes a DeidentifyTemplate message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeidentifyTemplate + * @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.privacy.dlp.v2.DeidentifyTemplate; + + /** + * Verifies a DeidentifyTemplate 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 DeidentifyTemplate message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeidentifyTemplate + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.DeidentifyTemplate; + + /** + * Creates a plain object from a DeidentifyTemplate message. Also converts values to other types if specified. + * @param message DeidentifyTemplate + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.DeidentifyTemplate, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeidentifyTemplate to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an Error. */ + interface IError { + + /** Error details */ + details?: (google.rpc.IStatus|null); + + /** Error timestamps */ + timestamps?: (google.protobuf.ITimestamp[]|null); + } + + /** Represents an Error. */ + class Error implements IError { + + /** + * Constructs a new Error. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.IError); + + /** Error details. */ + public details?: (google.rpc.IStatus|null); + + /** Error timestamps. */ + public timestamps: google.protobuf.ITimestamp[]; + + /** + * Creates a new Error instance using the specified properties. + * @param [properties] Properties to set + * @returns Error instance + */ + public static create(properties?: google.privacy.dlp.v2.IError): google.privacy.dlp.v2.Error; + + /** + * Encodes the specified Error message. Does not implicitly {@link google.privacy.dlp.v2.Error.verify|verify} messages. + * @param message Error message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.IError, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Error message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.Error.verify|verify} messages. + * @param message Error message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.IError, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Error message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Error + * @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.privacy.dlp.v2.Error; + + /** + * Decodes an Error message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Error + * @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.privacy.dlp.v2.Error; + + /** + * Verifies an Error 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 an Error message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Error + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.Error; + + /** + * Creates a plain object from an Error message. Also converts values to other types if specified. + * @param message Error + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.Error, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Error to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a JobTrigger. */ + interface IJobTrigger { + + /** JobTrigger name */ + name?: (string|null); + + /** JobTrigger displayName */ + displayName?: (string|null); + + /** JobTrigger description */ + description?: (string|null); + + /** JobTrigger inspectJob */ + inspectJob?: (google.privacy.dlp.v2.IInspectJobConfig|null); + + /** JobTrigger triggers */ + triggers?: (google.privacy.dlp.v2.JobTrigger.ITrigger[]|null); + + /** JobTrigger errors */ + errors?: (google.privacy.dlp.v2.IError[]|null); + + /** JobTrigger createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** JobTrigger updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** JobTrigger lastRunTime */ + lastRunTime?: (google.protobuf.ITimestamp|null); + + /** JobTrigger status */ + status?: (google.privacy.dlp.v2.JobTrigger.Status|keyof typeof google.privacy.dlp.v2.JobTrigger.Status|null); + } + + /** Represents a JobTrigger. */ + class JobTrigger implements IJobTrigger { + + /** + * Constructs a new JobTrigger. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.IJobTrigger); + + /** JobTrigger name. */ + public name: string; + + /** JobTrigger displayName. */ + public displayName: string; + + /** JobTrigger description. */ + public description: string; + + /** JobTrigger inspectJob. */ + public inspectJob?: (google.privacy.dlp.v2.IInspectJobConfig|null); + + /** JobTrigger triggers. */ + public triggers: google.privacy.dlp.v2.JobTrigger.ITrigger[]; + + /** JobTrigger errors. */ + public errors: google.privacy.dlp.v2.IError[]; + + /** JobTrigger createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** JobTrigger updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** JobTrigger lastRunTime. */ + public lastRunTime?: (google.protobuf.ITimestamp|null); + + /** JobTrigger status. */ + public status: (google.privacy.dlp.v2.JobTrigger.Status|keyof typeof google.privacy.dlp.v2.JobTrigger.Status); + + /** JobTrigger job. */ + public job?: "inspectJob"; + + /** + * Creates a new JobTrigger instance using the specified properties. + * @param [properties] Properties to set + * @returns JobTrigger instance + */ + public static create(properties?: google.privacy.dlp.v2.IJobTrigger): google.privacy.dlp.v2.JobTrigger; + + /** + * Encodes the specified JobTrigger message. Does not implicitly {@link google.privacy.dlp.v2.JobTrigger.verify|verify} messages. + * @param message JobTrigger message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.IJobTrigger, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified JobTrigger message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.JobTrigger.verify|verify} messages. + * @param message JobTrigger message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.IJobTrigger, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a JobTrigger message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns JobTrigger + * @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.privacy.dlp.v2.JobTrigger; + + /** + * Decodes a JobTrigger message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns JobTrigger + * @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.privacy.dlp.v2.JobTrigger; + + /** + * Verifies a JobTrigger 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 JobTrigger message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns JobTrigger + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.JobTrigger; + + /** + * Creates a plain object from a JobTrigger message. Also converts values to other types if specified. + * @param message JobTrigger + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.JobTrigger, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this JobTrigger to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace JobTrigger { + + /** Properties of a Trigger. */ + interface ITrigger { + + /** Trigger schedule */ + schedule?: (google.privacy.dlp.v2.ISchedule|null); + + /** Trigger manual */ + manual?: (google.privacy.dlp.v2.IManual|null); + } + + /** Represents a Trigger. */ + class Trigger implements ITrigger { + + /** + * Constructs a new Trigger. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.JobTrigger.ITrigger); + + /** Trigger schedule. */ + public schedule?: (google.privacy.dlp.v2.ISchedule|null); + + /** Trigger manual. */ + public manual?: (google.privacy.dlp.v2.IManual|null); + + /** Trigger trigger. */ + public trigger?: ("schedule"|"manual"); + + /** + * Creates a new Trigger instance using the specified properties. + * @param [properties] Properties to set + * @returns Trigger instance + */ + public static create(properties?: google.privacy.dlp.v2.JobTrigger.ITrigger): google.privacy.dlp.v2.JobTrigger.Trigger; + + /** + * Encodes the specified Trigger message. Does not implicitly {@link google.privacy.dlp.v2.JobTrigger.Trigger.verify|verify} messages. + * @param message Trigger message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.JobTrigger.ITrigger, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Trigger message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.JobTrigger.Trigger.verify|verify} messages. + * @param message Trigger message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.JobTrigger.ITrigger, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Trigger message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Trigger + * @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.privacy.dlp.v2.JobTrigger.Trigger; + + /** + * Decodes a Trigger message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Trigger + * @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.privacy.dlp.v2.JobTrigger.Trigger; + + /** + * Verifies a Trigger 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 Trigger message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Trigger + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.JobTrigger.Trigger; + + /** + * Creates a plain object from a Trigger message. Also converts values to other types if specified. + * @param message Trigger + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.JobTrigger.Trigger, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Trigger to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Status enum. */ + enum Status { + STATUS_UNSPECIFIED = 0, + HEALTHY = 1, + PAUSED = 2, + CANCELLED = 3 + } + } + + /** Properties of an Action. */ + interface IAction { + + /** Action saveFindings */ + saveFindings?: (google.privacy.dlp.v2.Action.ISaveFindings|null); + + /** Action pubSub */ + pubSub?: (google.privacy.dlp.v2.Action.IPublishToPubSub|null); + + /** Action publishSummaryToCscc */ + publishSummaryToCscc?: (google.privacy.dlp.v2.Action.IPublishSummaryToCscc|null); + + /** Action publishFindingsToCloudDataCatalog */ + publishFindingsToCloudDataCatalog?: (google.privacy.dlp.v2.Action.IPublishFindingsToCloudDataCatalog|null); + + /** Action jobNotificationEmails */ + jobNotificationEmails?: (google.privacy.dlp.v2.Action.IJobNotificationEmails|null); + + /** Action publishToStackdriver */ + publishToStackdriver?: (google.privacy.dlp.v2.Action.IPublishToStackdriver|null); + } + + /** Represents an Action. */ + class Action implements IAction { + + /** + * Constructs a new Action. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.IAction); + + /** Action saveFindings. */ + public saveFindings?: (google.privacy.dlp.v2.Action.ISaveFindings|null); + + /** Action pubSub. */ + public pubSub?: (google.privacy.dlp.v2.Action.IPublishToPubSub|null); + + /** Action publishSummaryToCscc. */ + public publishSummaryToCscc?: (google.privacy.dlp.v2.Action.IPublishSummaryToCscc|null); + + /** Action publishFindingsToCloudDataCatalog. */ + public publishFindingsToCloudDataCatalog?: (google.privacy.dlp.v2.Action.IPublishFindingsToCloudDataCatalog|null); + + /** Action jobNotificationEmails. */ + public jobNotificationEmails?: (google.privacy.dlp.v2.Action.IJobNotificationEmails|null); + + /** Action publishToStackdriver. */ + public publishToStackdriver?: (google.privacy.dlp.v2.Action.IPublishToStackdriver|null); + + /** Action action. */ + public action?: ("saveFindings"|"pubSub"|"publishSummaryToCscc"|"publishFindingsToCloudDataCatalog"|"jobNotificationEmails"|"publishToStackdriver"); + + /** + * Creates a new Action instance using the specified properties. + * @param [properties] Properties to set + * @returns Action instance + */ + public static create(properties?: google.privacy.dlp.v2.IAction): google.privacy.dlp.v2.Action; + + /** + * Encodes the specified Action message. Does not implicitly {@link google.privacy.dlp.v2.Action.verify|verify} messages. + * @param message Action message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.IAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Action message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.Action.verify|verify} messages. + * @param message Action message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.IAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Action message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Action + * @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.privacy.dlp.v2.Action; + + /** + * Decodes an Action message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Action + * @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.privacy.dlp.v2.Action; + + /** + * Verifies an Action 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 an Action message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Action + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.Action; + + /** + * Creates a plain object from an Action message. Also converts values to other types if specified. + * @param message Action + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.Action, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Action to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace Action { + + /** Properties of a SaveFindings. */ + interface ISaveFindings { + + /** SaveFindings outputConfig */ + outputConfig?: (google.privacy.dlp.v2.IOutputStorageConfig|null); + } + + /** Represents a SaveFindings. */ + class SaveFindings implements ISaveFindings { + + /** + * Constructs a new SaveFindings. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.Action.ISaveFindings); + + /** SaveFindings outputConfig. */ + public outputConfig?: (google.privacy.dlp.v2.IOutputStorageConfig|null); + + /** + * Creates a new SaveFindings instance using the specified properties. + * @param [properties] Properties to set + * @returns SaveFindings instance + */ + public static create(properties?: google.privacy.dlp.v2.Action.ISaveFindings): google.privacy.dlp.v2.Action.SaveFindings; + + /** + * Encodes the specified SaveFindings message. Does not implicitly {@link google.privacy.dlp.v2.Action.SaveFindings.verify|verify} messages. + * @param message SaveFindings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.Action.ISaveFindings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SaveFindings message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.Action.SaveFindings.verify|verify} messages. + * @param message SaveFindings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.Action.ISaveFindings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SaveFindings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SaveFindings + * @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.privacy.dlp.v2.Action.SaveFindings; + + /** + * Decodes a SaveFindings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SaveFindings + * @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.privacy.dlp.v2.Action.SaveFindings; + + /** + * Verifies a SaveFindings 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 SaveFindings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SaveFindings + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.Action.SaveFindings; + + /** + * Creates a plain object from a SaveFindings message. Also converts values to other types if specified. + * @param message SaveFindings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.Action.SaveFindings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SaveFindings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a PublishToPubSub. */ + interface IPublishToPubSub { + + /** PublishToPubSub topic */ + topic?: (string|null); + } + + /** Represents a PublishToPubSub. */ + class PublishToPubSub implements IPublishToPubSub { + + /** + * Constructs a new PublishToPubSub. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.Action.IPublishToPubSub); + + /** PublishToPubSub topic. */ + public topic: string; + + /** + * Creates a new PublishToPubSub instance using the specified properties. + * @param [properties] Properties to set + * @returns PublishToPubSub instance + */ + public static create(properties?: google.privacy.dlp.v2.Action.IPublishToPubSub): google.privacy.dlp.v2.Action.PublishToPubSub; + + /** + * Encodes the specified PublishToPubSub message. Does not implicitly {@link google.privacy.dlp.v2.Action.PublishToPubSub.verify|verify} messages. + * @param message PublishToPubSub message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.Action.IPublishToPubSub, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PublishToPubSub message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.Action.PublishToPubSub.verify|verify} messages. + * @param message PublishToPubSub message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.Action.IPublishToPubSub, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PublishToPubSub message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PublishToPubSub + * @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.privacy.dlp.v2.Action.PublishToPubSub; + + /** + * Decodes a PublishToPubSub message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PublishToPubSub + * @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.privacy.dlp.v2.Action.PublishToPubSub; + + /** + * Verifies a PublishToPubSub 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 PublishToPubSub message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PublishToPubSub + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.Action.PublishToPubSub; + + /** + * Creates a plain object from a PublishToPubSub message. Also converts values to other types if specified. + * @param message PublishToPubSub + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.Action.PublishToPubSub, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PublishToPubSub to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a PublishSummaryToCscc. */ + interface IPublishSummaryToCscc { + } + + /** Represents a PublishSummaryToCscc. */ + class PublishSummaryToCscc implements IPublishSummaryToCscc { + + /** + * Constructs a new PublishSummaryToCscc. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.Action.IPublishSummaryToCscc); + + /** + * Creates a new PublishSummaryToCscc instance using the specified properties. + * @param [properties] Properties to set + * @returns PublishSummaryToCscc instance + */ + public static create(properties?: google.privacy.dlp.v2.Action.IPublishSummaryToCscc): google.privacy.dlp.v2.Action.PublishSummaryToCscc; + + /** + * Encodes the specified PublishSummaryToCscc message. Does not implicitly {@link google.privacy.dlp.v2.Action.PublishSummaryToCscc.verify|verify} messages. + * @param message PublishSummaryToCscc message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.Action.IPublishSummaryToCscc, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PublishSummaryToCscc message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.Action.PublishSummaryToCscc.verify|verify} messages. + * @param message PublishSummaryToCscc message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.Action.IPublishSummaryToCscc, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PublishSummaryToCscc message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PublishSummaryToCscc + * @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.privacy.dlp.v2.Action.PublishSummaryToCscc; + + /** + * Decodes a PublishSummaryToCscc message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PublishSummaryToCscc + * @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.privacy.dlp.v2.Action.PublishSummaryToCscc; + + /** + * Verifies a PublishSummaryToCscc 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 PublishSummaryToCscc message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PublishSummaryToCscc + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.Action.PublishSummaryToCscc; + + /** + * Creates a plain object from a PublishSummaryToCscc message. Also converts values to other types if specified. + * @param message PublishSummaryToCscc + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.Action.PublishSummaryToCscc, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PublishSummaryToCscc to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a PublishFindingsToCloudDataCatalog. */ + interface IPublishFindingsToCloudDataCatalog { + } + + /** Represents a PublishFindingsToCloudDataCatalog. */ + class PublishFindingsToCloudDataCatalog implements IPublishFindingsToCloudDataCatalog { + + /** + * Constructs a new PublishFindingsToCloudDataCatalog. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.Action.IPublishFindingsToCloudDataCatalog); + + /** + * Creates a new PublishFindingsToCloudDataCatalog instance using the specified properties. + * @param [properties] Properties to set + * @returns PublishFindingsToCloudDataCatalog instance + */ + public static create(properties?: google.privacy.dlp.v2.Action.IPublishFindingsToCloudDataCatalog): google.privacy.dlp.v2.Action.PublishFindingsToCloudDataCatalog; + + /** + * Encodes the specified PublishFindingsToCloudDataCatalog message. Does not implicitly {@link google.privacy.dlp.v2.Action.PublishFindingsToCloudDataCatalog.verify|verify} messages. + * @param message PublishFindingsToCloudDataCatalog message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.Action.IPublishFindingsToCloudDataCatalog, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PublishFindingsToCloudDataCatalog message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.Action.PublishFindingsToCloudDataCatalog.verify|verify} messages. + * @param message PublishFindingsToCloudDataCatalog message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.Action.IPublishFindingsToCloudDataCatalog, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PublishFindingsToCloudDataCatalog message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PublishFindingsToCloudDataCatalog + * @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.privacy.dlp.v2.Action.PublishFindingsToCloudDataCatalog; + + /** + * Decodes a PublishFindingsToCloudDataCatalog message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PublishFindingsToCloudDataCatalog + * @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.privacy.dlp.v2.Action.PublishFindingsToCloudDataCatalog; + + /** + * Verifies a PublishFindingsToCloudDataCatalog 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 PublishFindingsToCloudDataCatalog message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PublishFindingsToCloudDataCatalog + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.Action.PublishFindingsToCloudDataCatalog; + + /** + * Creates a plain object from a PublishFindingsToCloudDataCatalog message. Also converts values to other types if specified. + * @param message PublishFindingsToCloudDataCatalog + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.Action.PublishFindingsToCloudDataCatalog, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PublishFindingsToCloudDataCatalog to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a JobNotificationEmails. */ + interface IJobNotificationEmails { + } + + /** Represents a JobNotificationEmails. */ + class JobNotificationEmails implements IJobNotificationEmails { + + /** + * Constructs a new JobNotificationEmails. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.Action.IJobNotificationEmails); + + /** + * Creates a new JobNotificationEmails instance using the specified properties. + * @param [properties] Properties to set + * @returns JobNotificationEmails instance + */ + public static create(properties?: google.privacy.dlp.v2.Action.IJobNotificationEmails): google.privacy.dlp.v2.Action.JobNotificationEmails; + + /** + * Encodes the specified JobNotificationEmails message. Does not implicitly {@link google.privacy.dlp.v2.Action.JobNotificationEmails.verify|verify} messages. + * @param message JobNotificationEmails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.Action.IJobNotificationEmails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified JobNotificationEmails message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.Action.JobNotificationEmails.verify|verify} messages. + * @param message JobNotificationEmails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.Action.IJobNotificationEmails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a JobNotificationEmails message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns JobNotificationEmails + * @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.privacy.dlp.v2.Action.JobNotificationEmails; + + /** + * Decodes a JobNotificationEmails message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns JobNotificationEmails + * @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.privacy.dlp.v2.Action.JobNotificationEmails; + + /** + * Verifies a JobNotificationEmails 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 JobNotificationEmails message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns JobNotificationEmails + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.Action.JobNotificationEmails; + + /** + * Creates a plain object from a JobNotificationEmails message. Also converts values to other types if specified. + * @param message JobNotificationEmails + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.Action.JobNotificationEmails, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this JobNotificationEmails to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a PublishToStackdriver. */ + interface IPublishToStackdriver { + } + + /** Represents a PublishToStackdriver. */ + class PublishToStackdriver implements IPublishToStackdriver { + + /** + * Constructs a new PublishToStackdriver. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.Action.IPublishToStackdriver); + + /** + * Creates a new PublishToStackdriver instance using the specified properties. + * @param [properties] Properties to set + * @returns PublishToStackdriver instance + */ + public static create(properties?: google.privacy.dlp.v2.Action.IPublishToStackdriver): google.privacy.dlp.v2.Action.PublishToStackdriver; + + /** + * Encodes the specified PublishToStackdriver message. Does not implicitly {@link google.privacy.dlp.v2.Action.PublishToStackdriver.verify|verify} messages. + * @param message PublishToStackdriver message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.Action.IPublishToStackdriver, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PublishToStackdriver message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.Action.PublishToStackdriver.verify|verify} messages. + * @param message PublishToStackdriver message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.Action.IPublishToStackdriver, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PublishToStackdriver message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PublishToStackdriver + * @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.privacy.dlp.v2.Action.PublishToStackdriver; + + /** + * Decodes a PublishToStackdriver message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PublishToStackdriver + * @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.privacy.dlp.v2.Action.PublishToStackdriver; + + /** + * Verifies a PublishToStackdriver 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 PublishToStackdriver message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PublishToStackdriver + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.Action.PublishToStackdriver; + + /** + * Creates a plain object from a PublishToStackdriver message. Also converts values to other types if specified. + * @param message PublishToStackdriver + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.Action.PublishToStackdriver, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PublishToStackdriver to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of a CreateInspectTemplateRequest. */ + interface ICreateInspectTemplateRequest { + + /** CreateInspectTemplateRequest parent */ + parent?: (string|null); + + /** CreateInspectTemplateRequest inspectTemplate */ + inspectTemplate?: (google.privacy.dlp.v2.IInspectTemplate|null); + + /** CreateInspectTemplateRequest templateId */ + templateId?: (string|null); + + /** CreateInspectTemplateRequest locationId */ + locationId?: (string|null); + } + + /** Represents a CreateInspectTemplateRequest. */ + class CreateInspectTemplateRequest implements ICreateInspectTemplateRequest { + + /** + * Constructs a new CreateInspectTemplateRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.ICreateInspectTemplateRequest); + + /** CreateInspectTemplateRequest parent. */ + public parent: string; + + /** CreateInspectTemplateRequest inspectTemplate. */ + public inspectTemplate?: (google.privacy.dlp.v2.IInspectTemplate|null); + + /** CreateInspectTemplateRequest templateId. */ + public templateId: string; + + /** CreateInspectTemplateRequest locationId. */ + public locationId: string; + + /** + * Creates a new CreateInspectTemplateRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateInspectTemplateRequest instance + */ + public static create(properties?: google.privacy.dlp.v2.ICreateInspectTemplateRequest): google.privacy.dlp.v2.CreateInspectTemplateRequest; + + /** + * Encodes the specified CreateInspectTemplateRequest message. Does not implicitly {@link google.privacy.dlp.v2.CreateInspectTemplateRequest.verify|verify} messages. + * @param message CreateInspectTemplateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.ICreateInspectTemplateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateInspectTemplateRequest message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.CreateInspectTemplateRequest.verify|verify} messages. + * @param message CreateInspectTemplateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.ICreateInspectTemplateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateInspectTemplateRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateInspectTemplateRequest + * @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.privacy.dlp.v2.CreateInspectTemplateRequest; + + /** + * Decodes a CreateInspectTemplateRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateInspectTemplateRequest + * @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.privacy.dlp.v2.CreateInspectTemplateRequest; + + /** + * Verifies a CreateInspectTemplateRequest 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 CreateInspectTemplateRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateInspectTemplateRequest + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.CreateInspectTemplateRequest; + + /** + * Creates a plain object from a CreateInspectTemplateRequest message. Also converts values to other types if specified. + * @param message CreateInspectTemplateRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.CreateInspectTemplateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateInspectTemplateRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an UpdateInspectTemplateRequest. */ + interface IUpdateInspectTemplateRequest { + + /** UpdateInspectTemplateRequest name */ + name?: (string|null); + + /** UpdateInspectTemplateRequest inspectTemplate */ + inspectTemplate?: (google.privacy.dlp.v2.IInspectTemplate|null); + + /** UpdateInspectTemplateRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateInspectTemplateRequest. */ + class UpdateInspectTemplateRequest implements IUpdateInspectTemplateRequest { + + /** + * Constructs a new UpdateInspectTemplateRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.IUpdateInspectTemplateRequest); + + /** UpdateInspectTemplateRequest name. */ + public name: string; + + /** UpdateInspectTemplateRequest inspectTemplate. */ + public inspectTemplate?: (google.privacy.dlp.v2.IInspectTemplate|null); + + /** UpdateInspectTemplateRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateInspectTemplateRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateInspectTemplateRequest instance + */ + public static create(properties?: google.privacy.dlp.v2.IUpdateInspectTemplateRequest): google.privacy.dlp.v2.UpdateInspectTemplateRequest; + + /** + * Encodes the specified UpdateInspectTemplateRequest message. Does not implicitly {@link google.privacy.dlp.v2.UpdateInspectTemplateRequest.verify|verify} messages. + * @param message UpdateInspectTemplateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.IUpdateInspectTemplateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateInspectTemplateRequest message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.UpdateInspectTemplateRequest.verify|verify} messages. + * @param message UpdateInspectTemplateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.IUpdateInspectTemplateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateInspectTemplateRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateInspectTemplateRequest + * @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.privacy.dlp.v2.UpdateInspectTemplateRequest; + + /** + * Decodes an UpdateInspectTemplateRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateInspectTemplateRequest + * @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.privacy.dlp.v2.UpdateInspectTemplateRequest; + + /** + * Verifies an UpdateInspectTemplateRequest 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 an UpdateInspectTemplateRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateInspectTemplateRequest + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.UpdateInspectTemplateRequest; + + /** + * Creates a plain object from an UpdateInspectTemplateRequest message. Also converts values to other types if specified. + * @param message UpdateInspectTemplateRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.UpdateInspectTemplateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateInspectTemplateRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetInspectTemplateRequest. */ + interface IGetInspectTemplateRequest { + + /** GetInspectTemplateRequest name */ + name?: (string|null); + } + + /** Represents a GetInspectTemplateRequest. */ + class GetInspectTemplateRequest implements IGetInspectTemplateRequest { + + /** + * Constructs a new GetInspectTemplateRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.IGetInspectTemplateRequest); + + /** GetInspectTemplateRequest name. */ + public name: string; + + /** + * Creates a new GetInspectTemplateRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetInspectTemplateRequest instance + */ + public static create(properties?: google.privacy.dlp.v2.IGetInspectTemplateRequest): google.privacy.dlp.v2.GetInspectTemplateRequest; + + /** + * Encodes the specified GetInspectTemplateRequest message. Does not implicitly {@link google.privacy.dlp.v2.GetInspectTemplateRequest.verify|verify} messages. + * @param message GetInspectTemplateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.IGetInspectTemplateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetInspectTemplateRequest message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.GetInspectTemplateRequest.verify|verify} messages. + * @param message GetInspectTemplateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.IGetInspectTemplateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetInspectTemplateRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetInspectTemplateRequest + * @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.privacy.dlp.v2.GetInspectTemplateRequest; + + /** + * Decodes a GetInspectTemplateRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetInspectTemplateRequest + * @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.privacy.dlp.v2.GetInspectTemplateRequest; + + /** + * Verifies a GetInspectTemplateRequest 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 GetInspectTemplateRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetInspectTemplateRequest + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.GetInspectTemplateRequest; + + /** + * Creates a plain object from a GetInspectTemplateRequest message. Also converts values to other types if specified. + * @param message GetInspectTemplateRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.GetInspectTemplateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetInspectTemplateRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListInspectTemplatesRequest. */ + interface IListInspectTemplatesRequest { + + /** ListInspectTemplatesRequest parent */ + parent?: (string|null); + + /** ListInspectTemplatesRequest pageToken */ + pageToken?: (string|null); + + /** ListInspectTemplatesRequest pageSize */ + pageSize?: (number|null); + + /** ListInspectTemplatesRequest orderBy */ + orderBy?: (string|null); + + /** ListInspectTemplatesRequest locationId */ + locationId?: (string|null); + } + + /** Represents a ListInspectTemplatesRequest. */ + class ListInspectTemplatesRequest implements IListInspectTemplatesRequest { + + /** + * Constructs a new ListInspectTemplatesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.IListInspectTemplatesRequest); + + /** ListInspectTemplatesRequest parent. */ + public parent: string; + + /** ListInspectTemplatesRequest pageToken. */ + public pageToken: string; + + /** ListInspectTemplatesRequest pageSize. */ + public pageSize: number; + + /** ListInspectTemplatesRequest orderBy. */ + public orderBy: string; + + /** ListInspectTemplatesRequest locationId. */ + public locationId: string; + + /** + * Creates a new ListInspectTemplatesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListInspectTemplatesRequest instance + */ + public static create(properties?: google.privacy.dlp.v2.IListInspectTemplatesRequest): google.privacy.dlp.v2.ListInspectTemplatesRequest; + + /** + * Encodes the specified ListInspectTemplatesRequest message. Does not implicitly {@link google.privacy.dlp.v2.ListInspectTemplatesRequest.verify|verify} messages. + * @param message ListInspectTemplatesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.IListInspectTemplatesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListInspectTemplatesRequest message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.ListInspectTemplatesRequest.verify|verify} messages. + * @param message ListInspectTemplatesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.IListInspectTemplatesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListInspectTemplatesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListInspectTemplatesRequest + * @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.privacy.dlp.v2.ListInspectTemplatesRequest; + + /** + * Decodes a ListInspectTemplatesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListInspectTemplatesRequest + * @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.privacy.dlp.v2.ListInspectTemplatesRequest; + + /** + * Verifies a ListInspectTemplatesRequest 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 ListInspectTemplatesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListInspectTemplatesRequest + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.ListInspectTemplatesRequest; + + /** + * Creates a plain object from a ListInspectTemplatesRequest message. Also converts values to other types if specified. + * @param message ListInspectTemplatesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.ListInspectTemplatesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListInspectTemplatesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListInspectTemplatesResponse. */ + interface IListInspectTemplatesResponse { + + /** ListInspectTemplatesResponse inspectTemplates */ + inspectTemplates?: (google.privacy.dlp.v2.IInspectTemplate[]|null); + + /** ListInspectTemplatesResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListInspectTemplatesResponse. */ + class ListInspectTemplatesResponse implements IListInspectTemplatesResponse { + + /** + * Constructs a new ListInspectTemplatesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.IListInspectTemplatesResponse); + + /** ListInspectTemplatesResponse inspectTemplates. */ + public inspectTemplates: google.privacy.dlp.v2.IInspectTemplate[]; + + /** ListInspectTemplatesResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListInspectTemplatesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListInspectTemplatesResponse instance + */ + public static create(properties?: google.privacy.dlp.v2.IListInspectTemplatesResponse): google.privacy.dlp.v2.ListInspectTemplatesResponse; + + /** + * Encodes the specified ListInspectTemplatesResponse message. Does not implicitly {@link google.privacy.dlp.v2.ListInspectTemplatesResponse.verify|verify} messages. + * @param message ListInspectTemplatesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.IListInspectTemplatesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListInspectTemplatesResponse message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.ListInspectTemplatesResponse.verify|verify} messages. + * @param message ListInspectTemplatesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.IListInspectTemplatesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListInspectTemplatesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListInspectTemplatesResponse + * @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.privacy.dlp.v2.ListInspectTemplatesResponse; + + /** + * Decodes a ListInspectTemplatesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListInspectTemplatesResponse + * @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.privacy.dlp.v2.ListInspectTemplatesResponse; + + /** + * Verifies a ListInspectTemplatesResponse 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 ListInspectTemplatesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListInspectTemplatesResponse + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.ListInspectTemplatesResponse; + + /** + * Creates a plain object from a ListInspectTemplatesResponse message. Also converts values to other types if specified. + * @param message ListInspectTemplatesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.ListInspectTemplatesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListInspectTemplatesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeleteInspectTemplateRequest. */ + interface IDeleteInspectTemplateRequest { + + /** DeleteInspectTemplateRequest name */ + name?: (string|null); + } + + /** Represents a DeleteInspectTemplateRequest. */ + class DeleteInspectTemplateRequest implements IDeleteInspectTemplateRequest { + + /** + * Constructs a new DeleteInspectTemplateRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.IDeleteInspectTemplateRequest); + + /** DeleteInspectTemplateRequest name. */ + public name: string; + + /** + * Creates a new DeleteInspectTemplateRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteInspectTemplateRequest instance + */ + public static create(properties?: google.privacy.dlp.v2.IDeleteInspectTemplateRequest): google.privacy.dlp.v2.DeleteInspectTemplateRequest; + + /** + * Encodes the specified DeleteInspectTemplateRequest message. Does not implicitly {@link google.privacy.dlp.v2.DeleteInspectTemplateRequest.verify|verify} messages. + * @param message DeleteInspectTemplateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.IDeleteInspectTemplateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteInspectTemplateRequest message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.DeleteInspectTemplateRequest.verify|verify} messages. + * @param message DeleteInspectTemplateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.IDeleteInspectTemplateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteInspectTemplateRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteInspectTemplateRequest + * @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.privacy.dlp.v2.DeleteInspectTemplateRequest; + + /** + * Decodes a DeleteInspectTemplateRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteInspectTemplateRequest + * @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.privacy.dlp.v2.DeleteInspectTemplateRequest; + + /** + * Verifies a DeleteInspectTemplateRequest 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 DeleteInspectTemplateRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteInspectTemplateRequest + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.DeleteInspectTemplateRequest; + + /** + * Creates a plain object from a DeleteInspectTemplateRequest message. Also converts values to other types if specified. + * @param message DeleteInspectTemplateRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.DeleteInspectTemplateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteInspectTemplateRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a CreateJobTriggerRequest. */ + interface ICreateJobTriggerRequest { + + /** CreateJobTriggerRequest parent */ + parent?: (string|null); + + /** CreateJobTriggerRequest jobTrigger */ + jobTrigger?: (google.privacy.dlp.v2.IJobTrigger|null); + + /** CreateJobTriggerRequest triggerId */ + triggerId?: (string|null); + + /** CreateJobTriggerRequest locationId */ + locationId?: (string|null); + } + + /** Represents a CreateJobTriggerRequest. */ + class CreateJobTriggerRequest implements ICreateJobTriggerRequest { + + /** + * Constructs a new CreateJobTriggerRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.ICreateJobTriggerRequest); + + /** CreateJobTriggerRequest parent. */ + public parent: string; + + /** CreateJobTriggerRequest jobTrigger. */ + public jobTrigger?: (google.privacy.dlp.v2.IJobTrigger|null); + + /** CreateJobTriggerRequest triggerId. */ + public triggerId: string; + + /** CreateJobTriggerRequest locationId. */ + public locationId: string; + + /** + * Creates a new CreateJobTriggerRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateJobTriggerRequest instance + */ + public static create(properties?: google.privacy.dlp.v2.ICreateJobTriggerRequest): google.privacy.dlp.v2.CreateJobTriggerRequest; + + /** + * Encodes the specified CreateJobTriggerRequest message. Does not implicitly {@link google.privacy.dlp.v2.CreateJobTriggerRequest.verify|verify} messages. + * @param message CreateJobTriggerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.ICreateJobTriggerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateJobTriggerRequest message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.CreateJobTriggerRequest.verify|verify} messages. + * @param message CreateJobTriggerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.ICreateJobTriggerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateJobTriggerRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateJobTriggerRequest + * @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.privacy.dlp.v2.CreateJobTriggerRequest; + + /** + * Decodes a CreateJobTriggerRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateJobTriggerRequest + * @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.privacy.dlp.v2.CreateJobTriggerRequest; + + /** + * Verifies a CreateJobTriggerRequest 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 CreateJobTriggerRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateJobTriggerRequest + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.CreateJobTriggerRequest; + + /** + * Creates a plain object from a CreateJobTriggerRequest message. Also converts values to other types if specified. + * @param message CreateJobTriggerRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.CreateJobTriggerRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateJobTriggerRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an ActivateJobTriggerRequest. */ + interface IActivateJobTriggerRequest { + + /** ActivateJobTriggerRequest name */ + name?: (string|null); + } + + /** Represents an ActivateJobTriggerRequest. */ + class ActivateJobTriggerRequest implements IActivateJobTriggerRequest { + + /** + * Constructs a new ActivateJobTriggerRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.IActivateJobTriggerRequest); + + /** ActivateJobTriggerRequest name. */ + public name: string; + + /** + * Creates a new ActivateJobTriggerRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ActivateJobTriggerRequest instance + */ + public static create(properties?: google.privacy.dlp.v2.IActivateJobTriggerRequest): google.privacy.dlp.v2.ActivateJobTriggerRequest; + + /** + * Encodes the specified ActivateJobTriggerRequest message. Does not implicitly {@link google.privacy.dlp.v2.ActivateJobTriggerRequest.verify|verify} messages. + * @param message ActivateJobTriggerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.IActivateJobTriggerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ActivateJobTriggerRequest message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.ActivateJobTriggerRequest.verify|verify} messages. + * @param message ActivateJobTriggerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.IActivateJobTriggerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ActivateJobTriggerRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ActivateJobTriggerRequest + * @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.privacy.dlp.v2.ActivateJobTriggerRequest; + + /** + * Decodes an ActivateJobTriggerRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ActivateJobTriggerRequest + * @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.privacy.dlp.v2.ActivateJobTriggerRequest; + + /** + * Verifies an ActivateJobTriggerRequest 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 an ActivateJobTriggerRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ActivateJobTriggerRequest + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.ActivateJobTriggerRequest; + + /** + * Creates a plain object from an ActivateJobTriggerRequest message. Also converts values to other types if specified. + * @param message ActivateJobTriggerRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.ActivateJobTriggerRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ActivateJobTriggerRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an UpdateJobTriggerRequest. */ + interface IUpdateJobTriggerRequest { + + /** UpdateJobTriggerRequest name */ + name?: (string|null); + + /** UpdateJobTriggerRequest jobTrigger */ + jobTrigger?: (google.privacy.dlp.v2.IJobTrigger|null); + + /** UpdateJobTriggerRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateJobTriggerRequest. */ + class UpdateJobTriggerRequest implements IUpdateJobTriggerRequest { + + /** + * Constructs a new UpdateJobTriggerRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.IUpdateJobTriggerRequest); + + /** UpdateJobTriggerRequest name. */ + public name: string; + + /** UpdateJobTriggerRequest jobTrigger. */ + public jobTrigger?: (google.privacy.dlp.v2.IJobTrigger|null); + + /** UpdateJobTriggerRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateJobTriggerRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateJobTriggerRequest instance + */ + public static create(properties?: google.privacy.dlp.v2.IUpdateJobTriggerRequest): google.privacy.dlp.v2.UpdateJobTriggerRequest; + + /** + * Encodes the specified UpdateJobTriggerRequest message. Does not implicitly {@link google.privacy.dlp.v2.UpdateJobTriggerRequest.verify|verify} messages. + * @param message UpdateJobTriggerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.IUpdateJobTriggerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateJobTriggerRequest message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.UpdateJobTriggerRequest.verify|verify} messages. + * @param message UpdateJobTriggerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.IUpdateJobTriggerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateJobTriggerRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateJobTriggerRequest + * @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.privacy.dlp.v2.UpdateJobTriggerRequest; + + /** + * Decodes an UpdateJobTriggerRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateJobTriggerRequest + * @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.privacy.dlp.v2.UpdateJobTriggerRequest; + + /** + * Verifies an UpdateJobTriggerRequest 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 an UpdateJobTriggerRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateJobTriggerRequest + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.UpdateJobTriggerRequest; + + /** + * Creates a plain object from an UpdateJobTriggerRequest message. Also converts values to other types if specified. + * @param message UpdateJobTriggerRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.UpdateJobTriggerRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateJobTriggerRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetJobTriggerRequest. */ + interface IGetJobTriggerRequest { + + /** GetJobTriggerRequest name */ + name?: (string|null); + } + + /** Represents a GetJobTriggerRequest. */ + class GetJobTriggerRequest implements IGetJobTriggerRequest { + + /** + * Constructs a new GetJobTriggerRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.IGetJobTriggerRequest); + + /** GetJobTriggerRequest name. */ + public name: string; + + /** + * Creates a new GetJobTriggerRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetJobTriggerRequest instance + */ + public static create(properties?: google.privacy.dlp.v2.IGetJobTriggerRequest): google.privacy.dlp.v2.GetJobTriggerRequest; + + /** + * Encodes the specified GetJobTriggerRequest message. Does not implicitly {@link google.privacy.dlp.v2.GetJobTriggerRequest.verify|verify} messages. + * @param message GetJobTriggerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.IGetJobTriggerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetJobTriggerRequest message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.GetJobTriggerRequest.verify|verify} messages. + * @param message GetJobTriggerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.IGetJobTriggerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetJobTriggerRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetJobTriggerRequest + * @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.privacy.dlp.v2.GetJobTriggerRequest; + + /** + * Decodes a GetJobTriggerRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetJobTriggerRequest + * @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.privacy.dlp.v2.GetJobTriggerRequest; + + /** + * Verifies a GetJobTriggerRequest 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 GetJobTriggerRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetJobTriggerRequest + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.GetJobTriggerRequest; + + /** + * Creates a plain object from a GetJobTriggerRequest message. Also converts values to other types if specified. + * @param message GetJobTriggerRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.GetJobTriggerRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetJobTriggerRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a CreateDlpJobRequest. */ + interface ICreateDlpJobRequest { + + /** CreateDlpJobRequest parent */ + parent?: (string|null); + + /** CreateDlpJobRequest inspectJob */ + inspectJob?: (google.privacy.dlp.v2.IInspectJobConfig|null); + + /** CreateDlpJobRequest riskJob */ + riskJob?: (google.privacy.dlp.v2.IRiskAnalysisJobConfig|null); + + /** CreateDlpJobRequest jobId */ + jobId?: (string|null); + + /** CreateDlpJobRequest locationId */ + locationId?: (string|null); + } + + /** Represents a CreateDlpJobRequest. */ + class CreateDlpJobRequest implements ICreateDlpJobRequest { + + /** + * Constructs a new CreateDlpJobRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.ICreateDlpJobRequest); + + /** CreateDlpJobRequest parent. */ + public parent: string; + + /** CreateDlpJobRequest inspectJob. */ + public inspectJob?: (google.privacy.dlp.v2.IInspectJobConfig|null); + + /** CreateDlpJobRequest riskJob. */ + public riskJob?: (google.privacy.dlp.v2.IRiskAnalysisJobConfig|null); + + /** CreateDlpJobRequest jobId. */ + public jobId: string; + + /** CreateDlpJobRequest locationId. */ + public locationId: string; + + /** CreateDlpJobRequest job. */ + public job?: ("inspectJob"|"riskJob"); + + /** + * Creates a new CreateDlpJobRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateDlpJobRequest instance + */ + public static create(properties?: google.privacy.dlp.v2.ICreateDlpJobRequest): google.privacy.dlp.v2.CreateDlpJobRequest; + + /** + * Encodes the specified CreateDlpJobRequest message. Does not implicitly {@link google.privacy.dlp.v2.CreateDlpJobRequest.verify|verify} messages. + * @param message CreateDlpJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.ICreateDlpJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateDlpJobRequest message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.CreateDlpJobRequest.verify|verify} messages. + * @param message CreateDlpJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.ICreateDlpJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateDlpJobRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateDlpJobRequest + * @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.privacy.dlp.v2.CreateDlpJobRequest; + + /** + * Decodes a CreateDlpJobRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateDlpJobRequest + * @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.privacy.dlp.v2.CreateDlpJobRequest; + + /** + * Verifies a CreateDlpJobRequest 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 CreateDlpJobRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateDlpJobRequest + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.CreateDlpJobRequest; + + /** + * Creates a plain object from a CreateDlpJobRequest message. Also converts values to other types if specified. + * @param message CreateDlpJobRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.CreateDlpJobRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateDlpJobRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListJobTriggersRequest. */ + interface IListJobTriggersRequest { + + /** ListJobTriggersRequest parent */ + parent?: (string|null); + + /** ListJobTriggersRequest pageToken */ + pageToken?: (string|null); + + /** ListJobTriggersRequest pageSize */ + pageSize?: (number|null); + + /** ListJobTriggersRequest orderBy */ + orderBy?: (string|null); + + /** ListJobTriggersRequest filter */ + filter?: (string|null); + + /** ListJobTriggersRequest locationId */ + locationId?: (string|null); + } + + /** Represents a ListJobTriggersRequest. */ + class ListJobTriggersRequest implements IListJobTriggersRequest { + + /** + * Constructs a new ListJobTriggersRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.IListJobTriggersRequest); + + /** ListJobTriggersRequest parent. */ + public parent: string; + + /** ListJobTriggersRequest pageToken. */ + public pageToken: string; + + /** ListJobTriggersRequest pageSize. */ + public pageSize: number; + + /** ListJobTriggersRequest orderBy. */ + public orderBy: string; + + /** ListJobTriggersRequest filter. */ + public filter: string; + + /** ListJobTriggersRequest locationId. */ + public locationId: string; + + /** + * Creates a new ListJobTriggersRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListJobTriggersRequest instance + */ + public static create(properties?: google.privacy.dlp.v2.IListJobTriggersRequest): google.privacy.dlp.v2.ListJobTriggersRequest; + + /** + * Encodes the specified ListJobTriggersRequest message. Does not implicitly {@link google.privacy.dlp.v2.ListJobTriggersRequest.verify|verify} messages. + * @param message ListJobTriggersRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.IListJobTriggersRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListJobTriggersRequest message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.ListJobTriggersRequest.verify|verify} messages. + * @param message ListJobTriggersRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.IListJobTriggersRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListJobTriggersRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListJobTriggersRequest + * @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.privacy.dlp.v2.ListJobTriggersRequest; + + /** + * Decodes a ListJobTriggersRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListJobTriggersRequest + * @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.privacy.dlp.v2.ListJobTriggersRequest; + + /** + * Verifies a ListJobTriggersRequest 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 ListJobTriggersRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListJobTriggersRequest + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.ListJobTriggersRequest; + + /** + * Creates a plain object from a ListJobTriggersRequest message. Also converts values to other types if specified. + * @param message ListJobTriggersRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.ListJobTriggersRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListJobTriggersRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListJobTriggersResponse. */ + interface IListJobTriggersResponse { + + /** ListJobTriggersResponse jobTriggers */ + jobTriggers?: (google.privacy.dlp.v2.IJobTrigger[]|null); + + /** ListJobTriggersResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListJobTriggersResponse. */ + class ListJobTriggersResponse implements IListJobTriggersResponse { + + /** + * Constructs a new ListJobTriggersResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.IListJobTriggersResponse); + + /** ListJobTriggersResponse jobTriggers. */ + public jobTriggers: google.privacy.dlp.v2.IJobTrigger[]; + + /** ListJobTriggersResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListJobTriggersResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListJobTriggersResponse instance + */ + public static create(properties?: google.privacy.dlp.v2.IListJobTriggersResponse): google.privacy.dlp.v2.ListJobTriggersResponse; + + /** + * Encodes the specified ListJobTriggersResponse message. Does not implicitly {@link google.privacy.dlp.v2.ListJobTriggersResponse.verify|verify} messages. + * @param message ListJobTriggersResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.IListJobTriggersResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListJobTriggersResponse message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.ListJobTriggersResponse.verify|verify} messages. + * @param message ListJobTriggersResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.IListJobTriggersResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListJobTriggersResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListJobTriggersResponse + * @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.privacy.dlp.v2.ListJobTriggersResponse; + + /** + * Decodes a ListJobTriggersResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListJobTriggersResponse + * @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.privacy.dlp.v2.ListJobTriggersResponse; + + /** + * Verifies a ListJobTriggersResponse 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 ListJobTriggersResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListJobTriggersResponse + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.ListJobTriggersResponse; + + /** + * Creates a plain object from a ListJobTriggersResponse message. Also converts values to other types if specified. + * @param message ListJobTriggersResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.ListJobTriggersResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListJobTriggersResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeleteJobTriggerRequest. */ + interface IDeleteJobTriggerRequest { + + /** DeleteJobTriggerRequest name */ + name?: (string|null); + } + + /** Represents a DeleteJobTriggerRequest. */ + class DeleteJobTriggerRequest implements IDeleteJobTriggerRequest { + + /** + * Constructs a new DeleteJobTriggerRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.IDeleteJobTriggerRequest); + + /** DeleteJobTriggerRequest name. */ + public name: string; + + /** + * Creates a new DeleteJobTriggerRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteJobTriggerRequest instance + */ + public static create(properties?: google.privacy.dlp.v2.IDeleteJobTriggerRequest): google.privacy.dlp.v2.DeleteJobTriggerRequest; + + /** + * Encodes the specified DeleteJobTriggerRequest message. Does not implicitly {@link google.privacy.dlp.v2.DeleteJobTriggerRequest.verify|verify} messages. + * @param message DeleteJobTriggerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.IDeleteJobTriggerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteJobTriggerRequest message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.DeleteJobTriggerRequest.verify|verify} messages. + * @param message DeleteJobTriggerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.IDeleteJobTriggerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteJobTriggerRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteJobTriggerRequest + * @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.privacy.dlp.v2.DeleteJobTriggerRequest; + + /** + * Decodes a DeleteJobTriggerRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteJobTriggerRequest + * @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.privacy.dlp.v2.DeleteJobTriggerRequest; + + /** + * Verifies a DeleteJobTriggerRequest 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 DeleteJobTriggerRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteJobTriggerRequest + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.DeleteJobTriggerRequest; + + /** + * Creates a plain object from a DeleteJobTriggerRequest message. Also converts values to other types if specified. + * @param message DeleteJobTriggerRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.DeleteJobTriggerRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteJobTriggerRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InspectJobConfig. */ + interface IInspectJobConfig { + + /** InspectJobConfig storageConfig */ + storageConfig?: (google.privacy.dlp.v2.IStorageConfig|null); + + /** InspectJobConfig inspectConfig */ + inspectConfig?: (google.privacy.dlp.v2.IInspectConfig|null); + + /** InspectJobConfig inspectTemplateName */ + inspectTemplateName?: (string|null); + + /** InspectJobConfig actions */ + actions?: (google.privacy.dlp.v2.IAction[]|null); + } + + /** Represents an InspectJobConfig. */ + class InspectJobConfig implements IInspectJobConfig { + + /** + * Constructs a new InspectJobConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.IInspectJobConfig); + + /** InspectJobConfig storageConfig. */ + public storageConfig?: (google.privacy.dlp.v2.IStorageConfig|null); + + /** InspectJobConfig inspectConfig. */ + public inspectConfig?: (google.privacy.dlp.v2.IInspectConfig|null); + + /** InspectJobConfig inspectTemplateName. */ + public inspectTemplateName: string; + + /** InspectJobConfig actions. */ + public actions: google.privacy.dlp.v2.IAction[]; + + /** + * Creates a new InspectJobConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns InspectJobConfig instance + */ + public static create(properties?: google.privacy.dlp.v2.IInspectJobConfig): google.privacy.dlp.v2.InspectJobConfig; + + /** + * Encodes the specified InspectJobConfig message. Does not implicitly {@link google.privacy.dlp.v2.InspectJobConfig.verify|verify} messages. + * @param message InspectJobConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.IInspectJobConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InspectJobConfig message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.InspectJobConfig.verify|verify} messages. + * @param message InspectJobConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.IInspectJobConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InspectJobConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InspectJobConfig + * @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.privacy.dlp.v2.InspectJobConfig; + + /** + * Decodes an InspectJobConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InspectJobConfig + * @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.privacy.dlp.v2.InspectJobConfig; + + /** + * Verifies an InspectJobConfig 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 an InspectJobConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InspectJobConfig + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.InspectJobConfig; + + /** + * Creates a plain object from an InspectJobConfig message. Also converts values to other types if specified. + * @param message InspectJobConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.InspectJobConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InspectJobConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DlpJob. */ + interface IDlpJob { + + /** DlpJob name */ + name?: (string|null); + + /** DlpJob type */ + type?: (google.privacy.dlp.v2.DlpJobType|keyof typeof google.privacy.dlp.v2.DlpJobType|null); + + /** DlpJob state */ + state?: (google.privacy.dlp.v2.DlpJob.JobState|keyof typeof google.privacy.dlp.v2.DlpJob.JobState|null); + + /** DlpJob riskDetails */ + riskDetails?: (google.privacy.dlp.v2.IAnalyzeDataSourceRiskDetails|null); + + /** DlpJob inspectDetails */ + inspectDetails?: (google.privacy.dlp.v2.IInspectDataSourceDetails|null); + + /** DlpJob createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** DlpJob startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** DlpJob endTime */ + endTime?: (google.protobuf.ITimestamp|null); + + /** DlpJob jobTriggerName */ + jobTriggerName?: (string|null); + + /** DlpJob errors */ + errors?: (google.privacy.dlp.v2.IError[]|null); + } + + /** Represents a DlpJob. */ + class DlpJob implements IDlpJob { + + /** + * Constructs a new DlpJob. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.IDlpJob); + + /** DlpJob name. */ + public name: string; + + /** DlpJob type. */ + public type: (google.privacy.dlp.v2.DlpJobType|keyof typeof google.privacy.dlp.v2.DlpJobType); + + /** DlpJob state. */ + public state: (google.privacy.dlp.v2.DlpJob.JobState|keyof typeof google.privacy.dlp.v2.DlpJob.JobState); + + /** DlpJob riskDetails. */ + public riskDetails?: (google.privacy.dlp.v2.IAnalyzeDataSourceRiskDetails|null); + + /** DlpJob inspectDetails. */ + public inspectDetails?: (google.privacy.dlp.v2.IInspectDataSourceDetails|null); + + /** DlpJob createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** DlpJob startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** DlpJob endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** DlpJob jobTriggerName. */ + public jobTriggerName: string; + + /** DlpJob errors. */ + public errors: google.privacy.dlp.v2.IError[]; + + /** DlpJob details. */ + public details?: ("riskDetails"|"inspectDetails"); + + /** + * Creates a new DlpJob instance using the specified properties. + * @param [properties] Properties to set + * @returns DlpJob instance + */ + public static create(properties?: google.privacy.dlp.v2.IDlpJob): google.privacy.dlp.v2.DlpJob; + + /** + * Encodes the specified DlpJob message. Does not implicitly {@link google.privacy.dlp.v2.DlpJob.verify|verify} messages. + * @param message DlpJob message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.IDlpJob, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DlpJob message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.DlpJob.verify|verify} messages. + * @param message DlpJob message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.IDlpJob, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DlpJob message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DlpJob + * @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.privacy.dlp.v2.DlpJob; + + /** + * Decodes a DlpJob message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DlpJob + * @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.privacy.dlp.v2.DlpJob; + + /** + * Verifies a DlpJob 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 DlpJob message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DlpJob + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.DlpJob; + + /** + * Creates a plain object from a DlpJob message. Also converts values to other types if specified. + * @param message DlpJob + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.DlpJob, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DlpJob to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace DlpJob { + + /** JobState enum. */ + enum JobState { + JOB_STATE_UNSPECIFIED = 0, + PENDING = 1, + RUNNING = 2, + DONE = 3, + CANCELED = 4, + FAILED = 5, + ACTIVE = 6 + } + } + + /** Properties of a GetDlpJobRequest. */ + interface IGetDlpJobRequest { + + /** GetDlpJobRequest name */ + name?: (string|null); + } + + /** Represents a GetDlpJobRequest. */ + class GetDlpJobRequest implements IGetDlpJobRequest { + + /** + * Constructs a new GetDlpJobRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.IGetDlpJobRequest); + + /** GetDlpJobRequest name. */ + public name: string; + + /** + * Creates a new GetDlpJobRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetDlpJobRequest instance + */ + public static create(properties?: google.privacy.dlp.v2.IGetDlpJobRequest): google.privacy.dlp.v2.GetDlpJobRequest; + + /** + * Encodes the specified GetDlpJobRequest message. Does not implicitly {@link google.privacy.dlp.v2.GetDlpJobRequest.verify|verify} messages. + * @param message GetDlpJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.IGetDlpJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetDlpJobRequest message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.GetDlpJobRequest.verify|verify} messages. + * @param message GetDlpJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.IGetDlpJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetDlpJobRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetDlpJobRequest + * @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.privacy.dlp.v2.GetDlpJobRequest; + + /** + * Decodes a GetDlpJobRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetDlpJobRequest + * @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.privacy.dlp.v2.GetDlpJobRequest; + + /** + * Verifies a GetDlpJobRequest 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 GetDlpJobRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetDlpJobRequest + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.GetDlpJobRequest; + + /** + * Creates a plain object from a GetDlpJobRequest message. Also converts values to other types if specified. + * @param message GetDlpJobRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.GetDlpJobRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetDlpJobRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListDlpJobsRequest. */ + interface IListDlpJobsRequest { + + /** ListDlpJobsRequest parent */ + parent?: (string|null); + + /** ListDlpJobsRequest filter */ + filter?: (string|null); + + /** ListDlpJobsRequest pageSize */ + pageSize?: (number|null); + + /** ListDlpJobsRequest pageToken */ + pageToken?: (string|null); + + /** ListDlpJobsRequest type */ + type?: (google.privacy.dlp.v2.DlpJobType|keyof typeof google.privacy.dlp.v2.DlpJobType|null); + + /** ListDlpJobsRequest orderBy */ + orderBy?: (string|null); + + /** ListDlpJobsRequest locationId */ + locationId?: (string|null); + } + + /** Represents a ListDlpJobsRequest. */ + class ListDlpJobsRequest implements IListDlpJobsRequest { + + /** + * Constructs a new ListDlpJobsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.IListDlpJobsRequest); + + /** ListDlpJobsRequest parent. */ + public parent: string; + + /** ListDlpJobsRequest filter. */ + public filter: string; + + /** ListDlpJobsRequest pageSize. */ + public pageSize: number; + + /** ListDlpJobsRequest pageToken. */ + public pageToken: string; + + /** ListDlpJobsRequest type. */ + public type: (google.privacy.dlp.v2.DlpJobType|keyof typeof google.privacy.dlp.v2.DlpJobType); + + /** ListDlpJobsRequest orderBy. */ + public orderBy: string; + + /** ListDlpJobsRequest locationId. */ + public locationId: string; + + /** + * Creates a new ListDlpJobsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListDlpJobsRequest instance + */ + public static create(properties?: google.privacy.dlp.v2.IListDlpJobsRequest): google.privacy.dlp.v2.ListDlpJobsRequest; + + /** + * Encodes the specified ListDlpJobsRequest message. Does not implicitly {@link google.privacy.dlp.v2.ListDlpJobsRequest.verify|verify} messages. + * @param message ListDlpJobsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.IListDlpJobsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListDlpJobsRequest message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.ListDlpJobsRequest.verify|verify} messages. + * @param message ListDlpJobsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.IListDlpJobsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListDlpJobsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListDlpJobsRequest + * @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.privacy.dlp.v2.ListDlpJobsRequest; + + /** + * Decodes a ListDlpJobsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListDlpJobsRequest + * @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.privacy.dlp.v2.ListDlpJobsRequest; + + /** + * Verifies a ListDlpJobsRequest 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 ListDlpJobsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListDlpJobsRequest + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.ListDlpJobsRequest; + + /** + * Creates a plain object from a ListDlpJobsRequest message. Also converts values to other types if specified. + * @param message ListDlpJobsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.ListDlpJobsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListDlpJobsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListDlpJobsResponse. */ + interface IListDlpJobsResponse { + + /** ListDlpJobsResponse jobs */ + jobs?: (google.privacy.dlp.v2.IDlpJob[]|null); + + /** ListDlpJobsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListDlpJobsResponse. */ + class ListDlpJobsResponse implements IListDlpJobsResponse { + + /** + * Constructs a new ListDlpJobsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.IListDlpJobsResponse); + + /** ListDlpJobsResponse jobs. */ + public jobs: google.privacy.dlp.v2.IDlpJob[]; + + /** ListDlpJobsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListDlpJobsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListDlpJobsResponse instance + */ + public static create(properties?: google.privacy.dlp.v2.IListDlpJobsResponse): google.privacy.dlp.v2.ListDlpJobsResponse; + + /** + * Encodes the specified ListDlpJobsResponse message. Does not implicitly {@link google.privacy.dlp.v2.ListDlpJobsResponse.verify|verify} messages. + * @param message ListDlpJobsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.IListDlpJobsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListDlpJobsResponse message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.ListDlpJobsResponse.verify|verify} messages. + * @param message ListDlpJobsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.IListDlpJobsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListDlpJobsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListDlpJobsResponse + * @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.privacy.dlp.v2.ListDlpJobsResponse; + + /** + * Decodes a ListDlpJobsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListDlpJobsResponse + * @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.privacy.dlp.v2.ListDlpJobsResponse; + + /** + * Verifies a ListDlpJobsResponse 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 ListDlpJobsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListDlpJobsResponse + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.ListDlpJobsResponse; + + /** + * Creates a plain object from a ListDlpJobsResponse message. Also converts values to other types if specified. + * @param message ListDlpJobsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.ListDlpJobsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListDlpJobsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a CancelDlpJobRequest. */ + interface ICancelDlpJobRequest { + + /** CancelDlpJobRequest name */ + name?: (string|null); + } + + /** Represents a CancelDlpJobRequest. */ + class CancelDlpJobRequest implements ICancelDlpJobRequest { + + /** + * Constructs a new CancelDlpJobRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.ICancelDlpJobRequest); + + /** CancelDlpJobRequest name. */ + public name: string; + + /** + * Creates a new CancelDlpJobRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CancelDlpJobRequest instance + */ + public static create(properties?: google.privacy.dlp.v2.ICancelDlpJobRequest): google.privacy.dlp.v2.CancelDlpJobRequest; + + /** + * Encodes the specified CancelDlpJobRequest message. Does not implicitly {@link google.privacy.dlp.v2.CancelDlpJobRequest.verify|verify} messages. + * @param message CancelDlpJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.ICancelDlpJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CancelDlpJobRequest message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.CancelDlpJobRequest.verify|verify} messages. + * @param message CancelDlpJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.ICancelDlpJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CancelDlpJobRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CancelDlpJobRequest + * @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.privacy.dlp.v2.CancelDlpJobRequest; + + /** + * Decodes a CancelDlpJobRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CancelDlpJobRequest + * @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.privacy.dlp.v2.CancelDlpJobRequest; + + /** + * Verifies a CancelDlpJobRequest 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 CancelDlpJobRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CancelDlpJobRequest + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.CancelDlpJobRequest; + + /** + * Creates a plain object from a CancelDlpJobRequest message. Also converts values to other types if specified. + * @param message CancelDlpJobRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.CancelDlpJobRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CancelDlpJobRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a FinishDlpJobRequest. */ + interface IFinishDlpJobRequest { + + /** FinishDlpJobRequest name */ + name?: (string|null); + } + + /** Represents a FinishDlpJobRequest. */ + class FinishDlpJobRequest implements IFinishDlpJobRequest { + + /** + * Constructs a new FinishDlpJobRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.IFinishDlpJobRequest); + + /** FinishDlpJobRequest name. */ + public name: string; + + /** + * Creates a new FinishDlpJobRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns FinishDlpJobRequest instance + */ + public static create(properties?: google.privacy.dlp.v2.IFinishDlpJobRequest): google.privacy.dlp.v2.FinishDlpJobRequest; + + /** + * Encodes the specified FinishDlpJobRequest message. Does not implicitly {@link google.privacy.dlp.v2.FinishDlpJobRequest.verify|verify} messages. + * @param message FinishDlpJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.IFinishDlpJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FinishDlpJobRequest message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.FinishDlpJobRequest.verify|verify} messages. + * @param message FinishDlpJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.IFinishDlpJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FinishDlpJobRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FinishDlpJobRequest + * @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.privacy.dlp.v2.FinishDlpJobRequest; + + /** + * Decodes a FinishDlpJobRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FinishDlpJobRequest + * @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.privacy.dlp.v2.FinishDlpJobRequest; + + /** + * Verifies a FinishDlpJobRequest 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 FinishDlpJobRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FinishDlpJobRequest + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.FinishDlpJobRequest; + + /** + * Creates a plain object from a FinishDlpJobRequest message. Also converts values to other types if specified. + * @param message FinishDlpJobRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.FinishDlpJobRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FinishDlpJobRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeleteDlpJobRequest. */ + interface IDeleteDlpJobRequest { + + /** DeleteDlpJobRequest name */ + name?: (string|null); + } + + /** Represents a DeleteDlpJobRequest. */ + class DeleteDlpJobRequest implements IDeleteDlpJobRequest { + + /** + * Constructs a new DeleteDlpJobRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.IDeleteDlpJobRequest); + + /** DeleteDlpJobRequest name. */ + public name: string; + + /** + * Creates a new DeleteDlpJobRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteDlpJobRequest instance + */ + public static create(properties?: google.privacy.dlp.v2.IDeleteDlpJobRequest): google.privacy.dlp.v2.DeleteDlpJobRequest; + + /** + * Encodes the specified DeleteDlpJobRequest message. Does not implicitly {@link google.privacy.dlp.v2.DeleteDlpJobRequest.verify|verify} messages. + * @param message DeleteDlpJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.IDeleteDlpJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteDlpJobRequest message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.DeleteDlpJobRequest.verify|verify} messages. + * @param message DeleteDlpJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.IDeleteDlpJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteDlpJobRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteDlpJobRequest + * @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.privacy.dlp.v2.DeleteDlpJobRequest; + + /** + * Decodes a DeleteDlpJobRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteDlpJobRequest + * @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.privacy.dlp.v2.DeleteDlpJobRequest; + + /** + * Verifies a DeleteDlpJobRequest 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 DeleteDlpJobRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteDlpJobRequest + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.DeleteDlpJobRequest; + + /** + * Creates a plain object from a DeleteDlpJobRequest message. Also converts values to other types if specified. + * @param message DeleteDlpJobRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.DeleteDlpJobRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteDlpJobRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a CreateDeidentifyTemplateRequest. */ + interface ICreateDeidentifyTemplateRequest { + + /** CreateDeidentifyTemplateRequest parent */ + parent?: (string|null); + + /** CreateDeidentifyTemplateRequest deidentifyTemplate */ + deidentifyTemplate?: (google.privacy.dlp.v2.IDeidentifyTemplate|null); + + /** CreateDeidentifyTemplateRequest templateId */ + templateId?: (string|null); + + /** CreateDeidentifyTemplateRequest locationId */ + locationId?: (string|null); + } + + /** Represents a CreateDeidentifyTemplateRequest. */ + class CreateDeidentifyTemplateRequest implements ICreateDeidentifyTemplateRequest { + + /** + * Constructs a new CreateDeidentifyTemplateRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.ICreateDeidentifyTemplateRequest); + + /** CreateDeidentifyTemplateRequest parent. */ + public parent: string; + + /** CreateDeidentifyTemplateRequest deidentifyTemplate. */ + public deidentifyTemplate?: (google.privacy.dlp.v2.IDeidentifyTemplate|null); + + /** CreateDeidentifyTemplateRequest templateId. */ + public templateId: string; + + /** CreateDeidentifyTemplateRequest locationId. */ + public locationId: string; + + /** + * Creates a new CreateDeidentifyTemplateRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateDeidentifyTemplateRequest instance + */ + public static create(properties?: google.privacy.dlp.v2.ICreateDeidentifyTemplateRequest): google.privacy.dlp.v2.CreateDeidentifyTemplateRequest; + + /** + * Encodes the specified CreateDeidentifyTemplateRequest message. Does not implicitly {@link google.privacy.dlp.v2.CreateDeidentifyTemplateRequest.verify|verify} messages. + * @param message CreateDeidentifyTemplateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.ICreateDeidentifyTemplateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateDeidentifyTemplateRequest message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.CreateDeidentifyTemplateRequest.verify|verify} messages. + * @param message CreateDeidentifyTemplateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.ICreateDeidentifyTemplateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateDeidentifyTemplateRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateDeidentifyTemplateRequest + * @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.privacy.dlp.v2.CreateDeidentifyTemplateRequest; + + /** + * Decodes a CreateDeidentifyTemplateRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateDeidentifyTemplateRequest + * @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.privacy.dlp.v2.CreateDeidentifyTemplateRequest; + + /** + * Verifies a CreateDeidentifyTemplateRequest 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 CreateDeidentifyTemplateRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateDeidentifyTemplateRequest + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.CreateDeidentifyTemplateRequest; + + /** + * Creates a plain object from a CreateDeidentifyTemplateRequest message. Also converts values to other types if specified. + * @param message CreateDeidentifyTemplateRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.CreateDeidentifyTemplateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateDeidentifyTemplateRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an UpdateDeidentifyTemplateRequest. */ + interface IUpdateDeidentifyTemplateRequest { + + /** UpdateDeidentifyTemplateRequest name */ + name?: (string|null); + + /** UpdateDeidentifyTemplateRequest deidentifyTemplate */ + deidentifyTemplate?: (google.privacy.dlp.v2.IDeidentifyTemplate|null); + + /** UpdateDeidentifyTemplateRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateDeidentifyTemplateRequest. */ + class UpdateDeidentifyTemplateRequest implements IUpdateDeidentifyTemplateRequest { + + /** + * Constructs a new UpdateDeidentifyTemplateRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.IUpdateDeidentifyTemplateRequest); + + /** UpdateDeidentifyTemplateRequest name. */ + public name: string; + + /** UpdateDeidentifyTemplateRequest deidentifyTemplate. */ + public deidentifyTemplate?: (google.privacy.dlp.v2.IDeidentifyTemplate|null); + + /** UpdateDeidentifyTemplateRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateDeidentifyTemplateRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateDeidentifyTemplateRequest instance + */ + public static create(properties?: google.privacy.dlp.v2.IUpdateDeidentifyTemplateRequest): google.privacy.dlp.v2.UpdateDeidentifyTemplateRequest; + + /** + * Encodes the specified UpdateDeidentifyTemplateRequest message. Does not implicitly {@link google.privacy.dlp.v2.UpdateDeidentifyTemplateRequest.verify|verify} messages. + * @param message UpdateDeidentifyTemplateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.IUpdateDeidentifyTemplateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateDeidentifyTemplateRequest message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.UpdateDeidentifyTemplateRequest.verify|verify} messages. + * @param message UpdateDeidentifyTemplateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.IUpdateDeidentifyTemplateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateDeidentifyTemplateRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateDeidentifyTemplateRequest + * @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.privacy.dlp.v2.UpdateDeidentifyTemplateRequest; + + /** + * Decodes an UpdateDeidentifyTemplateRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateDeidentifyTemplateRequest + * @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.privacy.dlp.v2.UpdateDeidentifyTemplateRequest; + + /** + * Verifies an UpdateDeidentifyTemplateRequest 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 an UpdateDeidentifyTemplateRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateDeidentifyTemplateRequest + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.UpdateDeidentifyTemplateRequest; + + /** + * Creates a plain object from an UpdateDeidentifyTemplateRequest message. Also converts values to other types if specified. + * @param message UpdateDeidentifyTemplateRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.UpdateDeidentifyTemplateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateDeidentifyTemplateRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetDeidentifyTemplateRequest. */ + interface IGetDeidentifyTemplateRequest { + + /** GetDeidentifyTemplateRequest name */ + name?: (string|null); + } + + /** Represents a GetDeidentifyTemplateRequest. */ + class GetDeidentifyTemplateRequest implements IGetDeidentifyTemplateRequest { + + /** + * Constructs a new GetDeidentifyTemplateRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.IGetDeidentifyTemplateRequest); + + /** GetDeidentifyTemplateRequest name. */ + public name: string; + + /** + * Creates a new GetDeidentifyTemplateRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetDeidentifyTemplateRequest instance + */ + public static create(properties?: google.privacy.dlp.v2.IGetDeidentifyTemplateRequest): google.privacy.dlp.v2.GetDeidentifyTemplateRequest; + + /** + * Encodes the specified GetDeidentifyTemplateRequest message. Does not implicitly {@link google.privacy.dlp.v2.GetDeidentifyTemplateRequest.verify|verify} messages. + * @param message GetDeidentifyTemplateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.IGetDeidentifyTemplateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetDeidentifyTemplateRequest message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.GetDeidentifyTemplateRequest.verify|verify} messages. + * @param message GetDeidentifyTemplateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.IGetDeidentifyTemplateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetDeidentifyTemplateRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetDeidentifyTemplateRequest + * @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.privacy.dlp.v2.GetDeidentifyTemplateRequest; + + /** + * Decodes a GetDeidentifyTemplateRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetDeidentifyTemplateRequest + * @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.privacy.dlp.v2.GetDeidentifyTemplateRequest; + + /** + * Verifies a GetDeidentifyTemplateRequest 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 GetDeidentifyTemplateRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetDeidentifyTemplateRequest + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.GetDeidentifyTemplateRequest; + + /** + * Creates a plain object from a GetDeidentifyTemplateRequest message. Also converts values to other types if specified. + * @param message GetDeidentifyTemplateRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.GetDeidentifyTemplateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetDeidentifyTemplateRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListDeidentifyTemplatesRequest. */ + interface IListDeidentifyTemplatesRequest { + + /** ListDeidentifyTemplatesRequest parent */ + parent?: (string|null); + + /** ListDeidentifyTemplatesRequest pageToken */ + pageToken?: (string|null); + + /** ListDeidentifyTemplatesRequest pageSize */ + pageSize?: (number|null); + + /** ListDeidentifyTemplatesRequest orderBy */ + orderBy?: (string|null); + + /** ListDeidentifyTemplatesRequest locationId */ + locationId?: (string|null); + } + + /** Represents a ListDeidentifyTemplatesRequest. */ + class ListDeidentifyTemplatesRequest implements IListDeidentifyTemplatesRequest { + + /** + * Constructs a new ListDeidentifyTemplatesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.IListDeidentifyTemplatesRequest); + + /** ListDeidentifyTemplatesRequest parent. */ + public parent: string; + + /** ListDeidentifyTemplatesRequest pageToken. */ + public pageToken: string; + + /** ListDeidentifyTemplatesRequest pageSize. */ + public pageSize: number; + + /** ListDeidentifyTemplatesRequest orderBy. */ + public orderBy: string; + + /** ListDeidentifyTemplatesRequest locationId. */ + public locationId: string; + + /** + * Creates a new ListDeidentifyTemplatesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListDeidentifyTemplatesRequest instance + */ + public static create(properties?: google.privacy.dlp.v2.IListDeidentifyTemplatesRequest): google.privacy.dlp.v2.ListDeidentifyTemplatesRequest; + + /** + * Encodes the specified ListDeidentifyTemplatesRequest message. Does not implicitly {@link google.privacy.dlp.v2.ListDeidentifyTemplatesRequest.verify|verify} messages. + * @param message ListDeidentifyTemplatesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.IListDeidentifyTemplatesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListDeidentifyTemplatesRequest message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.ListDeidentifyTemplatesRequest.verify|verify} messages. + * @param message ListDeidentifyTemplatesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.IListDeidentifyTemplatesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListDeidentifyTemplatesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListDeidentifyTemplatesRequest + * @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.privacy.dlp.v2.ListDeidentifyTemplatesRequest; + + /** + * Decodes a ListDeidentifyTemplatesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListDeidentifyTemplatesRequest + * @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.privacy.dlp.v2.ListDeidentifyTemplatesRequest; + + /** + * Verifies a ListDeidentifyTemplatesRequest 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 ListDeidentifyTemplatesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListDeidentifyTemplatesRequest + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.ListDeidentifyTemplatesRequest; + + /** + * Creates a plain object from a ListDeidentifyTemplatesRequest message. Also converts values to other types if specified. + * @param message ListDeidentifyTemplatesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.ListDeidentifyTemplatesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListDeidentifyTemplatesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListDeidentifyTemplatesResponse. */ + interface IListDeidentifyTemplatesResponse { + + /** ListDeidentifyTemplatesResponse deidentifyTemplates */ + deidentifyTemplates?: (google.privacy.dlp.v2.IDeidentifyTemplate[]|null); + + /** ListDeidentifyTemplatesResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListDeidentifyTemplatesResponse. */ + class ListDeidentifyTemplatesResponse implements IListDeidentifyTemplatesResponse { + + /** + * Constructs a new ListDeidentifyTemplatesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.IListDeidentifyTemplatesResponse); + + /** ListDeidentifyTemplatesResponse deidentifyTemplates. */ + public deidentifyTemplates: google.privacy.dlp.v2.IDeidentifyTemplate[]; + + /** ListDeidentifyTemplatesResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListDeidentifyTemplatesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListDeidentifyTemplatesResponse instance + */ + public static create(properties?: google.privacy.dlp.v2.IListDeidentifyTemplatesResponse): google.privacy.dlp.v2.ListDeidentifyTemplatesResponse; + + /** + * Encodes the specified ListDeidentifyTemplatesResponse message. Does not implicitly {@link google.privacy.dlp.v2.ListDeidentifyTemplatesResponse.verify|verify} messages. + * @param message ListDeidentifyTemplatesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.IListDeidentifyTemplatesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListDeidentifyTemplatesResponse message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.ListDeidentifyTemplatesResponse.verify|verify} messages. + * @param message ListDeidentifyTemplatesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.IListDeidentifyTemplatesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListDeidentifyTemplatesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListDeidentifyTemplatesResponse + * @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.privacy.dlp.v2.ListDeidentifyTemplatesResponse; + + /** + * Decodes a ListDeidentifyTemplatesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListDeidentifyTemplatesResponse + * @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.privacy.dlp.v2.ListDeidentifyTemplatesResponse; + + /** + * Verifies a ListDeidentifyTemplatesResponse 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 ListDeidentifyTemplatesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListDeidentifyTemplatesResponse + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.ListDeidentifyTemplatesResponse; + + /** + * Creates a plain object from a ListDeidentifyTemplatesResponse message. Also converts values to other types if specified. + * @param message ListDeidentifyTemplatesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.ListDeidentifyTemplatesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListDeidentifyTemplatesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeleteDeidentifyTemplateRequest. */ + interface IDeleteDeidentifyTemplateRequest { + + /** DeleteDeidentifyTemplateRequest name */ + name?: (string|null); + } + + /** Represents a DeleteDeidentifyTemplateRequest. */ + class DeleteDeidentifyTemplateRequest implements IDeleteDeidentifyTemplateRequest { + + /** + * Constructs a new DeleteDeidentifyTemplateRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.IDeleteDeidentifyTemplateRequest); + + /** DeleteDeidentifyTemplateRequest name. */ + public name: string; + + /** + * Creates a new DeleteDeidentifyTemplateRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteDeidentifyTemplateRequest instance + */ + public static create(properties?: google.privacy.dlp.v2.IDeleteDeidentifyTemplateRequest): google.privacy.dlp.v2.DeleteDeidentifyTemplateRequest; + + /** + * Encodes the specified DeleteDeidentifyTemplateRequest message. Does not implicitly {@link google.privacy.dlp.v2.DeleteDeidentifyTemplateRequest.verify|verify} messages. + * @param message DeleteDeidentifyTemplateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.IDeleteDeidentifyTemplateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteDeidentifyTemplateRequest message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.DeleteDeidentifyTemplateRequest.verify|verify} messages. + * @param message DeleteDeidentifyTemplateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.IDeleteDeidentifyTemplateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteDeidentifyTemplateRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteDeidentifyTemplateRequest + * @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.privacy.dlp.v2.DeleteDeidentifyTemplateRequest; + + /** + * Decodes a DeleteDeidentifyTemplateRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteDeidentifyTemplateRequest + * @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.privacy.dlp.v2.DeleteDeidentifyTemplateRequest; + + /** + * Verifies a DeleteDeidentifyTemplateRequest 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 DeleteDeidentifyTemplateRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteDeidentifyTemplateRequest + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.DeleteDeidentifyTemplateRequest; + + /** + * Creates a plain object from a DeleteDeidentifyTemplateRequest message. Also converts values to other types if specified. + * @param message DeleteDeidentifyTemplateRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.DeleteDeidentifyTemplateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteDeidentifyTemplateRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a LargeCustomDictionaryConfig. */ + interface ILargeCustomDictionaryConfig { + + /** LargeCustomDictionaryConfig outputPath */ + outputPath?: (google.privacy.dlp.v2.ICloudStoragePath|null); + + /** LargeCustomDictionaryConfig cloudStorageFileSet */ + cloudStorageFileSet?: (google.privacy.dlp.v2.ICloudStorageFileSet|null); + + /** LargeCustomDictionaryConfig bigQueryField */ + bigQueryField?: (google.privacy.dlp.v2.IBigQueryField|null); + } + + /** Represents a LargeCustomDictionaryConfig. */ + class LargeCustomDictionaryConfig implements ILargeCustomDictionaryConfig { + + /** + * Constructs a new LargeCustomDictionaryConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.ILargeCustomDictionaryConfig); + + /** LargeCustomDictionaryConfig outputPath. */ + public outputPath?: (google.privacy.dlp.v2.ICloudStoragePath|null); + + /** LargeCustomDictionaryConfig cloudStorageFileSet. */ + public cloudStorageFileSet?: (google.privacy.dlp.v2.ICloudStorageFileSet|null); + + /** LargeCustomDictionaryConfig bigQueryField. */ + public bigQueryField?: (google.privacy.dlp.v2.IBigQueryField|null); + + /** LargeCustomDictionaryConfig source. */ + public source?: ("cloudStorageFileSet"|"bigQueryField"); + + /** + * Creates a new LargeCustomDictionaryConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns LargeCustomDictionaryConfig instance + */ + public static create(properties?: google.privacy.dlp.v2.ILargeCustomDictionaryConfig): google.privacy.dlp.v2.LargeCustomDictionaryConfig; + + /** + * Encodes the specified LargeCustomDictionaryConfig message. Does not implicitly {@link google.privacy.dlp.v2.LargeCustomDictionaryConfig.verify|verify} messages. + * @param message LargeCustomDictionaryConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.ILargeCustomDictionaryConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LargeCustomDictionaryConfig message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.LargeCustomDictionaryConfig.verify|verify} messages. + * @param message LargeCustomDictionaryConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.ILargeCustomDictionaryConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LargeCustomDictionaryConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LargeCustomDictionaryConfig + * @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.privacy.dlp.v2.LargeCustomDictionaryConfig; + + /** + * Decodes a LargeCustomDictionaryConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LargeCustomDictionaryConfig + * @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.privacy.dlp.v2.LargeCustomDictionaryConfig; + + /** + * Verifies a LargeCustomDictionaryConfig 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 LargeCustomDictionaryConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LargeCustomDictionaryConfig + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.LargeCustomDictionaryConfig; + + /** + * Creates a plain object from a LargeCustomDictionaryConfig message. Also converts values to other types if specified. + * @param message LargeCustomDictionaryConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.LargeCustomDictionaryConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LargeCustomDictionaryConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a LargeCustomDictionaryStats. */ + interface ILargeCustomDictionaryStats { + + /** LargeCustomDictionaryStats approxNumPhrases */ + approxNumPhrases?: (number|Long|string|null); + } + + /** Represents a LargeCustomDictionaryStats. */ + class LargeCustomDictionaryStats implements ILargeCustomDictionaryStats { + + /** + * Constructs a new LargeCustomDictionaryStats. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.ILargeCustomDictionaryStats); + + /** LargeCustomDictionaryStats approxNumPhrases. */ + public approxNumPhrases: (number|Long|string); + + /** + * Creates a new LargeCustomDictionaryStats instance using the specified properties. + * @param [properties] Properties to set + * @returns LargeCustomDictionaryStats instance + */ + public static create(properties?: google.privacy.dlp.v2.ILargeCustomDictionaryStats): google.privacy.dlp.v2.LargeCustomDictionaryStats; + + /** + * Encodes the specified LargeCustomDictionaryStats message. Does not implicitly {@link google.privacy.dlp.v2.LargeCustomDictionaryStats.verify|verify} messages. + * @param message LargeCustomDictionaryStats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.ILargeCustomDictionaryStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LargeCustomDictionaryStats message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.LargeCustomDictionaryStats.verify|verify} messages. + * @param message LargeCustomDictionaryStats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.ILargeCustomDictionaryStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LargeCustomDictionaryStats message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LargeCustomDictionaryStats + * @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.privacy.dlp.v2.LargeCustomDictionaryStats; + + /** + * Decodes a LargeCustomDictionaryStats message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LargeCustomDictionaryStats + * @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.privacy.dlp.v2.LargeCustomDictionaryStats; + + /** + * Verifies a LargeCustomDictionaryStats 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 LargeCustomDictionaryStats message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LargeCustomDictionaryStats + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.LargeCustomDictionaryStats; + + /** + * Creates a plain object from a LargeCustomDictionaryStats message. Also converts values to other types if specified. + * @param message LargeCustomDictionaryStats + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.LargeCustomDictionaryStats, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LargeCustomDictionaryStats to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a StoredInfoTypeConfig. */ + interface IStoredInfoTypeConfig { + + /** StoredInfoTypeConfig displayName */ + displayName?: (string|null); + + /** StoredInfoTypeConfig description */ + description?: (string|null); + + /** StoredInfoTypeConfig largeCustomDictionary */ + largeCustomDictionary?: (google.privacy.dlp.v2.ILargeCustomDictionaryConfig|null); + + /** StoredInfoTypeConfig dictionary */ + dictionary?: (google.privacy.dlp.v2.CustomInfoType.IDictionary|null); + + /** StoredInfoTypeConfig regex */ + regex?: (google.privacy.dlp.v2.CustomInfoType.IRegex|null); + } + + /** Represents a StoredInfoTypeConfig. */ + class StoredInfoTypeConfig implements IStoredInfoTypeConfig { + + /** + * Constructs a new StoredInfoTypeConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.IStoredInfoTypeConfig); + + /** StoredInfoTypeConfig displayName. */ + public displayName: string; + + /** StoredInfoTypeConfig description. */ + public description: string; + + /** StoredInfoTypeConfig largeCustomDictionary. */ + public largeCustomDictionary?: (google.privacy.dlp.v2.ILargeCustomDictionaryConfig|null); + + /** StoredInfoTypeConfig dictionary. */ + public dictionary?: (google.privacy.dlp.v2.CustomInfoType.IDictionary|null); + + /** StoredInfoTypeConfig regex. */ + public regex?: (google.privacy.dlp.v2.CustomInfoType.IRegex|null); + + /** StoredInfoTypeConfig type. */ + public type?: ("largeCustomDictionary"|"dictionary"|"regex"); + + /** + * Creates a new StoredInfoTypeConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns StoredInfoTypeConfig instance + */ + public static create(properties?: google.privacy.dlp.v2.IStoredInfoTypeConfig): google.privacy.dlp.v2.StoredInfoTypeConfig; + + /** + * Encodes the specified StoredInfoTypeConfig message. Does not implicitly {@link google.privacy.dlp.v2.StoredInfoTypeConfig.verify|verify} messages. + * @param message StoredInfoTypeConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.IStoredInfoTypeConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StoredInfoTypeConfig message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.StoredInfoTypeConfig.verify|verify} messages. + * @param message StoredInfoTypeConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.IStoredInfoTypeConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StoredInfoTypeConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StoredInfoTypeConfig + * @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.privacy.dlp.v2.StoredInfoTypeConfig; + + /** + * Decodes a StoredInfoTypeConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StoredInfoTypeConfig + * @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.privacy.dlp.v2.StoredInfoTypeConfig; + + /** + * Verifies a StoredInfoTypeConfig 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 StoredInfoTypeConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StoredInfoTypeConfig + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.StoredInfoTypeConfig; + + /** + * Creates a plain object from a StoredInfoTypeConfig message. Also converts values to other types if specified. + * @param message StoredInfoTypeConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.StoredInfoTypeConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StoredInfoTypeConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a StoredInfoTypeStats. */ + interface IStoredInfoTypeStats { + + /** StoredInfoTypeStats largeCustomDictionary */ + largeCustomDictionary?: (google.privacy.dlp.v2.ILargeCustomDictionaryStats|null); + } + + /** Represents a StoredInfoTypeStats. */ + class StoredInfoTypeStats implements IStoredInfoTypeStats { + + /** + * Constructs a new StoredInfoTypeStats. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.IStoredInfoTypeStats); + + /** StoredInfoTypeStats largeCustomDictionary. */ + public largeCustomDictionary?: (google.privacy.dlp.v2.ILargeCustomDictionaryStats|null); + + /** StoredInfoTypeStats type. */ + public type?: "largeCustomDictionary"; + + /** + * Creates a new StoredInfoTypeStats instance using the specified properties. + * @param [properties] Properties to set + * @returns StoredInfoTypeStats instance + */ + public static create(properties?: google.privacy.dlp.v2.IStoredInfoTypeStats): google.privacy.dlp.v2.StoredInfoTypeStats; + + /** + * Encodes the specified StoredInfoTypeStats message. Does not implicitly {@link google.privacy.dlp.v2.StoredInfoTypeStats.verify|verify} messages. + * @param message StoredInfoTypeStats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.IStoredInfoTypeStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StoredInfoTypeStats message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.StoredInfoTypeStats.verify|verify} messages. + * @param message StoredInfoTypeStats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.IStoredInfoTypeStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StoredInfoTypeStats message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StoredInfoTypeStats + * @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.privacy.dlp.v2.StoredInfoTypeStats; + + /** + * Decodes a StoredInfoTypeStats message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StoredInfoTypeStats + * @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.privacy.dlp.v2.StoredInfoTypeStats; + + /** + * Verifies a StoredInfoTypeStats 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 StoredInfoTypeStats message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StoredInfoTypeStats + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.StoredInfoTypeStats; + + /** + * Creates a plain object from a StoredInfoTypeStats message. Also converts values to other types if specified. + * @param message StoredInfoTypeStats + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.StoredInfoTypeStats, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StoredInfoTypeStats to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a StoredInfoTypeVersion. */ + interface IStoredInfoTypeVersion { + + /** StoredInfoTypeVersion config */ + config?: (google.privacy.dlp.v2.IStoredInfoTypeConfig|null); + + /** StoredInfoTypeVersion createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** StoredInfoTypeVersion state */ + state?: (google.privacy.dlp.v2.StoredInfoTypeState|keyof typeof google.privacy.dlp.v2.StoredInfoTypeState|null); + + /** StoredInfoTypeVersion errors */ + errors?: (google.privacy.dlp.v2.IError[]|null); + + /** StoredInfoTypeVersion stats */ + stats?: (google.privacy.dlp.v2.IStoredInfoTypeStats|null); + } + + /** Represents a StoredInfoTypeVersion. */ + class StoredInfoTypeVersion implements IStoredInfoTypeVersion { + + /** + * Constructs a new StoredInfoTypeVersion. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.IStoredInfoTypeVersion); + + /** StoredInfoTypeVersion config. */ + public config?: (google.privacy.dlp.v2.IStoredInfoTypeConfig|null); + + /** StoredInfoTypeVersion createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** StoredInfoTypeVersion state. */ + public state: (google.privacy.dlp.v2.StoredInfoTypeState|keyof typeof google.privacy.dlp.v2.StoredInfoTypeState); + + /** StoredInfoTypeVersion errors. */ + public errors: google.privacy.dlp.v2.IError[]; + + /** StoredInfoTypeVersion stats. */ + public stats?: (google.privacy.dlp.v2.IStoredInfoTypeStats|null); + + /** + * Creates a new StoredInfoTypeVersion instance using the specified properties. + * @param [properties] Properties to set + * @returns StoredInfoTypeVersion instance + */ + public static create(properties?: google.privacy.dlp.v2.IStoredInfoTypeVersion): google.privacy.dlp.v2.StoredInfoTypeVersion; + + /** + * Encodes the specified StoredInfoTypeVersion message. Does not implicitly {@link google.privacy.dlp.v2.StoredInfoTypeVersion.verify|verify} messages. + * @param message StoredInfoTypeVersion message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.IStoredInfoTypeVersion, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StoredInfoTypeVersion message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.StoredInfoTypeVersion.verify|verify} messages. + * @param message StoredInfoTypeVersion message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.IStoredInfoTypeVersion, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StoredInfoTypeVersion message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StoredInfoTypeVersion + * @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.privacy.dlp.v2.StoredInfoTypeVersion; + + /** + * Decodes a StoredInfoTypeVersion message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StoredInfoTypeVersion + * @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.privacy.dlp.v2.StoredInfoTypeVersion; + + /** + * Verifies a StoredInfoTypeVersion 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 StoredInfoTypeVersion message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StoredInfoTypeVersion + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.StoredInfoTypeVersion; + + /** + * Creates a plain object from a StoredInfoTypeVersion message. Also converts values to other types if specified. + * @param message StoredInfoTypeVersion + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.StoredInfoTypeVersion, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StoredInfoTypeVersion to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a StoredInfoType. */ + interface IStoredInfoType { + + /** StoredInfoType name */ + name?: (string|null); + + /** StoredInfoType currentVersion */ + currentVersion?: (google.privacy.dlp.v2.IStoredInfoTypeVersion|null); + + /** StoredInfoType pendingVersions */ + pendingVersions?: (google.privacy.dlp.v2.IStoredInfoTypeVersion[]|null); + } + + /** Represents a StoredInfoType. */ + class StoredInfoType implements IStoredInfoType { + + /** + * Constructs a new StoredInfoType. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.IStoredInfoType); + + /** StoredInfoType name. */ + public name: string; + + /** StoredInfoType currentVersion. */ + public currentVersion?: (google.privacy.dlp.v2.IStoredInfoTypeVersion|null); + + /** StoredInfoType pendingVersions. */ + public pendingVersions: google.privacy.dlp.v2.IStoredInfoTypeVersion[]; + + /** + * Creates a new StoredInfoType instance using the specified properties. + * @param [properties] Properties to set + * @returns StoredInfoType instance + */ + public static create(properties?: google.privacy.dlp.v2.IStoredInfoType): google.privacy.dlp.v2.StoredInfoType; + + /** + * Encodes the specified StoredInfoType message. Does not implicitly {@link google.privacy.dlp.v2.StoredInfoType.verify|verify} messages. + * @param message StoredInfoType message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.IStoredInfoType, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StoredInfoType message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.StoredInfoType.verify|verify} messages. + * @param message StoredInfoType message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.IStoredInfoType, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StoredInfoType message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StoredInfoType + * @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.privacy.dlp.v2.StoredInfoType; + + /** + * Decodes a StoredInfoType message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StoredInfoType + * @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.privacy.dlp.v2.StoredInfoType; + + /** + * Verifies a StoredInfoType 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 StoredInfoType message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StoredInfoType + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.StoredInfoType; + + /** + * Creates a plain object from a StoredInfoType message. Also converts values to other types if specified. + * @param message StoredInfoType + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.StoredInfoType, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StoredInfoType to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a CreateStoredInfoTypeRequest. */ + interface ICreateStoredInfoTypeRequest { + + /** CreateStoredInfoTypeRequest parent */ + parent?: (string|null); + + /** CreateStoredInfoTypeRequest config */ + config?: (google.privacy.dlp.v2.IStoredInfoTypeConfig|null); + + /** CreateStoredInfoTypeRequest storedInfoTypeId */ + storedInfoTypeId?: (string|null); + + /** CreateStoredInfoTypeRequest locationId */ + locationId?: (string|null); + } + + /** Represents a CreateStoredInfoTypeRequest. */ + class CreateStoredInfoTypeRequest implements ICreateStoredInfoTypeRequest { + + /** + * Constructs a new CreateStoredInfoTypeRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.ICreateStoredInfoTypeRequest); + + /** CreateStoredInfoTypeRequest parent. */ + public parent: string; + + /** CreateStoredInfoTypeRequest config. */ + public config?: (google.privacy.dlp.v2.IStoredInfoTypeConfig|null); + + /** CreateStoredInfoTypeRequest storedInfoTypeId. */ + public storedInfoTypeId: string; + + /** CreateStoredInfoTypeRequest locationId. */ + public locationId: string; + + /** + * Creates a new CreateStoredInfoTypeRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateStoredInfoTypeRequest instance + */ + public static create(properties?: google.privacy.dlp.v2.ICreateStoredInfoTypeRequest): google.privacy.dlp.v2.CreateStoredInfoTypeRequest; + + /** + * Encodes the specified CreateStoredInfoTypeRequest message. Does not implicitly {@link google.privacy.dlp.v2.CreateStoredInfoTypeRequest.verify|verify} messages. + * @param message CreateStoredInfoTypeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.ICreateStoredInfoTypeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateStoredInfoTypeRequest message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.CreateStoredInfoTypeRequest.verify|verify} messages. + * @param message CreateStoredInfoTypeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.ICreateStoredInfoTypeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateStoredInfoTypeRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateStoredInfoTypeRequest + * @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.privacy.dlp.v2.CreateStoredInfoTypeRequest; + + /** + * Decodes a CreateStoredInfoTypeRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateStoredInfoTypeRequest + * @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.privacy.dlp.v2.CreateStoredInfoTypeRequest; + + /** + * Verifies a CreateStoredInfoTypeRequest 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 CreateStoredInfoTypeRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateStoredInfoTypeRequest + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.CreateStoredInfoTypeRequest; + + /** + * Creates a plain object from a CreateStoredInfoTypeRequest message. Also converts values to other types if specified. + * @param message CreateStoredInfoTypeRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.CreateStoredInfoTypeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateStoredInfoTypeRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an UpdateStoredInfoTypeRequest. */ + interface IUpdateStoredInfoTypeRequest { + + /** UpdateStoredInfoTypeRequest name */ + name?: (string|null); + + /** UpdateStoredInfoTypeRequest config */ + config?: (google.privacy.dlp.v2.IStoredInfoTypeConfig|null); + + /** UpdateStoredInfoTypeRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateStoredInfoTypeRequest. */ + class UpdateStoredInfoTypeRequest implements IUpdateStoredInfoTypeRequest { + + /** + * Constructs a new UpdateStoredInfoTypeRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.IUpdateStoredInfoTypeRequest); + + /** UpdateStoredInfoTypeRequest name. */ + public name: string; + + /** UpdateStoredInfoTypeRequest config. */ + public config?: (google.privacy.dlp.v2.IStoredInfoTypeConfig|null); + + /** UpdateStoredInfoTypeRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateStoredInfoTypeRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateStoredInfoTypeRequest instance + */ + public static create(properties?: google.privacy.dlp.v2.IUpdateStoredInfoTypeRequest): google.privacy.dlp.v2.UpdateStoredInfoTypeRequest; + + /** + * Encodes the specified UpdateStoredInfoTypeRequest message. Does not implicitly {@link google.privacy.dlp.v2.UpdateStoredInfoTypeRequest.verify|verify} messages. + * @param message UpdateStoredInfoTypeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.IUpdateStoredInfoTypeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateStoredInfoTypeRequest message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.UpdateStoredInfoTypeRequest.verify|verify} messages. + * @param message UpdateStoredInfoTypeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.IUpdateStoredInfoTypeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateStoredInfoTypeRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateStoredInfoTypeRequest + * @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.privacy.dlp.v2.UpdateStoredInfoTypeRequest; + + /** + * Decodes an UpdateStoredInfoTypeRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateStoredInfoTypeRequest + * @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.privacy.dlp.v2.UpdateStoredInfoTypeRequest; + + /** + * Verifies an UpdateStoredInfoTypeRequest 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 an UpdateStoredInfoTypeRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateStoredInfoTypeRequest + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.UpdateStoredInfoTypeRequest; + + /** + * Creates a plain object from an UpdateStoredInfoTypeRequest message. Also converts values to other types if specified. + * @param message UpdateStoredInfoTypeRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.UpdateStoredInfoTypeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateStoredInfoTypeRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetStoredInfoTypeRequest. */ + interface IGetStoredInfoTypeRequest { + + /** GetStoredInfoTypeRequest name */ + name?: (string|null); + } + + /** Represents a GetStoredInfoTypeRequest. */ + class GetStoredInfoTypeRequest implements IGetStoredInfoTypeRequest { + + /** + * Constructs a new GetStoredInfoTypeRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.IGetStoredInfoTypeRequest); + + /** GetStoredInfoTypeRequest name. */ + public name: string; + + /** + * Creates a new GetStoredInfoTypeRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetStoredInfoTypeRequest instance + */ + public static create(properties?: google.privacy.dlp.v2.IGetStoredInfoTypeRequest): google.privacy.dlp.v2.GetStoredInfoTypeRequest; + + /** + * Encodes the specified GetStoredInfoTypeRequest message. Does not implicitly {@link google.privacy.dlp.v2.GetStoredInfoTypeRequest.verify|verify} messages. + * @param message GetStoredInfoTypeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.IGetStoredInfoTypeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetStoredInfoTypeRequest message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.GetStoredInfoTypeRequest.verify|verify} messages. + * @param message GetStoredInfoTypeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.IGetStoredInfoTypeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetStoredInfoTypeRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetStoredInfoTypeRequest + * @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.privacy.dlp.v2.GetStoredInfoTypeRequest; + + /** + * Decodes a GetStoredInfoTypeRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetStoredInfoTypeRequest + * @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.privacy.dlp.v2.GetStoredInfoTypeRequest; + + /** + * Verifies a GetStoredInfoTypeRequest 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 GetStoredInfoTypeRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetStoredInfoTypeRequest + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.GetStoredInfoTypeRequest; + + /** + * Creates a plain object from a GetStoredInfoTypeRequest message. Also converts values to other types if specified. + * @param message GetStoredInfoTypeRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.GetStoredInfoTypeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetStoredInfoTypeRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListStoredInfoTypesRequest. */ + interface IListStoredInfoTypesRequest { + + /** ListStoredInfoTypesRequest parent */ + parent?: (string|null); + + /** ListStoredInfoTypesRequest pageToken */ + pageToken?: (string|null); + + /** ListStoredInfoTypesRequest pageSize */ + pageSize?: (number|null); + + /** ListStoredInfoTypesRequest orderBy */ + orderBy?: (string|null); + + /** ListStoredInfoTypesRequest locationId */ + locationId?: (string|null); + } + + /** Represents a ListStoredInfoTypesRequest. */ + class ListStoredInfoTypesRequest implements IListStoredInfoTypesRequest { + + /** + * Constructs a new ListStoredInfoTypesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.IListStoredInfoTypesRequest); + + /** ListStoredInfoTypesRequest parent. */ + public parent: string; + + /** ListStoredInfoTypesRequest pageToken. */ + public pageToken: string; + + /** ListStoredInfoTypesRequest pageSize. */ + public pageSize: number; + + /** ListStoredInfoTypesRequest orderBy. */ + public orderBy: string; + + /** ListStoredInfoTypesRequest locationId. */ + public locationId: string; + + /** + * Creates a new ListStoredInfoTypesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListStoredInfoTypesRequest instance + */ + public static create(properties?: google.privacy.dlp.v2.IListStoredInfoTypesRequest): google.privacy.dlp.v2.ListStoredInfoTypesRequest; + + /** + * Encodes the specified ListStoredInfoTypesRequest message. Does not implicitly {@link google.privacy.dlp.v2.ListStoredInfoTypesRequest.verify|verify} messages. + * @param message ListStoredInfoTypesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.IListStoredInfoTypesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListStoredInfoTypesRequest message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.ListStoredInfoTypesRequest.verify|verify} messages. + * @param message ListStoredInfoTypesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.IListStoredInfoTypesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListStoredInfoTypesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListStoredInfoTypesRequest + * @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.privacy.dlp.v2.ListStoredInfoTypesRequest; + + /** + * Decodes a ListStoredInfoTypesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListStoredInfoTypesRequest + * @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.privacy.dlp.v2.ListStoredInfoTypesRequest; + + /** + * Verifies a ListStoredInfoTypesRequest 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 ListStoredInfoTypesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListStoredInfoTypesRequest + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.ListStoredInfoTypesRequest; + + /** + * Creates a plain object from a ListStoredInfoTypesRequest message. Also converts values to other types if specified. + * @param message ListStoredInfoTypesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.ListStoredInfoTypesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListStoredInfoTypesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListStoredInfoTypesResponse. */ + interface IListStoredInfoTypesResponse { + + /** ListStoredInfoTypesResponse storedInfoTypes */ + storedInfoTypes?: (google.privacy.dlp.v2.IStoredInfoType[]|null); + + /** ListStoredInfoTypesResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListStoredInfoTypesResponse. */ + class ListStoredInfoTypesResponse implements IListStoredInfoTypesResponse { + + /** + * Constructs a new ListStoredInfoTypesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.IListStoredInfoTypesResponse); + + /** ListStoredInfoTypesResponse storedInfoTypes. */ + public storedInfoTypes: google.privacy.dlp.v2.IStoredInfoType[]; + + /** ListStoredInfoTypesResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListStoredInfoTypesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListStoredInfoTypesResponse instance + */ + public static create(properties?: google.privacy.dlp.v2.IListStoredInfoTypesResponse): google.privacy.dlp.v2.ListStoredInfoTypesResponse; + + /** + * Encodes the specified ListStoredInfoTypesResponse message. Does not implicitly {@link google.privacy.dlp.v2.ListStoredInfoTypesResponse.verify|verify} messages. + * @param message ListStoredInfoTypesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.IListStoredInfoTypesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListStoredInfoTypesResponse message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.ListStoredInfoTypesResponse.verify|verify} messages. + * @param message ListStoredInfoTypesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.IListStoredInfoTypesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListStoredInfoTypesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListStoredInfoTypesResponse + * @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.privacy.dlp.v2.ListStoredInfoTypesResponse; + + /** + * Decodes a ListStoredInfoTypesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListStoredInfoTypesResponse + * @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.privacy.dlp.v2.ListStoredInfoTypesResponse; + + /** + * Verifies a ListStoredInfoTypesResponse 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 ListStoredInfoTypesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListStoredInfoTypesResponse + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.ListStoredInfoTypesResponse; + + /** + * Creates a plain object from a ListStoredInfoTypesResponse message. Also converts values to other types if specified. + * @param message ListStoredInfoTypesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.ListStoredInfoTypesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListStoredInfoTypesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeleteStoredInfoTypeRequest. */ + interface IDeleteStoredInfoTypeRequest { + + /** DeleteStoredInfoTypeRequest name */ + name?: (string|null); + } + + /** Represents a DeleteStoredInfoTypeRequest. */ + class DeleteStoredInfoTypeRequest implements IDeleteStoredInfoTypeRequest { + + /** + * Constructs a new DeleteStoredInfoTypeRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.IDeleteStoredInfoTypeRequest); + + /** DeleteStoredInfoTypeRequest name. */ + public name: string; + + /** + * Creates a new DeleteStoredInfoTypeRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteStoredInfoTypeRequest instance + */ + public static create(properties?: google.privacy.dlp.v2.IDeleteStoredInfoTypeRequest): google.privacy.dlp.v2.DeleteStoredInfoTypeRequest; + + /** + * Encodes the specified DeleteStoredInfoTypeRequest message. Does not implicitly {@link google.privacy.dlp.v2.DeleteStoredInfoTypeRequest.verify|verify} messages. + * @param message DeleteStoredInfoTypeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.IDeleteStoredInfoTypeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteStoredInfoTypeRequest message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.DeleteStoredInfoTypeRequest.verify|verify} messages. + * @param message DeleteStoredInfoTypeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.IDeleteStoredInfoTypeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteStoredInfoTypeRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteStoredInfoTypeRequest + * @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.privacy.dlp.v2.DeleteStoredInfoTypeRequest; + + /** + * Decodes a DeleteStoredInfoTypeRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteStoredInfoTypeRequest + * @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.privacy.dlp.v2.DeleteStoredInfoTypeRequest; + + /** + * Verifies a DeleteStoredInfoTypeRequest 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 DeleteStoredInfoTypeRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteStoredInfoTypeRequest + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.DeleteStoredInfoTypeRequest; + + /** + * Creates a plain object from a DeleteStoredInfoTypeRequest message. Also converts values to other types if specified. + * @param message DeleteStoredInfoTypeRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.DeleteStoredInfoTypeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteStoredInfoTypeRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a HybridInspectJobTriggerRequest. */ + interface IHybridInspectJobTriggerRequest { + + /** HybridInspectJobTriggerRequest name */ + name?: (string|null); + + /** HybridInspectJobTriggerRequest hybridItem */ + hybridItem?: (google.privacy.dlp.v2.IHybridContentItem|null); + } + + /** Represents a HybridInspectJobTriggerRequest. */ + class HybridInspectJobTriggerRequest implements IHybridInspectJobTriggerRequest { + + /** + * Constructs a new HybridInspectJobTriggerRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.IHybridInspectJobTriggerRequest); + + /** HybridInspectJobTriggerRequest name. */ + public name: string; + + /** HybridInspectJobTriggerRequest hybridItem. */ + public hybridItem?: (google.privacy.dlp.v2.IHybridContentItem|null); + + /** + * Creates a new HybridInspectJobTriggerRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns HybridInspectJobTriggerRequest instance + */ + public static create(properties?: google.privacy.dlp.v2.IHybridInspectJobTriggerRequest): google.privacy.dlp.v2.HybridInspectJobTriggerRequest; + + /** + * Encodes the specified HybridInspectJobTriggerRequest message. Does not implicitly {@link google.privacy.dlp.v2.HybridInspectJobTriggerRequest.verify|verify} messages. + * @param message HybridInspectJobTriggerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.IHybridInspectJobTriggerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HybridInspectJobTriggerRequest message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.HybridInspectJobTriggerRequest.verify|verify} messages. + * @param message HybridInspectJobTriggerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.IHybridInspectJobTriggerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HybridInspectJobTriggerRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HybridInspectJobTriggerRequest + * @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.privacy.dlp.v2.HybridInspectJobTriggerRequest; + + /** + * Decodes a HybridInspectJobTriggerRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HybridInspectJobTriggerRequest + * @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.privacy.dlp.v2.HybridInspectJobTriggerRequest; + + /** + * Verifies a HybridInspectJobTriggerRequest 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 HybridInspectJobTriggerRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HybridInspectJobTriggerRequest + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.HybridInspectJobTriggerRequest; + + /** + * Creates a plain object from a HybridInspectJobTriggerRequest message. Also converts values to other types if specified. + * @param message HybridInspectJobTriggerRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.HybridInspectJobTriggerRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HybridInspectJobTriggerRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a HybridInspectDlpJobRequest. */ + interface IHybridInspectDlpJobRequest { + + /** HybridInspectDlpJobRequest name */ + name?: (string|null); + + /** HybridInspectDlpJobRequest hybridItem */ + hybridItem?: (google.privacy.dlp.v2.IHybridContentItem|null); + } + + /** Represents a HybridInspectDlpJobRequest. */ + class HybridInspectDlpJobRequest implements IHybridInspectDlpJobRequest { + + /** + * Constructs a new HybridInspectDlpJobRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.IHybridInspectDlpJobRequest); + + /** HybridInspectDlpJobRequest name. */ + public name: string; + + /** HybridInspectDlpJobRequest hybridItem. */ + public hybridItem?: (google.privacy.dlp.v2.IHybridContentItem|null); + + /** + * Creates a new HybridInspectDlpJobRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns HybridInspectDlpJobRequest instance + */ + public static create(properties?: google.privacy.dlp.v2.IHybridInspectDlpJobRequest): google.privacy.dlp.v2.HybridInspectDlpJobRequest; + + /** + * Encodes the specified HybridInspectDlpJobRequest message. Does not implicitly {@link google.privacy.dlp.v2.HybridInspectDlpJobRequest.verify|verify} messages. + * @param message HybridInspectDlpJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.IHybridInspectDlpJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HybridInspectDlpJobRequest message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.HybridInspectDlpJobRequest.verify|verify} messages. + * @param message HybridInspectDlpJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.IHybridInspectDlpJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HybridInspectDlpJobRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HybridInspectDlpJobRequest + * @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.privacy.dlp.v2.HybridInspectDlpJobRequest; + + /** + * Decodes a HybridInspectDlpJobRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HybridInspectDlpJobRequest + * @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.privacy.dlp.v2.HybridInspectDlpJobRequest; + + /** + * Verifies a HybridInspectDlpJobRequest 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 HybridInspectDlpJobRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HybridInspectDlpJobRequest + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.HybridInspectDlpJobRequest; + + /** + * Creates a plain object from a HybridInspectDlpJobRequest message. Also converts values to other types if specified. + * @param message HybridInspectDlpJobRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.HybridInspectDlpJobRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HybridInspectDlpJobRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a HybridContentItem. */ + interface IHybridContentItem { + + /** HybridContentItem item */ + item?: (google.privacy.dlp.v2.IContentItem|null); + + /** HybridContentItem findingDetails */ + findingDetails?: (google.privacy.dlp.v2.IHybridFindingDetails|null); + } + + /** Represents a HybridContentItem. */ + class HybridContentItem implements IHybridContentItem { + + /** + * Constructs a new HybridContentItem. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.IHybridContentItem); + + /** HybridContentItem item. */ + public item?: (google.privacy.dlp.v2.IContentItem|null); + + /** HybridContentItem findingDetails. */ + public findingDetails?: (google.privacy.dlp.v2.IHybridFindingDetails|null); + + /** + * Creates a new HybridContentItem instance using the specified properties. + * @param [properties] Properties to set + * @returns HybridContentItem instance + */ + public static create(properties?: google.privacy.dlp.v2.IHybridContentItem): google.privacy.dlp.v2.HybridContentItem; + + /** + * Encodes the specified HybridContentItem message. Does not implicitly {@link google.privacy.dlp.v2.HybridContentItem.verify|verify} messages. + * @param message HybridContentItem message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.IHybridContentItem, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HybridContentItem message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.HybridContentItem.verify|verify} messages. + * @param message HybridContentItem message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.IHybridContentItem, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HybridContentItem message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HybridContentItem + * @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.privacy.dlp.v2.HybridContentItem; + + /** + * Decodes a HybridContentItem message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HybridContentItem + * @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.privacy.dlp.v2.HybridContentItem; + + /** + * Verifies a HybridContentItem 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 HybridContentItem message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HybridContentItem + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.HybridContentItem; + + /** + * Creates a plain object from a HybridContentItem message. Also converts values to other types if specified. + * @param message HybridContentItem + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.HybridContentItem, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HybridContentItem to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a HybridFindingDetails. */ + interface IHybridFindingDetails { + + /** HybridFindingDetails containerDetails */ + containerDetails?: (google.privacy.dlp.v2.IContainer|null); + + /** HybridFindingDetails fileOffset */ + fileOffset?: (number|Long|string|null); + + /** HybridFindingDetails rowOffset */ + rowOffset?: (number|Long|string|null); + + /** HybridFindingDetails tableOptions */ + tableOptions?: (google.privacy.dlp.v2.ITableOptions|null); + + /** HybridFindingDetails labels */ + labels?: ({ [k: string]: string }|null); + } + + /** Represents a HybridFindingDetails. */ + class HybridFindingDetails implements IHybridFindingDetails { + + /** + * Constructs a new HybridFindingDetails. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.IHybridFindingDetails); + + /** HybridFindingDetails containerDetails. */ + public containerDetails?: (google.privacy.dlp.v2.IContainer|null); + + /** HybridFindingDetails fileOffset. */ + public fileOffset: (number|Long|string); + + /** HybridFindingDetails rowOffset. */ + public rowOffset: (number|Long|string); + + /** HybridFindingDetails tableOptions. */ + public tableOptions?: (google.privacy.dlp.v2.ITableOptions|null); + + /** HybridFindingDetails labels. */ + public labels: { [k: string]: string }; + + /** + * Creates a new HybridFindingDetails instance using the specified properties. + * @param [properties] Properties to set + * @returns HybridFindingDetails instance + */ + public static create(properties?: google.privacy.dlp.v2.IHybridFindingDetails): google.privacy.dlp.v2.HybridFindingDetails; + + /** + * Encodes the specified HybridFindingDetails message. Does not implicitly {@link google.privacy.dlp.v2.HybridFindingDetails.verify|verify} messages. + * @param message HybridFindingDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.IHybridFindingDetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HybridFindingDetails message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.HybridFindingDetails.verify|verify} messages. + * @param message HybridFindingDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.IHybridFindingDetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HybridFindingDetails message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HybridFindingDetails + * @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.privacy.dlp.v2.HybridFindingDetails; + + /** + * Decodes a HybridFindingDetails message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HybridFindingDetails + * @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.privacy.dlp.v2.HybridFindingDetails; + + /** + * Verifies a HybridFindingDetails 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 HybridFindingDetails message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HybridFindingDetails + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.HybridFindingDetails; + + /** + * Creates a plain object from a HybridFindingDetails message. Also converts values to other types if specified. + * @param message HybridFindingDetails + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.HybridFindingDetails, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HybridFindingDetails to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a HybridInspectResponse. */ + interface IHybridInspectResponse { + } + + /** Represents a HybridInspectResponse. */ + class HybridInspectResponse implements IHybridInspectResponse { + + /** + * Constructs a new HybridInspectResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.IHybridInspectResponse); + + /** + * Creates a new HybridInspectResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns HybridInspectResponse instance + */ + public static create(properties?: google.privacy.dlp.v2.IHybridInspectResponse): google.privacy.dlp.v2.HybridInspectResponse; + + /** + * Encodes the specified HybridInspectResponse message. Does not implicitly {@link google.privacy.dlp.v2.HybridInspectResponse.verify|verify} messages. + * @param message HybridInspectResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.IHybridInspectResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HybridInspectResponse message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.HybridInspectResponse.verify|verify} messages. + * @param message HybridInspectResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.IHybridInspectResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HybridInspectResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HybridInspectResponse + * @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.privacy.dlp.v2.HybridInspectResponse; + + /** + * Decodes a HybridInspectResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HybridInspectResponse + * @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.privacy.dlp.v2.HybridInspectResponse; + + /** + * Verifies a HybridInspectResponse 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 HybridInspectResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HybridInspectResponse + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.HybridInspectResponse; + + /** + * Creates a plain object from a HybridInspectResponse message. Also converts values to other types if specified. + * @param message HybridInspectResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.HybridInspectResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HybridInspectResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** RelationalOperator enum. */ + enum RelationalOperator { + RELATIONAL_OPERATOR_UNSPECIFIED = 0, + EQUAL_TO = 1, + NOT_EQUAL_TO = 2, + GREATER_THAN = 3, + LESS_THAN = 4, + GREATER_THAN_OR_EQUALS = 5, + LESS_THAN_OR_EQUALS = 6, + EXISTS = 7 + } + + /** MatchingType enum. */ + enum MatchingType { + MATCHING_TYPE_UNSPECIFIED = 0, + MATCHING_TYPE_FULL_MATCH = 1, + MATCHING_TYPE_PARTIAL_MATCH = 2, + MATCHING_TYPE_INVERSE_MATCH = 3 + } + + /** ContentOption enum. */ + enum ContentOption { + CONTENT_UNSPECIFIED = 0, + CONTENT_TEXT = 1, + CONTENT_IMAGE = 2 + } + + /** MetadataType enum. */ + enum MetadataType { + METADATATYPE_UNSPECIFIED = 0, + STORAGE_METADATA = 2 + } + + /** InfoTypeSupportedBy enum. */ + enum InfoTypeSupportedBy { + ENUM_TYPE_UNSPECIFIED = 0, + INSPECT = 1, + RISK_ANALYSIS = 2 + } + + /** DlpJobType enum. */ + enum DlpJobType { + DLP_JOB_TYPE_UNSPECIFIED = 0, + INSPECT_JOB = 1, + RISK_ANALYSIS_JOB = 2 + } + + /** StoredInfoTypeState enum. */ + enum StoredInfoTypeState { + STORED_INFO_TYPE_STATE_UNSPECIFIED = 0, + PENDING = 1, + READY = 2, + FAILED = 3, + INVALID = 4 + } + + /** Properties of an InfoType. */ + interface IInfoType { + + /** InfoType name */ + name?: (string|null); + } + + /** Represents an InfoType. */ + class InfoType implements IInfoType { + + /** + * Constructs a new InfoType. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.IInfoType); + + /** InfoType name. */ + public name: string; + + /** + * Creates a new InfoType instance using the specified properties. + * @param [properties] Properties to set + * @returns InfoType instance + */ + public static create(properties?: google.privacy.dlp.v2.IInfoType): google.privacy.dlp.v2.InfoType; + + /** + * Encodes the specified InfoType message. Does not implicitly {@link google.privacy.dlp.v2.InfoType.verify|verify} messages. + * @param message InfoType message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.IInfoType, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InfoType message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.InfoType.verify|verify} messages. + * @param message InfoType message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.IInfoType, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InfoType message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InfoType + * @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.privacy.dlp.v2.InfoType; + + /** + * Decodes an InfoType message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InfoType + * @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.privacy.dlp.v2.InfoType; + + /** + * Verifies an InfoType 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 an InfoType message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InfoType + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.InfoType; + + /** + * Creates a plain object from an InfoType message. Also converts values to other types if specified. + * @param message InfoType + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.InfoType, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InfoType to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a StoredType. */ + interface IStoredType { + + /** StoredType name */ + name?: (string|null); + + /** StoredType createTime */ + createTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a StoredType. */ + class StoredType implements IStoredType { + + /** + * Constructs a new StoredType. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.IStoredType); + + /** StoredType name. */ + public name: string; + + /** StoredType createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new StoredType instance using the specified properties. + * @param [properties] Properties to set + * @returns StoredType instance + */ + public static create(properties?: google.privacy.dlp.v2.IStoredType): google.privacy.dlp.v2.StoredType; + + /** + * Encodes the specified StoredType message. Does not implicitly {@link google.privacy.dlp.v2.StoredType.verify|verify} messages. + * @param message StoredType message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.IStoredType, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StoredType message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.StoredType.verify|verify} messages. + * @param message StoredType message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.IStoredType, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StoredType message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StoredType + * @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.privacy.dlp.v2.StoredType; + + /** + * Decodes a StoredType message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StoredType + * @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.privacy.dlp.v2.StoredType; + + /** + * Verifies a StoredType 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 StoredType message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StoredType + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.StoredType; + + /** + * Creates a plain object from a StoredType message. Also converts values to other types if specified. + * @param message StoredType + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.StoredType, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StoredType to JSON. + * @returns JSON object + */ + 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 { + + /** CustomInfoType infoType */ + infoType?: (google.privacy.dlp.v2.IInfoType|null); + + /** CustomInfoType likelihood */ + likelihood?: (google.privacy.dlp.v2.Likelihood|keyof typeof google.privacy.dlp.v2.Likelihood|null); + + /** CustomInfoType dictionary */ + dictionary?: (google.privacy.dlp.v2.CustomInfoType.IDictionary|null); + + /** CustomInfoType regex */ + regex?: (google.privacy.dlp.v2.CustomInfoType.IRegex|null); + + /** CustomInfoType surrogateType */ + surrogateType?: (google.privacy.dlp.v2.CustomInfoType.ISurrogateType|null); + + /** CustomInfoType storedType */ + storedType?: (google.privacy.dlp.v2.IStoredType|null); + + /** CustomInfoType detectionRules */ + detectionRules?: (google.privacy.dlp.v2.CustomInfoType.IDetectionRule[]|null); + + /** CustomInfoType exclusionType */ + exclusionType?: (google.privacy.dlp.v2.CustomInfoType.ExclusionType|keyof typeof google.privacy.dlp.v2.CustomInfoType.ExclusionType|null); + } + + /** Represents a CustomInfoType. */ + class CustomInfoType implements ICustomInfoType { + + /** + * Constructs a new CustomInfoType. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.ICustomInfoType); + + /** CustomInfoType infoType. */ + public infoType?: (google.privacy.dlp.v2.IInfoType|null); + + /** CustomInfoType likelihood. */ + public likelihood: (google.privacy.dlp.v2.Likelihood|keyof typeof google.privacy.dlp.v2.Likelihood); + + /** CustomInfoType dictionary. */ + public dictionary?: (google.privacy.dlp.v2.CustomInfoType.IDictionary|null); + + /** CustomInfoType regex. */ + public regex?: (google.privacy.dlp.v2.CustomInfoType.IRegex|null); + + /** CustomInfoType surrogateType. */ + public surrogateType?: (google.privacy.dlp.v2.CustomInfoType.ISurrogateType|null); + + /** CustomInfoType storedType. */ + public storedType?: (google.privacy.dlp.v2.IStoredType|null); + + /** CustomInfoType detectionRules. */ + public detectionRules: google.privacy.dlp.v2.CustomInfoType.IDetectionRule[]; + + /** CustomInfoType exclusionType. */ + public exclusionType: (google.privacy.dlp.v2.CustomInfoType.ExclusionType|keyof typeof google.privacy.dlp.v2.CustomInfoType.ExclusionType); + + /** CustomInfoType type. */ + public type?: ("dictionary"|"regex"|"surrogateType"|"storedType"); + + /** + * Creates a new CustomInfoType instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomInfoType instance + */ + public static create(properties?: google.privacy.dlp.v2.ICustomInfoType): google.privacy.dlp.v2.CustomInfoType; + + /** + * Encodes the specified CustomInfoType message. Does not implicitly {@link google.privacy.dlp.v2.CustomInfoType.verify|verify} messages. + * @param message CustomInfoType message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.ICustomInfoType, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CustomInfoType message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.CustomInfoType.verify|verify} messages. + * @param message CustomInfoType message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.ICustomInfoType, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomInfoType message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CustomInfoType + * @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.privacy.dlp.v2.CustomInfoType; + + /** + * Decodes a CustomInfoType message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CustomInfoType + * @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.privacy.dlp.v2.CustomInfoType; + + /** + * Verifies a CustomInfoType 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 CustomInfoType message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CustomInfoType + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.CustomInfoType; + + /** + * Creates a plain object from a CustomInfoType message. Also converts values to other types if specified. + * @param message CustomInfoType + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.CustomInfoType, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CustomInfoType to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace CustomInfoType { + + /** Properties of a Dictionary. */ + interface IDictionary { + + /** Dictionary wordList */ + wordList?: (google.privacy.dlp.v2.CustomInfoType.Dictionary.IWordList|null); + + /** Dictionary cloudStoragePath */ + cloudStoragePath?: (google.privacy.dlp.v2.ICloudStoragePath|null); + } + + /** Represents a Dictionary. */ + class Dictionary implements IDictionary { + + /** + * Constructs a new Dictionary. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.CustomInfoType.IDictionary); + + /** Dictionary wordList. */ + public wordList?: (google.privacy.dlp.v2.CustomInfoType.Dictionary.IWordList|null); + + /** Dictionary cloudStoragePath. */ + public cloudStoragePath?: (google.privacy.dlp.v2.ICloudStoragePath|null); + + /** Dictionary source. */ + public source?: ("wordList"|"cloudStoragePath"); + + /** + * Creates a new Dictionary instance using the specified properties. + * @param [properties] Properties to set + * @returns Dictionary instance + */ + public static create(properties?: google.privacy.dlp.v2.CustomInfoType.IDictionary): google.privacy.dlp.v2.CustomInfoType.Dictionary; + + /** + * Encodes the specified Dictionary message. Does not implicitly {@link google.privacy.dlp.v2.CustomInfoType.Dictionary.verify|verify} messages. + * @param message Dictionary message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.CustomInfoType.IDictionary, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Dictionary message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.CustomInfoType.Dictionary.verify|verify} messages. + * @param message Dictionary message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.CustomInfoType.IDictionary, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Dictionary message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Dictionary + * @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.privacy.dlp.v2.CustomInfoType.Dictionary; + + /** + * Decodes a Dictionary message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Dictionary + * @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.privacy.dlp.v2.CustomInfoType.Dictionary; + + /** + * Verifies a Dictionary 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 Dictionary message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Dictionary + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.CustomInfoType.Dictionary; + + /** + * Creates a plain object from a Dictionary message. Also converts values to other types if specified. + * @param message Dictionary + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.CustomInfoType.Dictionary, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Dictionary to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace Dictionary { + + /** Properties of a WordList. */ + interface IWordList { + + /** WordList words */ + words?: (string[]|null); + } + + /** Represents a WordList. */ + class WordList implements IWordList { + + /** + * Constructs a new WordList. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.CustomInfoType.Dictionary.IWordList); + + /** WordList words. */ + public words: string[]; + + /** + * Creates a new WordList instance using the specified properties. + * @param [properties] Properties to set + * @returns WordList instance + */ + public static create(properties?: google.privacy.dlp.v2.CustomInfoType.Dictionary.IWordList): google.privacy.dlp.v2.CustomInfoType.Dictionary.WordList; + + /** + * Encodes the specified WordList message. Does not implicitly {@link google.privacy.dlp.v2.CustomInfoType.Dictionary.WordList.verify|verify} messages. + * @param message WordList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.CustomInfoType.Dictionary.IWordList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WordList message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.CustomInfoType.Dictionary.WordList.verify|verify} messages. + * @param message WordList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.CustomInfoType.Dictionary.IWordList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WordList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WordList + * @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.privacy.dlp.v2.CustomInfoType.Dictionary.WordList; + + /** + * Decodes a WordList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WordList + * @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.privacy.dlp.v2.CustomInfoType.Dictionary.WordList; + + /** + * Verifies a WordList 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 WordList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WordList + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.CustomInfoType.Dictionary.WordList; + + /** + * Creates a plain object from a WordList message. Also converts values to other types if specified. + * @param message WordList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.CustomInfoType.Dictionary.WordList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WordList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of a Regex. */ + interface IRegex { + + /** Regex pattern */ + pattern?: (string|null); + + /** Regex groupIndexes */ + groupIndexes?: (number[]|null); + } + + /** Represents a Regex. */ + class Regex implements IRegex { + + /** + * Constructs a new Regex. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.CustomInfoType.IRegex); + + /** Regex pattern. */ + public pattern: string; + + /** Regex groupIndexes. */ + public groupIndexes: number[]; + + /** + * Creates a new Regex instance using the specified properties. + * @param [properties] Properties to set + * @returns Regex instance + */ + public static create(properties?: google.privacy.dlp.v2.CustomInfoType.IRegex): google.privacy.dlp.v2.CustomInfoType.Regex; + + /** + * Encodes the specified Regex message. Does not implicitly {@link google.privacy.dlp.v2.CustomInfoType.Regex.verify|verify} messages. + * @param message Regex message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.CustomInfoType.IRegex, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Regex message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.CustomInfoType.Regex.verify|verify} messages. + * @param message Regex message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.CustomInfoType.IRegex, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Regex message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Regex + * @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.privacy.dlp.v2.CustomInfoType.Regex; + + /** + * Decodes a Regex message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Regex + * @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.privacy.dlp.v2.CustomInfoType.Regex; + + /** + * Verifies a Regex 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 Regex message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Regex + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.CustomInfoType.Regex; + + /** + * Creates a plain object from a Regex message. Also converts values to other types if specified. + * @param message Regex + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.CustomInfoType.Regex, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Regex to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SurrogateType. */ + interface ISurrogateType { + } + + /** Represents a SurrogateType. */ + class SurrogateType implements ISurrogateType { + + /** + * Constructs a new SurrogateType. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.CustomInfoType.ISurrogateType); + + /** + * Creates a new SurrogateType instance using the specified properties. + * @param [properties] Properties to set + * @returns SurrogateType instance + */ + public static create(properties?: google.privacy.dlp.v2.CustomInfoType.ISurrogateType): google.privacy.dlp.v2.CustomInfoType.SurrogateType; + + /** + * Encodes the specified SurrogateType message. Does not implicitly {@link google.privacy.dlp.v2.CustomInfoType.SurrogateType.verify|verify} messages. + * @param message SurrogateType message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.CustomInfoType.ISurrogateType, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SurrogateType message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.CustomInfoType.SurrogateType.verify|verify} messages. + * @param message SurrogateType message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.CustomInfoType.ISurrogateType, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SurrogateType message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SurrogateType + * @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.privacy.dlp.v2.CustomInfoType.SurrogateType; + + /** + * Decodes a SurrogateType message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SurrogateType + * @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.privacy.dlp.v2.CustomInfoType.SurrogateType; + + /** + * Verifies a SurrogateType 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 SurrogateType message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SurrogateType + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.CustomInfoType.SurrogateType; + + /** + * Creates a plain object from a SurrogateType message. Also converts values to other types if specified. + * @param message SurrogateType + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.CustomInfoType.SurrogateType, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SurrogateType to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DetectionRule. */ + interface IDetectionRule { + + /** DetectionRule hotwordRule */ + hotwordRule?: (google.privacy.dlp.v2.CustomInfoType.DetectionRule.IHotwordRule|null); + } + + /** Represents a DetectionRule. */ + class DetectionRule implements IDetectionRule { + + /** + * Constructs a new DetectionRule. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.CustomInfoType.IDetectionRule); + + /** DetectionRule hotwordRule. */ + public hotwordRule?: (google.privacy.dlp.v2.CustomInfoType.DetectionRule.IHotwordRule|null); + + /** DetectionRule type. */ + public type?: "hotwordRule"; + + /** + * Creates a new DetectionRule instance using the specified properties. + * @param [properties] Properties to set + * @returns DetectionRule instance + */ + public static create(properties?: google.privacy.dlp.v2.CustomInfoType.IDetectionRule): google.privacy.dlp.v2.CustomInfoType.DetectionRule; + + /** + * Encodes the specified DetectionRule message. Does not implicitly {@link google.privacy.dlp.v2.CustomInfoType.DetectionRule.verify|verify} messages. + * @param message DetectionRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.CustomInfoType.IDetectionRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DetectionRule message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.CustomInfoType.DetectionRule.verify|verify} messages. + * @param message DetectionRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.CustomInfoType.IDetectionRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DetectionRule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DetectionRule + * @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.privacy.dlp.v2.CustomInfoType.DetectionRule; + + /** + * Decodes a DetectionRule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DetectionRule + * @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.privacy.dlp.v2.CustomInfoType.DetectionRule; + + /** + * Verifies a DetectionRule 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 DetectionRule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DetectionRule + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.CustomInfoType.DetectionRule; + + /** + * Creates a plain object from a DetectionRule message. Also converts values to other types if specified. + * @param message DetectionRule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.CustomInfoType.DetectionRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DetectionRule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace DetectionRule { + + /** Properties of a Proximity. */ + interface IProximity { + + /** Proximity windowBefore */ + windowBefore?: (number|null); + + /** Proximity windowAfter */ + windowAfter?: (number|null); + } + + /** Represents a Proximity. */ + class Proximity implements IProximity { + + /** + * Constructs a new Proximity. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.CustomInfoType.DetectionRule.IProximity); + + /** Proximity windowBefore. */ + public windowBefore: number; + + /** Proximity windowAfter. */ + public windowAfter: number; + + /** + * Creates a new Proximity instance using the specified properties. + * @param [properties] Properties to set + * @returns Proximity instance + */ + public static create(properties?: google.privacy.dlp.v2.CustomInfoType.DetectionRule.IProximity): google.privacy.dlp.v2.CustomInfoType.DetectionRule.Proximity; + + /** + * Encodes the specified Proximity message. Does not implicitly {@link google.privacy.dlp.v2.CustomInfoType.DetectionRule.Proximity.verify|verify} messages. + * @param message Proximity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.CustomInfoType.DetectionRule.IProximity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Proximity message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.CustomInfoType.DetectionRule.Proximity.verify|verify} messages. + * @param message Proximity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.CustomInfoType.DetectionRule.IProximity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Proximity message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Proximity + * @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.privacy.dlp.v2.CustomInfoType.DetectionRule.Proximity; + + /** + * Decodes a Proximity message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Proximity + * @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.privacy.dlp.v2.CustomInfoType.DetectionRule.Proximity; + + /** + * Verifies a Proximity 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 Proximity message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Proximity + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.CustomInfoType.DetectionRule.Proximity; + + /** + * Creates a plain object from a Proximity message. Also converts values to other types if specified. + * @param message Proximity + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.CustomInfoType.DetectionRule.Proximity, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Proximity to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a LikelihoodAdjustment. */ + interface ILikelihoodAdjustment { + + /** LikelihoodAdjustment fixedLikelihood */ + fixedLikelihood?: (google.privacy.dlp.v2.Likelihood|keyof typeof google.privacy.dlp.v2.Likelihood|null); + + /** LikelihoodAdjustment relativeLikelihood */ + relativeLikelihood?: (number|null); + } + + /** Represents a LikelihoodAdjustment. */ + class LikelihoodAdjustment implements ILikelihoodAdjustment { + + /** + * Constructs a new LikelihoodAdjustment. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.CustomInfoType.DetectionRule.ILikelihoodAdjustment); + + /** LikelihoodAdjustment fixedLikelihood. */ + public fixedLikelihood: (google.privacy.dlp.v2.Likelihood|keyof typeof google.privacy.dlp.v2.Likelihood); + + /** LikelihoodAdjustment relativeLikelihood. */ + public relativeLikelihood: number; + + /** LikelihoodAdjustment adjustment. */ + public adjustment?: ("fixedLikelihood"|"relativeLikelihood"); + + /** + * Creates a new LikelihoodAdjustment instance using the specified properties. + * @param [properties] Properties to set + * @returns LikelihoodAdjustment instance + */ + public static create(properties?: google.privacy.dlp.v2.CustomInfoType.DetectionRule.ILikelihoodAdjustment): google.privacy.dlp.v2.CustomInfoType.DetectionRule.LikelihoodAdjustment; + + /** + * Encodes the specified LikelihoodAdjustment message. Does not implicitly {@link google.privacy.dlp.v2.CustomInfoType.DetectionRule.LikelihoodAdjustment.verify|verify} messages. + * @param message LikelihoodAdjustment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.CustomInfoType.DetectionRule.ILikelihoodAdjustment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LikelihoodAdjustment message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.CustomInfoType.DetectionRule.LikelihoodAdjustment.verify|verify} messages. + * @param message LikelihoodAdjustment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.CustomInfoType.DetectionRule.ILikelihoodAdjustment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LikelihoodAdjustment message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LikelihoodAdjustment + * @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.privacy.dlp.v2.CustomInfoType.DetectionRule.LikelihoodAdjustment; + + /** + * Decodes a LikelihoodAdjustment message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LikelihoodAdjustment + * @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.privacy.dlp.v2.CustomInfoType.DetectionRule.LikelihoodAdjustment; + + /** + * Verifies a LikelihoodAdjustment 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 LikelihoodAdjustment message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LikelihoodAdjustment + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.CustomInfoType.DetectionRule.LikelihoodAdjustment; + + /** + * Creates a plain object from a LikelihoodAdjustment message. Also converts values to other types if specified. + * @param message LikelihoodAdjustment + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.CustomInfoType.DetectionRule.LikelihoodAdjustment, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LikelihoodAdjustment to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a HotwordRule. */ + interface IHotwordRule { + + /** HotwordRule hotwordRegex */ + hotwordRegex?: (google.privacy.dlp.v2.CustomInfoType.IRegex|null); + + /** HotwordRule proximity */ + proximity?: (google.privacy.dlp.v2.CustomInfoType.DetectionRule.IProximity|null); + + /** HotwordRule likelihoodAdjustment */ + likelihoodAdjustment?: (google.privacy.dlp.v2.CustomInfoType.DetectionRule.ILikelihoodAdjustment|null); + } + + /** Represents a HotwordRule. */ + class HotwordRule implements IHotwordRule { + + /** + * Constructs a new HotwordRule. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.CustomInfoType.DetectionRule.IHotwordRule); + + /** HotwordRule hotwordRegex. */ + public hotwordRegex?: (google.privacy.dlp.v2.CustomInfoType.IRegex|null); + + /** HotwordRule proximity. */ + public proximity?: (google.privacy.dlp.v2.CustomInfoType.DetectionRule.IProximity|null); + + /** HotwordRule likelihoodAdjustment. */ + public likelihoodAdjustment?: (google.privacy.dlp.v2.CustomInfoType.DetectionRule.ILikelihoodAdjustment|null); + + /** + * Creates a new HotwordRule instance using the specified properties. + * @param [properties] Properties to set + * @returns HotwordRule instance + */ + public static create(properties?: google.privacy.dlp.v2.CustomInfoType.DetectionRule.IHotwordRule): google.privacy.dlp.v2.CustomInfoType.DetectionRule.HotwordRule; + + /** + * Encodes the specified HotwordRule message. Does not implicitly {@link google.privacy.dlp.v2.CustomInfoType.DetectionRule.HotwordRule.verify|verify} messages. + * @param message HotwordRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.CustomInfoType.DetectionRule.IHotwordRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HotwordRule message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.CustomInfoType.DetectionRule.HotwordRule.verify|verify} messages. + * @param message HotwordRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.CustomInfoType.DetectionRule.IHotwordRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HotwordRule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HotwordRule + * @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.privacy.dlp.v2.CustomInfoType.DetectionRule.HotwordRule; + + /** + * Decodes a HotwordRule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HotwordRule + * @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.privacy.dlp.v2.CustomInfoType.DetectionRule.HotwordRule; + + /** + * Verifies a HotwordRule 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 HotwordRule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HotwordRule + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.CustomInfoType.DetectionRule.HotwordRule; + + /** + * Creates a plain object from a HotwordRule message. Also converts values to other types if specified. + * @param message HotwordRule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.CustomInfoType.DetectionRule.HotwordRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HotwordRule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** ExclusionType enum. */ + enum ExclusionType { + EXCLUSION_TYPE_UNSPECIFIED = 0, + EXCLUSION_TYPE_EXCLUDE = 1 + } + } + + /** Properties of a FieldId. */ + interface IFieldId { + + /** FieldId name */ + name?: (string|null); + } + + /** Represents a FieldId. */ + class FieldId implements IFieldId { + + /** + * Constructs a new FieldId. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.IFieldId); + + /** FieldId name. */ + public name: string; + + /** + * Creates a new FieldId instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldId instance + */ + public static create(properties?: google.privacy.dlp.v2.IFieldId): google.privacy.dlp.v2.FieldId; + + /** + * Encodes the specified FieldId message. Does not implicitly {@link google.privacy.dlp.v2.FieldId.verify|verify} messages. + * @param message FieldId message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.IFieldId, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldId message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.FieldId.verify|verify} messages. + * @param message FieldId message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.IFieldId, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldId message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldId + * @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.privacy.dlp.v2.FieldId; + + /** + * Decodes a FieldId message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldId + * @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.privacy.dlp.v2.FieldId; + + /** + * Verifies a FieldId 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 FieldId message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldId + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.FieldId; + + /** + * Creates a plain object from a FieldId message. Also converts values to other types if specified. + * @param message FieldId + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.FieldId, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldId to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a PartitionId. */ + interface IPartitionId { + + /** PartitionId projectId */ + projectId?: (string|null); + + /** PartitionId namespaceId */ + namespaceId?: (string|null); + } + + /** Represents a PartitionId. */ + class PartitionId implements IPartitionId { + + /** + * Constructs a new PartitionId. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.IPartitionId); + + /** PartitionId projectId. */ + public projectId: string; + + /** PartitionId namespaceId. */ + public namespaceId: string; + + /** + * Creates a new PartitionId instance using the specified properties. + * @param [properties] Properties to set + * @returns PartitionId instance + */ + public static create(properties?: google.privacy.dlp.v2.IPartitionId): google.privacy.dlp.v2.PartitionId; + + /** + * Encodes the specified PartitionId message. Does not implicitly {@link google.privacy.dlp.v2.PartitionId.verify|verify} messages. + * @param message PartitionId message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.IPartitionId, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PartitionId message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.PartitionId.verify|verify} messages. + * @param message PartitionId message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.IPartitionId, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PartitionId message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PartitionId + * @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.privacy.dlp.v2.PartitionId; + + /** + * Decodes a PartitionId message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PartitionId + * @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.privacy.dlp.v2.PartitionId; + + /** + * Verifies a PartitionId 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 PartitionId message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PartitionId + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.PartitionId; + + /** + * Creates a plain object from a PartitionId message. Also converts values to other types if specified. + * @param message PartitionId + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.PartitionId, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PartitionId to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a KindExpression. */ + interface IKindExpression { + + /** KindExpression name */ + name?: (string|null); + } + + /** Represents a KindExpression. */ + class KindExpression implements IKindExpression { + + /** + * Constructs a new KindExpression. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.IKindExpression); + + /** KindExpression name. */ + public name: string; + + /** + * Creates a new KindExpression instance using the specified properties. + * @param [properties] Properties to set + * @returns KindExpression instance + */ + public static create(properties?: google.privacy.dlp.v2.IKindExpression): google.privacy.dlp.v2.KindExpression; + + /** + * Encodes the specified KindExpression message. Does not implicitly {@link google.privacy.dlp.v2.KindExpression.verify|verify} messages. + * @param message KindExpression message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.IKindExpression, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified KindExpression message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.KindExpression.verify|verify} messages. + * @param message KindExpression message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.IKindExpression, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a KindExpression message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns KindExpression + * @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.privacy.dlp.v2.KindExpression; + + /** + * Decodes a KindExpression message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns KindExpression + * @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.privacy.dlp.v2.KindExpression; + + /** + * Verifies a KindExpression 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 KindExpression message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns KindExpression + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.KindExpression; + + /** + * Creates a plain object from a KindExpression message. Also converts values to other types if specified. + * @param message KindExpression + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.KindExpression, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this KindExpression to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DatastoreOptions. */ + interface IDatastoreOptions { + + /** DatastoreOptions partitionId */ + partitionId?: (google.privacy.dlp.v2.IPartitionId|null); + + /** DatastoreOptions kind */ + kind?: (google.privacy.dlp.v2.IKindExpression|null); + } + + /** Represents a DatastoreOptions. */ + class DatastoreOptions implements IDatastoreOptions { + + /** + * Constructs a new DatastoreOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.IDatastoreOptions); + + /** DatastoreOptions partitionId. */ + public partitionId?: (google.privacy.dlp.v2.IPartitionId|null); + + /** DatastoreOptions kind. */ + public kind?: (google.privacy.dlp.v2.IKindExpression|null); + + /** + * Creates a new DatastoreOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns DatastoreOptions instance + */ + public static create(properties?: google.privacy.dlp.v2.IDatastoreOptions): google.privacy.dlp.v2.DatastoreOptions; + + /** + * Encodes the specified DatastoreOptions message. Does not implicitly {@link google.privacy.dlp.v2.DatastoreOptions.verify|verify} messages. + * @param message DatastoreOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.IDatastoreOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DatastoreOptions message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.DatastoreOptions.verify|verify} messages. + * @param message DatastoreOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.IDatastoreOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DatastoreOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DatastoreOptions + * @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.privacy.dlp.v2.DatastoreOptions; + + /** + * Decodes a DatastoreOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DatastoreOptions + * @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.privacy.dlp.v2.DatastoreOptions; + + /** + * Verifies a DatastoreOptions 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 DatastoreOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DatastoreOptions + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.DatastoreOptions; + + /** + * Creates a plain object from a DatastoreOptions message. Also converts values to other types if specified. + * @param message DatastoreOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.DatastoreOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DatastoreOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a CloudStorageRegexFileSet. */ + interface ICloudStorageRegexFileSet { + + /** CloudStorageRegexFileSet bucketName */ + bucketName?: (string|null); + + /** CloudStorageRegexFileSet includeRegex */ + includeRegex?: (string[]|null); + + /** CloudStorageRegexFileSet excludeRegex */ + excludeRegex?: (string[]|null); + } + + /** Represents a CloudStorageRegexFileSet. */ + class CloudStorageRegexFileSet implements ICloudStorageRegexFileSet { + + /** + * Constructs a new CloudStorageRegexFileSet. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.ICloudStorageRegexFileSet); + + /** CloudStorageRegexFileSet bucketName. */ + public bucketName: string; + + /** CloudStorageRegexFileSet includeRegex. */ + public includeRegex: string[]; + + /** CloudStorageRegexFileSet excludeRegex. */ + public excludeRegex: string[]; + + /** + * Creates a new CloudStorageRegexFileSet instance using the specified properties. + * @param [properties] Properties to set + * @returns CloudStorageRegexFileSet instance + */ + public static create(properties?: google.privacy.dlp.v2.ICloudStorageRegexFileSet): google.privacy.dlp.v2.CloudStorageRegexFileSet; + + /** + * Encodes the specified CloudStorageRegexFileSet message. Does not implicitly {@link google.privacy.dlp.v2.CloudStorageRegexFileSet.verify|verify} messages. + * @param message CloudStorageRegexFileSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.ICloudStorageRegexFileSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CloudStorageRegexFileSet message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.CloudStorageRegexFileSet.verify|verify} messages. + * @param message CloudStorageRegexFileSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.ICloudStorageRegexFileSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CloudStorageRegexFileSet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CloudStorageRegexFileSet + * @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.privacy.dlp.v2.CloudStorageRegexFileSet; + + /** + * Decodes a CloudStorageRegexFileSet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CloudStorageRegexFileSet + * @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.privacy.dlp.v2.CloudStorageRegexFileSet; + + /** + * Verifies a CloudStorageRegexFileSet 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 CloudStorageRegexFileSet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CloudStorageRegexFileSet + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.CloudStorageRegexFileSet; + + /** + * Creates a plain object from a CloudStorageRegexFileSet message. Also converts values to other types if specified. + * @param message CloudStorageRegexFileSet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.CloudStorageRegexFileSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CloudStorageRegexFileSet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a CloudStorageOptions. */ + interface ICloudStorageOptions { + + /** CloudStorageOptions fileSet */ + fileSet?: (google.privacy.dlp.v2.CloudStorageOptions.IFileSet|null); + + /** CloudStorageOptions bytesLimitPerFile */ + bytesLimitPerFile?: (number|Long|string|null); + + /** CloudStorageOptions bytesLimitPerFilePercent */ + bytesLimitPerFilePercent?: (number|null); + + /** CloudStorageOptions fileTypes */ + fileTypes?: (google.privacy.dlp.v2.FileType[]|null); + + /** CloudStorageOptions sampleMethod */ + sampleMethod?: (google.privacy.dlp.v2.CloudStorageOptions.SampleMethod|keyof typeof google.privacy.dlp.v2.CloudStorageOptions.SampleMethod|null); + + /** CloudStorageOptions filesLimitPercent */ + filesLimitPercent?: (number|null); + } + + /** Represents a CloudStorageOptions. */ + class CloudStorageOptions implements ICloudStorageOptions { + + /** + * Constructs a new CloudStorageOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.ICloudStorageOptions); + + /** CloudStorageOptions fileSet. */ + public fileSet?: (google.privacy.dlp.v2.CloudStorageOptions.IFileSet|null); + + /** CloudStorageOptions bytesLimitPerFile. */ + public bytesLimitPerFile: (number|Long|string); + + /** CloudStorageOptions bytesLimitPerFilePercent. */ + public bytesLimitPerFilePercent: number; + + /** CloudStorageOptions fileTypes. */ + public fileTypes: google.privacy.dlp.v2.FileType[]; + + /** CloudStorageOptions sampleMethod. */ + public sampleMethod: (google.privacy.dlp.v2.CloudStorageOptions.SampleMethod|keyof typeof google.privacy.dlp.v2.CloudStorageOptions.SampleMethod); + + /** CloudStorageOptions filesLimitPercent. */ + public filesLimitPercent: number; + + /** + * Creates a new CloudStorageOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns CloudStorageOptions instance + */ + public static create(properties?: google.privacy.dlp.v2.ICloudStorageOptions): google.privacy.dlp.v2.CloudStorageOptions; + + /** + * Encodes the specified CloudStorageOptions message. Does not implicitly {@link google.privacy.dlp.v2.CloudStorageOptions.verify|verify} messages. + * @param message CloudStorageOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.ICloudStorageOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CloudStorageOptions message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.CloudStorageOptions.verify|verify} messages. + * @param message CloudStorageOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.ICloudStorageOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CloudStorageOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CloudStorageOptions + * @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.privacy.dlp.v2.CloudStorageOptions; + + /** + * Decodes a CloudStorageOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CloudStorageOptions + * @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.privacy.dlp.v2.CloudStorageOptions; + + /** + * Verifies a CloudStorageOptions 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 CloudStorageOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CloudStorageOptions + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.CloudStorageOptions; + + /** + * Creates a plain object from a CloudStorageOptions message. Also converts values to other types if specified. + * @param message CloudStorageOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.CloudStorageOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CloudStorageOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace CloudStorageOptions { + + /** Properties of a FileSet. */ + interface IFileSet { + + /** FileSet url */ + url?: (string|null); + + /** FileSet regexFileSet */ + regexFileSet?: (google.privacy.dlp.v2.ICloudStorageRegexFileSet|null); + } + + /** Represents a FileSet. */ + class FileSet implements IFileSet { + + /** + * Constructs a new FileSet. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.CloudStorageOptions.IFileSet); + + /** FileSet url. */ + public url: string; + + /** FileSet regexFileSet. */ + public regexFileSet?: (google.privacy.dlp.v2.ICloudStorageRegexFileSet|null); + + /** + * Creates a new FileSet instance using the specified properties. + * @param [properties] Properties to set + * @returns FileSet instance + */ + public static create(properties?: google.privacy.dlp.v2.CloudStorageOptions.IFileSet): google.privacy.dlp.v2.CloudStorageOptions.FileSet; + + /** + * Encodes the specified FileSet message. Does not implicitly {@link google.privacy.dlp.v2.CloudStorageOptions.FileSet.verify|verify} messages. + * @param message FileSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.CloudStorageOptions.IFileSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileSet message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.CloudStorageOptions.FileSet.verify|verify} messages. + * @param message FileSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.CloudStorageOptions.IFileSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileSet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileSet + * @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.privacy.dlp.v2.CloudStorageOptions.FileSet; + + /** + * Decodes a FileSet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileSet + * @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.privacy.dlp.v2.CloudStorageOptions.FileSet; + + /** + * Verifies a FileSet 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 FileSet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileSet + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.CloudStorageOptions.FileSet; + + /** + * Creates a plain object from a FileSet message. Also converts values to other types if specified. + * @param message FileSet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.CloudStorageOptions.FileSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileSet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** SampleMethod enum. */ + enum SampleMethod { + SAMPLE_METHOD_UNSPECIFIED = 0, + TOP = 1, + RANDOM_START = 2 + } + } + + /** Properties of a CloudStorageFileSet. */ + interface ICloudStorageFileSet { + + /** CloudStorageFileSet url */ + url?: (string|null); + } + + /** Represents a CloudStorageFileSet. */ + class CloudStorageFileSet implements ICloudStorageFileSet { + + /** + * Constructs a new CloudStorageFileSet. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.ICloudStorageFileSet); + + /** CloudStorageFileSet url. */ + public url: string; + + /** + * Creates a new CloudStorageFileSet instance using the specified properties. + * @param [properties] Properties to set + * @returns CloudStorageFileSet instance + */ + public static create(properties?: google.privacy.dlp.v2.ICloudStorageFileSet): google.privacy.dlp.v2.CloudStorageFileSet; + + /** + * Encodes the specified CloudStorageFileSet message. Does not implicitly {@link google.privacy.dlp.v2.CloudStorageFileSet.verify|verify} messages. + * @param message CloudStorageFileSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.ICloudStorageFileSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CloudStorageFileSet message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.CloudStorageFileSet.verify|verify} messages. + * @param message CloudStorageFileSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.ICloudStorageFileSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CloudStorageFileSet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CloudStorageFileSet + * @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.privacy.dlp.v2.CloudStorageFileSet; + + /** + * Decodes a CloudStorageFileSet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CloudStorageFileSet + * @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.privacy.dlp.v2.CloudStorageFileSet; + + /** + * Verifies a CloudStorageFileSet 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 CloudStorageFileSet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CloudStorageFileSet + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.CloudStorageFileSet; + + /** + * Creates a plain object from a CloudStorageFileSet message. Also converts values to other types if specified. + * @param message CloudStorageFileSet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.CloudStorageFileSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CloudStorageFileSet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a CloudStoragePath. */ + interface ICloudStoragePath { + + /** CloudStoragePath path */ + path?: (string|null); + } + + /** Represents a CloudStoragePath. */ + class CloudStoragePath implements ICloudStoragePath { + + /** + * Constructs a new CloudStoragePath. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.ICloudStoragePath); + + /** CloudStoragePath path. */ + public path: string; + + /** + * Creates a new CloudStoragePath instance using the specified properties. + * @param [properties] Properties to set + * @returns CloudStoragePath instance + */ + public static create(properties?: google.privacy.dlp.v2.ICloudStoragePath): google.privacy.dlp.v2.CloudStoragePath; + + /** + * Encodes the specified CloudStoragePath message. Does not implicitly {@link google.privacy.dlp.v2.CloudStoragePath.verify|verify} messages. + * @param message CloudStoragePath message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.ICloudStoragePath, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CloudStoragePath message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.CloudStoragePath.verify|verify} messages. + * @param message CloudStoragePath message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.ICloudStoragePath, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CloudStoragePath message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CloudStoragePath + * @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.privacy.dlp.v2.CloudStoragePath; + + /** + * Decodes a CloudStoragePath message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CloudStoragePath + * @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.privacy.dlp.v2.CloudStoragePath; + + /** + * Verifies a CloudStoragePath 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 CloudStoragePath message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CloudStoragePath + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.CloudStoragePath; + + /** + * Creates a plain object from a CloudStoragePath message. Also converts values to other types if specified. + * @param message CloudStoragePath + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.CloudStoragePath, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CloudStoragePath to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a BigQueryOptions. */ + interface IBigQueryOptions { + + /** BigQueryOptions tableReference */ + tableReference?: (google.privacy.dlp.v2.IBigQueryTable|null); + + /** BigQueryOptions identifyingFields */ + identifyingFields?: (google.privacy.dlp.v2.IFieldId[]|null); + + /** BigQueryOptions rowsLimit */ + rowsLimit?: (number|Long|string|null); + + /** BigQueryOptions rowsLimitPercent */ + rowsLimitPercent?: (number|null); + + /** BigQueryOptions sampleMethod */ + sampleMethod?: (google.privacy.dlp.v2.BigQueryOptions.SampleMethod|keyof typeof google.privacy.dlp.v2.BigQueryOptions.SampleMethod|null); + + /** BigQueryOptions excludedFields */ + excludedFields?: (google.privacy.dlp.v2.IFieldId[]|null); + } + + /** Represents a BigQueryOptions. */ + class BigQueryOptions implements IBigQueryOptions { + + /** + * Constructs a new BigQueryOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.IBigQueryOptions); + + /** BigQueryOptions tableReference. */ + public tableReference?: (google.privacy.dlp.v2.IBigQueryTable|null); + + /** BigQueryOptions identifyingFields. */ + public identifyingFields: google.privacy.dlp.v2.IFieldId[]; + + /** BigQueryOptions rowsLimit. */ + public rowsLimit: (number|Long|string); + + /** BigQueryOptions rowsLimitPercent. */ + public rowsLimitPercent: number; + + /** BigQueryOptions sampleMethod. */ + public sampleMethod: (google.privacy.dlp.v2.BigQueryOptions.SampleMethod|keyof typeof google.privacy.dlp.v2.BigQueryOptions.SampleMethod); + + /** BigQueryOptions excludedFields. */ + public excludedFields: google.privacy.dlp.v2.IFieldId[]; + + /** + * Creates a new BigQueryOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns BigQueryOptions instance + */ + public static create(properties?: google.privacy.dlp.v2.IBigQueryOptions): google.privacy.dlp.v2.BigQueryOptions; + + /** + * Encodes the specified BigQueryOptions message. Does not implicitly {@link google.privacy.dlp.v2.BigQueryOptions.verify|verify} messages. + * @param message BigQueryOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.IBigQueryOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BigQueryOptions message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.BigQueryOptions.verify|verify} messages. + * @param message BigQueryOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.IBigQueryOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BigQueryOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BigQueryOptions + * @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.privacy.dlp.v2.BigQueryOptions; + + /** + * Decodes a BigQueryOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BigQueryOptions + * @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.privacy.dlp.v2.BigQueryOptions; + + /** + * Verifies a BigQueryOptions 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 BigQueryOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BigQueryOptions + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.BigQueryOptions; + + /** + * Creates a plain object from a BigQueryOptions message. Also converts values to other types if specified. + * @param message BigQueryOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.BigQueryOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BigQueryOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace BigQueryOptions { + + /** SampleMethod enum. */ + enum SampleMethod { + SAMPLE_METHOD_UNSPECIFIED = 0, + TOP = 1, + RANDOM_START = 2 + } + } + + /** Properties of a StorageConfig. */ + interface IStorageConfig { + + /** StorageConfig datastoreOptions */ + datastoreOptions?: (google.privacy.dlp.v2.IDatastoreOptions|null); + + /** StorageConfig cloudStorageOptions */ + cloudStorageOptions?: (google.privacy.dlp.v2.ICloudStorageOptions|null); + + /** StorageConfig bigQueryOptions */ + bigQueryOptions?: (google.privacy.dlp.v2.IBigQueryOptions|null); + + /** StorageConfig hybridOptions */ + hybridOptions?: (google.privacy.dlp.v2.IHybridOptions|null); + + /** StorageConfig timespanConfig */ + timespanConfig?: (google.privacy.dlp.v2.StorageConfig.ITimespanConfig|null); + } + + /** Represents a StorageConfig. */ + class StorageConfig implements IStorageConfig { + + /** + * Constructs a new StorageConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.IStorageConfig); + + /** StorageConfig datastoreOptions. */ + public datastoreOptions?: (google.privacy.dlp.v2.IDatastoreOptions|null); + + /** StorageConfig cloudStorageOptions. */ + public cloudStorageOptions?: (google.privacy.dlp.v2.ICloudStorageOptions|null); + + /** StorageConfig bigQueryOptions. */ + public bigQueryOptions?: (google.privacy.dlp.v2.IBigQueryOptions|null); + + /** StorageConfig hybridOptions. */ + public hybridOptions?: (google.privacy.dlp.v2.IHybridOptions|null); + + /** StorageConfig timespanConfig. */ + public timespanConfig?: (google.privacy.dlp.v2.StorageConfig.ITimespanConfig|null); + + /** StorageConfig type. */ + public type?: ("datastoreOptions"|"cloudStorageOptions"|"bigQueryOptions"|"hybridOptions"); + + /** + * Creates a new StorageConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns StorageConfig instance + */ + public static create(properties?: google.privacy.dlp.v2.IStorageConfig): google.privacy.dlp.v2.StorageConfig; + + /** + * Encodes the specified StorageConfig message. Does not implicitly {@link google.privacy.dlp.v2.StorageConfig.verify|verify} messages. + * @param message StorageConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.IStorageConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StorageConfig message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.StorageConfig.verify|verify} messages. + * @param message StorageConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.IStorageConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StorageConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StorageConfig + * @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.privacy.dlp.v2.StorageConfig; + + /** + * Decodes a StorageConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StorageConfig + * @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.privacy.dlp.v2.StorageConfig; + + /** + * Verifies a StorageConfig 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 StorageConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StorageConfig + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.StorageConfig; + + /** + * Creates a plain object from a StorageConfig message. Also converts values to other types if specified. + * @param message StorageConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.StorageConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StorageConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace StorageConfig { + + /** Properties of a TimespanConfig. */ + interface ITimespanConfig { + + /** TimespanConfig startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** TimespanConfig endTime */ + endTime?: (google.protobuf.ITimestamp|null); + + /** TimespanConfig timestampField */ + timestampField?: (google.privacy.dlp.v2.IFieldId|null); + + /** TimespanConfig enableAutoPopulationOfTimespanConfig */ + enableAutoPopulationOfTimespanConfig?: (boolean|null); + } + + /** Represents a TimespanConfig. */ + class TimespanConfig implements ITimespanConfig { + + /** + * Constructs a new TimespanConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.StorageConfig.ITimespanConfig); + + /** TimespanConfig startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** TimespanConfig endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** TimespanConfig timestampField. */ + public timestampField?: (google.privacy.dlp.v2.IFieldId|null); + + /** TimespanConfig enableAutoPopulationOfTimespanConfig. */ + public enableAutoPopulationOfTimespanConfig: boolean; + + /** + * Creates a new TimespanConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns TimespanConfig instance + */ + public static create(properties?: google.privacy.dlp.v2.StorageConfig.ITimespanConfig): google.privacy.dlp.v2.StorageConfig.TimespanConfig; + + /** + * Encodes the specified TimespanConfig message. Does not implicitly {@link google.privacy.dlp.v2.StorageConfig.TimespanConfig.verify|verify} messages. + * @param message TimespanConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.StorageConfig.ITimespanConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TimespanConfig message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.StorageConfig.TimespanConfig.verify|verify} messages. + * @param message TimespanConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.StorageConfig.ITimespanConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TimespanConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TimespanConfig + * @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.privacy.dlp.v2.StorageConfig.TimespanConfig; + + /** + * Decodes a TimespanConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TimespanConfig + * @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.privacy.dlp.v2.StorageConfig.TimespanConfig; + + /** + * Verifies a TimespanConfig 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 TimespanConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TimespanConfig + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.StorageConfig.TimespanConfig; + + /** + * Creates a plain object from a TimespanConfig message. Also converts values to other types if specified. + * @param message TimespanConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.StorageConfig.TimespanConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TimespanConfig to JSON. + * @returns JSON object + */ + 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 + } + + /** Properties of a HybridOptions. */ + interface IHybridOptions { + + /** HybridOptions description */ + description?: (string|null); + + /** HybridOptions requiredFindingLabelKeys */ + requiredFindingLabelKeys?: (string[]|null); + + /** HybridOptions labels */ + labels?: ({ [k: string]: string }|null); + + /** HybridOptions tableOptions */ + tableOptions?: (google.privacy.dlp.v2.ITableOptions|null); + } + + /** Represents a HybridOptions. */ + class HybridOptions implements IHybridOptions { + + /** + * Constructs a new HybridOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.IHybridOptions); + + /** HybridOptions description. */ + public description: string; + + /** HybridOptions requiredFindingLabelKeys. */ + public requiredFindingLabelKeys: string[]; + + /** HybridOptions labels. */ + public labels: { [k: string]: string }; + + /** HybridOptions tableOptions. */ + public tableOptions?: (google.privacy.dlp.v2.ITableOptions|null); + + /** + * Creates a new HybridOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns HybridOptions instance + */ + public static create(properties?: google.privacy.dlp.v2.IHybridOptions): google.privacy.dlp.v2.HybridOptions; + + /** + * Encodes the specified HybridOptions message. Does not implicitly {@link google.privacy.dlp.v2.HybridOptions.verify|verify} messages. + * @param message HybridOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.IHybridOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HybridOptions message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.HybridOptions.verify|verify} messages. + * @param message HybridOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.IHybridOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HybridOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HybridOptions + * @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.privacy.dlp.v2.HybridOptions; + + /** + * Decodes a HybridOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HybridOptions + * @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.privacy.dlp.v2.HybridOptions; + + /** + * Verifies a HybridOptions 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 HybridOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HybridOptions + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.HybridOptions; + + /** + * Creates a plain object from a HybridOptions message. Also converts values to other types if specified. + * @param message HybridOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.HybridOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HybridOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a BigQueryKey. */ + interface IBigQueryKey { + + /** BigQueryKey tableReference */ + tableReference?: (google.privacy.dlp.v2.IBigQueryTable|null); + + /** BigQueryKey rowNumber */ + rowNumber?: (number|Long|string|null); + } + + /** Represents a BigQueryKey. */ + class BigQueryKey implements IBigQueryKey { + + /** + * Constructs a new BigQueryKey. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.IBigQueryKey); + + /** BigQueryKey tableReference. */ + public tableReference?: (google.privacy.dlp.v2.IBigQueryTable|null); + + /** BigQueryKey rowNumber. */ + public rowNumber: (number|Long|string); + + /** + * Creates a new BigQueryKey instance using the specified properties. + * @param [properties] Properties to set + * @returns BigQueryKey instance + */ + public static create(properties?: google.privacy.dlp.v2.IBigQueryKey): google.privacy.dlp.v2.BigQueryKey; + + /** + * Encodes the specified BigQueryKey message. Does not implicitly {@link google.privacy.dlp.v2.BigQueryKey.verify|verify} messages. + * @param message BigQueryKey message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.IBigQueryKey, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BigQueryKey message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.BigQueryKey.verify|verify} messages. + * @param message BigQueryKey message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.IBigQueryKey, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BigQueryKey message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BigQueryKey + * @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.privacy.dlp.v2.BigQueryKey; + + /** + * Decodes a BigQueryKey message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BigQueryKey + * @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.privacy.dlp.v2.BigQueryKey; + + /** + * Verifies a BigQueryKey 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 BigQueryKey message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BigQueryKey + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.BigQueryKey; + + /** + * Creates a plain object from a BigQueryKey message. Also converts values to other types if specified. + * @param message BigQueryKey + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.BigQueryKey, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BigQueryKey to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DatastoreKey. */ + interface IDatastoreKey { + + /** DatastoreKey entityKey */ + entityKey?: (google.privacy.dlp.v2.IKey|null); + } + + /** Represents a DatastoreKey. */ + class DatastoreKey implements IDatastoreKey { + + /** + * Constructs a new DatastoreKey. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.IDatastoreKey); + + /** DatastoreKey entityKey. */ + public entityKey?: (google.privacy.dlp.v2.IKey|null); + + /** + * Creates a new DatastoreKey instance using the specified properties. + * @param [properties] Properties to set + * @returns DatastoreKey instance + */ + public static create(properties?: google.privacy.dlp.v2.IDatastoreKey): google.privacy.dlp.v2.DatastoreKey; + + /** + * Encodes the specified DatastoreKey message. Does not implicitly {@link google.privacy.dlp.v2.DatastoreKey.verify|verify} messages. + * @param message DatastoreKey message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.IDatastoreKey, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DatastoreKey message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.DatastoreKey.verify|verify} messages. + * @param message DatastoreKey message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.IDatastoreKey, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DatastoreKey message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DatastoreKey + * @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.privacy.dlp.v2.DatastoreKey; + + /** + * Decodes a DatastoreKey message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DatastoreKey + * @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.privacy.dlp.v2.DatastoreKey; + + /** + * Verifies a DatastoreKey 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 DatastoreKey message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DatastoreKey + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.DatastoreKey; + + /** + * Creates a plain object from a DatastoreKey message. Also converts values to other types if specified. + * @param message DatastoreKey + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.DatastoreKey, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DatastoreKey to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Key. */ + interface IKey { + + /** Key partitionId */ + partitionId?: (google.privacy.dlp.v2.IPartitionId|null); + + /** Key path */ + path?: (google.privacy.dlp.v2.Key.IPathElement[]|null); + } + + /** Represents a Key. */ + class Key implements IKey { + + /** + * Constructs a new Key. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.IKey); + + /** Key partitionId. */ + public partitionId?: (google.privacy.dlp.v2.IPartitionId|null); + + /** Key path. */ + public path: google.privacy.dlp.v2.Key.IPathElement[]; + + /** + * Creates a new Key instance using the specified properties. + * @param [properties] Properties to set + * @returns Key instance + */ + public static create(properties?: google.privacy.dlp.v2.IKey): google.privacy.dlp.v2.Key; + + /** + * Encodes the specified Key message. Does not implicitly {@link google.privacy.dlp.v2.Key.verify|verify} messages. + * @param message Key message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.IKey, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Key message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.Key.verify|verify} messages. + * @param message Key message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.IKey, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Key message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Key + * @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.privacy.dlp.v2.Key; + + /** + * Decodes a Key message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Key + * @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.privacy.dlp.v2.Key; + + /** + * Verifies a Key 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 Key message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Key + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.Key; + + /** + * Creates a plain object from a Key message. Also converts values to other types if specified. + * @param message Key + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.Key, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Key to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace Key { + + /** Properties of a PathElement. */ + interface IPathElement { + + /** PathElement kind */ + kind?: (string|null); + + /** PathElement id */ + id?: (number|Long|string|null); + + /** PathElement name */ + name?: (string|null); + } + + /** Represents a PathElement. */ + class PathElement implements IPathElement { + + /** + * Constructs a new PathElement. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.Key.IPathElement); + + /** PathElement kind. */ + public kind: string; + + /** PathElement id. */ + public id: (number|Long|string); + + /** PathElement name. */ + public name: string; + + /** PathElement idType. */ + public idType?: ("id"|"name"); + + /** + * Creates a new PathElement instance using the specified properties. + * @param [properties] Properties to set + * @returns PathElement instance + */ + public static create(properties?: google.privacy.dlp.v2.Key.IPathElement): google.privacy.dlp.v2.Key.PathElement; + + /** + * Encodes the specified PathElement message. Does not implicitly {@link google.privacy.dlp.v2.Key.PathElement.verify|verify} messages. + * @param message PathElement message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.Key.IPathElement, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PathElement message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.Key.PathElement.verify|verify} messages. + * @param message PathElement message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.Key.IPathElement, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PathElement message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PathElement + * @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.privacy.dlp.v2.Key.PathElement; + + /** + * Decodes a PathElement message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PathElement + * @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.privacy.dlp.v2.Key.PathElement; + + /** + * Verifies a PathElement 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 PathElement message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PathElement + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.Key.PathElement; + + /** + * Creates a plain object from a PathElement message. Also converts values to other types if specified. + * @param message PathElement + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.Key.PathElement, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PathElement to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of a RecordKey. */ + interface IRecordKey { + + /** RecordKey datastoreKey */ + datastoreKey?: (google.privacy.dlp.v2.IDatastoreKey|null); + + /** RecordKey bigQueryKey */ + bigQueryKey?: (google.privacy.dlp.v2.IBigQueryKey|null); + + /** RecordKey idValues */ + idValues?: (string[]|null); + } + + /** Represents a RecordKey. */ + class RecordKey implements IRecordKey { + + /** + * Constructs a new RecordKey. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.IRecordKey); + + /** RecordKey datastoreKey. */ + public datastoreKey?: (google.privacy.dlp.v2.IDatastoreKey|null); + + /** RecordKey bigQueryKey. */ + public bigQueryKey?: (google.privacy.dlp.v2.IBigQueryKey|null); + + /** RecordKey idValues. */ + public idValues: string[]; + + /** RecordKey type. */ + public type?: ("datastoreKey"|"bigQueryKey"); + + /** + * Creates a new RecordKey instance using the specified properties. + * @param [properties] Properties to set + * @returns RecordKey instance + */ + public static create(properties?: google.privacy.dlp.v2.IRecordKey): google.privacy.dlp.v2.RecordKey; + + /** + * Encodes the specified RecordKey message. Does not implicitly {@link google.privacy.dlp.v2.RecordKey.verify|verify} messages. + * @param message RecordKey message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.IRecordKey, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RecordKey message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.RecordKey.verify|verify} messages. + * @param message RecordKey message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.IRecordKey, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RecordKey message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RecordKey + * @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.privacy.dlp.v2.RecordKey; + + /** + * Decodes a RecordKey message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RecordKey + * @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.privacy.dlp.v2.RecordKey; + + /** + * Verifies a RecordKey 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 RecordKey message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RecordKey + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.RecordKey; + + /** + * Creates a plain object from a RecordKey message. Also converts values to other types if specified. + * @param message RecordKey + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.RecordKey, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RecordKey to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a BigQueryTable. */ + interface IBigQueryTable { + + /** BigQueryTable projectId */ + projectId?: (string|null); + + /** BigQueryTable datasetId */ + datasetId?: (string|null); + + /** BigQueryTable tableId */ + tableId?: (string|null); + } + + /** Represents a BigQueryTable. */ + class BigQueryTable implements IBigQueryTable { + + /** + * Constructs a new BigQueryTable. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.IBigQueryTable); + + /** BigQueryTable projectId. */ + public projectId: string; + + /** BigQueryTable datasetId. */ + public datasetId: string; + + /** BigQueryTable tableId. */ + public tableId: string; + + /** + * Creates a new BigQueryTable instance using the specified properties. + * @param [properties] Properties to set + * @returns BigQueryTable instance + */ + public static create(properties?: google.privacy.dlp.v2.IBigQueryTable): google.privacy.dlp.v2.BigQueryTable; + + /** + * Encodes the specified BigQueryTable message. Does not implicitly {@link google.privacy.dlp.v2.BigQueryTable.verify|verify} messages. + * @param message BigQueryTable message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.IBigQueryTable, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BigQueryTable message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.BigQueryTable.verify|verify} messages. + * @param message BigQueryTable message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.IBigQueryTable, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BigQueryTable message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BigQueryTable + * @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.privacy.dlp.v2.BigQueryTable; + + /** + * Decodes a BigQueryTable message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BigQueryTable + * @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.privacy.dlp.v2.BigQueryTable; + + /** + * Verifies a BigQueryTable 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 BigQueryTable message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BigQueryTable + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.BigQueryTable; + + /** + * Creates a plain object from a BigQueryTable message. Also converts values to other types if specified. + * @param message BigQueryTable + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.BigQueryTable, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BigQueryTable to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a BigQueryField. */ + interface IBigQueryField { + + /** BigQueryField table */ + table?: (google.privacy.dlp.v2.IBigQueryTable|null); + + /** BigQueryField field */ + field?: (google.privacy.dlp.v2.IFieldId|null); + } + + /** Represents a BigQueryField. */ + class BigQueryField implements IBigQueryField { + + /** + * Constructs a new BigQueryField. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.IBigQueryField); + + /** BigQueryField table. */ + public table?: (google.privacy.dlp.v2.IBigQueryTable|null); + + /** BigQueryField field. */ + public field?: (google.privacy.dlp.v2.IFieldId|null); + + /** + * Creates a new BigQueryField instance using the specified properties. + * @param [properties] Properties to set + * @returns BigQueryField instance + */ + public static create(properties?: google.privacy.dlp.v2.IBigQueryField): google.privacy.dlp.v2.BigQueryField; + + /** + * Encodes the specified BigQueryField message. Does not implicitly {@link google.privacy.dlp.v2.BigQueryField.verify|verify} messages. + * @param message BigQueryField message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.IBigQueryField, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BigQueryField message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.BigQueryField.verify|verify} messages. + * @param message BigQueryField message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.IBigQueryField, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BigQueryField message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BigQueryField + * @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.privacy.dlp.v2.BigQueryField; + + /** + * Decodes a BigQueryField message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BigQueryField + * @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.privacy.dlp.v2.BigQueryField; + + /** + * Verifies a BigQueryField 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 BigQueryField message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BigQueryField + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.BigQueryField; + + /** + * Creates a plain object from a BigQueryField message. Also converts values to other types if specified. + * @param message BigQueryField + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.BigQueryField, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BigQueryField to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an EntityId. */ + interface IEntityId { + + /** EntityId field */ + field?: (google.privacy.dlp.v2.IFieldId|null); + } + + /** Represents an EntityId. */ + class EntityId implements IEntityId { + + /** + * Constructs a new EntityId. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.IEntityId); + + /** EntityId field. */ + public field?: (google.privacy.dlp.v2.IFieldId|null); + + /** + * Creates a new EntityId instance using the specified properties. + * @param [properties] Properties to set + * @returns EntityId instance + */ + public static create(properties?: google.privacy.dlp.v2.IEntityId): google.privacy.dlp.v2.EntityId; + + /** + * Encodes the specified EntityId message. Does not implicitly {@link google.privacy.dlp.v2.EntityId.verify|verify} messages. + * @param message EntityId message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.IEntityId, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EntityId message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.EntityId.verify|verify} messages. + * @param message EntityId message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.IEntityId, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EntityId message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EntityId + * @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.privacy.dlp.v2.EntityId; + + /** + * Decodes an EntityId message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EntityId + * @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.privacy.dlp.v2.EntityId; + + /** + * Verifies an EntityId 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 an EntityId message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EntityId + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.EntityId; + + /** + * Creates a plain object from an EntityId message. Also converts values to other types if specified. + * @param message EntityId + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.EntityId, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EntityId to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a TableOptions. */ + interface ITableOptions { + + /** TableOptions identifyingFields */ + identifyingFields?: (google.privacy.dlp.v2.IFieldId[]|null); + } + + /** Represents a TableOptions. */ + class TableOptions implements ITableOptions { + + /** + * Constructs a new TableOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.ITableOptions); + + /** TableOptions identifyingFields. */ + public identifyingFields: google.privacy.dlp.v2.IFieldId[]; + + /** + * Creates a new TableOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns TableOptions instance + */ + public static create(properties?: google.privacy.dlp.v2.ITableOptions): google.privacy.dlp.v2.TableOptions; + + /** + * Encodes the specified TableOptions message. Does not implicitly {@link google.privacy.dlp.v2.TableOptions.verify|verify} messages. + * @param message TableOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.ITableOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TableOptions message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.TableOptions.verify|verify} messages. + * @param message TableOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.ITableOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TableOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TableOptions + * @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.privacy.dlp.v2.TableOptions; + + /** + * Decodes a TableOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TableOptions + * @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.privacy.dlp.v2.TableOptions; + + /** + * Verifies a TableOptions 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 TableOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TableOptions + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.TableOptions; + + /** + * Creates a plain object from a TableOptions message. Also converts values to other types if specified. + * @param message TableOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.TableOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TableOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + } + } + + /** 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 + } + + /** 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); + + /** ResourceDescriptor singular */ + singular?: (string|null); + + /** ResourceDescriptor style */ + style?: (google.api.ResourceDescriptor.Style[]|null); + } + + /** Represents a ResourceDescriptor. */ + class ResourceDescriptor implements IResourceDescriptor { + + /** + * Constructs a new ResourceDescriptor. + * @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; + + /** ResourceDescriptor singular. */ + public singular: string; + + /** ResourceDescriptor style. */ + public style: google.api.ResourceDescriptor.Style[]; + + /** + * Creates a new ResourceDescriptor instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceDescriptor instance + */ + public static create(properties?: google.api.IResourceDescriptor): google.api.ResourceDescriptor; + + /** + * 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.IResourceDescriptor, 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 + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * 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 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.ResourceDescriptor; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @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.ResourceDescriptor; + + /** + * 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 ResourceDescriptor message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceDescriptor + */ + public static fromObject(object: { [k: string]: any }): google.api.ResourceDescriptor; + + /** + * 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.ResourceDescriptor, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceDescriptor to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace ResourceDescriptor { + + /** History enum. */ + enum History { + HISTORY_UNSPECIFIED = 0, + ORIGINALLY_SINGLE_PATTERN = 1, + FUTURE_MULTI_PATTERN = 2 + } + + /** Style enum. */ + enum Style { + STYLE_UNSPECIFIED = 0, + DECLARATIVE_FRIENDLY = 1 + } + } + + /** 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 ResourceReference. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IResourceReference); + + /** ResourceReference type. */ + public type: string; + + /** ResourceReference childType. */ + public childType: string; + + /** + * Creates a new ResourceReference instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceReference instance + */ + public static create(properties?: google.api.IResourceReference): google.api.ResourceReference; + + /** + * 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; + + /** + * 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; + + /** + * 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 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.ResourceReference; + + /** + * Decodes a ResourceReference message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @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.ResourceReference; + + /** + * 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 ResourceReference message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceReference + */ + public static fromObject(object: { [k: string]: any }): google.api.ResourceReference; + + /** + * 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.ResourceReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceReference to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Http. */ + interface IHttp { + + /** Http rules */ + rules?: (google.api.IHttpRule[]|null); + + /** Http fullyDecodeReservedExpansion */ + fullyDecodeReservedExpansion?: (boolean|null); + } + + /** Represents a Http. */ + class Http implements IHttp { + + /** + * Constructs a new Http. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IHttp); + + /** Http rules. */ + public rules: google.api.IHttpRule[]; + + /** Http fullyDecodeReservedExpansion. */ + public fullyDecodeReservedExpansion: boolean; + + /** + * Creates a new Http instance using the specified properties. + * @param [properties] Properties to set + * @returns Http instance + */ + public static create(properties?: google.api.IHttp): google.api.Http; + + /** + * 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.IHttp, 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 + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * 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 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.Http; + + /** + * Decodes a Http message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @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.Http; + + /** + * 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 Http message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Http + */ + public static fromObject(object: { [k: string]: any }): google.api.Http; + + /** + * 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.Http, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Http 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); + + /** HttpRule put */ + put?: (string|null); + + /** HttpRule post */ + post?: (string|null); + + /** HttpRule delete */ + "delete"?: (string|null); + + /** HttpRule patch */ + patch?: (string|null); + + /** HttpRule custom */ + custom?: (google.api.ICustomHttpPattern|null); + + /** HttpRule body */ + body?: (string|null); + + /** HttpRule responseBody */ + responseBody?: (string|null); + + /** HttpRule additionalBindings */ + additionalBindings?: (google.api.IHttpRule[]|null); + } + + /** Represents a HttpRule. */ + class HttpRule implements IHttpRule { + + /** + * Constructs a new HttpRule. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IHttpRule); + + /** HttpRule selector. */ + public selector: string; + + /** HttpRule get. */ + public get: string; + + /** HttpRule put. */ + public put: string; + + /** HttpRule post. */ + public post: string; + + /** HttpRule delete. */ + public delete: string; + + /** HttpRule patch. */ + public patch: string; + + /** 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 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.HttpRule; + + /** + * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @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.HttpRule; + + /** + * 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 HttpRule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HttpRule + */ + public static fromObject(object: { [k: string]: any }): google.api.HttpRule; + + /** + * 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.HttpRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HttpRule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a CustomHttpPattern. */ + interface ICustomHttpPattern { + + /** CustomHttpPattern kind */ + kind?: (string|null); + + /** CustomHttpPattern path */ + path?: (string|null); + } + + /** Represents a CustomHttpPattern. */ + class CustomHttpPattern implements ICustomHttpPattern { + + /** + * Constructs a new CustomHttpPattern. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ICustomHttpPattern); + + /** CustomHttpPattern kind. */ + public kind: string; + + /** CustomHttpPattern path. */ + public path: string; + + /** + * Creates a new CustomHttpPattern instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomHttpPattern instance + */ + public static create(properties?: google.api.ICustomHttpPattern): google.api.CustomHttpPattern; + + /** + * 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.ICustomHttpPattern, 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 + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * 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 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.CustomHttpPattern; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @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.CustomHttpPattern; + + /** + * 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 CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CustomHttpPattern + */ + public static fromObject(object: { [k: string]: any }): google.api.CustomHttpPattern; + + /** + * 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.CustomHttpPattern, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CustomHttpPattern to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Namespace protobuf. */ + namespace protobuf { + + /** Properties of a FileDescriptorSet. */ + interface IFileDescriptorSet { + + /** FileDescriptorSet file */ + file?: (google.protobuf.IFileDescriptorProto[]|null); + } + + /** Represents a FileDescriptorSet. */ + class FileDescriptorSet implements IFileDescriptorSet { + + /** + * Constructs a new FileDescriptorSet. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileDescriptorSet); + + /** FileDescriptorSet file. */ + public file: google.protobuf.IFileDescriptorProto[]; + + /** + * Creates a new FileDescriptorSet instance using the specified properties. + * @param [properties] Properties to set + * @returns FileDescriptorSet instance + */ + public static create(properties?: google.protobuf.IFileDescriptorSet): google.protobuf.FileDescriptorSet; + + /** + * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @param message FileDescriptorSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @param message FileDescriptorSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileDescriptorSet + * @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.protobuf.FileDescriptorSet; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileDescriptorSet + * @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.protobuf.FileDescriptorSet; + + /** + * Verifies a FileDescriptorSet 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 FileDescriptorSet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileDescriptorSet + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorSet; + + /** + * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. + * @param message FileDescriptorSet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileDescriptorSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileDescriptorSet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a FileDescriptorProto. */ + interface IFileDescriptorProto { + + /** FileDescriptorProto name */ + name?: (string|null); + + /** FileDescriptorProto package */ + "package"?: (string|null); + + /** FileDescriptorProto dependency */ + dependency?: (string[]|null); + + /** FileDescriptorProto publicDependency */ + publicDependency?: (number[]|null); + + /** FileDescriptorProto weakDependency */ + weakDependency?: (number[]|null); + + /** FileDescriptorProto messageType */ + messageType?: (google.protobuf.IDescriptorProto[]|null); + + /** FileDescriptorProto enumType */ + enumType?: (google.protobuf.IEnumDescriptorProto[]|null); + + /** FileDescriptorProto service */ + service?: (google.protobuf.IServiceDescriptorProto[]|null); + + /** FileDescriptorProto extension */ + extension?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** FileDescriptorProto options */ + options?: (google.protobuf.IFileOptions|null); + + /** FileDescriptorProto sourceCodeInfo */ + sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); + + /** FileDescriptorProto syntax */ + syntax?: (string|null); + } + + /** Represents a FileDescriptorProto. */ + class FileDescriptorProto implements IFileDescriptorProto { + + /** + * Constructs a new FileDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileDescriptorProto); + + /** FileDescriptorProto name. */ + public name: string; + + /** FileDescriptorProto package. */ + public package: string; + + /** FileDescriptorProto dependency. */ + public dependency: string[]; + + /** FileDescriptorProto publicDependency. */ + public publicDependency: number[]; + + /** FileDescriptorProto weakDependency. */ + public weakDependency: number[]; + + /** FileDescriptorProto messageType. */ + public messageType: google.protobuf.IDescriptorProto[]; + + /** FileDescriptorProto enumType. */ + public enumType: google.protobuf.IEnumDescriptorProto[]; + + /** FileDescriptorProto service. */ + public service: google.protobuf.IServiceDescriptorProto[]; + + /** FileDescriptorProto extension. */ + public extension: google.protobuf.IFieldDescriptorProto[]; + + /** FileDescriptorProto options. */ + public options?: (google.protobuf.IFileOptions|null); + + /** FileDescriptorProto sourceCodeInfo. */ + public sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); + + /** FileDescriptorProto syntax. */ + public syntax: string; + + /** + * Creates a new FileDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns FileDescriptorProto instance + */ + public static create(properties?: google.protobuf.IFileDescriptorProto): google.protobuf.FileDescriptorProto; + + /** + * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @param message FileDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @param message FileDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileDescriptorProto + * @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.protobuf.FileDescriptorProto; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileDescriptorProto + * @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.protobuf.FileDescriptorProto; + + /** + * Verifies a FileDescriptorProto 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 FileDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorProto; + + /** + * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. + * @param message FileDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DescriptorProto. */ + interface IDescriptorProto { + + /** DescriptorProto name */ + name?: (string|null); + + /** DescriptorProto field */ + field?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** DescriptorProto extension */ + extension?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** DescriptorProto nestedType */ + nestedType?: (google.protobuf.IDescriptorProto[]|null); + + /** DescriptorProto enumType */ + enumType?: (google.protobuf.IEnumDescriptorProto[]|null); + + /** DescriptorProto extensionRange */ + extensionRange?: (google.protobuf.DescriptorProto.IExtensionRange[]|null); + + /** DescriptorProto oneofDecl */ + oneofDecl?: (google.protobuf.IOneofDescriptorProto[]|null); + + /** DescriptorProto options */ + options?: (google.protobuf.IMessageOptions|null); + + /** DescriptorProto reservedRange */ + reservedRange?: (google.protobuf.DescriptorProto.IReservedRange[]|null); + + /** DescriptorProto reservedName */ + reservedName?: (string[]|null); + } + + /** Represents a DescriptorProto. */ + class DescriptorProto implements IDescriptorProto { + + /** + * Constructs a new DescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDescriptorProto); + + /** DescriptorProto name. */ + public name: string; + + /** DescriptorProto field. */ + public field: google.protobuf.IFieldDescriptorProto[]; + + /** DescriptorProto extension. */ + public extension: google.protobuf.IFieldDescriptorProto[]; + + /** DescriptorProto nestedType. */ + public nestedType: google.protobuf.IDescriptorProto[]; + + /** DescriptorProto enumType. */ + public enumType: google.protobuf.IEnumDescriptorProto[]; + + /** DescriptorProto extensionRange. */ + public extensionRange: google.protobuf.DescriptorProto.IExtensionRange[]; + + /** DescriptorProto oneofDecl. */ + public oneofDecl: google.protobuf.IOneofDescriptorProto[]; + + /** DescriptorProto options. */ + public options?: (google.protobuf.IMessageOptions|null); + + /** DescriptorProto reservedRange. */ + public reservedRange: google.protobuf.DescriptorProto.IReservedRange[]; + + /** DescriptorProto reservedName. */ + public reservedName: string[]; + + /** + * Creates a new DescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns DescriptorProto instance + */ + public static create(properties?: google.protobuf.IDescriptorProto): google.protobuf.DescriptorProto; + + /** + * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @param message DescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @param message DescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DescriptorProto + * @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.protobuf.DescriptorProto; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DescriptorProto + * @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.protobuf.DescriptorProto; + + /** + * Verifies a DescriptorProto 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 DescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto; + + /** + * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. + * @param message DescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace DescriptorProto { + + /** Properties of an ExtensionRange. */ + interface IExtensionRange { + + /** ExtensionRange start */ + start?: (number|null); + + /** ExtensionRange end */ + end?: (number|null); + + /** ExtensionRange options */ + options?: (google.protobuf.IExtensionRangeOptions|null); + } + + /** Represents an ExtensionRange. */ + class ExtensionRange implements IExtensionRange { + + /** + * Constructs a new ExtensionRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.DescriptorProto.IExtensionRange); + + /** ExtensionRange start. */ + public start: number; + + /** ExtensionRange end. */ + public end: number; + + /** ExtensionRange options. */ + public options?: (google.protobuf.IExtensionRangeOptions|null); + + /** + * Creates a new ExtensionRange instance using the specified properties. + * @param [properties] Properties to set + * @returns ExtensionRange instance + */ + public static create(properties?: google.protobuf.DescriptorProto.IExtensionRange): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @param message ExtensionRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @param message ExtensionRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExtensionRange + * @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.protobuf.DescriptorProto.ExtensionRange; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExtensionRange + * @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.protobuf.DescriptorProto.ExtensionRange; + + /** + * Verifies an ExtensionRange 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 an ExtensionRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExtensionRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. + * @param message ExtensionRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto.ExtensionRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExtensionRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ReservedRange. */ + interface IReservedRange { + + /** ReservedRange start */ + start?: (number|null); + + /** ReservedRange end */ + end?: (number|null); + } + + /** Represents a ReservedRange. */ + class ReservedRange implements IReservedRange { + + /** + * Constructs a new ReservedRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.DescriptorProto.IReservedRange); + + /** ReservedRange start. */ + public start: number; + + /** ReservedRange end. */ + public end: number; + + /** + * Creates a new ReservedRange instance using the specified properties. + * @param [properties] Properties to set + * @returns ReservedRange instance + */ + public static create(properties?: google.protobuf.DescriptorProto.IReservedRange): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @param message ReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @param message ReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReservedRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReservedRange + * @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.protobuf.DescriptorProto.ReservedRange; + + /** + * Decodes a ReservedRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReservedRange + * @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.protobuf.DescriptorProto.ReservedRange; + + /** + * Verifies a ReservedRange 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 ReservedRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReservedRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. + * @param message ReservedRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto.ReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReservedRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of an ExtensionRangeOptions. */ + interface IExtensionRangeOptions { + + /** ExtensionRangeOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an ExtensionRangeOptions. */ + class ExtensionRangeOptions implements IExtensionRangeOptions { + + /** + * Constructs a new ExtensionRangeOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IExtensionRangeOptions); + + /** ExtensionRangeOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new ExtensionRangeOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ExtensionRangeOptions instance + */ + public static create(properties?: google.protobuf.IExtensionRangeOptions): google.protobuf.ExtensionRangeOptions; + + /** + * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @param message ExtensionRangeOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @param message ExtensionRangeOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExtensionRangeOptions + * @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.protobuf.ExtensionRangeOptions; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExtensionRangeOptions + * @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.protobuf.ExtensionRangeOptions; + + /** + * Verifies an ExtensionRangeOptions 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 an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExtensionRangeOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ExtensionRangeOptions; + + /** + * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. + * @param message ExtensionRangeOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ExtensionRangeOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExtensionRangeOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a FieldDescriptorProto. */ + interface IFieldDescriptorProto { + + /** FieldDescriptorProto name */ + name?: (string|null); + + /** FieldDescriptorProto number */ + number?: (number|null); + + /** FieldDescriptorProto label */ + label?: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label|null); + + /** FieldDescriptorProto type */ + type?: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type|null); + + /** FieldDescriptorProto typeName */ + typeName?: (string|null); + + /** FieldDescriptorProto extendee */ + extendee?: (string|null); + + /** FieldDescriptorProto defaultValue */ + defaultValue?: (string|null); + + /** FieldDescriptorProto oneofIndex */ + oneofIndex?: (number|null); + + /** FieldDescriptorProto jsonName */ + jsonName?: (string|null); + + /** FieldDescriptorProto options */ + options?: (google.protobuf.IFieldOptions|null); + + /** FieldDescriptorProto proto3Optional */ + proto3Optional?: (boolean|null); + } + + /** Represents a FieldDescriptorProto. */ + class FieldDescriptorProto implements IFieldDescriptorProto { + + /** + * Constructs a new FieldDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldDescriptorProto); + + /** FieldDescriptorProto name. */ + public name: string; + + /** FieldDescriptorProto number. */ + public number: number; + + /** FieldDescriptorProto label. */ + public label: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label); + + /** FieldDescriptorProto type. */ + public type: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type); + + /** FieldDescriptorProto typeName. */ + public typeName: string; + + /** FieldDescriptorProto extendee. */ + public extendee: string; + + /** FieldDescriptorProto defaultValue. */ + public defaultValue: string; + + /** FieldDescriptorProto oneofIndex. */ + public oneofIndex: number; + + /** FieldDescriptorProto jsonName. */ + public jsonName: string; + + /** FieldDescriptorProto options. */ + public options?: (google.protobuf.IFieldOptions|null); + + /** FieldDescriptorProto proto3Optional. */ + public proto3Optional: boolean; + + /** + * Creates a new FieldDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldDescriptorProto instance + */ + public static create(properties?: google.protobuf.IFieldDescriptorProto): google.protobuf.FieldDescriptorProto; + + /** + * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @param message FieldDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @param message FieldDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldDescriptorProto + * @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.protobuf.FieldDescriptorProto; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldDescriptorProto + * @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.protobuf.FieldDescriptorProto; + + /** + * Verifies a FieldDescriptorProto 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 FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldDescriptorProto; + + /** + * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. + * @param message FieldDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace FieldDescriptorProto { + + /** Type enum. */ + enum Type { + TYPE_DOUBLE = 1, + TYPE_FLOAT = 2, + TYPE_INT64 = 3, + TYPE_UINT64 = 4, + TYPE_INT32 = 5, + TYPE_FIXED64 = 6, + TYPE_FIXED32 = 7, + TYPE_BOOL = 8, + TYPE_STRING = 9, + TYPE_GROUP = 10, + TYPE_MESSAGE = 11, + TYPE_BYTES = 12, + TYPE_UINT32 = 13, + TYPE_ENUM = 14, + TYPE_SFIXED32 = 15, + TYPE_SFIXED64 = 16, + TYPE_SINT32 = 17, + TYPE_SINT64 = 18 + } + + /** Label enum. */ + enum Label { + LABEL_OPTIONAL = 1, + LABEL_REQUIRED = 2, + LABEL_REPEATED = 3 + } + } + + /** Properties of an OneofDescriptorProto. */ + interface IOneofDescriptorProto { + + /** OneofDescriptorProto name */ + name?: (string|null); + + /** OneofDescriptorProto options */ + options?: (google.protobuf.IOneofOptions|null); + } + + /** Represents an OneofDescriptorProto. */ + class OneofDescriptorProto implements IOneofDescriptorProto { + + /** + * Constructs a new OneofDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IOneofDescriptorProto); + + /** OneofDescriptorProto name. */ + public name: string; + + /** OneofDescriptorProto options. */ + public options?: (google.protobuf.IOneofOptions|null); + + /** + * Creates a new OneofDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns OneofDescriptorProto instance + */ + public static create(properties?: google.protobuf.IOneofDescriptorProto): google.protobuf.OneofDescriptorProto; + + /** + * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @param message OneofDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @param message OneofDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OneofDescriptorProto + * @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.protobuf.OneofDescriptorProto; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OneofDescriptorProto + * @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.protobuf.OneofDescriptorProto; + + /** + * Verifies an OneofDescriptorProto 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 an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OneofDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.OneofDescriptorProto; + + /** + * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. + * @param message OneofDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.OneofDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OneofDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an EnumDescriptorProto. */ + interface IEnumDescriptorProto { + + /** EnumDescriptorProto name */ + name?: (string|null); + + /** EnumDescriptorProto value */ + value?: (google.protobuf.IEnumValueDescriptorProto[]|null); + + /** EnumDescriptorProto options */ + options?: (google.protobuf.IEnumOptions|null); + + /** EnumDescriptorProto reservedRange */ + reservedRange?: (google.protobuf.EnumDescriptorProto.IEnumReservedRange[]|null); + + /** EnumDescriptorProto reservedName */ + reservedName?: (string[]|null); + } + + /** Represents an EnumDescriptorProto. */ + class EnumDescriptorProto implements IEnumDescriptorProto { + + /** + * Constructs a new EnumDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumDescriptorProto); + + /** EnumDescriptorProto name. */ + public name: string; + + /** EnumDescriptorProto value. */ + public value: google.protobuf.IEnumValueDescriptorProto[]; + + /** EnumDescriptorProto options. */ + public options?: (google.protobuf.IEnumOptions|null); + + /** EnumDescriptorProto reservedRange. */ + public reservedRange: google.protobuf.EnumDescriptorProto.IEnumReservedRange[]; + + /** EnumDescriptorProto reservedName. */ + public reservedName: string[]; + + /** + * Creates a new EnumDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumDescriptorProto instance + */ + public static create(properties?: google.protobuf.IEnumDescriptorProto): google.protobuf.EnumDescriptorProto; + + /** + * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @param message EnumDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @param message EnumDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumDescriptorProto + * @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.protobuf.EnumDescriptorProto; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumDescriptorProto + * @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.protobuf.EnumDescriptorProto; + + /** + * Verifies an EnumDescriptorProto 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 an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto; + + /** + * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. + * @param message EnumDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace EnumDescriptorProto { + + /** Properties of an EnumReservedRange. */ + interface IEnumReservedRange { + + /** EnumReservedRange start */ + start?: (number|null); + + /** EnumReservedRange end */ + end?: (number|null); + } + + /** Represents an EnumReservedRange. */ + class EnumReservedRange implements IEnumReservedRange { + + /** + * Constructs a new EnumReservedRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange); + + /** EnumReservedRange start. */ + public start: number; + + /** EnumReservedRange end. */ + public end: number; + + /** + * Creates a new EnumReservedRange instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumReservedRange instance + */ + public static create(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @param message EnumReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @param message EnumReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumReservedRange + * @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.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumReservedRange + * @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.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Verifies an EnumReservedRange 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 an EnumReservedRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumReservedRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. + * @param message EnumReservedRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumDescriptorProto.EnumReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumReservedRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of an EnumValueDescriptorProto. */ + interface IEnumValueDescriptorProto { + + /** EnumValueDescriptorProto name */ + name?: (string|null); + + /** EnumValueDescriptorProto number */ + number?: (number|null); + + /** EnumValueDescriptorProto options */ + options?: (google.protobuf.IEnumValueOptions|null); + } + + /** Represents an EnumValueDescriptorProto. */ + class EnumValueDescriptorProto implements IEnumValueDescriptorProto { + + /** + * Constructs a new EnumValueDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumValueDescriptorProto); + + /** EnumValueDescriptorProto name. */ + public name: string; + + /** EnumValueDescriptorProto number. */ + public number: number; + + /** EnumValueDescriptorProto options. */ + public options?: (google.protobuf.IEnumValueOptions|null); + + /** + * Creates a new EnumValueDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumValueDescriptorProto instance + */ + public static create(properties?: google.protobuf.IEnumValueDescriptorProto): google.protobuf.EnumValueDescriptorProto; + + /** + * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @param message EnumValueDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @param message EnumValueDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumValueDescriptorProto + * @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.protobuf.EnumValueDescriptorProto; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumValueDescriptorProto + * @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.protobuf.EnumValueDescriptorProto; + + /** + * Verifies an EnumValueDescriptorProto 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 an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumValueDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueDescriptorProto; + + /** + * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. + * @param message EnumValueDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumValueDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumValueDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ServiceDescriptorProto. */ + interface IServiceDescriptorProto { + + /** ServiceDescriptorProto name */ + name?: (string|null); + + /** ServiceDescriptorProto method */ + method?: (google.protobuf.IMethodDescriptorProto[]|null); + + /** ServiceDescriptorProto options */ + options?: (google.protobuf.IServiceOptions|null); + } + + /** Represents a ServiceDescriptorProto. */ + class ServiceDescriptorProto implements IServiceDescriptorProto { + + /** + * Constructs a new ServiceDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceDescriptorProto); + + /** ServiceDescriptorProto name. */ + public name: string; + + /** ServiceDescriptorProto method. */ + public method: google.protobuf.IMethodDescriptorProto[]; + + /** ServiceDescriptorProto options. */ + public options?: (google.protobuf.IServiceOptions|null); + + /** + * Creates a new ServiceDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceDescriptorProto instance + */ + public static create(properties?: google.protobuf.IServiceDescriptorProto): google.protobuf.ServiceDescriptorProto; + + /** + * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @param message ServiceDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @param message ServiceDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceDescriptorProto + * @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.protobuf.ServiceDescriptorProto; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceDescriptorProto + * @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.protobuf.ServiceDescriptorProto; + + /** + * Verifies a ServiceDescriptorProto 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 ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceDescriptorProto; + + /** + * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. + * @param message ServiceDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ServiceDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a MethodDescriptorProto. */ + interface IMethodDescriptorProto { + + /** MethodDescriptorProto name */ + name?: (string|null); + + /** MethodDescriptorProto inputType */ + inputType?: (string|null); + + /** MethodDescriptorProto outputType */ + outputType?: (string|null); + + /** MethodDescriptorProto options */ + options?: (google.protobuf.IMethodOptions|null); + + /** MethodDescriptorProto clientStreaming */ + clientStreaming?: (boolean|null); + + /** MethodDescriptorProto serverStreaming */ + serverStreaming?: (boolean|null); + } + + /** Represents a MethodDescriptorProto. */ + class MethodDescriptorProto implements IMethodDescriptorProto { + + /** + * Constructs a new MethodDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMethodDescriptorProto); + + /** MethodDescriptorProto name. */ + public name: string; + + /** MethodDescriptorProto inputType. */ + public inputType: string; + + /** MethodDescriptorProto outputType. */ + public outputType: string; + + /** MethodDescriptorProto options. */ + public options?: (google.protobuf.IMethodOptions|null); + + /** MethodDescriptorProto clientStreaming. */ + public clientStreaming: boolean; + + /** MethodDescriptorProto serverStreaming. */ + public serverStreaming: boolean; + + /** + * Creates a new MethodDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodDescriptorProto instance + */ + public static create(properties?: google.protobuf.IMethodDescriptorProto): google.protobuf.MethodDescriptorProto; + + /** + * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @param message MethodDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @param message MethodDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodDescriptorProto + * @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.protobuf.MethodDescriptorProto; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodDescriptorProto + * @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.protobuf.MethodDescriptorProto; + + /** + * Verifies a MethodDescriptorProto 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 MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MethodDescriptorProto; + + /** + * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. + * @param message MethodDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MethodDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a FileOptions. */ + interface IFileOptions { + + /** FileOptions javaPackage */ + javaPackage?: (string|null); + + /** FileOptions javaOuterClassname */ + javaOuterClassname?: (string|null); + + /** FileOptions javaMultipleFiles */ + javaMultipleFiles?: (boolean|null); + + /** FileOptions javaGenerateEqualsAndHash */ + javaGenerateEqualsAndHash?: (boolean|null); + + /** FileOptions javaStringCheckUtf8 */ + javaStringCheckUtf8?: (boolean|null); + + /** FileOptions optimizeFor */ + optimizeFor?: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode|null); + + /** FileOptions goPackage */ + goPackage?: (string|null); + + /** FileOptions ccGenericServices */ + ccGenericServices?: (boolean|null); + + /** FileOptions javaGenericServices */ + javaGenericServices?: (boolean|null); + + /** FileOptions pyGenericServices */ + pyGenericServices?: (boolean|null); + + /** FileOptions phpGenericServices */ + phpGenericServices?: (boolean|null); + + /** FileOptions deprecated */ + deprecated?: (boolean|null); + + /** FileOptions ccEnableArenas */ + ccEnableArenas?: (boolean|null); + + /** FileOptions objcClassPrefix */ + objcClassPrefix?: (string|null); + + /** FileOptions csharpNamespace */ + csharpNamespace?: (string|null); + + /** FileOptions swiftPrefix */ + swiftPrefix?: (string|null); + + /** FileOptions phpClassPrefix */ + phpClassPrefix?: (string|null); + + /** FileOptions phpNamespace */ + phpNamespace?: (string|null); + + /** FileOptions phpMetadataNamespace */ + phpMetadataNamespace?: (string|null); + + /** FileOptions rubyPackage */ + rubyPackage?: (string|null); + + /** FileOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** FileOptions .google.api.resourceDefinition */ + ".google.api.resourceDefinition"?: (google.api.IResourceDescriptor[]|null); + } + + /** Represents a FileOptions. */ + class FileOptions implements IFileOptions { + + /** + * Constructs a new FileOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileOptions); + + /** FileOptions javaPackage. */ + public javaPackage: string; + + /** FileOptions javaOuterClassname. */ + public javaOuterClassname: string; + + /** FileOptions javaMultipleFiles. */ + public javaMultipleFiles: boolean; + + /** FileOptions javaGenerateEqualsAndHash. */ + public javaGenerateEqualsAndHash: boolean; + + /** FileOptions javaStringCheckUtf8. */ + public javaStringCheckUtf8: boolean; + + /** FileOptions optimizeFor. */ + public optimizeFor: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode); + + /** FileOptions goPackage. */ + public goPackage: string; + + /** FileOptions ccGenericServices. */ + public ccGenericServices: boolean; + + /** FileOptions javaGenericServices. */ + public javaGenericServices: boolean; + + /** FileOptions pyGenericServices. */ + public pyGenericServices: boolean; + + /** FileOptions phpGenericServices. */ + public phpGenericServices: boolean; + + /** FileOptions deprecated. */ + public deprecated: boolean; + + /** FileOptions ccEnableArenas. */ + public ccEnableArenas: boolean; + + /** FileOptions objcClassPrefix. */ + public objcClassPrefix: string; + + /** FileOptions csharpNamespace. */ + public csharpNamespace: string; + + /** FileOptions swiftPrefix. */ + public swiftPrefix: string; + + /** FileOptions phpClassPrefix. */ + public phpClassPrefix: string; + + /** FileOptions phpNamespace. */ + public phpNamespace: string; + + /** FileOptions phpMetadataNamespace. */ + public phpMetadataNamespace: string; + + /** FileOptions rubyPackage. */ + public rubyPackage: string; + + /** FileOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new FileOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns FileOptions instance + */ + public static create(properties?: google.protobuf.IFileOptions): google.protobuf.FileOptions; + + /** + * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @param message FileOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @param message FileOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileOptions + * @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.protobuf.FileOptions; + + /** + * Decodes a FileOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileOptions + * @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.protobuf.FileOptions; + + /** + * Verifies a FileOptions 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 FileOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileOptions; + + /** + * Creates a plain object from a FileOptions message. Also converts values to other types if specified. + * @param message FileOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace FileOptions { + + /** OptimizeMode enum. */ + enum OptimizeMode { + SPEED = 1, + CODE_SIZE = 2, + LITE_RUNTIME = 3 + } + } + + /** Properties of a MessageOptions. */ + interface IMessageOptions { + + /** MessageOptions messageSetWireFormat */ + messageSetWireFormat?: (boolean|null); + + /** MessageOptions noStandardDescriptorAccessor */ + noStandardDescriptorAccessor?: (boolean|null); + + /** MessageOptions deprecated */ + deprecated?: (boolean|null); + + /** MessageOptions mapEntry */ + mapEntry?: (boolean|null); + + /** MessageOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** MessageOptions .google.api.resource */ + ".google.api.resource"?: (google.api.IResourceDescriptor|null); + } + + /** Represents a MessageOptions. */ + class MessageOptions implements IMessageOptions { + + /** + * Constructs a new MessageOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMessageOptions); + + /** MessageOptions messageSetWireFormat. */ + public messageSetWireFormat: boolean; + + /** MessageOptions noStandardDescriptorAccessor. */ + public noStandardDescriptorAccessor: boolean; + + /** MessageOptions deprecated. */ + public deprecated: boolean; + + /** MessageOptions mapEntry. */ + public mapEntry: boolean; + + /** MessageOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new MessageOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns MessageOptions instance + */ + public static create(properties?: google.protobuf.IMessageOptions): google.protobuf.MessageOptions; + + /** + * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @param message MessageOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @param message MessageOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MessageOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MessageOptions + * @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.protobuf.MessageOptions; + + /** + * Decodes a MessageOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MessageOptions + * @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.protobuf.MessageOptions; + + /** + * Verifies a MessageOptions 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 MessageOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MessageOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MessageOptions; + + /** + * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. + * @param message MessageOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MessageOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MessageOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a FieldOptions. */ + interface IFieldOptions { + + /** FieldOptions ctype */ + ctype?: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType|null); + + /** FieldOptions packed */ + packed?: (boolean|null); + + /** FieldOptions jstype */ + jstype?: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType|null); + + /** FieldOptions lazy */ + lazy?: (boolean|null); + + /** FieldOptions deprecated */ + deprecated?: (boolean|null); + + /** FieldOptions weak */ + weak?: (boolean|null); + + /** FieldOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** FieldOptions .google.api.fieldBehavior */ + ".google.api.fieldBehavior"?: (google.api.FieldBehavior[]|null); + + /** FieldOptions .google.api.resourceReference */ + ".google.api.resourceReference"?: (google.api.IResourceReference|null); + } + + /** Represents a FieldOptions. */ + class FieldOptions implements IFieldOptions { + + /** + * Constructs a new FieldOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldOptions); + + /** FieldOptions ctype. */ + public ctype: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType); + + /** FieldOptions packed. */ + public packed: boolean; + + /** FieldOptions jstype. */ + public jstype: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType); + + /** FieldOptions lazy. */ + public lazy: boolean; + + /** FieldOptions deprecated. */ + public deprecated: boolean; + + /** FieldOptions weak. */ + public weak: boolean; + + /** FieldOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new FieldOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldOptions instance + */ + public static create(properties?: google.protobuf.IFieldOptions): google.protobuf.FieldOptions; + + /** + * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @param message FieldOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @param message FieldOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldOptions + * @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.protobuf.FieldOptions; + + /** + * Decodes a FieldOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldOptions + * @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.protobuf.FieldOptions; + + /** + * Verifies a FieldOptions 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 FieldOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions; + + /** + * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. + * @param message FieldOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace FieldOptions { + + /** CType enum. */ + enum CType { + STRING = 0, + CORD = 1, + STRING_PIECE = 2 + } + + /** JSType enum. */ + enum JSType { + JS_NORMAL = 0, + JS_STRING = 1, + JS_NUMBER = 2 + } + } + + /** Properties of an OneofOptions. */ + interface IOneofOptions { + + /** OneofOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an OneofOptions. */ + class OneofOptions implements IOneofOptions { + + /** + * Constructs a new OneofOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IOneofOptions); + + /** OneofOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new OneofOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns OneofOptions instance + */ + public static create(properties?: google.protobuf.IOneofOptions): google.protobuf.OneofOptions; + + /** + * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @param message OneofOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @param message OneofOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OneofOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OneofOptions + * @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.protobuf.OneofOptions; + + /** + * Decodes an OneofOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OneofOptions + * @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.protobuf.OneofOptions; + + /** + * Verifies an OneofOptions 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 an OneofOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OneofOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.OneofOptions; + + /** + * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. + * @param message OneofOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.OneofOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OneofOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an EnumOptions. */ + interface IEnumOptions { + + /** EnumOptions allowAlias */ + allowAlias?: (boolean|null); + + /** EnumOptions deprecated */ + deprecated?: (boolean|null); + + /** EnumOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an EnumOptions. */ + class EnumOptions implements IEnumOptions { + + /** + * Constructs a new EnumOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumOptions); + + /** EnumOptions allowAlias. */ + public allowAlias: boolean; + + /** EnumOptions deprecated. */ + public deprecated: boolean; + + /** EnumOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new EnumOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumOptions instance + */ + public static create(properties?: google.protobuf.IEnumOptions): google.protobuf.EnumOptions; + + /** + * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @param message EnumOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @param message EnumOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumOptions + * @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.protobuf.EnumOptions; + + /** + * Decodes an EnumOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumOptions + * @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.protobuf.EnumOptions; + + /** + * Verifies an EnumOptions 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 an EnumOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumOptions; + + /** + * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. + * @param message EnumOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an EnumValueOptions. */ + interface IEnumValueOptions { + + /** EnumValueOptions deprecated */ + deprecated?: (boolean|null); + + /** EnumValueOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an EnumValueOptions. */ + class EnumValueOptions implements IEnumValueOptions { + + /** + * Constructs a new EnumValueOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumValueOptions); + + /** EnumValueOptions deprecated. */ + public deprecated: boolean; + + /** EnumValueOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new EnumValueOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumValueOptions instance + */ + public static create(properties?: google.protobuf.IEnumValueOptions): google.protobuf.EnumValueOptions; + + /** + * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @param message EnumValueOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @param message EnumValueOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumValueOptions + * @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.protobuf.EnumValueOptions; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumValueOptions + * @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.protobuf.EnumValueOptions; + + /** + * Verifies an EnumValueOptions 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 an EnumValueOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumValueOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueOptions; + + /** + * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. + * @param message EnumValueOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumValueOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumValueOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ServiceOptions. */ + interface IServiceOptions { + + /** ServiceOptions deprecated */ + deprecated?: (boolean|null); + + /** ServiceOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** ServiceOptions .google.api.defaultHost */ + ".google.api.defaultHost"?: (string|null); + + /** ServiceOptions .google.api.oauthScopes */ + ".google.api.oauthScopes"?: (string|null); + } + + /** Represents a ServiceOptions. */ + class ServiceOptions implements IServiceOptions { + + /** + * Constructs a new ServiceOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceOptions); + + /** ServiceOptions deprecated. */ + public deprecated: boolean; + + /** ServiceOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new ServiceOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceOptions instance + */ + public static create(properties?: google.protobuf.IServiceOptions): google.protobuf.ServiceOptions; + + /** + * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @param message ServiceOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @param message ServiceOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceOptions + * @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.protobuf.ServiceOptions; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceOptions + * @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.protobuf.ServiceOptions; + + /** + * Verifies a ServiceOptions 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 ServiceOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceOptions; + + /** + * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. + * @param message ServiceOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ServiceOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a MethodOptions. */ + interface IMethodOptions { + + /** MethodOptions deprecated */ + deprecated?: (boolean|null); + + /** MethodOptions idempotencyLevel */ + idempotencyLevel?: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel|null); + + /** 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); + } + + /** Represents a MethodOptions. */ + class MethodOptions implements IMethodOptions { + + /** + * Constructs a new MethodOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMethodOptions); + + /** MethodOptions deprecated. */ + public deprecated: boolean; + + /** MethodOptions idempotencyLevel. */ + public idempotencyLevel: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel); + + /** MethodOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new MethodOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodOptions instance + */ + public static create(properties?: google.protobuf.IMethodOptions): google.protobuf.MethodOptions; + + /** + * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @param message MethodOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @param message MethodOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodOptions + * @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.protobuf.MethodOptions; + + /** + * Decodes a MethodOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodOptions + * @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.protobuf.MethodOptions; + + /** + * Verifies a MethodOptions 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 MethodOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MethodOptions; + + /** + * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. + * @param message MethodOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MethodOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace MethodOptions { + + /** IdempotencyLevel enum. */ + enum IdempotencyLevel { + IDEMPOTENCY_UNKNOWN = 0, + NO_SIDE_EFFECTS = 1, + IDEMPOTENT = 2 + } + } + + /** Properties of an UninterpretedOption. */ + interface IUninterpretedOption { + + /** UninterpretedOption name */ + name?: (google.protobuf.UninterpretedOption.INamePart[]|null); + + /** UninterpretedOption identifierValue */ + identifierValue?: (string|null); + + /** UninterpretedOption positiveIntValue */ + positiveIntValue?: (number|Long|string|null); + + /** UninterpretedOption negativeIntValue */ + negativeIntValue?: (number|Long|string|null); + + /** UninterpretedOption doubleValue */ + doubleValue?: (number|null); + + /** UninterpretedOption stringValue */ + stringValue?: (Uint8Array|string|null); + + /** UninterpretedOption aggregateValue */ + aggregateValue?: (string|null); + } + + /** Represents an UninterpretedOption. */ + class UninterpretedOption implements IUninterpretedOption { + + /** + * Constructs a new UninterpretedOption. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IUninterpretedOption); + + /** UninterpretedOption name. */ + public name: google.protobuf.UninterpretedOption.INamePart[]; + + /** UninterpretedOption identifierValue. */ + public identifierValue: string; + + /** UninterpretedOption positiveIntValue. */ + public positiveIntValue: (number|Long|string); + + /** UninterpretedOption negativeIntValue. */ + public negativeIntValue: (number|Long|string); + + /** UninterpretedOption doubleValue. */ + public doubleValue: number; + + /** UninterpretedOption stringValue. */ + public stringValue: (Uint8Array|string); + + /** UninterpretedOption aggregateValue. */ + public aggregateValue: string; + + /** + * Creates a new UninterpretedOption instance using the specified properties. + * @param [properties] Properties to set + * @returns UninterpretedOption instance + */ + public static create(properties?: google.protobuf.IUninterpretedOption): google.protobuf.UninterpretedOption; + + /** + * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @param message UninterpretedOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @param message UninterpretedOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UninterpretedOption + * @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.protobuf.UninterpretedOption; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UninterpretedOption + * @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.protobuf.UninterpretedOption; + + /** + * Verifies an UninterpretedOption 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 an UninterpretedOption message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UninterpretedOption + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption; + + /** + * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. + * @param message UninterpretedOption + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UninterpretedOption, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UninterpretedOption to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace UninterpretedOption { + + /** Properties of a NamePart. */ + interface INamePart { + + /** NamePart namePart */ + namePart: string; + + /** NamePart isExtension */ + isExtension: boolean; + } + + /** Represents a NamePart. */ + class NamePart implements INamePart { + + /** + * Constructs a new NamePart. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.UninterpretedOption.INamePart); + + /** NamePart namePart. */ + public namePart: string; + + /** NamePart isExtension. */ + public isExtension: boolean; + + /** + * Creates a new NamePart instance using the specified properties. + * @param [properties] Properties to set + * @returns NamePart instance + */ + public static create(properties?: google.protobuf.UninterpretedOption.INamePart): google.protobuf.UninterpretedOption.NamePart; + + /** + * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @param message NamePart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @param message NamePart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NamePart message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NamePart + * @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.protobuf.UninterpretedOption.NamePart; + + /** + * Decodes a NamePart message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NamePart + * @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.protobuf.UninterpretedOption.NamePart; + + /** + * Verifies a NamePart 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 NamePart message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NamePart + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption.NamePart; + + /** + * Creates a plain object from a NamePart message. Also converts values to other types if specified. + * @param message NamePart + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UninterpretedOption.NamePart, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NamePart to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of a SourceCodeInfo. */ + interface ISourceCodeInfo { + + /** SourceCodeInfo location */ + location?: (google.protobuf.SourceCodeInfo.ILocation[]|null); + } + + /** Represents a SourceCodeInfo. */ + class SourceCodeInfo implements ISourceCodeInfo { + + /** + * Constructs a new SourceCodeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ISourceCodeInfo); + + /** SourceCodeInfo location. */ + public location: google.protobuf.SourceCodeInfo.ILocation[]; + + /** + * Creates a new SourceCodeInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns SourceCodeInfo instance + */ + public static create(properties?: google.protobuf.ISourceCodeInfo): google.protobuf.SourceCodeInfo; + + /** + * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @param message SourceCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @param message SourceCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SourceCodeInfo + * @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.protobuf.SourceCodeInfo; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SourceCodeInfo + * @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.protobuf.SourceCodeInfo; + + /** + * Verifies a SourceCodeInfo 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 SourceCodeInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SourceCodeInfo + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo; + + /** + * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. + * @param message SourceCodeInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.SourceCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SourceCodeInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace SourceCodeInfo { + + /** Properties of a Location. */ + interface ILocation { + + /** Location path */ + path?: (number[]|null); + + /** Location span */ + span?: (number[]|null); + + /** Location leadingComments */ + leadingComments?: (string|null); + + /** Location trailingComments */ + trailingComments?: (string|null); + + /** Location leadingDetachedComments */ + leadingDetachedComments?: (string[]|null); + } + + /** Represents a Location. */ + class Location implements ILocation { + + /** + * Constructs a new Location. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.SourceCodeInfo.ILocation); + + /** Location path. */ + public path: number[]; + + /** Location span. */ + public span: number[]; + + /** Location leadingComments. */ + public leadingComments: string; + + /** Location trailingComments. */ + public trailingComments: string; + + /** Location leadingDetachedComments. */ + public leadingDetachedComments: string[]; + + /** + * Creates a new Location instance using the specified properties. + * @param [properties] Properties to set + * @returns Location instance + */ + public static create(properties?: google.protobuf.SourceCodeInfo.ILocation): google.protobuf.SourceCodeInfo.Location; + + /** + * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Location message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Location + * @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.protobuf.SourceCodeInfo.Location; + + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Location + * @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.protobuf.SourceCodeInfo.Location; + + /** + * Verifies a Location 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 Location message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Location + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo.Location; + + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @param message Location + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.SourceCodeInfo.Location, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Location to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of a GeneratedCodeInfo. */ + interface IGeneratedCodeInfo { + + /** GeneratedCodeInfo annotation */ + annotation?: (google.protobuf.GeneratedCodeInfo.IAnnotation[]|null); + } + + /** Represents a GeneratedCodeInfo. */ + class GeneratedCodeInfo implements IGeneratedCodeInfo { + + /** + * Constructs a new GeneratedCodeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IGeneratedCodeInfo); + + /** GeneratedCodeInfo annotation. */ + public annotation: google.protobuf.GeneratedCodeInfo.IAnnotation[]; + + /** + * Creates a new GeneratedCodeInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns GeneratedCodeInfo instance + */ + public static create(properties?: google.protobuf.IGeneratedCodeInfo): google.protobuf.GeneratedCodeInfo; + + /** + * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @param message GeneratedCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @param message GeneratedCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GeneratedCodeInfo + * @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.protobuf.GeneratedCodeInfo; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GeneratedCodeInfo + * @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.protobuf.GeneratedCodeInfo; + + /** + * Verifies a GeneratedCodeInfo 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 GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GeneratedCodeInfo + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo; + + /** + * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. + * @param message GeneratedCodeInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.GeneratedCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GeneratedCodeInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace GeneratedCodeInfo { + + /** Properties of an Annotation. */ + interface IAnnotation { + + /** Annotation path */ + path?: (number[]|null); + + /** Annotation sourceFile */ + sourceFile?: (string|null); + + /** Annotation begin */ + begin?: (number|null); + + /** Annotation end */ + end?: (number|null); + } + + /** Represents an Annotation. */ + class Annotation implements IAnnotation { + + /** + * Constructs a new Annotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation); + + /** Annotation path. */ + public path: number[]; + + /** Annotation sourceFile. */ + public sourceFile: string; + + /** Annotation begin. */ + public begin: number; + + /** Annotation end. */ + public end: number; + + /** + * Creates a new Annotation instance using the specified properties. + * @param [properties] Properties to set + * @returns Annotation instance + */ + public static create(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @param message Annotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @param message Annotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Annotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Annotation + * @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.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Decodes an Annotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Annotation + * @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.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Verifies an Annotation 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 an Annotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Annotation + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Creates a plain object from an Annotation message. Also converts values to other types if specified. + * @param message Annotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.GeneratedCodeInfo.Annotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Annotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of a Timestamp. */ + interface ITimestamp { + + /** Timestamp seconds */ + seconds?: (number|Long|string|null); + + /** Timestamp nanos */ + nanos?: (number|null); + } + + /** Represents a Timestamp. */ + class Timestamp implements ITimestamp { + + /** + * Constructs a new Timestamp. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ITimestamp); + + /** Timestamp seconds. */ + public seconds: (number|Long|string); + + /** Timestamp nanos. */ + public nanos: number; + + /** + * Creates a new Timestamp instance using the specified properties. + * @param [properties] Properties to set + * @returns Timestamp instance + */ + public static create(properties?: google.protobuf.ITimestamp): google.protobuf.Timestamp; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @param message Timestamp message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @param message Timestamp message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Timestamp + * @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.protobuf.Timestamp; + + /** + * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Timestamp + * @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.protobuf.Timestamp; + + /** + * Verifies a Timestamp 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 Timestamp message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Timestamp + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Timestamp; + + /** + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * @param message Timestamp + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Timestamp, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Timestamp to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Duration. */ + interface IDuration { + + /** Duration seconds */ + seconds?: (number|Long|string|null); + + /** Duration nanos */ + nanos?: (number|null); + } + + /** Represents a Duration. */ + class Duration implements IDuration { + + /** + * Constructs a new Duration. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDuration); + + /** Duration seconds. */ + public seconds: (number|Long|string); + + /** Duration nanos. */ + public nanos: number; + + /** + * Creates a new Duration instance using the specified properties. + * @param [properties] Properties to set + * @returns Duration instance + */ + public static create(properties?: google.protobuf.IDuration): google.protobuf.Duration; + + /** + * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @param message Duration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @param message Duration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Duration + * @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.protobuf.Duration; + + /** + * Decodes a Duration message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Duration + * @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.protobuf.Duration; + + /** + * Verifies a Duration 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 Duration message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Duration + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Duration; + + /** + * Creates a plain object from a Duration message. Also converts values to other types if specified. + * @param message Duration + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Duration, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Duration to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an Empty. */ + interface IEmpty { + } + + /** Represents an Empty. */ + class Empty implements IEmpty { + + /** + * Constructs a new Empty. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEmpty); + + /** + * Creates a new Empty instance using the specified properties. + * @param [properties] Properties to set + * @returns Empty instance + */ + public static create(properties?: google.protobuf.IEmpty): google.protobuf.Empty; + + /** + * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @param message Empty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @param message Empty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Empty message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Empty + * @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.protobuf.Empty; + + /** + * Decodes an Empty message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Empty + * @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.protobuf.Empty; + + /** + * Verifies an Empty 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 an Empty message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Empty + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Empty; + + /** + * Creates a plain object from an Empty message. Also converts values to other types if specified. + * @param message Empty + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Empty, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Empty to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a FieldMask. */ + interface IFieldMask { + + /** FieldMask paths */ + paths?: (string[]|null); + } + + /** Represents a FieldMask. */ + class FieldMask implements IFieldMask { + + /** + * Constructs a new FieldMask. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldMask); + + /** FieldMask paths. */ + public paths: string[]; + + /** + * Creates a new FieldMask instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldMask instance + */ + public static create(properties?: google.protobuf.IFieldMask): google.protobuf.FieldMask; + + /** + * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @param message FieldMask message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @param message FieldMask message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldMask message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldMask + * @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.protobuf.FieldMask; + + /** + * Decodes a FieldMask message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldMask + * @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.protobuf.FieldMask; + + /** + * Verifies a FieldMask 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 FieldMask message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldMask + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldMask; + + /** + * Creates a plain object from a FieldMask message. Also converts values to other types if specified. + * @param message FieldMask + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldMask, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldMask to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an Any. */ + interface IAny { + + /** Any type_url */ + type_url?: (string|null); + + /** Any value */ + value?: (Uint8Array|string|null); + } + + /** Represents an Any. */ + class Any implements IAny { + + /** + * Constructs a new Any. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IAny); + + /** Any type_url. */ + public type_url: string; + + /** Any value. */ + public value: (Uint8Array|string); + + /** + * Creates a new Any instance using the specified properties. + * @param [properties] Properties to set + * @returns Any instance + */ + public static create(properties?: google.protobuf.IAny): google.protobuf.Any; + + /** + * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @param message Any message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @param message Any message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Any message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Any + * @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.protobuf.Any; + + /** + * Decodes an Any message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Any + * @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.protobuf.Any; + + /** + * Verifies an Any 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 an Any message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Any + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Any; + + /** + * Creates a plain object from an Any message. Also converts values to other types if specified. + * @param message Any + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Any, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Any to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Namespace rpc. */ + namespace rpc { + + /** Properties of a Status. */ + interface IStatus { + + /** Status code */ + code?: (number|null); + + /** Status message */ + message?: (string|null); + + /** Status details */ + details?: (google.protobuf.IAny[]|null); + } + + /** Represents a Status. */ + class Status implements IStatus { + + /** + * Constructs a new Status. + * @param [properties] Properties to set + */ + constructor(properties?: google.rpc.IStatus); + + /** Status code. */ + public code: number; + + /** Status message. */ + public message: string; + + /** Status details. */ + public details: google.protobuf.IAny[]; + + /** + * Creates a new Status instance using the specified properties. + * @param [properties] Properties to set + * @returns Status instance + */ + public static create(properties?: google.rpc.IStatus): google.rpc.Status; + + /** + * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @param message Status message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @param message Status message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Status message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Status + * @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.rpc.Status; + + /** + * Decodes a Status message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Status + * @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.rpc.Status; + + /** + * Verifies a Status 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 Status message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Status + */ + public static fromObject(object: { [k: string]: any }): google.rpc.Status; + + /** + * Creates a plain object from a Status message. Also converts values to other types if specified. + * @param message Status + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.rpc.Status, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Status to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Namespace type. */ + namespace type { + + /** Properties of a Date. */ + interface IDate { + + /** Date year */ + year?: (number|null); + + /** Date month */ + month?: (number|null); + + /** Date day */ + day?: (number|null); + } + + /** Represents a Date. */ + class Date implements IDate { + + /** + * Constructs a new Date. + * @param [properties] Properties to set + */ + constructor(properties?: google.type.IDate); + + /** Date year. */ + public year: number; + + /** Date month. */ + public month: number; + + /** Date day. */ + public day: number; + + /** + * Creates a new Date instance using the specified properties. + * @param [properties] Properties to set + * @returns Date instance + */ + public static create(properties?: google.type.IDate): google.type.Date; + + /** + * Encodes the specified Date message. Does not implicitly {@link google.type.Date.verify|verify} messages. + * @param message Date message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.type.IDate, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Date message, length delimited. Does not implicitly {@link google.type.Date.verify|verify} messages. + * @param message Date message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.type.IDate, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Date message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Date + * @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.type.Date; + + /** + * Decodes a Date message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Date + * @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.type.Date; + + /** + * Verifies a Date 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 Date message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Date + */ + public static fromObject(object: { [k: string]: any }): google.type.Date; + + /** + * Creates a plain object from a Date message. Also converts values to other types if specified. + * @param message Date + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.type.Date, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Date to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** DayOfWeek enum. */ + enum DayOfWeek { + DAY_OF_WEEK_UNSPECIFIED = 0, + MONDAY = 1, + TUESDAY = 2, + WEDNESDAY = 3, + THURSDAY = 4, + FRIDAY = 5, + SATURDAY = 6, + SUNDAY = 7 + } + + /** Properties of a TimeOfDay. */ + interface ITimeOfDay { + + /** TimeOfDay hours */ + hours?: (number|null); + + /** TimeOfDay minutes */ + minutes?: (number|null); + + /** TimeOfDay seconds */ + seconds?: (number|null); + + /** TimeOfDay nanos */ + nanos?: (number|null); + } + + /** Represents a TimeOfDay. */ + class TimeOfDay implements ITimeOfDay { + + /** + * Constructs a new TimeOfDay. + * @param [properties] Properties to set + */ + constructor(properties?: google.type.ITimeOfDay); + + /** TimeOfDay hours. */ + public hours: number; + + /** TimeOfDay minutes. */ + public minutes: number; + + /** TimeOfDay seconds. */ + public seconds: number; + + /** TimeOfDay nanos. */ + public nanos: number; + + /** + * Creates a new TimeOfDay instance using the specified properties. + * @param [properties] Properties to set + * @returns TimeOfDay instance + */ + public static create(properties?: google.type.ITimeOfDay): google.type.TimeOfDay; + + /** + * Encodes the specified TimeOfDay message. Does not implicitly {@link google.type.TimeOfDay.verify|verify} messages. + * @param message TimeOfDay message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.type.ITimeOfDay, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TimeOfDay message, length delimited. Does not implicitly {@link google.type.TimeOfDay.verify|verify} messages. + * @param message TimeOfDay message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.type.ITimeOfDay, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TimeOfDay message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TimeOfDay + * @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.type.TimeOfDay; + + /** + * Decodes a TimeOfDay message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TimeOfDay + * @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.type.TimeOfDay; + + /** + * Verifies a TimeOfDay 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 TimeOfDay message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TimeOfDay + */ + public static fromObject(object: { [k: string]: any }): google.type.TimeOfDay; + + /** + * Creates a plain object from a TimeOfDay message. Also converts values to other types if specified. + * @param message TimeOfDay + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.type.TimeOfDay, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TimeOfDay to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } +} diff --git a/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/protos/protos.js b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/protos/protos.js new file mode 100644 index 000000000..badedc55a --- /dev/null +++ b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/protos/protos.js @@ -0,0 +1,65776 @@ +// 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 +// +// 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. + +/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ +(function(global, factory) { /* global define, require, module */ + + /* AMD */ if (typeof define === 'function' && define.amd) + define(["protobufjs/minimal"], factory); + + /* CommonJS */ else if (typeof require === 'function' && typeof module === 'object' && module && module.exports) + module.exports = factory(require("google-gax").protobufMinimal); + +})(this, function($protobuf) { + "use strict"; + + // Common aliases + var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; + + // Exported root namespace + var $root = $protobuf.roots._google_cloud_dlp_protos || ($protobuf.roots._google_cloud_dlp_protos = {}); + + $root.google = (function() { + + /** + * Namespace google. + * @exports google + * @namespace + */ + var google = {}; + + google.privacy = (function() { + + /** + * Namespace privacy. + * @memberof google + * @namespace + */ + var privacy = {}; + + privacy.dlp = (function() { + + /** + * Namespace dlp. + * @memberof google.privacy + * @namespace + */ + var dlp = {}; + + dlp.v2 = (function() { + + /** + * Namespace v2. + * @memberof google.privacy.dlp + * @namespace + */ + var v2 = {}; + + v2.DlpService = (function() { + + /** + * Constructs a new DlpService service. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents a DlpService + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function DlpService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (DlpService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = DlpService; + + /** + * Creates new DlpService service using the specified rpc implementation. + * @function create + * @memberof google.privacy.dlp.v2.DlpService + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {DlpService} RPC service. Useful where requests and/or responses are streamed. + */ + DlpService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.privacy.dlp.v2.DlpService#inspectContent}. + * @memberof google.privacy.dlp.v2.DlpService + * @typedef InspectContentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.privacy.dlp.v2.InspectContentResponse} [response] InspectContentResponse + */ + + /** + * Calls InspectContent. + * @function inspectContent + * @memberof google.privacy.dlp.v2.DlpService + * @instance + * @param {google.privacy.dlp.v2.IInspectContentRequest} request InspectContentRequest message or plain object + * @param {google.privacy.dlp.v2.DlpService.InspectContentCallback} callback Node-style callback called with the error, if any, and InspectContentResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DlpService.prototype.inspectContent = function inspectContent(request, callback) { + return this.rpcCall(inspectContent, $root.google.privacy.dlp.v2.InspectContentRequest, $root.google.privacy.dlp.v2.InspectContentResponse, request, callback); + }, "name", { value: "InspectContent" }); + + /** + * Calls InspectContent. + * @function inspectContent + * @memberof google.privacy.dlp.v2.DlpService + * @instance + * @param {google.privacy.dlp.v2.IInspectContentRequest} request InspectContentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.privacy.dlp.v2.DlpService#redactImage}. + * @memberof google.privacy.dlp.v2.DlpService + * @typedef RedactImageCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.privacy.dlp.v2.RedactImageResponse} [response] RedactImageResponse + */ + + /** + * Calls RedactImage. + * @function redactImage + * @memberof google.privacy.dlp.v2.DlpService + * @instance + * @param {google.privacy.dlp.v2.IRedactImageRequest} request RedactImageRequest message or plain object + * @param {google.privacy.dlp.v2.DlpService.RedactImageCallback} callback Node-style callback called with the error, if any, and RedactImageResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DlpService.prototype.redactImage = function redactImage(request, callback) { + return this.rpcCall(redactImage, $root.google.privacy.dlp.v2.RedactImageRequest, $root.google.privacy.dlp.v2.RedactImageResponse, request, callback); + }, "name", { value: "RedactImage" }); + + /** + * Calls RedactImage. + * @function redactImage + * @memberof google.privacy.dlp.v2.DlpService + * @instance + * @param {google.privacy.dlp.v2.IRedactImageRequest} request RedactImageRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.privacy.dlp.v2.DlpService#deidentifyContent}. + * @memberof google.privacy.dlp.v2.DlpService + * @typedef DeidentifyContentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.privacy.dlp.v2.DeidentifyContentResponse} [response] DeidentifyContentResponse + */ + + /** + * Calls DeidentifyContent. + * @function deidentifyContent + * @memberof google.privacy.dlp.v2.DlpService + * @instance + * @param {google.privacy.dlp.v2.IDeidentifyContentRequest} request DeidentifyContentRequest message or plain object + * @param {google.privacy.dlp.v2.DlpService.DeidentifyContentCallback} callback Node-style callback called with the error, if any, and DeidentifyContentResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DlpService.prototype.deidentifyContent = function deidentifyContent(request, callback) { + return this.rpcCall(deidentifyContent, $root.google.privacy.dlp.v2.DeidentifyContentRequest, $root.google.privacy.dlp.v2.DeidentifyContentResponse, request, callback); + }, "name", { value: "DeidentifyContent" }); + + /** + * Calls DeidentifyContent. + * @function deidentifyContent + * @memberof google.privacy.dlp.v2.DlpService + * @instance + * @param {google.privacy.dlp.v2.IDeidentifyContentRequest} request DeidentifyContentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.privacy.dlp.v2.DlpService#reidentifyContent}. + * @memberof google.privacy.dlp.v2.DlpService + * @typedef ReidentifyContentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.privacy.dlp.v2.ReidentifyContentResponse} [response] ReidentifyContentResponse + */ + + /** + * Calls ReidentifyContent. + * @function reidentifyContent + * @memberof google.privacy.dlp.v2.DlpService + * @instance + * @param {google.privacy.dlp.v2.IReidentifyContentRequest} request ReidentifyContentRequest message or plain object + * @param {google.privacy.dlp.v2.DlpService.ReidentifyContentCallback} callback Node-style callback called with the error, if any, and ReidentifyContentResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DlpService.prototype.reidentifyContent = function reidentifyContent(request, callback) { + return this.rpcCall(reidentifyContent, $root.google.privacy.dlp.v2.ReidentifyContentRequest, $root.google.privacy.dlp.v2.ReidentifyContentResponse, request, callback); + }, "name", { value: "ReidentifyContent" }); + + /** + * Calls ReidentifyContent. + * @function reidentifyContent + * @memberof google.privacy.dlp.v2.DlpService + * @instance + * @param {google.privacy.dlp.v2.IReidentifyContentRequest} request ReidentifyContentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.privacy.dlp.v2.DlpService#listInfoTypes}. + * @memberof google.privacy.dlp.v2.DlpService + * @typedef ListInfoTypesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.privacy.dlp.v2.ListInfoTypesResponse} [response] ListInfoTypesResponse + */ + + /** + * Calls ListInfoTypes. + * @function listInfoTypes + * @memberof google.privacy.dlp.v2.DlpService + * @instance + * @param {google.privacy.dlp.v2.IListInfoTypesRequest} request ListInfoTypesRequest message or plain object + * @param {google.privacy.dlp.v2.DlpService.ListInfoTypesCallback} callback Node-style callback called with the error, if any, and ListInfoTypesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DlpService.prototype.listInfoTypes = function listInfoTypes(request, callback) { + return this.rpcCall(listInfoTypes, $root.google.privacy.dlp.v2.ListInfoTypesRequest, $root.google.privacy.dlp.v2.ListInfoTypesResponse, request, callback); + }, "name", { value: "ListInfoTypes" }); + + /** + * Calls ListInfoTypes. + * @function listInfoTypes + * @memberof google.privacy.dlp.v2.DlpService + * @instance + * @param {google.privacy.dlp.v2.IListInfoTypesRequest} request ListInfoTypesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.privacy.dlp.v2.DlpService#createInspectTemplate}. + * @memberof google.privacy.dlp.v2.DlpService + * @typedef CreateInspectTemplateCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.privacy.dlp.v2.InspectTemplate} [response] InspectTemplate + */ + + /** + * Calls CreateInspectTemplate. + * @function createInspectTemplate + * @memberof google.privacy.dlp.v2.DlpService + * @instance + * @param {google.privacy.dlp.v2.ICreateInspectTemplateRequest} request CreateInspectTemplateRequest message or plain object + * @param {google.privacy.dlp.v2.DlpService.CreateInspectTemplateCallback} callback Node-style callback called with the error, if any, and InspectTemplate + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DlpService.prototype.createInspectTemplate = function createInspectTemplate(request, callback) { + return this.rpcCall(createInspectTemplate, $root.google.privacy.dlp.v2.CreateInspectTemplateRequest, $root.google.privacy.dlp.v2.InspectTemplate, request, callback); + }, "name", { value: "CreateInspectTemplate" }); + + /** + * Calls CreateInspectTemplate. + * @function createInspectTemplate + * @memberof google.privacy.dlp.v2.DlpService + * @instance + * @param {google.privacy.dlp.v2.ICreateInspectTemplateRequest} request CreateInspectTemplateRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.privacy.dlp.v2.DlpService#updateInspectTemplate}. + * @memberof google.privacy.dlp.v2.DlpService + * @typedef UpdateInspectTemplateCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.privacy.dlp.v2.InspectTemplate} [response] InspectTemplate + */ + + /** + * Calls UpdateInspectTemplate. + * @function updateInspectTemplate + * @memberof google.privacy.dlp.v2.DlpService + * @instance + * @param {google.privacy.dlp.v2.IUpdateInspectTemplateRequest} request UpdateInspectTemplateRequest message or plain object + * @param {google.privacy.dlp.v2.DlpService.UpdateInspectTemplateCallback} callback Node-style callback called with the error, if any, and InspectTemplate + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DlpService.prototype.updateInspectTemplate = function updateInspectTemplate(request, callback) { + return this.rpcCall(updateInspectTemplate, $root.google.privacy.dlp.v2.UpdateInspectTemplateRequest, $root.google.privacy.dlp.v2.InspectTemplate, request, callback); + }, "name", { value: "UpdateInspectTemplate" }); + + /** + * Calls UpdateInspectTemplate. + * @function updateInspectTemplate + * @memberof google.privacy.dlp.v2.DlpService + * @instance + * @param {google.privacy.dlp.v2.IUpdateInspectTemplateRequest} request UpdateInspectTemplateRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.privacy.dlp.v2.DlpService#getInspectTemplate}. + * @memberof google.privacy.dlp.v2.DlpService + * @typedef GetInspectTemplateCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.privacy.dlp.v2.InspectTemplate} [response] InspectTemplate + */ + + /** + * Calls GetInspectTemplate. + * @function getInspectTemplate + * @memberof google.privacy.dlp.v2.DlpService + * @instance + * @param {google.privacy.dlp.v2.IGetInspectTemplateRequest} request GetInspectTemplateRequest message or plain object + * @param {google.privacy.dlp.v2.DlpService.GetInspectTemplateCallback} callback Node-style callback called with the error, if any, and InspectTemplate + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DlpService.prototype.getInspectTemplate = function getInspectTemplate(request, callback) { + return this.rpcCall(getInspectTemplate, $root.google.privacy.dlp.v2.GetInspectTemplateRequest, $root.google.privacy.dlp.v2.InspectTemplate, request, callback); + }, "name", { value: "GetInspectTemplate" }); + + /** + * Calls GetInspectTemplate. + * @function getInspectTemplate + * @memberof google.privacy.dlp.v2.DlpService + * @instance + * @param {google.privacy.dlp.v2.IGetInspectTemplateRequest} request GetInspectTemplateRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.privacy.dlp.v2.DlpService#listInspectTemplates}. + * @memberof google.privacy.dlp.v2.DlpService + * @typedef ListInspectTemplatesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.privacy.dlp.v2.ListInspectTemplatesResponse} [response] ListInspectTemplatesResponse + */ + + /** + * Calls ListInspectTemplates. + * @function listInspectTemplates + * @memberof google.privacy.dlp.v2.DlpService + * @instance + * @param {google.privacy.dlp.v2.IListInspectTemplatesRequest} request ListInspectTemplatesRequest message or plain object + * @param {google.privacy.dlp.v2.DlpService.ListInspectTemplatesCallback} callback Node-style callback called with the error, if any, and ListInspectTemplatesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DlpService.prototype.listInspectTemplates = function listInspectTemplates(request, callback) { + return this.rpcCall(listInspectTemplates, $root.google.privacy.dlp.v2.ListInspectTemplatesRequest, $root.google.privacy.dlp.v2.ListInspectTemplatesResponse, request, callback); + }, "name", { value: "ListInspectTemplates" }); + + /** + * Calls ListInspectTemplates. + * @function listInspectTemplates + * @memberof google.privacy.dlp.v2.DlpService + * @instance + * @param {google.privacy.dlp.v2.IListInspectTemplatesRequest} request ListInspectTemplatesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.privacy.dlp.v2.DlpService#deleteInspectTemplate}. + * @memberof google.privacy.dlp.v2.DlpService + * @typedef DeleteInspectTemplateCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteInspectTemplate. + * @function deleteInspectTemplate + * @memberof google.privacy.dlp.v2.DlpService + * @instance + * @param {google.privacy.dlp.v2.IDeleteInspectTemplateRequest} request DeleteInspectTemplateRequest message or plain object + * @param {google.privacy.dlp.v2.DlpService.DeleteInspectTemplateCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DlpService.prototype.deleteInspectTemplate = function deleteInspectTemplate(request, callback) { + return this.rpcCall(deleteInspectTemplate, $root.google.privacy.dlp.v2.DeleteInspectTemplateRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteInspectTemplate" }); + + /** + * Calls DeleteInspectTemplate. + * @function deleteInspectTemplate + * @memberof google.privacy.dlp.v2.DlpService + * @instance + * @param {google.privacy.dlp.v2.IDeleteInspectTemplateRequest} request DeleteInspectTemplateRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.privacy.dlp.v2.DlpService#createDeidentifyTemplate}. + * @memberof google.privacy.dlp.v2.DlpService + * @typedef CreateDeidentifyTemplateCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.privacy.dlp.v2.DeidentifyTemplate} [response] DeidentifyTemplate + */ + + /** + * Calls CreateDeidentifyTemplate. + * @function createDeidentifyTemplate + * @memberof google.privacy.dlp.v2.DlpService + * @instance + * @param {google.privacy.dlp.v2.ICreateDeidentifyTemplateRequest} request CreateDeidentifyTemplateRequest message or plain object + * @param {google.privacy.dlp.v2.DlpService.CreateDeidentifyTemplateCallback} callback Node-style callback called with the error, if any, and DeidentifyTemplate + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DlpService.prototype.createDeidentifyTemplate = function createDeidentifyTemplate(request, callback) { + return this.rpcCall(createDeidentifyTemplate, $root.google.privacy.dlp.v2.CreateDeidentifyTemplateRequest, $root.google.privacy.dlp.v2.DeidentifyTemplate, request, callback); + }, "name", { value: "CreateDeidentifyTemplate" }); + + /** + * Calls CreateDeidentifyTemplate. + * @function createDeidentifyTemplate + * @memberof google.privacy.dlp.v2.DlpService + * @instance + * @param {google.privacy.dlp.v2.ICreateDeidentifyTemplateRequest} request CreateDeidentifyTemplateRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.privacy.dlp.v2.DlpService#updateDeidentifyTemplate}. + * @memberof google.privacy.dlp.v2.DlpService + * @typedef UpdateDeidentifyTemplateCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.privacy.dlp.v2.DeidentifyTemplate} [response] DeidentifyTemplate + */ + + /** + * Calls UpdateDeidentifyTemplate. + * @function updateDeidentifyTemplate + * @memberof google.privacy.dlp.v2.DlpService + * @instance + * @param {google.privacy.dlp.v2.IUpdateDeidentifyTemplateRequest} request UpdateDeidentifyTemplateRequest message or plain object + * @param {google.privacy.dlp.v2.DlpService.UpdateDeidentifyTemplateCallback} callback Node-style callback called with the error, if any, and DeidentifyTemplate + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DlpService.prototype.updateDeidentifyTemplate = function updateDeidentifyTemplate(request, callback) { + return this.rpcCall(updateDeidentifyTemplate, $root.google.privacy.dlp.v2.UpdateDeidentifyTemplateRequest, $root.google.privacy.dlp.v2.DeidentifyTemplate, request, callback); + }, "name", { value: "UpdateDeidentifyTemplate" }); + + /** + * Calls UpdateDeidentifyTemplate. + * @function updateDeidentifyTemplate + * @memberof google.privacy.dlp.v2.DlpService + * @instance + * @param {google.privacy.dlp.v2.IUpdateDeidentifyTemplateRequest} request UpdateDeidentifyTemplateRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.privacy.dlp.v2.DlpService#getDeidentifyTemplate}. + * @memberof google.privacy.dlp.v2.DlpService + * @typedef GetDeidentifyTemplateCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.privacy.dlp.v2.DeidentifyTemplate} [response] DeidentifyTemplate + */ + + /** + * Calls GetDeidentifyTemplate. + * @function getDeidentifyTemplate + * @memberof google.privacy.dlp.v2.DlpService + * @instance + * @param {google.privacy.dlp.v2.IGetDeidentifyTemplateRequest} request GetDeidentifyTemplateRequest message or plain object + * @param {google.privacy.dlp.v2.DlpService.GetDeidentifyTemplateCallback} callback Node-style callback called with the error, if any, and DeidentifyTemplate + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DlpService.prototype.getDeidentifyTemplate = function getDeidentifyTemplate(request, callback) { + return this.rpcCall(getDeidentifyTemplate, $root.google.privacy.dlp.v2.GetDeidentifyTemplateRequest, $root.google.privacy.dlp.v2.DeidentifyTemplate, request, callback); + }, "name", { value: "GetDeidentifyTemplate" }); + + /** + * Calls GetDeidentifyTemplate. + * @function getDeidentifyTemplate + * @memberof google.privacy.dlp.v2.DlpService + * @instance + * @param {google.privacy.dlp.v2.IGetDeidentifyTemplateRequest} request GetDeidentifyTemplateRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.privacy.dlp.v2.DlpService#listDeidentifyTemplates}. + * @memberof google.privacy.dlp.v2.DlpService + * @typedef ListDeidentifyTemplatesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.privacy.dlp.v2.ListDeidentifyTemplatesResponse} [response] ListDeidentifyTemplatesResponse + */ + + /** + * Calls ListDeidentifyTemplates. + * @function listDeidentifyTemplates + * @memberof google.privacy.dlp.v2.DlpService + * @instance + * @param {google.privacy.dlp.v2.IListDeidentifyTemplatesRequest} request ListDeidentifyTemplatesRequest message or plain object + * @param {google.privacy.dlp.v2.DlpService.ListDeidentifyTemplatesCallback} callback Node-style callback called with the error, if any, and ListDeidentifyTemplatesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DlpService.prototype.listDeidentifyTemplates = function listDeidentifyTemplates(request, callback) { + return this.rpcCall(listDeidentifyTemplates, $root.google.privacy.dlp.v2.ListDeidentifyTemplatesRequest, $root.google.privacy.dlp.v2.ListDeidentifyTemplatesResponse, request, callback); + }, "name", { value: "ListDeidentifyTemplates" }); + + /** + * Calls ListDeidentifyTemplates. + * @function listDeidentifyTemplates + * @memberof google.privacy.dlp.v2.DlpService + * @instance + * @param {google.privacy.dlp.v2.IListDeidentifyTemplatesRequest} request ListDeidentifyTemplatesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.privacy.dlp.v2.DlpService#deleteDeidentifyTemplate}. + * @memberof google.privacy.dlp.v2.DlpService + * @typedef DeleteDeidentifyTemplateCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteDeidentifyTemplate. + * @function deleteDeidentifyTemplate + * @memberof google.privacy.dlp.v2.DlpService + * @instance + * @param {google.privacy.dlp.v2.IDeleteDeidentifyTemplateRequest} request DeleteDeidentifyTemplateRequest message or plain object + * @param {google.privacy.dlp.v2.DlpService.DeleteDeidentifyTemplateCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DlpService.prototype.deleteDeidentifyTemplate = function deleteDeidentifyTemplate(request, callback) { + return this.rpcCall(deleteDeidentifyTemplate, $root.google.privacy.dlp.v2.DeleteDeidentifyTemplateRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteDeidentifyTemplate" }); + + /** + * Calls DeleteDeidentifyTemplate. + * @function deleteDeidentifyTemplate + * @memberof google.privacy.dlp.v2.DlpService + * @instance + * @param {google.privacy.dlp.v2.IDeleteDeidentifyTemplateRequest} request DeleteDeidentifyTemplateRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.privacy.dlp.v2.DlpService#createJobTrigger}. + * @memberof google.privacy.dlp.v2.DlpService + * @typedef CreateJobTriggerCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.privacy.dlp.v2.JobTrigger} [response] JobTrigger + */ + + /** + * Calls CreateJobTrigger. + * @function createJobTrigger + * @memberof google.privacy.dlp.v2.DlpService + * @instance + * @param {google.privacy.dlp.v2.ICreateJobTriggerRequest} request CreateJobTriggerRequest message or plain object + * @param {google.privacy.dlp.v2.DlpService.CreateJobTriggerCallback} callback Node-style callback called with the error, if any, and JobTrigger + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DlpService.prototype.createJobTrigger = function createJobTrigger(request, callback) { + return this.rpcCall(createJobTrigger, $root.google.privacy.dlp.v2.CreateJobTriggerRequest, $root.google.privacy.dlp.v2.JobTrigger, request, callback); + }, "name", { value: "CreateJobTrigger" }); + + /** + * Calls CreateJobTrigger. + * @function createJobTrigger + * @memberof google.privacy.dlp.v2.DlpService + * @instance + * @param {google.privacy.dlp.v2.ICreateJobTriggerRequest} request CreateJobTriggerRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.privacy.dlp.v2.DlpService#updateJobTrigger}. + * @memberof google.privacy.dlp.v2.DlpService + * @typedef UpdateJobTriggerCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.privacy.dlp.v2.JobTrigger} [response] JobTrigger + */ + + /** + * Calls UpdateJobTrigger. + * @function updateJobTrigger + * @memberof google.privacy.dlp.v2.DlpService + * @instance + * @param {google.privacy.dlp.v2.IUpdateJobTriggerRequest} request UpdateJobTriggerRequest message or plain object + * @param {google.privacy.dlp.v2.DlpService.UpdateJobTriggerCallback} callback Node-style callback called with the error, if any, and JobTrigger + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DlpService.prototype.updateJobTrigger = function updateJobTrigger(request, callback) { + return this.rpcCall(updateJobTrigger, $root.google.privacy.dlp.v2.UpdateJobTriggerRequest, $root.google.privacy.dlp.v2.JobTrigger, request, callback); + }, "name", { value: "UpdateJobTrigger" }); + + /** + * Calls UpdateJobTrigger. + * @function updateJobTrigger + * @memberof google.privacy.dlp.v2.DlpService + * @instance + * @param {google.privacy.dlp.v2.IUpdateJobTriggerRequest} request UpdateJobTriggerRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.privacy.dlp.v2.DlpService#hybridInspectJobTrigger}. + * @memberof google.privacy.dlp.v2.DlpService + * @typedef HybridInspectJobTriggerCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.privacy.dlp.v2.HybridInspectResponse} [response] HybridInspectResponse + */ + + /** + * Calls HybridInspectJobTrigger. + * @function hybridInspectJobTrigger + * @memberof google.privacy.dlp.v2.DlpService + * @instance + * @param {google.privacy.dlp.v2.IHybridInspectJobTriggerRequest} request HybridInspectJobTriggerRequest message or plain object + * @param {google.privacy.dlp.v2.DlpService.HybridInspectJobTriggerCallback} callback Node-style callback called with the error, if any, and HybridInspectResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DlpService.prototype.hybridInspectJobTrigger = function hybridInspectJobTrigger(request, callback) { + return this.rpcCall(hybridInspectJobTrigger, $root.google.privacy.dlp.v2.HybridInspectJobTriggerRequest, $root.google.privacy.dlp.v2.HybridInspectResponse, request, callback); + }, "name", { value: "HybridInspectJobTrigger" }); + + /** + * Calls HybridInspectJobTrigger. + * @function hybridInspectJobTrigger + * @memberof google.privacy.dlp.v2.DlpService + * @instance + * @param {google.privacy.dlp.v2.IHybridInspectJobTriggerRequest} request HybridInspectJobTriggerRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.privacy.dlp.v2.DlpService#getJobTrigger}. + * @memberof google.privacy.dlp.v2.DlpService + * @typedef GetJobTriggerCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.privacy.dlp.v2.JobTrigger} [response] JobTrigger + */ + + /** + * Calls GetJobTrigger. + * @function getJobTrigger + * @memberof google.privacy.dlp.v2.DlpService + * @instance + * @param {google.privacy.dlp.v2.IGetJobTriggerRequest} request GetJobTriggerRequest message or plain object + * @param {google.privacy.dlp.v2.DlpService.GetJobTriggerCallback} callback Node-style callback called with the error, if any, and JobTrigger + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DlpService.prototype.getJobTrigger = function getJobTrigger(request, callback) { + return this.rpcCall(getJobTrigger, $root.google.privacy.dlp.v2.GetJobTriggerRequest, $root.google.privacy.dlp.v2.JobTrigger, request, callback); + }, "name", { value: "GetJobTrigger" }); + + /** + * Calls GetJobTrigger. + * @function getJobTrigger + * @memberof google.privacy.dlp.v2.DlpService + * @instance + * @param {google.privacy.dlp.v2.IGetJobTriggerRequest} request GetJobTriggerRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.privacy.dlp.v2.DlpService#listJobTriggers}. + * @memberof google.privacy.dlp.v2.DlpService + * @typedef ListJobTriggersCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.privacy.dlp.v2.ListJobTriggersResponse} [response] ListJobTriggersResponse + */ + + /** + * Calls ListJobTriggers. + * @function listJobTriggers + * @memberof google.privacy.dlp.v2.DlpService + * @instance + * @param {google.privacy.dlp.v2.IListJobTriggersRequest} request ListJobTriggersRequest message or plain object + * @param {google.privacy.dlp.v2.DlpService.ListJobTriggersCallback} callback Node-style callback called with the error, if any, and ListJobTriggersResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DlpService.prototype.listJobTriggers = function listJobTriggers(request, callback) { + return this.rpcCall(listJobTriggers, $root.google.privacy.dlp.v2.ListJobTriggersRequest, $root.google.privacy.dlp.v2.ListJobTriggersResponse, request, callback); + }, "name", { value: "ListJobTriggers" }); + + /** + * Calls ListJobTriggers. + * @function listJobTriggers + * @memberof google.privacy.dlp.v2.DlpService + * @instance + * @param {google.privacy.dlp.v2.IListJobTriggersRequest} request ListJobTriggersRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.privacy.dlp.v2.DlpService#deleteJobTrigger}. + * @memberof google.privacy.dlp.v2.DlpService + * @typedef DeleteJobTriggerCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteJobTrigger. + * @function deleteJobTrigger + * @memberof google.privacy.dlp.v2.DlpService + * @instance + * @param {google.privacy.dlp.v2.IDeleteJobTriggerRequest} request DeleteJobTriggerRequest message or plain object + * @param {google.privacy.dlp.v2.DlpService.DeleteJobTriggerCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DlpService.prototype.deleteJobTrigger = function deleteJobTrigger(request, callback) { + return this.rpcCall(deleteJobTrigger, $root.google.privacy.dlp.v2.DeleteJobTriggerRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteJobTrigger" }); + + /** + * Calls DeleteJobTrigger. + * @function deleteJobTrigger + * @memberof google.privacy.dlp.v2.DlpService + * @instance + * @param {google.privacy.dlp.v2.IDeleteJobTriggerRequest} request DeleteJobTriggerRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.privacy.dlp.v2.DlpService#activateJobTrigger}. + * @memberof google.privacy.dlp.v2.DlpService + * @typedef ActivateJobTriggerCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.privacy.dlp.v2.DlpJob} [response] DlpJob + */ + + /** + * Calls ActivateJobTrigger. + * @function activateJobTrigger + * @memberof google.privacy.dlp.v2.DlpService + * @instance + * @param {google.privacy.dlp.v2.IActivateJobTriggerRequest} request ActivateJobTriggerRequest message or plain object + * @param {google.privacy.dlp.v2.DlpService.ActivateJobTriggerCallback} callback Node-style callback called with the error, if any, and DlpJob + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DlpService.prototype.activateJobTrigger = function activateJobTrigger(request, callback) { + return this.rpcCall(activateJobTrigger, $root.google.privacy.dlp.v2.ActivateJobTriggerRequest, $root.google.privacy.dlp.v2.DlpJob, request, callback); + }, "name", { value: "ActivateJobTrigger" }); + + /** + * Calls ActivateJobTrigger. + * @function activateJobTrigger + * @memberof google.privacy.dlp.v2.DlpService + * @instance + * @param {google.privacy.dlp.v2.IActivateJobTriggerRequest} request ActivateJobTriggerRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.privacy.dlp.v2.DlpService#createDlpJob}. + * @memberof google.privacy.dlp.v2.DlpService + * @typedef CreateDlpJobCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.privacy.dlp.v2.DlpJob} [response] DlpJob + */ + + /** + * Calls CreateDlpJob. + * @function createDlpJob + * @memberof google.privacy.dlp.v2.DlpService + * @instance + * @param {google.privacy.dlp.v2.ICreateDlpJobRequest} request CreateDlpJobRequest message or plain object + * @param {google.privacy.dlp.v2.DlpService.CreateDlpJobCallback} callback Node-style callback called with the error, if any, and DlpJob + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DlpService.prototype.createDlpJob = function createDlpJob(request, callback) { + return this.rpcCall(createDlpJob, $root.google.privacy.dlp.v2.CreateDlpJobRequest, $root.google.privacy.dlp.v2.DlpJob, request, callback); + }, "name", { value: "CreateDlpJob" }); + + /** + * Calls CreateDlpJob. + * @function createDlpJob + * @memberof google.privacy.dlp.v2.DlpService + * @instance + * @param {google.privacy.dlp.v2.ICreateDlpJobRequest} request CreateDlpJobRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.privacy.dlp.v2.DlpService#listDlpJobs}. + * @memberof google.privacy.dlp.v2.DlpService + * @typedef ListDlpJobsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.privacy.dlp.v2.ListDlpJobsResponse} [response] ListDlpJobsResponse + */ + + /** + * Calls ListDlpJobs. + * @function listDlpJobs + * @memberof google.privacy.dlp.v2.DlpService + * @instance + * @param {google.privacy.dlp.v2.IListDlpJobsRequest} request ListDlpJobsRequest message or plain object + * @param {google.privacy.dlp.v2.DlpService.ListDlpJobsCallback} callback Node-style callback called with the error, if any, and ListDlpJobsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DlpService.prototype.listDlpJobs = function listDlpJobs(request, callback) { + return this.rpcCall(listDlpJobs, $root.google.privacy.dlp.v2.ListDlpJobsRequest, $root.google.privacy.dlp.v2.ListDlpJobsResponse, request, callback); + }, "name", { value: "ListDlpJobs" }); + + /** + * Calls ListDlpJobs. + * @function listDlpJobs + * @memberof google.privacy.dlp.v2.DlpService + * @instance + * @param {google.privacy.dlp.v2.IListDlpJobsRequest} request ListDlpJobsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.privacy.dlp.v2.DlpService#getDlpJob}. + * @memberof google.privacy.dlp.v2.DlpService + * @typedef GetDlpJobCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.privacy.dlp.v2.DlpJob} [response] DlpJob + */ + + /** + * Calls GetDlpJob. + * @function getDlpJob + * @memberof google.privacy.dlp.v2.DlpService + * @instance + * @param {google.privacy.dlp.v2.IGetDlpJobRequest} request GetDlpJobRequest message or plain object + * @param {google.privacy.dlp.v2.DlpService.GetDlpJobCallback} callback Node-style callback called with the error, if any, and DlpJob + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DlpService.prototype.getDlpJob = function getDlpJob(request, callback) { + return this.rpcCall(getDlpJob, $root.google.privacy.dlp.v2.GetDlpJobRequest, $root.google.privacy.dlp.v2.DlpJob, request, callback); + }, "name", { value: "GetDlpJob" }); + + /** + * Calls GetDlpJob. + * @function getDlpJob + * @memberof google.privacy.dlp.v2.DlpService + * @instance + * @param {google.privacy.dlp.v2.IGetDlpJobRequest} request GetDlpJobRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.privacy.dlp.v2.DlpService#deleteDlpJob}. + * @memberof google.privacy.dlp.v2.DlpService + * @typedef DeleteDlpJobCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteDlpJob. + * @function deleteDlpJob + * @memberof google.privacy.dlp.v2.DlpService + * @instance + * @param {google.privacy.dlp.v2.IDeleteDlpJobRequest} request DeleteDlpJobRequest message or plain object + * @param {google.privacy.dlp.v2.DlpService.DeleteDlpJobCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DlpService.prototype.deleteDlpJob = function deleteDlpJob(request, callback) { + return this.rpcCall(deleteDlpJob, $root.google.privacy.dlp.v2.DeleteDlpJobRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteDlpJob" }); + + /** + * Calls DeleteDlpJob. + * @function deleteDlpJob + * @memberof google.privacy.dlp.v2.DlpService + * @instance + * @param {google.privacy.dlp.v2.IDeleteDlpJobRequest} request DeleteDlpJobRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.privacy.dlp.v2.DlpService#cancelDlpJob}. + * @memberof google.privacy.dlp.v2.DlpService + * @typedef CancelDlpJobCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls CancelDlpJob. + * @function cancelDlpJob + * @memberof google.privacy.dlp.v2.DlpService + * @instance + * @param {google.privacy.dlp.v2.ICancelDlpJobRequest} request CancelDlpJobRequest message or plain object + * @param {google.privacy.dlp.v2.DlpService.CancelDlpJobCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DlpService.prototype.cancelDlpJob = function cancelDlpJob(request, callback) { + return this.rpcCall(cancelDlpJob, $root.google.privacy.dlp.v2.CancelDlpJobRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "CancelDlpJob" }); + + /** + * Calls CancelDlpJob. + * @function cancelDlpJob + * @memberof google.privacy.dlp.v2.DlpService + * @instance + * @param {google.privacy.dlp.v2.ICancelDlpJobRequest} request CancelDlpJobRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.privacy.dlp.v2.DlpService#createStoredInfoType}. + * @memberof google.privacy.dlp.v2.DlpService + * @typedef CreateStoredInfoTypeCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.privacy.dlp.v2.StoredInfoType} [response] StoredInfoType + */ + + /** + * Calls CreateStoredInfoType. + * @function createStoredInfoType + * @memberof google.privacy.dlp.v2.DlpService + * @instance + * @param {google.privacy.dlp.v2.ICreateStoredInfoTypeRequest} request CreateStoredInfoTypeRequest message or plain object + * @param {google.privacy.dlp.v2.DlpService.CreateStoredInfoTypeCallback} callback Node-style callback called with the error, if any, and StoredInfoType + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DlpService.prototype.createStoredInfoType = function createStoredInfoType(request, callback) { + return this.rpcCall(createStoredInfoType, $root.google.privacy.dlp.v2.CreateStoredInfoTypeRequest, $root.google.privacy.dlp.v2.StoredInfoType, request, callback); + }, "name", { value: "CreateStoredInfoType" }); + + /** + * Calls CreateStoredInfoType. + * @function createStoredInfoType + * @memberof google.privacy.dlp.v2.DlpService + * @instance + * @param {google.privacy.dlp.v2.ICreateStoredInfoTypeRequest} request CreateStoredInfoTypeRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.privacy.dlp.v2.DlpService#updateStoredInfoType}. + * @memberof google.privacy.dlp.v2.DlpService + * @typedef UpdateStoredInfoTypeCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.privacy.dlp.v2.StoredInfoType} [response] StoredInfoType + */ + + /** + * Calls UpdateStoredInfoType. + * @function updateStoredInfoType + * @memberof google.privacy.dlp.v2.DlpService + * @instance + * @param {google.privacy.dlp.v2.IUpdateStoredInfoTypeRequest} request UpdateStoredInfoTypeRequest message or plain object + * @param {google.privacy.dlp.v2.DlpService.UpdateStoredInfoTypeCallback} callback Node-style callback called with the error, if any, and StoredInfoType + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DlpService.prototype.updateStoredInfoType = function updateStoredInfoType(request, callback) { + return this.rpcCall(updateStoredInfoType, $root.google.privacy.dlp.v2.UpdateStoredInfoTypeRequest, $root.google.privacy.dlp.v2.StoredInfoType, request, callback); + }, "name", { value: "UpdateStoredInfoType" }); + + /** + * Calls UpdateStoredInfoType. + * @function updateStoredInfoType + * @memberof google.privacy.dlp.v2.DlpService + * @instance + * @param {google.privacy.dlp.v2.IUpdateStoredInfoTypeRequest} request UpdateStoredInfoTypeRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.privacy.dlp.v2.DlpService#getStoredInfoType}. + * @memberof google.privacy.dlp.v2.DlpService + * @typedef GetStoredInfoTypeCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.privacy.dlp.v2.StoredInfoType} [response] StoredInfoType + */ + + /** + * Calls GetStoredInfoType. + * @function getStoredInfoType + * @memberof google.privacy.dlp.v2.DlpService + * @instance + * @param {google.privacy.dlp.v2.IGetStoredInfoTypeRequest} request GetStoredInfoTypeRequest message or plain object + * @param {google.privacy.dlp.v2.DlpService.GetStoredInfoTypeCallback} callback Node-style callback called with the error, if any, and StoredInfoType + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DlpService.prototype.getStoredInfoType = function getStoredInfoType(request, callback) { + return this.rpcCall(getStoredInfoType, $root.google.privacy.dlp.v2.GetStoredInfoTypeRequest, $root.google.privacy.dlp.v2.StoredInfoType, request, callback); + }, "name", { value: "GetStoredInfoType" }); + + /** + * Calls GetStoredInfoType. + * @function getStoredInfoType + * @memberof google.privacy.dlp.v2.DlpService + * @instance + * @param {google.privacy.dlp.v2.IGetStoredInfoTypeRequest} request GetStoredInfoTypeRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.privacy.dlp.v2.DlpService#listStoredInfoTypes}. + * @memberof google.privacy.dlp.v2.DlpService + * @typedef ListStoredInfoTypesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.privacy.dlp.v2.ListStoredInfoTypesResponse} [response] ListStoredInfoTypesResponse + */ + + /** + * Calls ListStoredInfoTypes. + * @function listStoredInfoTypes + * @memberof google.privacy.dlp.v2.DlpService + * @instance + * @param {google.privacy.dlp.v2.IListStoredInfoTypesRequest} request ListStoredInfoTypesRequest message or plain object + * @param {google.privacy.dlp.v2.DlpService.ListStoredInfoTypesCallback} callback Node-style callback called with the error, if any, and ListStoredInfoTypesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DlpService.prototype.listStoredInfoTypes = function listStoredInfoTypes(request, callback) { + return this.rpcCall(listStoredInfoTypes, $root.google.privacy.dlp.v2.ListStoredInfoTypesRequest, $root.google.privacy.dlp.v2.ListStoredInfoTypesResponse, request, callback); + }, "name", { value: "ListStoredInfoTypes" }); + + /** + * Calls ListStoredInfoTypes. + * @function listStoredInfoTypes + * @memberof google.privacy.dlp.v2.DlpService + * @instance + * @param {google.privacy.dlp.v2.IListStoredInfoTypesRequest} request ListStoredInfoTypesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.privacy.dlp.v2.DlpService#deleteStoredInfoType}. + * @memberof google.privacy.dlp.v2.DlpService + * @typedef DeleteStoredInfoTypeCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteStoredInfoType. + * @function deleteStoredInfoType + * @memberof google.privacy.dlp.v2.DlpService + * @instance + * @param {google.privacy.dlp.v2.IDeleteStoredInfoTypeRequest} request DeleteStoredInfoTypeRequest message or plain object + * @param {google.privacy.dlp.v2.DlpService.DeleteStoredInfoTypeCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DlpService.prototype.deleteStoredInfoType = function deleteStoredInfoType(request, callback) { + return this.rpcCall(deleteStoredInfoType, $root.google.privacy.dlp.v2.DeleteStoredInfoTypeRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteStoredInfoType" }); + + /** + * Calls DeleteStoredInfoType. + * @function deleteStoredInfoType + * @memberof google.privacy.dlp.v2.DlpService + * @instance + * @param {google.privacy.dlp.v2.IDeleteStoredInfoTypeRequest} request DeleteStoredInfoTypeRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.privacy.dlp.v2.DlpService#hybridInspectDlpJob}. + * @memberof google.privacy.dlp.v2.DlpService + * @typedef HybridInspectDlpJobCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.privacy.dlp.v2.HybridInspectResponse} [response] HybridInspectResponse + */ + + /** + * Calls HybridInspectDlpJob. + * @function hybridInspectDlpJob + * @memberof google.privacy.dlp.v2.DlpService + * @instance + * @param {google.privacy.dlp.v2.IHybridInspectDlpJobRequest} request HybridInspectDlpJobRequest message or plain object + * @param {google.privacy.dlp.v2.DlpService.HybridInspectDlpJobCallback} callback Node-style callback called with the error, if any, and HybridInspectResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DlpService.prototype.hybridInspectDlpJob = function hybridInspectDlpJob(request, callback) { + return this.rpcCall(hybridInspectDlpJob, $root.google.privacy.dlp.v2.HybridInspectDlpJobRequest, $root.google.privacy.dlp.v2.HybridInspectResponse, request, callback); + }, "name", { value: "HybridInspectDlpJob" }); + + /** + * Calls HybridInspectDlpJob. + * @function hybridInspectDlpJob + * @memberof google.privacy.dlp.v2.DlpService + * @instance + * @param {google.privacy.dlp.v2.IHybridInspectDlpJobRequest} request HybridInspectDlpJobRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.privacy.dlp.v2.DlpService#finishDlpJob}. + * @memberof google.privacy.dlp.v2.DlpService + * @typedef FinishDlpJobCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls FinishDlpJob. + * @function finishDlpJob + * @memberof google.privacy.dlp.v2.DlpService + * @instance + * @param {google.privacy.dlp.v2.IFinishDlpJobRequest} request FinishDlpJobRequest message or plain object + * @param {google.privacy.dlp.v2.DlpService.FinishDlpJobCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DlpService.prototype.finishDlpJob = function finishDlpJob(request, callback) { + return this.rpcCall(finishDlpJob, $root.google.privacy.dlp.v2.FinishDlpJobRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "FinishDlpJob" }); + + /** + * Calls FinishDlpJob. + * @function finishDlpJob + * @memberof google.privacy.dlp.v2.DlpService + * @instance + * @param {google.privacy.dlp.v2.IFinishDlpJobRequest} request FinishDlpJobRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return DlpService; + })(); + + v2.ExcludeInfoTypes = (function() { + + /** + * Properties of an ExcludeInfoTypes. + * @memberof google.privacy.dlp.v2 + * @interface IExcludeInfoTypes + * @property {Array.|null} [infoTypes] ExcludeInfoTypes infoTypes + */ + + /** + * Constructs a new ExcludeInfoTypes. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents an ExcludeInfoTypes. + * @implements IExcludeInfoTypes + * @constructor + * @param {google.privacy.dlp.v2.IExcludeInfoTypes=} [properties] Properties to set + */ + function ExcludeInfoTypes(properties) { + this.infoTypes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExcludeInfoTypes infoTypes. + * @member {Array.} infoTypes + * @memberof google.privacy.dlp.v2.ExcludeInfoTypes + * @instance + */ + ExcludeInfoTypes.prototype.infoTypes = $util.emptyArray; + + /** + * Creates a new ExcludeInfoTypes instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.ExcludeInfoTypes + * @static + * @param {google.privacy.dlp.v2.IExcludeInfoTypes=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.ExcludeInfoTypes} ExcludeInfoTypes instance + */ + ExcludeInfoTypes.create = function create(properties) { + return new ExcludeInfoTypes(properties); + }; + + /** + * Encodes the specified ExcludeInfoTypes message. Does not implicitly {@link google.privacy.dlp.v2.ExcludeInfoTypes.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.ExcludeInfoTypes + * @static + * @param {google.privacy.dlp.v2.IExcludeInfoTypes} message ExcludeInfoTypes message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExcludeInfoTypes.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.infoTypes != null && message.infoTypes.length) + for (var i = 0; i < message.infoTypes.length; ++i) + $root.google.privacy.dlp.v2.InfoType.encode(message.infoTypes[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExcludeInfoTypes message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.ExcludeInfoTypes.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.ExcludeInfoTypes + * @static + * @param {google.privacy.dlp.v2.IExcludeInfoTypes} message ExcludeInfoTypes message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExcludeInfoTypes.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExcludeInfoTypes message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.ExcludeInfoTypes + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.ExcludeInfoTypes} ExcludeInfoTypes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExcludeInfoTypes.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.privacy.dlp.v2.ExcludeInfoTypes(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.infoTypes && message.infoTypes.length)) + message.infoTypes = []; + message.infoTypes.push($root.google.privacy.dlp.v2.InfoType.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExcludeInfoTypes message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.ExcludeInfoTypes + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.ExcludeInfoTypes} ExcludeInfoTypes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExcludeInfoTypes.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExcludeInfoTypes message. + * @function verify + * @memberof google.privacy.dlp.v2.ExcludeInfoTypes + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExcludeInfoTypes.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.infoTypes != null && message.hasOwnProperty("infoTypes")) { + if (!Array.isArray(message.infoTypes)) + return "infoTypes: array expected"; + for (var i = 0; i < message.infoTypes.length; ++i) { + var error = $root.google.privacy.dlp.v2.InfoType.verify(message.infoTypes[i]); + if (error) + return "infoTypes." + error; + } + } + return null; + }; + + /** + * Creates an ExcludeInfoTypes message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.ExcludeInfoTypes + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.ExcludeInfoTypes} ExcludeInfoTypes + */ + ExcludeInfoTypes.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.ExcludeInfoTypes) + return object; + var message = new $root.google.privacy.dlp.v2.ExcludeInfoTypes(); + if (object.infoTypes) { + if (!Array.isArray(object.infoTypes)) + throw TypeError(".google.privacy.dlp.v2.ExcludeInfoTypes.infoTypes: array expected"); + message.infoTypes = []; + for (var i = 0; i < object.infoTypes.length; ++i) { + if (typeof object.infoTypes[i] !== "object") + throw TypeError(".google.privacy.dlp.v2.ExcludeInfoTypes.infoTypes: object expected"); + message.infoTypes[i] = $root.google.privacy.dlp.v2.InfoType.fromObject(object.infoTypes[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an ExcludeInfoTypes message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.ExcludeInfoTypes + * @static + * @param {google.privacy.dlp.v2.ExcludeInfoTypes} message ExcludeInfoTypes + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExcludeInfoTypes.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.infoTypes = []; + if (message.infoTypes && message.infoTypes.length) { + object.infoTypes = []; + for (var j = 0; j < message.infoTypes.length; ++j) + object.infoTypes[j] = $root.google.privacy.dlp.v2.InfoType.toObject(message.infoTypes[j], options); + } + return object; + }; + + /** + * Converts this ExcludeInfoTypes to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.ExcludeInfoTypes + * @instance + * @returns {Object.} JSON object + */ + ExcludeInfoTypes.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ExcludeInfoTypes; + })(); + + v2.ExclusionRule = (function() { + + /** + * Properties of an ExclusionRule. + * @memberof google.privacy.dlp.v2 + * @interface IExclusionRule + * @property {google.privacy.dlp.v2.CustomInfoType.IDictionary|null} [dictionary] ExclusionRule dictionary + * @property {google.privacy.dlp.v2.CustomInfoType.IRegex|null} [regex] ExclusionRule regex + * @property {google.privacy.dlp.v2.IExcludeInfoTypes|null} [excludeInfoTypes] ExclusionRule excludeInfoTypes + * @property {google.privacy.dlp.v2.MatchingType|null} [matchingType] ExclusionRule matchingType + */ + + /** + * Constructs a new ExclusionRule. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents an ExclusionRule. + * @implements IExclusionRule + * @constructor + * @param {google.privacy.dlp.v2.IExclusionRule=} [properties] Properties to set + */ + function ExclusionRule(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExclusionRule dictionary. + * @member {google.privacy.dlp.v2.CustomInfoType.IDictionary|null|undefined} dictionary + * @memberof google.privacy.dlp.v2.ExclusionRule + * @instance + */ + ExclusionRule.prototype.dictionary = null; + + /** + * ExclusionRule regex. + * @member {google.privacy.dlp.v2.CustomInfoType.IRegex|null|undefined} regex + * @memberof google.privacy.dlp.v2.ExclusionRule + * @instance + */ + ExclusionRule.prototype.regex = null; + + /** + * ExclusionRule excludeInfoTypes. + * @member {google.privacy.dlp.v2.IExcludeInfoTypes|null|undefined} excludeInfoTypes + * @memberof google.privacy.dlp.v2.ExclusionRule + * @instance + */ + ExclusionRule.prototype.excludeInfoTypes = null; + + /** + * ExclusionRule matchingType. + * @member {google.privacy.dlp.v2.MatchingType} matchingType + * @memberof google.privacy.dlp.v2.ExclusionRule + * @instance + */ + ExclusionRule.prototype.matchingType = 0; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ExclusionRule type. + * @member {"dictionary"|"regex"|"excludeInfoTypes"|undefined} type + * @memberof google.privacy.dlp.v2.ExclusionRule + * @instance + */ + Object.defineProperty(ExclusionRule.prototype, "type", { + get: $util.oneOfGetter($oneOfFields = ["dictionary", "regex", "excludeInfoTypes"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ExclusionRule instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.ExclusionRule + * @static + * @param {google.privacy.dlp.v2.IExclusionRule=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.ExclusionRule} ExclusionRule instance + */ + ExclusionRule.create = function create(properties) { + return new ExclusionRule(properties); + }; + + /** + * Encodes the specified ExclusionRule message. Does not implicitly {@link google.privacy.dlp.v2.ExclusionRule.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.ExclusionRule + * @static + * @param {google.privacy.dlp.v2.IExclusionRule} message ExclusionRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExclusionRule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dictionary != null && Object.hasOwnProperty.call(message, "dictionary")) + $root.google.privacy.dlp.v2.CustomInfoType.Dictionary.encode(message.dictionary, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.regex != null && Object.hasOwnProperty.call(message, "regex")) + $root.google.privacy.dlp.v2.CustomInfoType.Regex.encode(message.regex, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.excludeInfoTypes != null && Object.hasOwnProperty.call(message, "excludeInfoTypes")) + $root.google.privacy.dlp.v2.ExcludeInfoTypes.encode(message.excludeInfoTypes, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.matchingType != null && Object.hasOwnProperty.call(message, "matchingType")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.matchingType); + return writer; + }; + + /** + * Encodes the specified ExclusionRule message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.ExclusionRule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.ExclusionRule + * @static + * @param {google.privacy.dlp.v2.IExclusionRule} message ExclusionRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExclusionRule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExclusionRule message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.ExclusionRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.ExclusionRule} ExclusionRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExclusionRule.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.privacy.dlp.v2.ExclusionRule(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.dictionary = $root.google.privacy.dlp.v2.CustomInfoType.Dictionary.decode(reader, reader.uint32()); + break; + case 2: + message.regex = $root.google.privacy.dlp.v2.CustomInfoType.Regex.decode(reader, reader.uint32()); + break; + case 3: + message.excludeInfoTypes = $root.google.privacy.dlp.v2.ExcludeInfoTypes.decode(reader, reader.uint32()); + break; + case 4: + message.matchingType = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExclusionRule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.ExclusionRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.ExclusionRule} ExclusionRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExclusionRule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExclusionRule message. + * @function verify + * @memberof google.privacy.dlp.v2.ExclusionRule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExclusionRule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.dictionary != null && message.hasOwnProperty("dictionary")) { + properties.type = 1; + { + var error = $root.google.privacy.dlp.v2.CustomInfoType.Dictionary.verify(message.dictionary); + if (error) + return "dictionary." + error; + } + } + if (message.regex != null && message.hasOwnProperty("regex")) { + if (properties.type === 1) + return "type: multiple values"; + properties.type = 1; + { + var error = $root.google.privacy.dlp.v2.CustomInfoType.Regex.verify(message.regex); + if (error) + return "regex." + error; + } + } + if (message.excludeInfoTypes != null && message.hasOwnProperty("excludeInfoTypes")) { + if (properties.type === 1) + return "type: multiple values"; + properties.type = 1; + { + var error = $root.google.privacy.dlp.v2.ExcludeInfoTypes.verify(message.excludeInfoTypes); + if (error) + return "excludeInfoTypes." + error; + } + } + if (message.matchingType != null && message.hasOwnProperty("matchingType")) + switch (message.matchingType) { + default: + return "matchingType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + return null; + }; + + /** + * Creates an ExclusionRule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.ExclusionRule + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.ExclusionRule} ExclusionRule + */ + ExclusionRule.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.ExclusionRule) + return object; + var message = new $root.google.privacy.dlp.v2.ExclusionRule(); + if (object.dictionary != null) { + if (typeof object.dictionary !== "object") + throw TypeError(".google.privacy.dlp.v2.ExclusionRule.dictionary: object expected"); + message.dictionary = $root.google.privacy.dlp.v2.CustomInfoType.Dictionary.fromObject(object.dictionary); + } + if (object.regex != null) { + if (typeof object.regex !== "object") + throw TypeError(".google.privacy.dlp.v2.ExclusionRule.regex: object expected"); + message.regex = $root.google.privacy.dlp.v2.CustomInfoType.Regex.fromObject(object.regex); + } + if (object.excludeInfoTypes != null) { + if (typeof object.excludeInfoTypes !== "object") + throw TypeError(".google.privacy.dlp.v2.ExclusionRule.excludeInfoTypes: object expected"); + message.excludeInfoTypes = $root.google.privacy.dlp.v2.ExcludeInfoTypes.fromObject(object.excludeInfoTypes); + } + switch (object.matchingType) { + case "MATCHING_TYPE_UNSPECIFIED": + case 0: + message.matchingType = 0; + break; + case "MATCHING_TYPE_FULL_MATCH": + case 1: + message.matchingType = 1; + break; + case "MATCHING_TYPE_PARTIAL_MATCH": + case 2: + message.matchingType = 2; + break; + case "MATCHING_TYPE_INVERSE_MATCH": + case 3: + message.matchingType = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from an ExclusionRule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.ExclusionRule + * @static + * @param {google.privacy.dlp.v2.ExclusionRule} message ExclusionRule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExclusionRule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.matchingType = options.enums === String ? "MATCHING_TYPE_UNSPECIFIED" : 0; + if (message.dictionary != null && message.hasOwnProperty("dictionary")) { + object.dictionary = $root.google.privacy.dlp.v2.CustomInfoType.Dictionary.toObject(message.dictionary, options); + if (options.oneofs) + object.type = "dictionary"; + } + if (message.regex != null && message.hasOwnProperty("regex")) { + object.regex = $root.google.privacy.dlp.v2.CustomInfoType.Regex.toObject(message.regex, options); + if (options.oneofs) + object.type = "regex"; + } + if (message.excludeInfoTypes != null && message.hasOwnProperty("excludeInfoTypes")) { + object.excludeInfoTypes = $root.google.privacy.dlp.v2.ExcludeInfoTypes.toObject(message.excludeInfoTypes, options); + if (options.oneofs) + object.type = "excludeInfoTypes"; + } + if (message.matchingType != null && message.hasOwnProperty("matchingType")) + object.matchingType = options.enums === String ? $root.google.privacy.dlp.v2.MatchingType[message.matchingType] : message.matchingType; + return object; + }; + + /** + * Converts this ExclusionRule to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.ExclusionRule + * @instance + * @returns {Object.} JSON object + */ + ExclusionRule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ExclusionRule; + })(); + + v2.InspectionRule = (function() { + + /** + * Properties of an InspectionRule. + * @memberof google.privacy.dlp.v2 + * @interface IInspectionRule + * @property {google.privacy.dlp.v2.CustomInfoType.DetectionRule.IHotwordRule|null} [hotwordRule] InspectionRule hotwordRule + * @property {google.privacy.dlp.v2.IExclusionRule|null} [exclusionRule] InspectionRule exclusionRule + */ + + /** + * Constructs a new InspectionRule. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents an InspectionRule. + * @implements IInspectionRule + * @constructor + * @param {google.privacy.dlp.v2.IInspectionRule=} [properties] Properties to set + */ + function InspectionRule(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InspectionRule hotwordRule. + * @member {google.privacy.dlp.v2.CustomInfoType.DetectionRule.IHotwordRule|null|undefined} hotwordRule + * @memberof google.privacy.dlp.v2.InspectionRule + * @instance + */ + InspectionRule.prototype.hotwordRule = null; + + /** + * InspectionRule exclusionRule. + * @member {google.privacy.dlp.v2.IExclusionRule|null|undefined} exclusionRule + * @memberof google.privacy.dlp.v2.InspectionRule + * @instance + */ + InspectionRule.prototype.exclusionRule = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InspectionRule type. + * @member {"hotwordRule"|"exclusionRule"|undefined} type + * @memberof google.privacy.dlp.v2.InspectionRule + * @instance + */ + Object.defineProperty(InspectionRule.prototype, "type", { + get: $util.oneOfGetter($oneOfFields = ["hotwordRule", "exclusionRule"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InspectionRule instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.InspectionRule + * @static + * @param {google.privacy.dlp.v2.IInspectionRule=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.InspectionRule} InspectionRule instance + */ + InspectionRule.create = function create(properties) { + return new InspectionRule(properties); + }; + + /** + * Encodes the specified InspectionRule message. Does not implicitly {@link google.privacy.dlp.v2.InspectionRule.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.InspectionRule + * @static + * @param {google.privacy.dlp.v2.IInspectionRule} message InspectionRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InspectionRule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.hotwordRule != null && Object.hasOwnProperty.call(message, "hotwordRule")) + $root.google.privacy.dlp.v2.CustomInfoType.DetectionRule.HotwordRule.encode(message.hotwordRule, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.exclusionRule != null && Object.hasOwnProperty.call(message, "exclusionRule")) + $root.google.privacy.dlp.v2.ExclusionRule.encode(message.exclusionRule, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified InspectionRule message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.InspectionRule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.InspectionRule + * @static + * @param {google.privacy.dlp.v2.IInspectionRule} message InspectionRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InspectionRule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InspectionRule message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.InspectionRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.InspectionRule} InspectionRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InspectionRule.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.privacy.dlp.v2.InspectionRule(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.hotwordRule = $root.google.privacy.dlp.v2.CustomInfoType.DetectionRule.HotwordRule.decode(reader, reader.uint32()); + break; + case 2: + message.exclusionRule = $root.google.privacy.dlp.v2.ExclusionRule.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InspectionRule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.InspectionRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.InspectionRule} InspectionRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InspectionRule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InspectionRule message. + * @function verify + * @memberof google.privacy.dlp.v2.InspectionRule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InspectionRule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.hotwordRule != null && message.hasOwnProperty("hotwordRule")) { + properties.type = 1; + { + var error = $root.google.privacy.dlp.v2.CustomInfoType.DetectionRule.HotwordRule.verify(message.hotwordRule); + if (error) + return "hotwordRule." + error; + } + } + if (message.exclusionRule != null && message.hasOwnProperty("exclusionRule")) { + if (properties.type === 1) + return "type: multiple values"; + properties.type = 1; + { + var error = $root.google.privacy.dlp.v2.ExclusionRule.verify(message.exclusionRule); + if (error) + return "exclusionRule." + error; + } + } + return null; + }; + + /** + * Creates an InspectionRule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.InspectionRule + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.InspectionRule} InspectionRule + */ + InspectionRule.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.InspectionRule) + return object; + var message = new $root.google.privacy.dlp.v2.InspectionRule(); + if (object.hotwordRule != null) { + if (typeof object.hotwordRule !== "object") + throw TypeError(".google.privacy.dlp.v2.InspectionRule.hotwordRule: object expected"); + message.hotwordRule = $root.google.privacy.dlp.v2.CustomInfoType.DetectionRule.HotwordRule.fromObject(object.hotwordRule); + } + if (object.exclusionRule != null) { + if (typeof object.exclusionRule !== "object") + throw TypeError(".google.privacy.dlp.v2.InspectionRule.exclusionRule: object expected"); + message.exclusionRule = $root.google.privacy.dlp.v2.ExclusionRule.fromObject(object.exclusionRule); + } + return message; + }; + + /** + * Creates a plain object from an InspectionRule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.InspectionRule + * @static + * @param {google.privacy.dlp.v2.InspectionRule} message InspectionRule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InspectionRule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.hotwordRule != null && message.hasOwnProperty("hotwordRule")) { + object.hotwordRule = $root.google.privacy.dlp.v2.CustomInfoType.DetectionRule.HotwordRule.toObject(message.hotwordRule, options); + if (options.oneofs) + object.type = "hotwordRule"; + } + if (message.exclusionRule != null && message.hasOwnProperty("exclusionRule")) { + object.exclusionRule = $root.google.privacy.dlp.v2.ExclusionRule.toObject(message.exclusionRule, options); + if (options.oneofs) + object.type = "exclusionRule"; + } + return object; + }; + + /** + * Converts this InspectionRule to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.InspectionRule + * @instance + * @returns {Object.} JSON object + */ + InspectionRule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InspectionRule; + })(); + + v2.InspectionRuleSet = (function() { + + /** + * Properties of an InspectionRuleSet. + * @memberof google.privacy.dlp.v2 + * @interface IInspectionRuleSet + * @property {Array.|null} [infoTypes] InspectionRuleSet infoTypes + * @property {Array.|null} [rules] InspectionRuleSet rules + */ + + /** + * Constructs a new InspectionRuleSet. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents an InspectionRuleSet. + * @implements IInspectionRuleSet + * @constructor + * @param {google.privacy.dlp.v2.IInspectionRuleSet=} [properties] Properties to set + */ + function InspectionRuleSet(properties) { + this.infoTypes = []; + this.rules = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InspectionRuleSet infoTypes. + * @member {Array.} infoTypes + * @memberof google.privacy.dlp.v2.InspectionRuleSet + * @instance + */ + InspectionRuleSet.prototype.infoTypes = $util.emptyArray; + + /** + * InspectionRuleSet rules. + * @member {Array.} rules + * @memberof google.privacy.dlp.v2.InspectionRuleSet + * @instance + */ + InspectionRuleSet.prototype.rules = $util.emptyArray; + + /** + * Creates a new InspectionRuleSet instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.InspectionRuleSet + * @static + * @param {google.privacy.dlp.v2.IInspectionRuleSet=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.InspectionRuleSet} InspectionRuleSet instance + */ + InspectionRuleSet.create = function create(properties) { + return new InspectionRuleSet(properties); + }; + + /** + * Encodes the specified InspectionRuleSet message. Does not implicitly {@link google.privacy.dlp.v2.InspectionRuleSet.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.InspectionRuleSet + * @static + * @param {google.privacy.dlp.v2.IInspectionRuleSet} message InspectionRuleSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InspectionRuleSet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.infoTypes != null && message.infoTypes.length) + for (var i = 0; i < message.infoTypes.length; ++i) + $root.google.privacy.dlp.v2.InfoType.encode(message.infoTypes[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.rules != null && message.rules.length) + for (var i = 0; i < message.rules.length; ++i) + $root.google.privacy.dlp.v2.InspectionRule.encode(message.rules[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified InspectionRuleSet message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.InspectionRuleSet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.InspectionRuleSet + * @static + * @param {google.privacy.dlp.v2.IInspectionRuleSet} message InspectionRuleSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InspectionRuleSet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InspectionRuleSet message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.InspectionRuleSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.InspectionRuleSet} InspectionRuleSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InspectionRuleSet.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.privacy.dlp.v2.InspectionRuleSet(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.infoTypes && message.infoTypes.length)) + message.infoTypes = []; + message.infoTypes.push($root.google.privacy.dlp.v2.InfoType.decode(reader, reader.uint32())); + break; + case 2: + if (!(message.rules && message.rules.length)) + message.rules = []; + message.rules.push($root.google.privacy.dlp.v2.InspectionRule.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InspectionRuleSet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.InspectionRuleSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.InspectionRuleSet} InspectionRuleSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InspectionRuleSet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InspectionRuleSet message. + * @function verify + * @memberof google.privacy.dlp.v2.InspectionRuleSet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InspectionRuleSet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.infoTypes != null && message.hasOwnProperty("infoTypes")) { + if (!Array.isArray(message.infoTypes)) + return "infoTypes: array expected"; + for (var i = 0; i < message.infoTypes.length; ++i) { + var error = $root.google.privacy.dlp.v2.InfoType.verify(message.infoTypes[i]); + if (error) + return "infoTypes." + error; + } + } + 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.privacy.dlp.v2.InspectionRule.verify(message.rules[i]); + if (error) + return "rules." + error; + } + } + return null; + }; + + /** + * Creates an InspectionRuleSet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.InspectionRuleSet + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.InspectionRuleSet} InspectionRuleSet + */ + InspectionRuleSet.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.InspectionRuleSet) + return object; + var message = new $root.google.privacy.dlp.v2.InspectionRuleSet(); + if (object.infoTypes) { + if (!Array.isArray(object.infoTypes)) + throw TypeError(".google.privacy.dlp.v2.InspectionRuleSet.infoTypes: array expected"); + message.infoTypes = []; + for (var i = 0; i < object.infoTypes.length; ++i) { + if (typeof object.infoTypes[i] !== "object") + throw TypeError(".google.privacy.dlp.v2.InspectionRuleSet.infoTypes: object expected"); + message.infoTypes[i] = $root.google.privacy.dlp.v2.InfoType.fromObject(object.infoTypes[i]); + } + } + if (object.rules) { + if (!Array.isArray(object.rules)) + throw TypeError(".google.privacy.dlp.v2.InspectionRuleSet.rules: array expected"); + message.rules = []; + for (var i = 0; i < object.rules.length; ++i) { + if (typeof object.rules[i] !== "object") + throw TypeError(".google.privacy.dlp.v2.InspectionRuleSet.rules: object expected"); + message.rules[i] = $root.google.privacy.dlp.v2.InspectionRule.fromObject(object.rules[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an InspectionRuleSet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.InspectionRuleSet + * @static + * @param {google.privacy.dlp.v2.InspectionRuleSet} message InspectionRuleSet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InspectionRuleSet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.infoTypes = []; + object.rules = []; + } + if (message.infoTypes && message.infoTypes.length) { + object.infoTypes = []; + for (var j = 0; j < message.infoTypes.length; ++j) + object.infoTypes[j] = $root.google.privacy.dlp.v2.InfoType.toObject(message.infoTypes[j], options); + } + if (message.rules && message.rules.length) { + object.rules = []; + for (var j = 0; j < message.rules.length; ++j) + object.rules[j] = $root.google.privacy.dlp.v2.InspectionRule.toObject(message.rules[j], options); + } + return object; + }; + + /** + * Converts this InspectionRuleSet to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.InspectionRuleSet + * @instance + * @returns {Object.} JSON object + */ + InspectionRuleSet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InspectionRuleSet; + })(); + + v2.InspectConfig = (function() { + + /** + * Properties of an InspectConfig. + * @memberof google.privacy.dlp.v2 + * @interface IInspectConfig + * @property {Array.|null} [infoTypes] InspectConfig infoTypes + * @property {google.privacy.dlp.v2.Likelihood|null} [minLikelihood] InspectConfig minLikelihood + * @property {google.privacy.dlp.v2.InspectConfig.IFindingLimits|null} [limits] InspectConfig limits + * @property {boolean|null} [includeQuote] InspectConfig includeQuote + * @property {boolean|null} [excludeInfoTypes] InspectConfig excludeInfoTypes + * @property {Array.|null} [customInfoTypes] InspectConfig customInfoTypes + * @property {Array.|null} [contentOptions] InspectConfig contentOptions + * @property {Array.|null} [ruleSet] InspectConfig ruleSet + */ + + /** + * Constructs a new InspectConfig. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents an InspectConfig. + * @implements IInspectConfig + * @constructor + * @param {google.privacy.dlp.v2.IInspectConfig=} [properties] Properties to set + */ + function InspectConfig(properties) { + this.infoTypes = []; + this.customInfoTypes = []; + this.contentOptions = []; + this.ruleSet = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InspectConfig infoTypes. + * @member {Array.} infoTypes + * @memberof google.privacy.dlp.v2.InspectConfig + * @instance + */ + InspectConfig.prototype.infoTypes = $util.emptyArray; + + /** + * InspectConfig minLikelihood. + * @member {google.privacy.dlp.v2.Likelihood} minLikelihood + * @memberof google.privacy.dlp.v2.InspectConfig + * @instance + */ + InspectConfig.prototype.minLikelihood = 0; + + /** + * InspectConfig limits. + * @member {google.privacy.dlp.v2.InspectConfig.IFindingLimits|null|undefined} limits + * @memberof google.privacy.dlp.v2.InspectConfig + * @instance + */ + InspectConfig.prototype.limits = null; + + /** + * InspectConfig includeQuote. + * @member {boolean} includeQuote + * @memberof google.privacy.dlp.v2.InspectConfig + * @instance + */ + InspectConfig.prototype.includeQuote = false; + + /** + * InspectConfig excludeInfoTypes. + * @member {boolean} excludeInfoTypes + * @memberof google.privacy.dlp.v2.InspectConfig + * @instance + */ + InspectConfig.prototype.excludeInfoTypes = false; + + /** + * InspectConfig customInfoTypes. + * @member {Array.} customInfoTypes + * @memberof google.privacy.dlp.v2.InspectConfig + * @instance + */ + InspectConfig.prototype.customInfoTypes = $util.emptyArray; + + /** + * InspectConfig contentOptions. + * @member {Array.} contentOptions + * @memberof google.privacy.dlp.v2.InspectConfig + * @instance + */ + InspectConfig.prototype.contentOptions = $util.emptyArray; + + /** + * InspectConfig ruleSet. + * @member {Array.} ruleSet + * @memberof google.privacy.dlp.v2.InspectConfig + * @instance + */ + InspectConfig.prototype.ruleSet = $util.emptyArray; + + /** + * Creates a new InspectConfig instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.InspectConfig + * @static + * @param {google.privacy.dlp.v2.IInspectConfig=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.InspectConfig} InspectConfig instance + */ + InspectConfig.create = function create(properties) { + return new InspectConfig(properties); + }; + + /** + * Encodes the specified InspectConfig message. Does not implicitly {@link google.privacy.dlp.v2.InspectConfig.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.InspectConfig + * @static + * @param {google.privacy.dlp.v2.IInspectConfig} message InspectConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InspectConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.infoTypes != null && message.infoTypes.length) + for (var i = 0; i < message.infoTypes.length; ++i) + $root.google.privacy.dlp.v2.InfoType.encode(message.infoTypes[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.minLikelihood != null && Object.hasOwnProperty.call(message, "minLikelihood")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.minLikelihood); + if (message.limits != null && Object.hasOwnProperty.call(message, "limits")) + $root.google.privacy.dlp.v2.InspectConfig.FindingLimits.encode(message.limits, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.includeQuote != null && Object.hasOwnProperty.call(message, "includeQuote")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.includeQuote); + if (message.excludeInfoTypes != null && Object.hasOwnProperty.call(message, "excludeInfoTypes")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.excludeInfoTypes); + if (message.customInfoTypes != null && message.customInfoTypes.length) + for (var i = 0; i < message.customInfoTypes.length; ++i) + $root.google.privacy.dlp.v2.CustomInfoType.encode(message.customInfoTypes[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.contentOptions != null && message.contentOptions.length) { + writer.uint32(/* id 8, wireType 2 =*/66).fork(); + for (var i = 0; i < message.contentOptions.length; ++i) + writer.int32(message.contentOptions[i]); + writer.ldelim(); + } + if (message.ruleSet != null && message.ruleSet.length) + for (var i = 0; i < message.ruleSet.length; ++i) + $root.google.privacy.dlp.v2.InspectionRuleSet.encode(message.ruleSet[i], writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified InspectConfig message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.InspectConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.InspectConfig + * @static + * @param {google.privacy.dlp.v2.IInspectConfig} message InspectConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InspectConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InspectConfig message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.InspectConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.InspectConfig} InspectConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InspectConfig.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.privacy.dlp.v2.InspectConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.infoTypes && message.infoTypes.length)) + message.infoTypes = []; + message.infoTypes.push($root.google.privacy.dlp.v2.InfoType.decode(reader, reader.uint32())); + break; + case 2: + message.minLikelihood = reader.int32(); + break; + case 3: + message.limits = $root.google.privacy.dlp.v2.InspectConfig.FindingLimits.decode(reader, reader.uint32()); + break; + case 4: + message.includeQuote = reader.bool(); + break; + case 5: + message.excludeInfoTypes = reader.bool(); + break; + case 6: + if (!(message.customInfoTypes && message.customInfoTypes.length)) + message.customInfoTypes = []; + message.customInfoTypes.push($root.google.privacy.dlp.v2.CustomInfoType.decode(reader, reader.uint32())); + break; + case 8: + if (!(message.contentOptions && message.contentOptions.length)) + message.contentOptions = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.contentOptions.push(reader.int32()); + } else + message.contentOptions.push(reader.int32()); + break; + case 10: + if (!(message.ruleSet && message.ruleSet.length)) + message.ruleSet = []; + message.ruleSet.push($root.google.privacy.dlp.v2.InspectionRuleSet.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InspectConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.InspectConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.InspectConfig} InspectConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InspectConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InspectConfig message. + * @function verify + * @memberof google.privacy.dlp.v2.InspectConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InspectConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.infoTypes != null && message.hasOwnProperty("infoTypes")) { + if (!Array.isArray(message.infoTypes)) + return "infoTypes: array expected"; + for (var i = 0; i < message.infoTypes.length; ++i) { + var error = $root.google.privacy.dlp.v2.InfoType.verify(message.infoTypes[i]); + if (error) + return "infoTypes." + error; + } + } + if (message.minLikelihood != null && message.hasOwnProperty("minLikelihood")) + switch (message.minLikelihood) { + default: + return "minLikelihood: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.limits != null && message.hasOwnProperty("limits")) { + var error = $root.google.privacy.dlp.v2.InspectConfig.FindingLimits.verify(message.limits); + if (error) + return "limits." + error; + } + if (message.includeQuote != null && message.hasOwnProperty("includeQuote")) + if (typeof message.includeQuote !== "boolean") + return "includeQuote: boolean expected"; + if (message.excludeInfoTypes != null && message.hasOwnProperty("excludeInfoTypes")) + if (typeof message.excludeInfoTypes !== "boolean") + return "excludeInfoTypes: boolean expected"; + if (message.customInfoTypes != null && message.hasOwnProperty("customInfoTypes")) { + if (!Array.isArray(message.customInfoTypes)) + return "customInfoTypes: array expected"; + for (var i = 0; i < message.customInfoTypes.length; ++i) { + var error = $root.google.privacy.dlp.v2.CustomInfoType.verify(message.customInfoTypes[i]); + if (error) + return "customInfoTypes." + error; + } + } + if (message.contentOptions != null && message.hasOwnProperty("contentOptions")) { + if (!Array.isArray(message.contentOptions)) + return "contentOptions: array expected"; + for (var i = 0; i < message.contentOptions.length; ++i) + switch (message.contentOptions[i]) { + default: + return "contentOptions: enum value[] expected"; + case 0: + case 1: + case 2: + break; + } + } + if (message.ruleSet != null && message.hasOwnProperty("ruleSet")) { + if (!Array.isArray(message.ruleSet)) + return "ruleSet: array expected"; + for (var i = 0; i < message.ruleSet.length; ++i) { + var error = $root.google.privacy.dlp.v2.InspectionRuleSet.verify(message.ruleSet[i]); + if (error) + return "ruleSet." + error; + } + } + return null; + }; + + /** + * Creates an InspectConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.InspectConfig + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.InspectConfig} InspectConfig + */ + InspectConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.InspectConfig) + return object; + var message = new $root.google.privacy.dlp.v2.InspectConfig(); + if (object.infoTypes) { + if (!Array.isArray(object.infoTypes)) + throw TypeError(".google.privacy.dlp.v2.InspectConfig.infoTypes: array expected"); + message.infoTypes = []; + for (var i = 0; i < object.infoTypes.length; ++i) { + if (typeof object.infoTypes[i] !== "object") + throw TypeError(".google.privacy.dlp.v2.InspectConfig.infoTypes: object expected"); + message.infoTypes[i] = $root.google.privacy.dlp.v2.InfoType.fromObject(object.infoTypes[i]); + } + } + switch (object.minLikelihood) { + case "LIKELIHOOD_UNSPECIFIED": + case 0: + message.minLikelihood = 0; + break; + case "VERY_UNLIKELY": + case 1: + message.minLikelihood = 1; + break; + case "UNLIKELY": + case 2: + message.minLikelihood = 2; + break; + case "POSSIBLE": + case 3: + message.minLikelihood = 3; + break; + case "LIKELY": + case 4: + message.minLikelihood = 4; + break; + case "VERY_LIKELY": + case 5: + message.minLikelihood = 5; + break; + } + if (object.limits != null) { + if (typeof object.limits !== "object") + throw TypeError(".google.privacy.dlp.v2.InspectConfig.limits: object expected"); + message.limits = $root.google.privacy.dlp.v2.InspectConfig.FindingLimits.fromObject(object.limits); + } + if (object.includeQuote != null) + message.includeQuote = Boolean(object.includeQuote); + if (object.excludeInfoTypes != null) + message.excludeInfoTypes = Boolean(object.excludeInfoTypes); + if (object.customInfoTypes) { + if (!Array.isArray(object.customInfoTypes)) + throw TypeError(".google.privacy.dlp.v2.InspectConfig.customInfoTypes: array expected"); + message.customInfoTypes = []; + for (var i = 0; i < object.customInfoTypes.length; ++i) { + if (typeof object.customInfoTypes[i] !== "object") + throw TypeError(".google.privacy.dlp.v2.InspectConfig.customInfoTypes: object expected"); + message.customInfoTypes[i] = $root.google.privacy.dlp.v2.CustomInfoType.fromObject(object.customInfoTypes[i]); + } + } + if (object.contentOptions) { + if (!Array.isArray(object.contentOptions)) + throw TypeError(".google.privacy.dlp.v2.InspectConfig.contentOptions: array expected"); + message.contentOptions = []; + for (var i = 0; i < object.contentOptions.length; ++i) + switch (object.contentOptions[i]) { + default: + case "CONTENT_UNSPECIFIED": + case 0: + message.contentOptions[i] = 0; + break; + case "CONTENT_TEXT": + case 1: + message.contentOptions[i] = 1; + break; + case "CONTENT_IMAGE": + case 2: + message.contentOptions[i] = 2; + break; + } + } + if (object.ruleSet) { + if (!Array.isArray(object.ruleSet)) + throw TypeError(".google.privacy.dlp.v2.InspectConfig.ruleSet: array expected"); + message.ruleSet = []; + for (var i = 0; i < object.ruleSet.length; ++i) { + if (typeof object.ruleSet[i] !== "object") + throw TypeError(".google.privacy.dlp.v2.InspectConfig.ruleSet: object expected"); + message.ruleSet[i] = $root.google.privacy.dlp.v2.InspectionRuleSet.fromObject(object.ruleSet[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an InspectConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.InspectConfig + * @static + * @param {google.privacy.dlp.v2.InspectConfig} message InspectConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InspectConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.infoTypes = []; + object.customInfoTypes = []; + object.contentOptions = []; + object.ruleSet = []; + } + if (options.defaults) { + object.minLikelihood = options.enums === String ? "LIKELIHOOD_UNSPECIFIED" : 0; + object.limits = null; + object.includeQuote = false; + object.excludeInfoTypes = false; + } + if (message.infoTypes && message.infoTypes.length) { + object.infoTypes = []; + for (var j = 0; j < message.infoTypes.length; ++j) + object.infoTypes[j] = $root.google.privacy.dlp.v2.InfoType.toObject(message.infoTypes[j], options); + } + if (message.minLikelihood != null && message.hasOwnProperty("minLikelihood")) + object.minLikelihood = options.enums === String ? $root.google.privacy.dlp.v2.Likelihood[message.minLikelihood] : message.minLikelihood; + if (message.limits != null && message.hasOwnProperty("limits")) + object.limits = $root.google.privacy.dlp.v2.InspectConfig.FindingLimits.toObject(message.limits, options); + if (message.includeQuote != null && message.hasOwnProperty("includeQuote")) + object.includeQuote = message.includeQuote; + if (message.excludeInfoTypes != null && message.hasOwnProperty("excludeInfoTypes")) + object.excludeInfoTypes = message.excludeInfoTypes; + if (message.customInfoTypes && message.customInfoTypes.length) { + object.customInfoTypes = []; + for (var j = 0; j < message.customInfoTypes.length; ++j) + object.customInfoTypes[j] = $root.google.privacy.dlp.v2.CustomInfoType.toObject(message.customInfoTypes[j], options); + } + if (message.contentOptions && message.contentOptions.length) { + object.contentOptions = []; + for (var j = 0; j < message.contentOptions.length; ++j) + object.contentOptions[j] = options.enums === String ? $root.google.privacy.dlp.v2.ContentOption[message.contentOptions[j]] : message.contentOptions[j]; + } + if (message.ruleSet && message.ruleSet.length) { + object.ruleSet = []; + for (var j = 0; j < message.ruleSet.length; ++j) + object.ruleSet[j] = $root.google.privacy.dlp.v2.InspectionRuleSet.toObject(message.ruleSet[j], options); + } + return object; + }; + + /** + * Converts this InspectConfig to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.InspectConfig + * @instance + * @returns {Object.} JSON object + */ + InspectConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + InspectConfig.FindingLimits = (function() { + + /** + * Properties of a FindingLimits. + * @memberof google.privacy.dlp.v2.InspectConfig + * @interface IFindingLimits + * @property {number|null} [maxFindingsPerItem] FindingLimits maxFindingsPerItem + * @property {number|null} [maxFindingsPerRequest] FindingLimits maxFindingsPerRequest + * @property {Array.|null} [maxFindingsPerInfoType] FindingLimits maxFindingsPerInfoType + */ + + /** + * Constructs a new FindingLimits. + * @memberof google.privacy.dlp.v2.InspectConfig + * @classdesc Represents a FindingLimits. + * @implements IFindingLimits + * @constructor + * @param {google.privacy.dlp.v2.InspectConfig.IFindingLimits=} [properties] Properties to set + */ + function FindingLimits(properties) { + this.maxFindingsPerInfoType = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FindingLimits maxFindingsPerItem. + * @member {number} maxFindingsPerItem + * @memberof google.privacy.dlp.v2.InspectConfig.FindingLimits + * @instance + */ + FindingLimits.prototype.maxFindingsPerItem = 0; + + /** + * FindingLimits maxFindingsPerRequest. + * @member {number} maxFindingsPerRequest + * @memberof google.privacy.dlp.v2.InspectConfig.FindingLimits + * @instance + */ + FindingLimits.prototype.maxFindingsPerRequest = 0; + + /** + * FindingLimits maxFindingsPerInfoType. + * @member {Array.} maxFindingsPerInfoType + * @memberof google.privacy.dlp.v2.InspectConfig.FindingLimits + * @instance + */ + FindingLimits.prototype.maxFindingsPerInfoType = $util.emptyArray; + + /** + * Creates a new FindingLimits instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.InspectConfig.FindingLimits + * @static + * @param {google.privacy.dlp.v2.InspectConfig.IFindingLimits=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.InspectConfig.FindingLimits} FindingLimits instance + */ + FindingLimits.create = function create(properties) { + return new FindingLimits(properties); + }; + + /** + * Encodes the specified FindingLimits message. Does not implicitly {@link google.privacy.dlp.v2.InspectConfig.FindingLimits.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.InspectConfig.FindingLimits + * @static + * @param {google.privacy.dlp.v2.InspectConfig.IFindingLimits} message FindingLimits message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FindingLimits.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.maxFindingsPerItem != null && Object.hasOwnProperty.call(message, "maxFindingsPerItem")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.maxFindingsPerItem); + if (message.maxFindingsPerRequest != null && Object.hasOwnProperty.call(message, "maxFindingsPerRequest")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.maxFindingsPerRequest); + if (message.maxFindingsPerInfoType != null && message.maxFindingsPerInfoType.length) + for (var i = 0; i < message.maxFindingsPerInfoType.length; ++i) + $root.google.privacy.dlp.v2.InspectConfig.FindingLimits.InfoTypeLimit.encode(message.maxFindingsPerInfoType[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FindingLimits message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.InspectConfig.FindingLimits.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.InspectConfig.FindingLimits + * @static + * @param {google.privacy.dlp.v2.InspectConfig.IFindingLimits} message FindingLimits message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FindingLimits.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FindingLimits message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.InspectConfig.FindingLimits + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.InspectConfig.FindingLimits} FindingLimits + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FindingLimits.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.privacy.dlp.v2.InspectConfig.FindingLimits(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.maxFindingsPerItem = reader.int32(); + break; + case 2: + message.maxFindingsPerRequest = reader.int32(); + break; + case 3: + if (!(message.maxFindingsPerInfoType && message.maxFindingsPerInfoType.length)) + message.maxFindingsPerInfoType = []; + message.maxFindingsPerInfoType.push($root.google.privacy.dlp.v2.InspectConfig.FindingLimits.InfoTypeLimit.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FindingLimits message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.InspectConfig.FindingLimits + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.InspectConfig.FindingLimits} FindingLimits + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FindingLimits.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FindingLimits message. + * @function verify + * @memberof google.privacy.dlp.v2.InspectConfig.FindingLimits + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FindingLimits.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.maxFindingsPerItem != null && message.hasOwnProperty("maxFindingsPerItem")) + if (!$util.isInteger(message.maxFindingsPerItem)) + return "maxFindingsPerItem: integer expected"; + if (message.maxFindingsPerRequest != null && message.hasOwnProperty("maxFindingsPerRequest")) + if (!$util.isInteger(message.maxFindingsPerRequest)) + return "maxFindingsPerRequest: integer expected"; + if (message.maxFindingsPerInfoType != null && message.hasOwnProperty("maxFindingsPerInfoType")) { + if (!Array.isArray(message.maxFindingsPerInfoType)) + return "maxFindingsPerInfoType: array expected"; + for (var i = 0; i < message.maxFindingsPerInfoType.length; ++i) { + var error = $root.google.privacy.dlp.v2.InspectConfig.FindingLimits.InfoTypeLimit.verify(message.maxFindingsPerInfoType[i]); + if (error) + return "maxFindingsPerInfoType." + error; + } + } + return null; + }; + + /** + * Creates a FindingLimits message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.InspectConfig.FindingLimits + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.InspectConfig.FindingLimits} FindingLimits + */ + FindingLimits.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.InspectConfig.FindingLimits) + return object; + var message = new $root.google.privacy.dlp.v2.InspectConfig.FindingLimits(); + if (object.maxFindingsPerItem != null) + message.maxFindingsPerItem = object.maxFindingsPerItem | 0; + if (object.maxFindingsPerRequest != null) + message.maxFindingsPerRequest = object.maxFindingsPerRequest | 0; + if (object.maxFindingsPerInfoType) { + if (!Array.isArray(object.maxFindingsPerInfoType)) + throw TypeError(".google.privacy.dlp.v2.InspectConfig.FindingLimits.maxFindingsPerInfoType: array expected"); + message.maxFindingsPerInfoType = []; + for (var i = 0; i < object.maxFindingsPerInfoType.length; ++i) { + if (typeof object.maxFindingsPerInfoType[i] !== "object") + throw TypeError(".google.privacy.dlp.v2.InspectConfig.FindingLimits.maxFindingsPerInfoType: object expected"); + message.maxFindingsPerInfoType[i] = $root.google.privacy.dlp.v2.InspectConfig.FindingLimits.InfoTypeLimit.fromObject(object.maxFindingsPerInfoType[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a FindingLimits message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.InspectConfig.FindingLimits + * @static + * @param {google.privacy.dlp.v2.InspectConfig.FindingLimits} message FindingLimits + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FindingLimits.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.maxFindingsPerInfoType = []; + if (options.defaults) { + object.maxFindingsPerItem = 0; + object.maxFindingsPerRequest = 0; + } + if (message.maxFindingsPerItem != null && message.hasOwnProperty("maxFindingsPerItem")) + object.maxFindingsPerItem = message.maxFindingsPerItem; + if (message.maxFindingsPerRequest != null && message.hasOwnProperty("maxFindingsPerRequest")) + object.maxFindingsPerRequest = message.maxFindingsPerRequest; + if (message.maxFindingsPerInfoType && message.maxFindingsPerInfoType.length) { + object.maxFindingsPerInfoType = []; + for (var j = 0; j < message.maxFindingsPerInfoType.length; ++j) + object.maxFindingsPerInfoType[j] = $root.google.privacy.dlp.v2.InspectConfig.FindingLimits.InfoTypeLimit.toObject(message.maxFindingsPerInfoType[j], options); + } + return object; + }; + + /** + * Converts this FindingLimits to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.InspectConfig.FindingLimits + * @instance + * @returns {Object.} JSON object + */ + FindingLimits.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + FindingLimits.InfoTypeLimit = (function() { + + /** + * Properties of an InfoTypeLimit. + * @memberof google.privacy.dlp.v2.InspectConfig.FindingLimits + * @interface IInfoTypeLimit + * @property {google.privacy.dlp.v2.IInfoType|null} [infoType] InfoTypeLimit infoType + * @property {number|null} [maxFindings] InfoTypeLimit maxFindings + */ + + /** + * Constructs a new InfoTypeLimit. + * @memberof google.privacy.dlp.v2.InspectConfig.FindingLimits + * @classdesc Represents an InfoTypeLimit. + * @implements IInfoTypeLimit + * @constructor + * @param {google.privacy.dlp.v2.InspectConfig.FindingLimits.IInfoTypeLimit=} [properties] Properties to set + */ + function InfoTypeLimit(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InfoTypeLimit infoType. + * @member {google.privacy.dlp.v2.IInfoType|null|undefined} infoType + * @memberof google.privacy.dlp.v2.InspectConfig.FindingLimits.InfoTypeLimit + * @instance + */ + InfoTypeLimit.prototype.infoType = null; + + /** + * InfoTypeLimit maxFindings. + * @member {number} maxFindings + * @memberof google.privacy.dlp.v2.InspectConfig.FindingLimits.InfoTypeLimit + * @instance + */ + InfoTypeLimit.prototype.maxFindings = 0; + + /** + * Creates a new InfoTypeLimit instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.InspectConfig.FindingLimits.InfoTypeLimit + * @static + * @param {google.privacy.dlp.v2.InspectConfig.FindingLimits.IInfoTypeLimit=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.InspectConfig.FindingLimits.InfoTypeLimit} InfoTypeLimit instance + */ + InfoTypeLimit.create = function create(properties) { + return new InfoTypeLimit(properties); + }; + + /** + * Encodes the specified InfoTypeLimit message. Does not implicitly {@link google.privacy.dlp.v2.InspectConfig.FindingLimits.InfoTypeLimit.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.InspectConfig.FindingLimits.InfoTypeLimit + * @static + * @param {google.privacy.dlp.v2.InspectConfig.FindingLimits.IInfoTypeLimit} message InfoTypeLimit message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InfoTypeLimit.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.infoType != null && Object.hasOwnProperty.call(message, "infoType")) + $root.google.privacy.dlp.v2.InfoType.encode(message.infoType, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.maxFindings != null && Object.hasOwnProperty.call(message, "maxFindings")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.maxFindings); + return writer; + }; + + /** + * Encodes the specified InfoTypeLimit message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.InspectConfig.FindingLimits.InfoTypeLimit.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.InspectConfig.FindingLimits.InfoTypeLimit + * @static + * @param {google.privacy.dlp.v2.InspectConfig.FindingLimits.IInfoTypeLimit} message InfoTypeLimit message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InfoTypeLimit.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InfoTypeLimit message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.InspectConfig.FindingLimits.InfoTypeLimit + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.InspectConfig.FindingLimits.InfoTypeLimit} InfoTypeLimit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InfoTypeLimit.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.privacy.dlp.v2.InspectConfig.FindingLimits.InfoTypeLimit(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.infoType = $root.google.privacy.dlp.v2.InfoType.decode(reader, reader.uint32()); + break; + case 2: + message.maxFindings = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InfoTypeLimit message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.InspectConfig.FindingLimits.InfoTypeLimit + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.InspectConfig.FindingLimits.InfoTypeLimit} InfoTypeLimit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InfoTypeLimit.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InfoTypeLimit message. + * @function verify + * @memberof google.privacy.dlp.v2.InspectConfig.FindingLimits.InfoTypeLimit + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InfoTypeLimit.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.infoType != null && message.hasOwnProperty("infoType")) { + var error = $root.google.privacy.dlp.v2.InfoType.verify(message.infoType); + if (error) + return "infoType." + error; + } + if (message.maxFindings != null && message.hasOwnProperty("maxFindings")) + if (!$util.isInteger(message.maxFindings)) + return "maxFindings: integer expected"; + return null; + }; + + /** + * Creates an InfoTypeLimit message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.InspectConfig.FindingLimits.InfoTypeLimit + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.InspectConfig.FindingLimits.InfoTypeLimit} InfoTypeLimit + */ + InfoTypeLimit.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.InspectConfig.FindingLimits.InfoTypeLimit) + return object; + var message = new $root.google.privacy.dlp.v2.InspectConfig.FindingLimits.InfoTypeLimit(); + if (object.infoType != null) { + if (typeof object.infoType !== "object") + throw TypeError(".google.privacy.dlp.v2.InspectConfig.FindingLimits.InfoTypeLimit.infoType: object expected"); + message.infoType = $root.google.privacy.dlp.v2.InfoType.fromObject(object.infoType); + } + if (object.maxFindings != null) + message.maxFindings = object.maxFindings | 0; + return message; + }; + + /** + * Creates a plain object from an InfoTypeLimit message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.InspectConfig.FindingLimits.InfoTypeLimit + * @static + * @param {google.privacy.dlp.v2.InspectConfig.FindingLimits.InfoTypeLimit} message InfoTypeLimit + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InfoTypeLimit.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.infoType = null; + object.maxFindings = 0; + } + if (message.infoType != null && message.hasOwnProperty("infoType")) + object.infoType = $root.google.privacy.dlp.v2.InfoType.toObject(message.infoType, options); + if (message.maxFindings != null && message.hasOwnProperty("maxFindings")) + object.maxFindings = message.maxFindings; + return object; + }; + + /** + * Converts this InfoTypeLimit to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.InspectConfig.FindingLimits.InfoTypeLimit + * @instance + * @returns {Object.} JSON object + */ + InfoTypeLimit.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InfoTypeLimit; + })(); + + return FindingLimits; + })(); + + return InspectConfig; + })(); + + v2.ByteContentItem = (function() { + + /** + * Properties of a ByteContentItem. + * @memberof google.privacy.dlp.v2 + * @interface IByteContentItem + * @property {google.privacy.dlp.v2.ByteContentItem.BytesType|null} [type] ByteContentItem type + * @property {Uint8Array|null} [data] ByteContentItem data + */ + + /** + * Constructs a new ByteContentItem. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents a ByteContentItem. + * @implements IByteContentItem + * @constructor + * @param {google.privacy.dlp.v2.IByteContentItem=} [properties] Properties to set + */ + function ByteContentItem(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ByteContentItem type. + * @member {google.privacy.dlp.v2.ByteContentItem.BytesType} type + * @memberof google.privacy.dlp.v2.ByteContentItem + * @instance + */ + ByteContentItem.prototype.type = 0; + + /** + * ByteContentItem data. + * @member {Uint8Array} data + * @memberof google.privacy.dlp.v2.ByteContentItem + * @instance + */ + ByteContentItem.prototype.data = $util.newBuffer([]); + + /** + * Creates a new ByteContentItem instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.ByteContentItem + * @static + * @param {google.privacy.dlp.v2.IByteContentItem=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.ByteContentItem} ByteContentItem instance + */ + ByteContentItem.create = function create(properties) { + return new ByteContentItem(properties); + }; + + /** + * Encodes the specified ByteContentItem message. Does not implicitly {@link google.privacy.dlp.v2.ByteContentItem.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.ByteContentItem + * @static + * @param {google.privacy.dlp.v2.IByteContentItem} message ByteContentItem message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ByteContentItem.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.type); + if (message.data != null && Object.hasOwnProperty.call(message, "data")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.data); + return writer; + }; + + /** + * Encodes the specified ByteContentItem message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.ByteContentItem.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.ByteContentItem + * @static + * @param {google.privacy.dlp.v2.IByteContentItem} message ByteContentItem message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ByteContentItem.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ByteContentItem message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.ByteContentItem + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.ByteContentItem} ByteContentItem + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ByteContentItem.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.privacy.dlp.v2.ByteContentItem(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.type = reader.int32(); + break; + case 2: + message.data = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ByteContentItem message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.ByteContentItem + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.ByteContentItem} ByteContentItem + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ByteContentItem.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ByteContentItem message. + * @function verify + * @memberof google.privacy.dlp.v2.ByteContentItem + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ByteContentItem.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 6: + case 1: + case 2: + case 3: + case 4: + case 5: + case 7: + case 8: + case 11: + case 12: + case 13: + break; + } + if (message.data != null && message.hasOwnProperty("data")) + if (!(message.data && typeof message.data.length === "number" || $util.isString(message.data))) + return "data: buffer expected"; + return null; + }; + + /** + * Creates a ByteContentItem message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.ByteContentItem + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.ByteContentItem} ByteContentItem + */ + ByteContentItem.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.ByteContentItem) + return object; + var message = new $root.google.privacy.dlp.v2.ByteContentItem(); + switch (object.type) { + case "BYTES_TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "IMAGE": + case 6: + message.type = 6; + break; + case "IMAGE_JPEG": + case 1: + message.type = 1; + break; + case "IMAGE_BMP": + case 2: + message.type = 2; + break; + case "IMAGE_PNG": + case 3: + message.type = 3; + break; + case "IMAGE_SVG": + case 4: + message.type = 4; + break; + case "TEXT_UTF8": + case 5: + message.type = 5; + break; + case "WORD_DOCUMENT": + case 7: + message.type = 7; + break; + case "PDF": + case 8: + message.type = 8; + break; + case "AVRO": + case 11: + message.type = 11; + break; + case "CSV": + case 12: + message.type = 12; + break; + case "TSV": + case 13: + message.type = 13; + break; + } + if (object.data != null) + if (typeof object.data === "string") + $util.base64.decode(object.data, message.data = $util.newBuffer($util.base64.length(object.data)), 0); + else if (object.data.length) + message.data = object.data; + return message; + }; + + /** + * Creates a plain object from a ByteContentItem message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.ByteContentItem + * @static + * @param {google.privacy.dlp.v2.ByteContentItem} message ByteContentItem + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ByteContentItem.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = options.enums === String ? "BYTES_TYPE_UNSPECIFIED" : 0; + if (options.bytes === String) + object.data = ""; + else { + object.data = []; + if (options.bytes !== Array) + object.data = $util.newBuffer(object.data); + } + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.privacy.dlp.v2.ByteContentItem.BytesType[message.type] : message.type; + if (message.data != null && message.hasOwnProperty("data")) + object.data = options.bytes === String ? $util.base64.encode(message.data, 0, message.data.length) : options.bytes === Array ? Array.prototype.slice.call(message.data) : message.data; + return object; + }; + + /** + * Converts this ByteContentItem to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.ByteContentItem + * @instance + * @returns {Object.} JSON object + */ + ByteContentItem.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * BytesType enum. + * @name google.privacy.dlp.v2.ByteContentItem.BytesType + * @enum {number} + * @property {number} BYTES_TYPE_UNSPECIFIED=0 BYTES_TYPE_UNSPECIFIED value + * @property {number} IMAGE=6 IMAGE value + * @property {number} IMAGE_JPEG=1 IMAGE_JPEG value + * @property {number} IMAGE_BMP=2 IMAGE_BMP value + * @property {number} IMAGE_PNG=3 IMAGE_PNG value + * @property {number} IMAGE_SVG=4 IMAGE_SVG value + * @property {number} TEXT_UTF8=5 TEXT_UTF8 value + * @property {number} WORD_DOCUMENT=7 WORD_DOCUMENT value + * @property {number} PDF=8 PDF value + * @property {number} AVRO=11 AVRO value + * @property {number} CSV=12 CSV value + * @property {number} TSV=13 TSV value + */ + ByteContentItem.BytesType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "BYTES_TYPE_UNSPECIFIED"] = 0; + values[valuesById[6] = "IMAGE"] = 6; + values[valuesById[1] = "IMAGE_JPEG"] = 1; + values[valuesById[2] = "IMAGE_BMP"] = 2; + values[valuesById[3] = "IMAGE_PNG"] = 3; + values[valuesById[4] = "IMAGE_SVG"] = 4; + values[valuesById[5] = "TEXT_UTF8"] = 5; + values[valuesById[7] = "WORD_DOCUMENT"] = 7; + values[valuesById[8] = "PDF"] = 8; + values[valuesById[11] = "AVRO"] = 11; + values[valuesById[12] = "CSV"] = 12; + values[valuesById[13] = "TSV"] = 13; + return values; + })(); + + return ByteContentItem; + })(); + + v2.ContentItem = (function() { + + /** + * Properties of a ContentItem. + * @memberof google.privacy.dlp.v2 + * @interface IContentItem + * @property {string|null} [value] ContentItem value + * @property {google.privacy.dlp.v2.ITable|null} [table] ContentItem table + * @property {google.privacy.dlp.v2.IByteContentItem|null} [byteItem] ContentItem byteItem + */ + + /** + * Constructs a new ContentItem. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents a ContentItem. + * @implements IContentItem + * @constructor + * @param {google.privacy.dlp.v2.IContentItem=} [properties] Properties to set + */ + function ContentItem(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ContentItem value. + * @member {string} value + * @memberof google.privacy.dlp.v2.ContentItem + * @instance + */ + ContentItem.prototype.value = ""; + + /** + * ContentItem table. + * @member {google.privacy.dlp.v2.ITable|null|undefined} table + * @memberof google.privacy.dlp.v2.ContentItem + * @instance + */ + ContentItem.prototype.table = null; + + /** + * ContentItem byteItem. + * @member {google.privacy.dlp.v2.IByteContentItem|null|undefined} byteItem + * @memberof google.privacy.dlp.v2.ContentItem + * @instance + */ + ContentItem.prototype.byteItem = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ContentItem dataItem. + * @member {"value"|"table"|"byteItem"|undefined} dataItem + * @memberof google.privacy.dlp.v2.ContentItem + * @instance + */ + Object.defineProperty(ContentItem.prototype, "dataItem", { + get: $util.oneOfGetter($oneOfFields = ["value", "table", "byteItem"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ContentItem instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.ContentItem + * @static + * @param {google.privacy.dlp.v2.IContentItem=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.ContentItem} ContentItem instance + */ + ContentItem.create = function create(properties) { + return new ContentItem(properties); + }; + + /** + * Encodes the specified ContentItem message. Does not implicitly {@link google.privacy.dlp.v2.ContentItem.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.ContentItem + * @static + * @param {google.privacy.dlp.v2.IContentItem} message ContentItem message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContentItem.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.value); + if (message.table != null && Object.hasOwnProperty.call(message, "table")) + $root.google.privacy.dlp.v2.Table.encode(message.table, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.byteItem != null && Object.hasOwnProperty.call(message, "byteItem")) + $root.google.privacy.dlp.v2.ByteContentItem.encode(message.byteItem, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ContentItem message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.ContentItem.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.ContentItem + * @static + * @param {google.privacy.dlp.v2.IContentItem} message ContentItem message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContentItem.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ContentItem message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.ContentItem + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.ContentItem} ContentItem + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContentItem.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.privacy.dlp.v2.ContentItem(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: + message.value = reader.string(); + break; + case 4: + message.table = $root.google.privacy.dlp.v2.Table.decode(reader, reader.uint32()); + break; + case 5: + message.byteItem = $root.google.privacy.dlp.v2.ByteContentItem.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ContentItem message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.ContentItem + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.ContentItem} ContentItem + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContentItem.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ContentItem message. + * @function verify + * @memberof google.privacy.dlp.v2.ContentItem + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ContentItem.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.value != null && message.hasOwnProperty("value")) { + properties.dataItem = 1; + if (!$util.isString(message.value)) + return "value: string expected"; + } + if (message.table != null && message.hasOwnProperty("table")) { + if (properties.dataItem === 1) + return "dataItem: multiple values"; + properties.dataItem = 1; + { + var error = $root.google.privacy.dlp.v2.Table.verify(message.table); + if (error) + return "table." + error; + } + } + if (message.byteItem != null && message.hasOwnProperty("byteItem")) { + if (properties.dataItem === 1) + return "dataItem: multiple values"; + properties.dataItem = 1; + { + var error = $root.google.privacy.dlp.v2.ByteContentItem.verify(message.byteItem); + if (error) + return "byteItem." + error; + } + } + return null; + }; + + /** + * Creates a ContentItem message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.ContentItem + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.ContentItem} ContentItem + */ + ContentItem.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.ContentItem) + return object; + var message = new $root.google.privacy.dlp.v2.ContentItem(); + if (object.value != null) + message.value = String(object.value); + if (object.table != null) { + if (typeof object.table !== "object") + throw TypeError(".google.privacy.dlp.v2.ContentItem.table: object expected"); + message.table = $root.google.privacy.dlp.v2.Table.fromObject(object.table); + } + if (object.byteItem != null) { + if (typeof object.byteItem !== "object") + throw TypeError(".google.privacy.dlp.v2.ContentItem.byteItem: object expected"); + message.byteItem = $root.google.privacy.dlp.v2.ByteContentItem.fromObject(object.byteItem); + } + return message; + }; + + /** + * Creates a plain object from a ContentItem message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.ContentItem + * @static + * @param {google.privacy.dlp.v2.ContentItem} message ContentItem + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ContentItem.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.value != null && message.hasOwnProperty("value")) { + object.value = message.value; + if (options.oneofs) + object.dataItem = "value"; + } + if (message.table != null && message.hasOwnProperty("table")) { + object.table = $root.google.privacy.dlp.v2.Table.toObject(message.table, options); + if (options.oneofs) + object.dataItem = "table"; + } + if (message.byteItem != null && message.hasOwnProperty("byteItem")) { + object.byteItem = $root.google.privacy.dlp.v2.ByteContentItem.toObject(message.byteItem, options); + if (options.oneofs) + object.dataItem = "byteItem"; + } + return object; + }; + + /** + * Converts this ContentItem to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.ContentItem + * @instance + * @returns {Object.} JSON object + */ + ContentItem.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ContentItem; + })(); + + v2.Table = (function() { + + /** + * Properties of a Table. + * @memberof google.privacy.dlp.v2 + * @interface ITable + * @property {Array.|null} [headers] Table headers + * @property {Array.|null} [rows] Table rows + */ + + /** + * Constructs a new Table. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents a Table. + * @implements ITable + * @constructor + * @param {google.privacy.dlp.v2.ITable=} [properties] Properties to set + */ + function Table(properties) { + this.headers = []; + this.rows = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Table headers. + * @member {Array.} headers + * @memberof google.privacy.dlp.v2.Table + * @instance + */ + Table.prototype.headers = $util.emptyArray; + + /** + * Table rows. + * @member {Array.} rows + * @memberof google.privacy.dlp.v2.Table + * @instance + */ + Table.prototype.rows = $util.emptyArray; + + /** + * Creates a new Table instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.Table + * @static + * @param {google.privacy.dlp.v2.ITable=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.Table} Table instance + */ + Table.create = function create(properties) { + return new Table(properties); + }; + + /** + * Encodes the specified Table message. Does not implicitly {@link google.privacy.dlp.v2.Table.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.Table + * @static + * @param {google.privacy.dlp.v2.ITable} message Table message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Table.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.headers != null && message.headers.length) + for (var i = 0; i < message.headers.length; ++i) + $root.google.privacy.dlp.v2.FieldId.encode(message.headers[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.rows != null && message.rows.length) + for (var i = 0; i < message.rows.length; ++i) + $root.google.privacy.dlp.v2.Table.Row.encode(message.rows[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Table message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.Table.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.Table + * @static + * @param {google.privacy.dlp.v2.ITable} message Table message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Table.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Table message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.Table + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.Table} Table + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Table.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.privacy.dlp.v2.Table(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.headers && message.headers.length)) + message.headers = []; + message.headers.push($root.google.privacy.dlp.v2.FieldId.decode(reader, reader.uint32())); + break; + case 2: + if (!(message.rows && message.rows.length)) + message.rows = []; + message.rows.push($root.google.privacy.dlp.v2.Table.Row.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Table message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.Table + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.Table} Table + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Table.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Table message. + * @function verify + * @memberof google.privacy.dlp.v2.Table + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Table.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.headers != null && message.hasOwnProperty("headers")) { + if (!Array.isArray(message.headers)) + return "headers: array expected"; + for (var i = 0; i < message.headers.length; ++i) { + var error = $root.google.privacy.dlp.v2.FieldId.verify(message.headers[i]); + if (error) + return "headers." + error; + } + } + if (message.rows != null && message.hasOwnProperty("rows")) { + if (!Array.isArray(message.rows)) + return "rows: array expected"; + for (var i = 0; i < message.rows.length; ++i) { + var error = $root.google.privacy.dlp.v2.Table.Row.verify(message.rows[i]); + if (error) + return "rows." + error; + } + } + return null; + }; + + /** + * Creates a Table message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.Table + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.Table} Table + */ + Table.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.Table) + return object; + var message = new $root.google.privacy.dlp.v2.Table(); + if (object.headers) { + if (!Array.isArray(object.headers)) + throw TypeError(".google.privacy.dlp.v2.Table.headers: array expected"); + message.headers = []; + for (var i = 0; i < object.headers.length; ++i) { + if (typeof object.headers[i] !== "object") + throw TypeError(".google.privacy.dlp.v2.Table.headers: object expected"); + message.headers[i] = $root.google.privacy.dlp.v2.FieldId.fromObject(object.headers[i]); + } + } + if (object.rows) { + if (!Array.isArray(object.rows)) + throw TypeError(".google.privacy.dlp.v2.Table.rows: array expected"); + message.rows = []; + for (var i = 0; i < object.rows.length; ++i) { + if (typeof object.rows[i] !== "object") + throw TypeError(".google.privacy.dlp.v2.Table.rows: object expected"); + message.rows[i] = $root.google.privacy.dlp.v2.Table.Row.fromObject(object.rows[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Table message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.Table + * @static + * @param {google.privacy.dlp.v2.Table} message Table + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Table.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.headers = []; + object.rows = []; + } + if (message.headers && message.headers.length) { + object.headers = []; + for (var j = 0; j < message.headers.length; ++j) + object.headers[j] = $root.google.privacy.dlp.v2.FieldId.toObject(message.headers[j], options); + } + if (message.rows && message.rows.length) { + object.rows = []; + for (var j = 0; j < message.rows.length; ++j) + object.rows[j] = $root.google.privacy.dlp.v2.Table.Row.toObject(message.rows[j], options); + } + return object; + }; + + /** + * Converts this Table to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.Table + * @instance + * @returns {Object.} JSON object + */ + Table.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + Table.Row = (function() { + + /** + * Properties of a Row. + * @memberof google.privacy.dlp.v2.Table + * @interface IRow + * @property {Array.|null} [values] Row values + */ + + /** + * Constructs a new Row. + * @memberof google.privacy.dlp.v2.Table + * @classdesc Represents a Row. + * @implements IRow + * @constructor + * @param {google.privacy.dlp.v2.Table.IRow=} [properties] Properties to set + */ + function Row(properties) { + this.values = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Row values. + * @member {Array.} values + * @memberof google.privacy.dlp.v2.Table.Row + * @instance + */ + Row.prototype.values = $util.emptyArray; + + /** + * Creates a new Row instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.Table.Row + * @static + * @param {google.privacy.dlp.v2.Table.IRow=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.Table.Row} Row instance + */ + Row.create = function create(properties) { + return new Row(properties); + }; + + /** + * Encodes the specified Row message. Does not implicitly {@link google.privacy.dlp.v2.Table.Row.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.Table.Row + * @static + * @param {google.privacy.dlp.v2.Table.IRow} message Row message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Row.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.values != null && message.values.length) + for (var i = 0; i < message.values.length; ++i) + $root.google.privacy.dlp.v2.Value.encode(message.values[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Row message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.Table.Row.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.Table.Row + * @static + * @param {google.privacy.dlp.v2.Table.IRow} message Row message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Row.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Row message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.Table.Row + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.Table.Row} Row + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Row.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.privacy.dlp.v2.Table.Row(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.values && message.values.length)) + message.values = []; + message.values.push($root.google.privacy.dlp.v2.Value.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Row message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.Table.Row + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.Table.Row} Row + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Row.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Row message. + * @function verify + * @memberof google.privacy.dlp.v2.Table.Row + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Row.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.values != null && message.hasOwnProperty("values")) { + if (!Array.isArray(message.values)) + return "values: array expected"; + for (var i = 0; i < message.values.length; ++i) { + var error = $root.google.privacy.dlp.v2.Value.verify(message.values[i]); + if (error) + return "values." + error; + } + } + return null; + }; + + /** + * Creates a Row message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.Table.Row + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.Table.Row} Row + */ + Row.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.Table.Row) + return object; + var message = new $root.google.privacy.dlp.v2.Table.Row(); + if (object.values) { + if (!Array.isArray(object.values)) + throw TypeError(".google.privacy.dlp.v2.Table.Row.values: array expected"); + message.values = []; + for (var i = 0; i < object.values.length; ++i) { + if (typeof object.values[i] !== "object") + throw TypeError(".google.privacy.dlp.v2.Table.Row.values: object expected"); + message.values[i] = $root.google.privacy.dlp.v2.Value.fromObject(object.values[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Row message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.Table.Row + * @static + * @param {google.privacy.dlp.v2.Table.Row} message Row + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Row.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.values = []; + if (message.values && message.values.length) { + object.values = []; + for (var j = 0; j < message.values.length; ++j) + object.values[j] = $root.google.privacy.dlp.v2.Value.toObject(message.values[j], options); + } + return object; + }; + + /** + * Converts this Row to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.Table.Row + * @instance + * @returns {Object.} JSON object + */ + Row.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Row; + })(); + + return Table; + })(); + + v2.InspectResult = (function() { + + /** + * Properties of an InspectResult. + * @memberof google.privacy.dlp.v2 + * @interface IInspectResult + * @property {Array.|null} [findings] InspectResult findings + * @property {boolean|null} [findingsTruncated] InspectResult findingsTruncated + */ + + /** + * Constructs a new InspectResult. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents an InspectResult. + * @implements IInspectResult + * @constructor + * @param {google.privacy.dlp.v2.IInspectResult=} [properties] Properties to set + */ + function InspectResult(properties) { + this.findings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InspectResult findings. + * @member {Array.} findings + * @memberof google.privacy.dlp.v2.InspectResult + * @instance + */ + InspectResult.prototype.findings = $util.emptyArray; + + /** + * InspectResult findingsTruncated. + * @member {boolean} findingsTruncated + * @memberof google.privacy.dlp.v2.InspectResult + * @instance + */ + InspectResult.prototype.findingsTruncated = false; + + /** + * Creates a new InspectResult instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.InspectResult + * @static + * @param {google.privacy.dlp.v2.IInspectResult=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.InspectResult} InspectResult instance + */ + InspectResult.create = function create(properties) { + return new InspectResult(properties); + }; + + /** + * Encodes the specified InspectResult message. Does not implicitly {@link google.privacy.dlp.v2.InspectResult.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.InspectResult + * @static + * @param {google.privacy.dlp.v2.IInspectResult} message InspectResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InspectResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.findings != null && message.findings.length) + for (var i = 0; i < message.findings.length; ++i) + $root.google.privacy.dlp.v2.Finding.encode(message.findings[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.findingsTruncated != null && Object.hasOwnProperty.call(message, "findingsTruncated")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.findingsTruncated); + return writer; + }; + + /** + * Encodes the specified InspectResult message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.InspectResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.InspectResult + * @static + * @param {google.privacy.dlp.v2.IInspectResult} message InspectResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InspectResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InspectResult message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.InspectResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.InspectResult} InspectResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InspectResult.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.privacy.dlp.v2.InspectResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.findings && message.findings.length)) + message.findings = []; + message.findings.push($root.google.privacy.dlp.v2.Finding.decode(reader, reader.uint32())); + break; + case 2: + message.findingsTruncated = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InspectResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.InspectResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.InspectResult} InspectResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InspectResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InspectResult message. + * @function verify + * @memberof google.privacy.dlp.v2.InspectResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InspectResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.findings != null && message.hasOwnProperty("findings")) { + if (!Array.isArray(message.findings)) + return "findings: array expected"; + for (var i = 0; i < message.findings.length; ++i) { + var error = $root.google.privacy.dlp.v2.Finding.verify(message.findings[i]); + if (error) + return "findings." + error; + } + } + if (message.findingsTruncated != null && message.hasOwnProperty("findingsTruncated")) + if (typeof message.findingsTruncated !== "boolean") + return "findingsTruncated: boolean expected"; + return null; + }; + + /** + * Creates an InspectResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.InspectResult + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.InspectResult} InspectResult + */ + InspectResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.InspectResult) + return object; + var message = new $root.google.privacy.dlp.v2.InspectResult(); + if (object.findings) { + if (!Array.isArray(object.findings)) + throw TypeError(".google.privacy.dlp.v2.InspectResult.findings: array expected"); + message.findings = []; + for (var i = 0; i < object.findings.length; ++i) { + if (typeof object.findings[i] !== "object") + throw TypeError(".google.privacy.dlp.v2.InspectResult.findings: object expected"); + message.findings[i] = $root.google.privacy.dlp.v2.Finding.fromObject(object.findings[i]); + } + } + if (object.findingsTruncated != null) + message.findingsTruncated = Boolean(object.findingsTruncated); + return message; + }; + + /** + * Creates a plain object from an InspectResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.InspectResult + * @static + * @param {google.privacy.dlp.v2.InspectResult} message InspectResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InspectResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.findings = []; + if (options.defaults) + object.findingsTruncated = false; + if (message.findings && message.findings.length) { + object.findings = []; + for (var j = 0; j < message.findings.length; ++j) + object.findings[j] = $root.google.privacy.dlp.v2.Finding.toObject(message.findings[j], options); + } + if (message.findingsTruncated != null && message.hasOwnProperty("findingsTruncated")) + object.findingsTruncated = message.findingsTruncated; + return object; + }; + + /** + * Converts this InspectResult to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.InspectResult + * @instance + * @returns {Object.} JSON object + */ + InspectResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InspectResult; + })(); + + v2.Finding = (function() { + + /** + * Properties of a Finding. + * @memberof google.privacy.dlp.v2 + * @interface IFinding + * @property {string|null} [name] Finding name + * @property {string|null} [quote] Finding quote + * @property {google.privacy.dlp.v2.IInfoType|null} [infoType] Finding infoType + * @property {google.privacy.dlp.v2.Likelihood|null} [likelihood] Finding likelihood + * @property {google.privacy.dlp.v2.ILocation|null} [location] Finding location + * @property {google.protobuf.ITimestamp|null} [createTime] Finding createTime + * @property {google.privacy.dlp.v2.IQuoteInfo|null} [quoteInfo] Finding quoteInfo + * @property {string|null} [resourceName] Finding resourceName + * @property {string|null} [triggerName] Finding triggerName + * @property {Object.|null} [labels] Finding labels + * @property {google.protobuf.ITimestamp|null} [jobCreateTime] Finding jobCreateTime + * @property {string|null} [jobName] Finding jobName + */ + + /** + * Constructs a new Finding. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents a Finding. + * @implements IFinding + * @constructor + * @param {google.privacy.dlp.v2.IFinding=} [properties] Properties to set + */ + function Finding(properties) { + this.labels = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Finding name. + * @member {string} name + * @memberof google.privacy.dlp.v2.Finding + * @instance + */ + Finding.prototype.name = ""; + + /** + * Finding quote. + * @member {string} quote + * @memberof google.privacy.dlp.v2.Finding + * @instance + */ + Finding.prototype.quote = ""; + + /** + * Finding infoType. + * @member {google.privacy.dlp.v2.IInfoType|null|undefined} infoType + * @memberof google.privacy.dlp.v2.Finding + * @instance + */ + Finding.prototype.infoType = null; + + /** + * Finding likelihood. + * @member {google.privacy.dlp.v2.Likelihood} likelihood + * @memberof google.privacy.dlp.v2.Finding + * @instance + */ + Finding.prototype.likelihood = 0; + + /** + * Finding location. + * @member {google.privacy.dlp.v2.ILocation|null|undefined} location + * @memberof google.privacy.dlp.v2.Finding + * @instance + */ + Finding.prototype.location = null; + + /** + * Finding createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.privacy.dlp.v2.Finding + * @instance + */ + Finding.prototype.createTime = null; + + /** + * Finding quoteInfo. + * @member {google.privacy.dlp.v2.IQuoteInfo|null|undefined} quoteInfo + * @memberof google.privacy.dlp.v2.Finding + * @instance + */ + Finding.prototype.quoteInfo = null; + + /** + * Finding resourceName. + * @member {string} resourceName + * @memberof google.privacy.dlp.v2.Finding + * @instance + */ + Finding.prototype.resourceName = ""; + + /** + * Finding triggerName. + * @member {string} triggerName + * @memberof google.privacy.dlp.v2.Finding + * @instance + */ + Finding.prototype.triggerName = ""; + + /** + * Finding labels. + * @member {Object.} labels + * @memberof google.privacy.dlp.v2.Finding + * @instance + */ + Finding.prototype.labels = $util.emptyObject; + + /** + * Finding jobCreateTime. + * @member {google.protobuf.ITimestamp|null|undefined} jobCreateTime + * @memberof google.privacy.dlp.v2.Finding + * @instance + */ + Finding.prototype.jobCreateTime = null; + + /** + * Finding jobName. + * @member {string} jobName + * @memberof google.privacy.dlp.v2.Finding + * @instance + */ + Finding.prototype.jobName = ""; + + /** + * Creates a new Finding instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.Finding + * @static + * @param {google.privacy.dlp.v2.IFinding=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.Finding} Finding instance + */ + Finding.create = function create(properties) { + return new Finding(properties); + }; + + /** + * Encodes the specified Finding message. Does not implicitly {@link google.privacy.dlp.v2.Finding.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.Finding + * @static + * @param {google.privacy.dlp.v2.IFinding} message Finding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Finding.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.quote != null && Object.hasOwnProperty.call(message, "quote")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.quote); + if (message.infoType != null && Object.hasOwnProperty.call(message, "infoType")) + $root.google.privacy.dlp.v2.InfoType.encode(message.infoType, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.likelihood != null && Object.hasOwnProperty.call(message, "likelihood")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.likelihood); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + $root.google.privacy.dlp.v2.Location.encode(message.location, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.quoteInfo != null && Object.hasOwnProperty.call(message, "quoteInfo")) + $root.google.privacy.dlp.v2.QuoteInfo.encode(message.quoteInfo, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.resourceName != null && Object.hasOwnProperty.call(message, "resourceName")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.resourceName); + if (message.triggerName != null && Object.hasOwnProperty.call(message, "triggerName")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.triggerName); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 10, wireType 2 =*/82).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.jobCreateTime != null && Object.hasOwnProperty.call(message, "jobCreateTime")) + $root.google.protobuf.Timestamp.encode(message.jobCreateTime, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.jobName != null && Object.hasOwnProperty.call(message, "jobName")) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.jobName); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 14, wireType 2 =*/114).string(message.name); + return writer; + }; + + /** + * Encodes the specified Finding message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.Finding.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.Finding + * @static + * @param {google.privacy.dlp.v2.IFinding} message Finding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Finding.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Finding message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.Finding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.Finding} Finding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Finding.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.privacy.dlp.v2.Finding(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 14: + message.name = reader.string(); + break; + case 1: + message.quote = reader.string(); + break; + case 2: + message.infoType = $root.google.privacy.dlp.v2.InfoType.decode(reader, reader.uint32()); + break; + case 3: + message.likelihood = reader.int32(); + break; + case 4: + message.location = $root.google.privacy.dlp.v2.Location.decode(reader, reader.uint32()); + break; + case 6: + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 7: + message.quoteInfo = $root.google.privacy.dlp.v2.QuoteInfo.decode(reader, reader.uint32()); + break; + case 8: + message.resourceName = reader.string(); + break; + case 9: + message.triggerName = reader.string(); + break; + case 10: + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + case 11: + message.jobCreateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 13: + message.jobName = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Finding message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.Finding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.Finding} Finding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Finding.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Finding message. + * @function verify + * @memberof google.privacy.dlp.v2.Finding + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Finding.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.quote != null && message.hasOwnProperty("quote")) + if (!$util.isString(message.quote)) + return "quote: string expected"; + if (message.infoType != null && message.hasOwnProperty("infoType")) { + var error = $root.google.privacy.dlp.v2.InfoType.verify(message.infoType); + if (error) + return "infoType." + error; + } + if (message.likelihood != null && message.hasOwnProperty("likelihood")) + switch (message.likelihood) { + default: + return "likelihood: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.location != null && message.hasOwnProperty("location")) { + var error = $root.google.privacy.dlp.v2.Location.verify(message.location); + if (error) + return "location." + error; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.quoteInfo != null && message.hasOwnProperty("quoteInfo")) { + var error = $root.google.privacy.dlp.v2.QuoteInfo.verify(message.quoteInfo); + if (error) + return "quoteInfo." + error; + } + if (message.resourceName != null && message.hasOwnProperty("resourceName")) + if (!$util.isString(message.resourceName)) + return "resourceName: string expected"; + if (message.triggerName != null && message.hasOwnProperty("triggerName")) + if (!$util.isString(message.triggerName)) + return "triggerName: string expected"; + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.jobCreateTime != null && message.hasOwnProperty("jobCreateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.jobCreateTime); + if (error) + return "jobCreateTime." + error; + } + if (message.jobName != null && message.hasOwnProperty("jobName")) + if (!$util.isString(message.jobName)) + return "jobName: string expected"; + return null; + }; + + /** + * Creates a Finding message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.Finding + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.Finding} Finding + */ + Finding.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.Finding) + return object; + var message = new $root.google.privacy.dlp.v2.Finding(); + if (object.name != null) + message.name = String(object.name); + if (object.quote != null) + message.quote = String(object.quote); + if (object.infoType != null) { + if (typeof object.infoType !== "object") + throw TypeError(".google.privacy.dlp.v2.Finding.infoType: object expected"); + message.infoType = $root.google.privacy.dlp.v2.InfoType.fromObject(object.infoType); + } + switch (object.likelihood) { + case "LIKELIHOOD_UNSPECIFIED": + case 0: + message.likelihood = 0; + break; + case "VERY_UNLIKELY": + case 1: + message.likelihood = 1; + break; + case "UNLIKELY": + case 2: + message.likelihood = 2; + break; + case "POSSIBLE": + case 3: + message.likelihood = 3; + break; + case "LIKELY": + case 4: + message.likelihood = 4; + break; + case "VERY_LIKELY": + case 5: + message.likelihood = 5; + break; + } + if (object.location != null) { + if (typeof object.location !== "object") + throw TypeError(".google.privacy.dlp.v2.Finding.location: object expected"); + message.location = $root.google.privacy.dlp.v2.Location.fromObject(object.location); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.privacy.dlp.v2.Finding.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.quoteInfo != null) { + if (typeof object.quoteInfo !== "object") + throw TypeError(".google.privacy.dlp.v2.Finding.quoteInfo: object expected"); + message.quoteInfo = $root.google.privacy.dlp.v2.QuoteInfo.fromObject(object.quoteInfo); + } + if (object.resourceName != null) + message.resourceName = String(object.resourceName); + if (object.triggerName != null) + message.triggerName = String(object.triggerName); + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.privacy.dlp.v2.Finding.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + if (object.jobCreateTime != null) { + if (typeof object.jobCreateTime !== "object") + throw TypeError(".google.privacy.dlp.v2.Finding.jobCreateTime: object expected"); + message.jobCreateTime = $root.google.protobuf.Timestamp.fromObject(object.jobCreateTime); + } + if (object.jobName != null) + message.jobName = String(object.jobName); + return message; + }; + + /** + * Creates a plain object from a Finding message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.Finding + * @static + * @param {google.privacy.dlp.v2.Finding} message Finding + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Finding.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.quote = ""; + object.infoType = null; + object.likelihood = options.enums === String ? "LIKELIHOOD_UNSPECIFIED" : 0; + object.location = null; + object.createTime = null; + object.quoteInfo = null; + object.resourceName = ""; + object.triggerName = ""; + object.jobCreateTime = null; + object.jobName = ""; + object.name = ""; + } + if (message.quote != null && message.hasOwnProperty("quote")) + object.quote = message.quote; + if (message.infoType != null && message.hasOwnProperty("infoType")) + object.infoType = $root.google.privacy.dlp.v2.InfoType.toObject(message.infoType, options); + if (message.likelihood != null && message.hasOwnProperty("likelihood")) + object.likelihood = options.enums === String ? $root.google.privacy.dlp.v2.Likelihood[message.likelihood] : message.likelihood; + if (message.location != null && message.hasOwnProperty("location")) + object.location = $root.google.privacy.dlp.v2.Location.toObject(message.location, options); + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.quoteInfo != null && message.hasOwnProperty("quoteInfo")) + object.quoteInfo = $root.google.privacy.dlp.v2.QuoteInfo.toObject(message.quoteInfo, options); + if (message.resourceName != null && message.hasOwnProperty("resourceName")) + object.resourceName = message.resourceName; + if (message.triggerName != null && message.hasOwnProperty("triggerName")) + object.triggerName = message.triggerName; + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + if (message.jobCreateTime != null && message.hasOwnProperty("jobCreateTime")) + object.jobCreateTime = $root.google.protobuf.Timestamp.toObject(message.jobCreateTime, options); + if (message.jobName != null && message.hasOwnProperty("jobName")) + object.jobName = message.jobName; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this Finding to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.Finding + * @instance + * @returns {Object.} JSON object + */ + Finding.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Finding; + })(); + + v2.Location = (function() { + + /** + * Properties of a Location. + * @memberof google.privacy.dlp.v2 + * @interface ILocation + * @property {google.privacy.dlp.v2.IRange|null} [byteRange] Location byteRange + * @property {google.privacy.dlp.v2.IRange|null} [codepointRange] Location codepointRange + * @property {Array.|null} [contentLocations] Location contentLocations + * @property {google.privacy.dlp.v2.IContainer|null} [container] Location container + */ + + /** + * Constructs a new Location. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents a Location. + * @implements ILocation + * @constructor + * @param {google.privacy.dlp.v2.ILocation=} [properties] Properties to set + */ + function Location(properties) { + this.contentLocations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Location byteRange. + * @member {google.privacy.dlp.v2.IRange|null|undefined} byteRange + * @memberof google.privacy.dlp.v2.Location + * @instance + */ + Location.prototype.byteRange = null; + + /** + * Location codepointRange. + * @member {google.privacy.dlp.v2.IRange|null|undefined} codepointRange + * @memberof google.privacy.dlp.v2.Location + * @instance + */ + Location.prototype.codepointRange = null; + + /** + * Location contentLocations. + * @member {Array.} contentLocations + * @memberof google.privacy.dlp.v2.Location + * @instance + */ + Location.prototype.contentLocations = $util.emptyArray; + + /** + * Location container. + * @member {google.privacy.dlp.v2.IContainer|null|undefined} container + * @memberof google.privacy.dlp.v2.Location + * @instance + */ + Location.prototype.container = null; + + /** + * Creates a new Location instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.Location + * @static + * @param {google.privacy.dlp.v2.ILocation=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.Location} Location instance + */ + Location.create = function create(properties) { + return new Location(properties); + }; + + /** + * Encodes the specified Location message. Does not implicitly {@link google.privacy.dlp.v2.Location.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.Location + * @static + * @param {google.privacy.dlp.v2.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.byteRange != null && Object.hasOwnProperty.call(message, "byteRange")) + $root.google.privacy.dlp.v2.Range.encode(message.byteRange, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.codepointRange != null && Object.hasOwnProperty.call(message, "codepointRange")) + $root.google.privacy.dlp.v2.Range.encode(message.codepointRange, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.contentLocations != null && message.contentLocations.length) + for (var i = 0; i < message.contentLocations.length; ++i) + $root.google.privacy.dlp.v2.ContentLocation.encode(message.contentLocations[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.container != null && Object.hasOwnProperty.call(message, "container")) + $root.google.privacy.dlp.v2.Container.encode(message.container, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.Location.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.Location + * @static + * @param {google.privacy.dlp.v2.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Location message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.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.privacy.dlp.v2.Location(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.byteRange = $root.google.privacy.dlp.v2.Range.decode(reader, reader.uint32()); + break; + case 2: + message.codepointRange = $root.google.privacy.dlp.v2.Range.decode(reader, reader.uint32()); + break; + case 7: + if (!(message.contentLocations && message.contentLocations.length)) + message.contentLocations = []; + message.contentLocations.push($root.google.privacy.dlp.v2.ContentLocation.decode(reader, reader.uint32())); + break; + case 8: + message.container = $root.google.privacy.dlp.v2.Container.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Location message. + * @function verify + * @memberof google.privacy.dlp.v2.Location + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Location.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.byteRange != null && message.hasOwnProperty("byteRange")) { + var error = $root.google.privacy.dlp.v2.Range.verify(message.byteRange); + if (error) + return "byteRange." + error; + } + if (message.codepointRange != null && message.hasOwnProperty("codepointRange")) { + var error = $root.google.privacy.dlp.v2.Range.verify(message.codepointRange); + if (error) + return "codepointRange." + error; + } + if (message.contentLocations != null && message.hasOwnProperty("contentLocations")) { + if (!Array.isArray(message.contentLocations)) + return "contentLocations: array expected"; + for (var i = 0; i < message.contentLocations.length; ++i) { + var error = $root.google.privacy.dlp.v2.ContentLocation.verify(message.contentLocations[i]); + if (error) + return "contentLocations." + error; + } + } + if (message.container != null && message.hasOwnProperty("container")) { + var error = $root.google.privacy.dlp.v2.Container.verify(message.container); + if (error) + return "container." + error; + } + return null; + }; + + /** + * Creates a Location message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.Location + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.Location} Location + */ + Location.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.Location) + return object; + var message = new $root.google.privacy.dlp.v2.Location(); + if (object.byteRange != null) { + if (typeof object.byteRange !== "object") + throw TypeError(".google.privacy.dlp.v2.Location.byteRange: object expected"); + message.byteRange = $root.google.privacy.dlp.v2.Range.fromObject(object.byteRange); + } + if (object.codepointRange != null) { + if (typeof object.codepointRange !== "object") + throw TypeError(".google.privacy.dlp.v2.Location.codepointRange: object expected"); + message.codepointRange = $root.google.privacy.dlp.v2.Range.fromObject(object.codepointRange); + } + if (object.contentLocations) { + if (!Array.isArray(object.contentLocations)) + throw TypeError(".google.privacy.dlp.v2.Location.contentLocations: array expected"); + message.contentLocations = []; + for (var i = 0; i < object.contentLocations.length; ++i) { + if (typeof object.contentLocations[i] !== "object") + throw TypeError(".google.privacy.dlp.v2.Location.contentLocations: object expected"); + message.contentLocations[i] = $root.google.privacy.dlp.v2.ContentLocation.fromObject(object.contentLocations[i]); + } + } + if (object.container != null) { + if (typeof object.container !== "object") + throw TypeError(".google.privacy.dlp.v2.Location.container: object expected"); + message.container = $root.google.privacy.dlp.v2.Container.fromObject(object.container); + } + return message; + }; + + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.Location + * @static + * @param {google.privacy.dlp.v2.Location} message Location + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Location.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.contentLocations = []; + if (options.defaults) { + object.byteRange = null; + object.codepointRange = null; + object.container = null; + } + if (message.byteRange != null && message.hasOwnProperty("byteRange")) + object.byteRange = $root.google.privacy.dlp.v2.Range.toObject(message.byteRange, options); + if (message.codepointRange != null && message.hasOwnProperty("codepointRange")) + object.codepointRange = $root.google.privacy.dlp.v2.Range.toObject(message.codepointRange, options); + if (message.contentLocations && message.contentLocations.length) { + object.contentLocations = []; + for (var j = 0; j < message.contentLocations.length; ++j) + object.contentLocations[j] = $root.google.privacy.dlp.v2.ContentLocation.toObject(message.contentLocations[j], options); + } + if (message.container != null && message.hasOwnProperty("container")) + object.container = $root.google.privacy.dlp.v2.Container.toObject(message.container, options); + return object; + }; + + /** + * Converts this Location to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.Location + * @instance + * @returns {Object.} JSON object + */ + Location.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Location; + })(); + + v2.ContentLocation = (function() { + + /** + * Properties of a ContentLocation. + * @memberof google.privacy.dlp.v2 + * @interface IContentLocation + * @property {string|null} [containerName] ContentLocation containerName + * @property {google.privacy.dlp.v2.IRecordLocation|null} [recordLocation] ContentLocation recordLocation + * @property {google.privacy.dlp.v2.IImageLocation|null} [imageLocation] ContentLocation imageLocation + * @property {google.privacy.dlp.v2.IDocumentLocation|null} [documentLocation] ContentLocation documentLocation + * @property {google.privacy.dlp.v2.IMetadataLocation|null} [metadataLocation] ContentLocation metadataLocation + * @property {google.protobuf.ITimestamp|null} [containerTimestamp] ContentLocation containerTimestamp + * @property {string|null} [containerVersion] ContentLocation containerVersion + */ + + /** + * Constructs a new ContentLocation. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents a ContentLocation. + * @implements IContentLocation + * @constructor + * @param {google.privacy.dlp.v2.IContentLocation=} [properties] Properties to set + */ + function ContentLocation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ContentLocation containerName. + * @member {string} containerName + * @memberof google.privacy.dlp.v2.ContentLocation + * @instance + */ + ContentLocation.prototype.containerName = ""; + + /** + * ContentLocation recordLocation. + * @member {google.privacy.dlp.v2.IRecordLocation|null|undefined} recordLocation + * @memberof google.privacy.dlp.v2.ContentLocation + * @instance + */ + ContentLocation.prototype.recordLocation = null; + + /** + * ContentLocation imageLocation. + * @member {google.privacy.dlp.v2.IImageLocation|null|undefined} imageLocation + * @memberof google.privacy.dlp.v2.ContentLocation + * @instance + */ + ContentLocation.prototype.imageLocation = null; + + /** + * ContentLocation documentLocation. + * @member {google.privacy.dlp.v2.IDocumentLocation|null|undefined} documentLocation + * @memberof google.privacy.dlp.v2.ContentLocation + * @instance + */ + ContentLocation.prototype.documentLocation = null; + + /** + * ContentLocation metadataLocation. + * @member {google.privacy.dlp.v2.IMetadataLocation|null|undefined} metadataLocation + * @memberof google.privacy.dlp.v2.ContentLocation + * @instance + */ + ContentLocation.prototype.metadataLocation = null; + + /** + * ContentLocation containerTimestamp. + * @member {google.protobuf.ITimestamp|null|undefined} containerTimestamp + * @memberof google.privacy.dlp.v2.ContentLocation + * @instance + */ + ContentLocation.prototype.containerTimestamp = null; + + /** + * ContentLocation containerVersion. + * @member {string} containerVersion + * @memberof google.privacy.dlp.v2.ContentLocation + * @instance + */ + ContentLocation.prototype.containerVersion = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ContentLocation location. + * @member {"recordLocation"|"imageLocation"|"documentLocation"|"metadataLocation"|undefined} location + * @memberof google.privacy.dlp.v2.ContentLocation + * @instance + */ + Object.defineProperty(ContentLocation.prototype, "location", { + get: $util.oneOfGetter($oneOfFields = ["recordLocation", "imageLocation", "documentLocation", "metadataLocation"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ContentLocation instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.ContentLocation + * @static + * @param {google.privacy.dlp.v2.IContentLocation=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.ContentLocation} ContentLocation instance + */ + ContentLocation.create = function create(properties) { + return new ContentLocation(properties); + }; + + /** + * Encodes the specified ContentLocation message. Does not implicitly {@link google.privacy.dlp.v2.ContentLocation.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.ContentLocation + * @static + * @param {google.privacy.dlp.v2.IContentLocation} message ContentLocation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContentLocation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.containerName != null && Object.hasOwnProperty.call(message, "containerName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.containerName); + if (message.recordLocation != null && Object.hasOwnProperty.call(message, "recordLocation")) + $root.google.privacy.dlp.v2.RecordLocation.encode(message.recordLocation, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.imageLocation != null && Object.hasOwnProperty.call(message, "imageLocation")) + $root.google.privacy.dlp.v2.ImageLocation.encode(message.imageLocation, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.documentLocation != null && Object.hasOwnProperty.call(message, "documentLocation")) + $root.google.privacy.dlp.v2.DocumentLocation.encode(message.documentLocation, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.containerTimestamp != null && Object.hasOwnProperty.call(message, "containerTimestamp")) + $root.google.protobuf.Timestamp.encode(message.containerTimestamp, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.containerVersion != null && Object.hasOwnProperty.call(message, "containerVersion")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.containerVersion); + if (message.metadataLocation != null && Object.hasOwnProperty.call(message, "metadataLocation")) + $root.google.privacy.dlp.v2.MetadataLocation.encode(message.metadataLocation, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ContentLocation message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.ContentLocation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.ContentLocation + * @static + * @param {google.privacy.dlp.v2.IContentLocation} message ContentLocation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContentLocation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ContentLocation message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.ContentLocation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.ContentLocation} ContentLocation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContentLocation.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.privacy.dlp.v2.ContentLocation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.containerName = reader.string(); + break; + case 2: + message.recordLocation = $root.google.privacy.dlp.v2.RecordLocation.decode(reader, reader.uint32()); + break; + case 3: + message.imageLocation = $root.google.privacy.dlp.v2.ImageLocation.decode(reader, reader.uint32()); + break; + case 5: + message.documentLocation = $root.google.privacy.dlp.v2.DocumentLocation.decode(reader, reader.uint32()); + break; + case 8: + message.metadataLocation = $root.google.privacy.dlp.v2.MetadataLocation.decode(reader, reader.uint32()); + break; + case 6: + message.containerTimestamp = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 7: + message.containerVersion = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ContentLocation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.ContentLocation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.ContentLocation} ContentLocation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContentLocation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ContentLocation message. + * @function verify + * @memberof google.privacy.dlp.v2.ContentLocation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ContentLocation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.containerName != null && message.hasOwnProperty("containerName")) + if (!$util.isString(message.containerName)) + return "containerName: string expected"; + if (message.recordLocation != null && message.hasOwnProperty("recordLocation")) { + properties.location = 1; + { + var error = $root.google.privacy.dlp.v2.RecordLocation.verify(message.recordLocation); + if (error) + return "recordLocation." + error; + } + } + if (message.imageLocation != null && message.hasOwnProperty("imageLocation")) { + if (properties.location === 1) + return "location: multiple values"; + properties.location = 1; + { + var error = $root.google.privacy.dlp.v2.ImageLocation.verify(message.imageLocation); + if (error) + return "imageLocation." + error; + } + } + if (message.documentLocation != null && message.hasOwnProperty("documentLocation")) { + if (properties.location === 1) + return "location: multiple values"; + properties.location = 1; + { + var error = $root.google.privacy.dlp.v2.DocumentLocation.verify(message.documentLocation); + if (error) + return "documentLocation." + error; + } + } + if (message.metadataLocation != null && message.hasOwnProperty("metadataLocation")) { + if (properties.location === 1) + return "location: multiple values"; + properties.location = 1; + { + var error = $root.google.privacy.dlp.v2.MetadataLocation.verify(message.metadataLocation); + if (error) + return "metadataLocation." + error; + } + } + if (message.containerTimestamp != null && message.hasOwnProperty("containerTimestamp")) { + var error = $root.google.protobuf.Timestamp.verify(message.containerTimestamp); + if (error) + return "containerTimestamp." + error; + } + if (message.containerVersion != null && message.hasOwnProperty("containerVersion")) + if (!$util.isString(message.containerVersion)) + return "containerVersion: string expected"; + return null; + }; + + /** + * Creates a ContentLocation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.ContentLocation + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.ContentLocation} ContentLocation + */ + ContentLocation.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.ContentLocation) + return object; + var message = new $root.google.privacy.dlp.v2.ContentLocation(); + if (object.containerName != null) + message.containerName = String(object.containerName); + if (object.recordLocation != null) { + if (typeof object.recordLocation !== "object") + throw TypeError(".google.privacy.dlp.v2.ContentLocation.recordLocation: object expected"); + message.recordLocation = $root.google.privacy.dlp.v2.RecordLocation.fromObject(object.recordLocation); + } + if (object.imageLocation != null) { + if (typeof object.imageLocation !== "object") + throw TypeError(".google.privacy.dlp.v2.ContentLocation.imageLocation: object expected"); + message.imageLocation = $root.google.privacy.dlp.v2.ImageLocation.fromObject(object.imageLocation); + } + if (object.documentLocation != null) { + if (typeof object.documentLocation !== "object") + throw TypeError(".google.privacy.dlp.v2.ContentLocation.documentLocation: object expected"); + message.documentLocation = $root.google.privacy.dlp.v2.DocumentLocation.fromObject(object.documentLocation); + } + if (object.metadataLocation != null) { + if (typeof object.metadataLocation !== "object") + throw TypeError(".google.privacy.dlp.v2.ContentLocation.metadataLocation: object expected"); + message.metadataLocation = $root.google.privacy.dlp.v2.MetadataLocation.fromObject(object.metadataLocation); + } + if (object.containerTimestamp != null) { + if (typeof object.containerTimestamp !== "object") + throw TypeError(".google.privacy.dlp.v2.ContentLocation.containerTimestamp: object expected"); + message.containerTimestamp = $root.google.protobuf.Timestamp.fromObject(object.containerTimestamp); + } + if (object.containerVersion != null) + message.containerVersion = String(object.containerVersion); + return message; + }; + + /** + * Creates a plain object from a ContentLocation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.ContentLocation + * @static + * @param {google.privacy.dlp.v2.ContentLocation} message ContentLocation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ContentLocation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.containerName = ""; + object.containerTimestamp = null; + object.containerVersion = ""; + } + if (message.containerName != null && message.hasOwnProperty("containerName")) + object.containerName = message.containerName; + if (message.recordLocation != null && message.hasOwnProperty("recordLocation")) { + object.recordLocation = $root.google.privacy.dlp.v2.RecordLocation.toObject(message.recordLocation, options); + if (options.oneofs) + object.location = "recordLocation"; + } + if (message.imageLocation != null && message.hasOwnProperty("imageLocation")) { + object.imageLocation = $root.google.privacy.dlp.v2.ImageLocation.toObject(message.imageLocation, options); + if (options.oneofs) + object.location = "imageLocation"; + } + if (message.documentLocation != null && message.hasOwnProperty("documentLocation")) { + object.documentLocation = $root.google.privacy.dlp.v2.DocumentLocation.toObject(message.documentLocation, options); + if (options.oneofs) + object.location = "documentLocation"; + } + if (message.containerTimestamp != null && message.hasOwnProperty("containerTimestamp")) + object.containerTimestamp = $root.google.protobuf.Timestamp.toObject(message.containerTimestamp, options); + if (message.containerVersion != null && message.hasOwnProperty("containerVersion")) + object.containerVersion = message.containerVersion; + if (message.metadataLocation != null && message.hasOwnProperty("metadataLocation")) { + object.metadataLocation = $root.google.privacy.dlp.v2.MetadataLocation.toObject(message.metadataLocation, options); + if (options.oneofs) + object.location = "metadataLocation"; + } + return object; + }; + + /** + * Converts this ContentLocation to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.ContentLocation + * @instance + * @returns {Object.} JSON object + */ + ContentLocation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ContentLocation; + })(); + + v2.MetadataLocation = (function() { + + /** + * Properties of a MetadataLocation. + * @memberof google.privacy.dlp.v2 + * @interface IMetadataLocation + * @property {google.privacy.dlp.v2.MetadataType|null} [type] MetadataLocation type + * @property {google.privacy.dlp.v2.IStorageMetadataLabel|null} [storageLabel] MetadataLocation storageLabel + */ + + /** + * Constructs a new MetadataLocation. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents a MetadataLocation. + * @implements IMetadataLocation + * @constructor + * @param {google.privacy.dlp.v2.IMetadataLocation=} [properties] Properties to set + */ + function MetadataLocation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MetadataLocation type. + * @member {google.privacy.dlp.v2.MetadataType} type + * @memberof google.privacy.dlp.v2.MetadataLocation + * @instance + */ + MetadataLocation.prototype.type = 0; + + /** + * MetadataLocation storageLabel. + * @member {google.privacy.dlp.v2.IStorageMetadataLabel|null|undefined} storageLabel + * @memberof google.privacy.dlp.v2.MetadataLocation + * @instance + */ + MetadataLocation.prototype.storageLabel = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * MetadataLocation label. + * @member {"storageLabel"|undefined} label + * @memberof google.privacy.dlp.v2.MetadataLocation + * @instance + */ + Object.defineProperty(MetadataLocation.prototype, "label", { + get: $util.oneOfGetter($oneOfFields = ["storageLabel"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new MetadataLocation instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.MetadataLocation + * @static + * @param {google.privacy.dlp.v2.IMetadataLocation=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.MetadataLocation} MetadataLocation instance + */ + MetadataLocation.create = function create(properties) { + return new MetadataLocation(properties); + }; + + /** + * Encodes the specified MetadataLocation message. Does not implicitly {@link google.privacy.dlp.v2.MetadataLocation.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.MetadataLocation + * @static + * @param {google.privacy.dlp.v2.IMetadataLocation} message MetadataLocation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MetadataLocation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.type); + if (message.storageLabel != null && Object.hasOwnProperty.call(message, "storageLabel")) + $root.google.privacy.dlp.v2.StorageMetadataLabel.encode(message.storageLabel, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MetadataLocation message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.MetadataLocation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.MetadataLocation + * @static + * @param {google.privacy.dlp.v2.IMetadataLocation} message MetadataLocation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MetadataLocation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MetadataLocation message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.MetadataLocation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.MetadataLocation} MetadataLocation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MetadataLocation.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.privacy.dlp.v2.MetadataLocation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.type = reader.int32(); + break; + case 3: + message.storageLabel = $root.google.privacy.dlp.v2.StorageMetadataLabel.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MetadataLocation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.MetadataLocation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.MetadataLocation} MetadataLocation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MetadataLocation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MetadataLocation message. + * @function verify + * @memberof google.privacy.dlp.v2.MetadataLocation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MetadataLocation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 2: + break; + } + if (message.storageLabel != null && message.hasOwnProperty("storageLabel")) { + properties.label = 1; + { + var error = $root.google.privacy.dlp.v2.StorageMetadataLabel.verify(message.storageLabel); + if (error) + return "storageLabel." + error; + } + } + return null; + }; + + /** + * Creates a MetadataLocation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.MetadataLocation + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.MetadataLocation} MetadataLocation + */ + MetadataLocation.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.MetadataLocation) + return object; + var message = new $root.google.privacy.dlp.v2.MetadataLocation(); + switch (object.type) { + case "METADATATYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "STORAGE_METADATA": + case 2: + message.type = 2; + break; + } + if (object.storageLabel != null) { + if (typeof object.storageLabel !== "object") + throw TypeError(".google.privacy.dlp.v2.MetadataLocation.storageLabel: object expected"); + message.storageLabel = $root.google.privacy.dlp.v2.StorageMetadataLabel.fromObject(object.storageLabel); + } + return message; + }; + + /** + * Creates a plain object from a MetadataLocation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.MetadataLocation + * @static + * @param {google.privacy.dlp.v2.MetadataLocation} message MetadataLocation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MetadataLocation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.type = options.enums === String ? "METADATATYPE_UNSPECIFIED" : 0; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.privacy.dlp.v2.MetadataType[message.type] : message.type; + if (message.storageLabel != null && message.hasOwnProperty("storageLabel")) { + object.storageLabel = $root.google.privacy.dlp.v2.StorageMetadataLabel.toObject(message.storageLabel, options); + if (options.oneofs) + object.label = "storageLabel"; + } + return object; + }; + + /** + * Converts this MetadataLocation to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.MetadataLocation + * @instance + * @returns {Object.} JSON object + */ + MetadataLocation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MetadataLocation; + })(); + + v2.StorageMetadataLabel = (function() { + + /** + * Properties of a StorageMetadataLabel. + * @memberof google.privacy.dlp.v2 + * @interface IStorageMetadataLabel + * @property {string|null} [key] StorageMetadataLabel key + */ + + /** + * Constructs a new StorageMetadataLabel. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents a StorageMetadataLabel. + * @implements IStorageMetadataLabel + * @constructor + * @param {google.privacy.dlp.v2.IStorageMetadataLabel=} [properties] Properties to set + */ + function StorageMetadataLabel(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StorageMetadataLabel key. + * @member {string} key + * @memberof google.privacy.dlp.v2.StorageMetadataLabel + * @instance + */ + StorageMetadataLabel.prototype.key = ""; + + /** + * Creates a new StorageMetadataLabel instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.StorageMetadataLabel + * @static + * @param {google.privacy.dlp.v2.IStorageMetadataLabel=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.StorageMetadataLabel} StorageMetadataLabel instance + */ + StorageMetadataLabel.create = function create(properties) { + return new StorageMetadataLabel(properties); + }; + + /** + * Encodes the specified StorageMetadataLabel message. Does not implicitly {@link google.privacy.dlp.v2.StorageMetadataLabel.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.StorageMetadataLabel + * @static + * @param {google.privacy.dlp.v2.IStorageMetadataLabel} message StorageMetadataLabel message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StorageMetadataLabel.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.key != null && Object.hasOwnProperty.call(message, "key")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.key); + return writer; + }; + + /** + * Encodes the specified StorageMetadataLabel message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.StorageMetadataLabel.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.StorageMetadataLabel + * @static + * @param {google.privacy.dlp.v2.IStorageMetadataLabel} message StorageMetadataLabel message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StorageMetadataLabel.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StorageMetadataLabel message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.StorageMetadataLabel + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.StorageMetadataLabel} StorageMetadataLabel + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StorageMetadataLabel.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.privacy.dlp.v2.StorageMetadataLabel(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StorageMetadataLabel message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.StorageMetadataLabel + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.StorageMetadataLabel} StorageMetadataLabel + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StorageMetadataLabel.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StorageMetadataLabel message. + * @function verify + * @memberof google.privacy.dlp.v2.StorageMetadataLabel + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StorageMetadataLabel.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.key != null && message.hasOwnProperty("key")) + if (!$util.isString(message.key)) + return "key: string expected"; + return null; + }; + + /** + * Creates a StorageMetadataLabel message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.StorageMetadataLabel + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.StorageMetadataLabel} StorageMetadataLabel + */ + StorageMetadataLabel.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.StorageMetadataLabel) + return object; + var message = new $root.google.privacy.dlp.v2.StorageMetadataLabel(); + if (object.key != null) + message.key = String(object.key); + return message; + }; + + /** + * Creates a plain object from a StorageMetadataLabel message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.StorageMetadataLabel + * @static + * @param {google.privacy.dlp.v2.StorageMetadataLabel} message StorageMetadataLabel + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StorageMetadataLabel.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.key = ""; + if (message.key != null && message.hasOwnProperty("key")) + object.key = message.key; + return object; + }; + + /** + * Converts this StorageMetadataLabel to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.StorageMetadataLabel + * @instance + * @returns {Object.} JSON object + */ + StorageMetadataLabel.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return StorageMetadataLabel; + })(); + + v2.DocumentLocation = (function() { + + /** + * Properties of a DocumentLocation. + * @memberof google.privacy.dlp.v2 + * @interface IDocumentLocation + * @property {number|Long|null} [fileOffset] DocumentLocation fileOffset + */ + + /** + * Constructs a new DocumentLocation. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents a DocumentLocation. + * @implements IDocumentLocation + * @constructor + * @param {google.privacy.dlp.v2.IDocumentLocation=} [properties] Properties to set + */ + function DocumentLocation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DocumentLocation fileOffset. + * @member {number|Long} fileOffset + * @memberof google.privacy.dlp.v2.DocumentLocation + * @instance + */ + DocumentLocation.prototype.fileOffset = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new DocumentLocation instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.DocumentLocation + * @static + * @param {google.privacy.dlp.v2.IDocumentLocation=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.DocumentLocation} DocumentLocation instance + */ + DocumentLocation.create = function create(properties) { + return new DocumentLocation(properties); + }; + + /** + * Encodes the specified DocumentLocation message. Does not implicitly {@link google.privacy.dlp.v2.DocumentLocation.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.DocumentLocation + * @static + * @param {google.privacy.dlp.v2.IDocumentLocation} message DocumentLocation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DocumentLocation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fileOffset != null && Object.hasOwnProperty.call(message, "fileOffset")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.fileOffset); + return writer; + }; + + /** + * Encodes the specified DocumentLocation message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.DocumentLocation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.DocumentLocation + * @static + * @param {google.privacy.dlp.v2.IDocumentLocation} message DocumentLocation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DocumentLocation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DocumentLocation message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.DocumentLocation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.DocumentLocation} DocumentLocation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DocumentLocation.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.privacy.dlp.v2.DocumentLocation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.fileOffset = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DocumentLocation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.DocumentLocation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.DocumentLocation} DocumentLocation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DocumentLocation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DocumentLocation message. + * @function verify + * @memberof google.privacy.dlp.v2.DocumentLocation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DocumentLocation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.fileOffset != null && message.hasOwnProperty("fileOffset")) + if (!$util.isInteger(message.fileOffset) && !(message.fileOffset && $util.isInteger(message.fileOffset.low) && $util.isInteger(message.fileOffset.high))) + return "fileOffset: integer|Long expected"; + return null; + }; + + /** + * Creates a DocumentLocation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.DocumentLocation + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.DocumentLocation} DocumentLocation + */ + DocumentLocation.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.DocumentLocation) + return object; + var message = new $root.google.privacy.dlp.v2.DocumentLocation(); + if (object.fileOffset != null) + if ($util.Long) + (message.fileOffset = $util.Long.fromValue(object.fileOffset)).unsigned = false; + else if (typeof object.fileOffset === "string") + message.fileOffset = parseInt(object.fileOffset, 10); + else if (typeof object.fileOffset === "number") + message.fileOffset = object.fileOffset; + else if (typeof object.fileOffset === "object") + message.fileOffset = new $util.LongBits(object.fileOffset.low >>> 0, object.fileOffset.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a DocumentLocation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.DocumentLocation + * @static + * @param {google.privacy.dlp.v2.DocumentLocation} message DocumentLocation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DocumentLocation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.fileOffset = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.fileOffset = options.longs === String ? "0" : 0; + if (message.fileOffset != null && message.hasOwnProperty("fileOffset")) + if (typeof message.fileOffset === "number") + object.fileOffset = options.longs === String ? String(message.fileOffset) : message.fileOffset; + else + object.fileOffset = options.longs === String ? $util.Long.prototype.toString.call(message.fileOffset) : options.longs === Number ? new $util.LongBits(message.fileOffset.low >>> 0, message.fileOffset.high >>> 0).toNumber() : message.fileOffset; + return object; + }; + + /** + * Converts this DocumentLocation to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.DocumentLocation + * @instance + * @returns {Object.} JSON object + */ + DocumentLocation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DocumentLocation; + })(); + + v2.RecordLocation = (function() { + + /** + * Properties of a RecordLocation. + * @memberof google.privacy.dlp.v2 + * @interface IRecordLocation + * @property {google.privacy.dlp.v2.IRecordKey|null} [recordKey] RecordLocation recordKey + * @property {google.privacy.dlp.v2.IFieldId|null} [fieldId] RecordLocation fieldId + * @property {google.privacy.dlp.v2.ITableLocation|null} [tableLocation] RecordLocation tableLocation + */ + + /** + * Constructs a new RecordLocation. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents a RecordLocation. + * @implements IRecordLocation + * @constructor + * @param {google.privacy.dlp.v2.IRecordLocation=} [properties] Properties to set + */ + function RecordLocation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RecordLocation recordKey. + * @member {google.privacy.dlp.v2.IRecordKey|null|undefined} recordKey + * @memberof google.privacy.dlp.v2.RecordLocation + * @instance + */ + RecordLocation.prototype.recordKey = null; + + /** + * RecordLocation fieldId. + * @member {google.privacy.dlp.v2.IFieldId|null|undefined} fieldId + * @memberof google.privacy.dlp.v2.RecordLocation + * @instance + */ + RecordLocation.prototype.fieldId = null; + + /** + * RecordLocation tableLocation. + * @member {google.privacy.dlp.v2.ITableLocation|null|undefined} tableLocation + * @memberof google.privacy.dlp.v2.RecordLocation + * @instance + */ + RecordLocation.prototype.tableLocation = null; + + /** + * Creates a new RecordLocation instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.RecordLocation + * @static + * @param {google.privacy.dlp.v2.IRecordLocation=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.RecordLocation} RecordLocation instance + */ + RecordLocation.create = function create(properties) { + return new RecordLocation(properties); + }; + + /** + * Encodes the specified RecordLocation message. Does not implicitly {@link google.privacy.dlp.v2.RecordLocation.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.RecordLocation + * @static + * @param {google.privacy.dlp.v2.IRecordLocation} message RecordLocation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RecordLocation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.recordKey != null && Object.hasOwnProperty.call(message, "recordKey")) + $root.google.privacy.dlp.v2.RecordKey.encode(message.recordKey, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.fieldId != null && Object.hasOwnProperty.call(message, "fieldId")) + $root.google.privacy.dlp.v2.FieldId.encode(message.fieldId, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.tableLocation != null && Object.hasOwnProperty.call(message, "tableLocation")) + $root.google.privacy.dlp.v2.TableLocation.encode(message.tableLocation, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RecordLocation message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.RecordLocation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.RecordLocation + * @static + * @param {google.privacy.dlp.v2.IRecordLocation} message RecordLocation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RecordLocation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RecordLocation message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.RecordLocation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.RecordLocation} RecordLocation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RecordLocation.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.privacy.dlp.v2.RecordLocation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.recordKey = $root.google.privacy.dlp.v2.RecordKey.decode(reader, reader.uint32()); + break; + case 2: + message.fieldId = $root.google.privacy.dlp.v2.FieldId.decode(reader, reader.uint32()); + break; + case 3: + message.tableLocation = $root.google.privacy.dlp.v2.TableLocation.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RecordLocation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.RecordLocation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.RecordLocation} RecordLocation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RecordLocation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RecordLocation message. + * @function verify + * @memberof google.privacy.dlp.v2.RecordLocation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RecordLocation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.recordKey != null && message.hasOwnProperty("recordKey")) { + var error = $root.google.privacy.dlp.v2.RecordKey.verify(message.recordKey); + if (error) + return "recordKey." + error; + } + if (message.fieldId != null && message.hasOwnProperty("fieldId")) { + var error = $root.google.privacy.dlp.v2.FieldId.verify(message.fieldId); + if (error) + return "fieldId." + error; + } + if (message.tableLocation != null && message.hasOwnProperty("tableLocation")) { + var error = $root.google.privacy.dlp.v2.TableLocation.verify(message.tableLocation); + if (error) + return "tableLocation." + error; + } + return null; + }; + + /** + * Creates a RecordLocation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.RecordLocation + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.RecordLocation} RecordLocation + */ + RecordLocation.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.RecordLocation) + return object; + var message = new $root.google.privacy.dlp.v2.RecordLocation(); + if (object.recordKey != null) { + if (typeof object.recordKey !== "object") + throw TypeError(".google.privacy.dlp.v2.RecordLocation.recordKey: object expected"); + message.recordKey = $root.google.privacy.dlp.v2.RecordKey.fromObject(object.recordKey); + } + if (object.fieldId != null) { + if (typeof object.fieldId !== "object") + throw TypeError(".google.privacy.dlp.v2.RecordLocation.fieldId: object expected"); + message.fieldId = $root.google.privacy.dlp.v2.FieldId.fromObject(object.fieldId); + } + if (object.tableLocation != null) { + if (typeof object.tableLocation !== "object") + throw TypeError(".google.privacy.dlp.v2.RecordLocation.tableLocation: object expected"); + message.tableLocation = $root.google.privacy.dlp.v2.TableLocation.fromObject(object.tableLocation); + } + return message; + }; + + /** + * Creates a plain object from a RecordLocation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.RecordLocation + * @static + * @param {google.privacy.dlp.v2.RecordLocation} message RecordLocation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RecordLocation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.recordKey = null; + object.fieldId = null; + object.tableLocation = null; + } + if (message.recordKey != null && message.hasOwnProperty("recordKey")) + object.recordKey = $root.google.privacy.dlp.v2.RecordKey.toObject(message.recordKey, options); + if (message.fieldId != null && message.hasOwnProperty("fieldId")) + object.fieldId = $root.google.privacy.dlp.v2.FieldId.toObject(message.fieldId, options); + if (message.tableLocation != null && message.hasOwnProperty("tableLocation")) + object.tableLocation = $root.google.privacy.dlp.v2.TableLocation.toObject(message.tableLocation, options); + return object; + }; + + /** + * Converts this RecordLocation to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.RecordLocation + * @instance + * @returns {Object.} JSON object + */ + RecordLocation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RecordLocation; + })(); + + v2.TableLocation = (function() { + + /** + * Properties of a TableLocation. + * @memberof google.privacy.dlp.v2 + * @interface ITableLocation + * @property {number|Long|null} [rowIndex] TableLocation rowIndex + */ + + /** + * Constructs a new TableLocation. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents a TableLocation. + * @implements ITableLocation + * @constructor + * @param {google.privacy.dlp.v2.ITableLocation=} [properties] Properties to set + */ + function TableLocation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TableLocation rowIndex. + * @member {number|Long} rowIndex + * @memberof google.privacy.dlp.v2.TableLocation + * @instance + */ + TableLocation.prototype.rowIndex = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TableLocation instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.TableLocation + * @static + * @param {google.privacy.dlp.v2.ITableLocation=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.TableLocation} TableLocation instance + */ + TableLocation.create = function create(properties) { + return new TableLocation(properties); + }; + + /** + * Encodes the specified TableLocation message. Does not implicitly {@link google.privacy.dlp.v2.TableLocation.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.TableLocation + * @static + * @param {google.privacy.dlp.v2.ITableLocation} message TableLocation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TableLocation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rowIndex != null && Object.hasOwnProperty.call(message, "rowIndex")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.rowIndex); + return writer; + }; + + /** + * Encodes the specified TableLocation message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.TableLocation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.TableLocation + * @static + * @param {google.privacy.dlp.v2.ITableLocation} message TableLocation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TableLocation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TableLocation message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.TableLocation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.TableLocation} TableLocation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TableLocation.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.privacy.dlp.v2.TableLocation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.rowIndex = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TableLocation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.TableLocation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.TableLocation} TableLocation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TableLocation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TableLocation message. + * @function verify + * @memberof google.privacy.dlp.v2.TableLocation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TableLocation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.rowIndex != null && message.hasOwnProperty("rowIndex")) + if (!$util.isInteger(message.rowIndex) && !(message.rowIndex && $util.isInteger(message.rowIndex.low) && $util.isInteger(message.rowIndex.high))) + return "rowIndex: integer|Long expected"; + return null; + }; + + /** + * Creates a TableLocation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.TableLocation + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.TableLocation} TableLocation + */ + TableLocation.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.TableLocation) + return object; + var message = new $root.google.privacy.dlp.v2.TableLocation(); + if (object.rowIndex != null) + if ($util.Long) + (message.rowIndex = $util.Long.fromValue(object.rowIndex)).unsigned = false; + else if (typeof object.rowIndex === "string") + message.rowIndex = parseInt(object.rowIndex, 10); + else if (typeof object.rowIndex === "number") + message.rowIndex = object.rowIndex; + else if (typeof object.rowIndex === "object") + message.rowIndex = new $util.LongBits(object.rowIndex.low >>> 0, object.rowIndex.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a TableLocation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.TableLocation + * @static + * @param {google.privacy.dlp.v2.TableLocation} message TableLocation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TableLocation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.rowIndex = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.rowIndex = options.longs === String ? "0" : 0; + if (message.rowIndex != null && message.hasOwnProperty("rowIndex")) + if (typeof message.rowIndex === "number") + object.rowIndex = options.longs === String ? String(message.rowIndex) : message.rowIndex; + else + object.rowIndex = options.longs === String ? $util.Long.prototype.toString.call(message.rowIndex) : options.longs === Number ? new $util.LongBits(message.rowIndex.low >>> 0, message.rowIndex.high >>> 0).toNumber() : message.rowIndex; + return object; + }; + + /** + * Converts this TableLocation to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.TableLocation + * @instance + * @returns {Object.} JSON object + */ + TableLocation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TableLocation; + })(); + + v2.Container = (function() { + + /** + * Properties of a Container. + * @memberof google.privacy.dlp.v2 + * @interface IContainer + * @property {string|null} [type] Container type + * @property {string|null} [projectId] Container projectId + * @property {string|null} [fullPath] Container fullPath + * @property {string|null} [rootPath] Container rootPath + * @property {string|null} [relativePath] Container relativePath + * @property {google.protobuf.ITimestamp|null} [updateTime] Container updateTime + * @property {string|null} [version] Container version + */ + + /** + * Constructs a new Container. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents a Container. + * @implements IContainer + * @constructor + * @param {google.privacy.dlp.v2.IContainer=} [properties] Properties to set + */ + function Container(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Container type. + * @member {string} type + * @memberof google.privacy.dlp.v2.Container + * @instance + */ + Container.prototype.type = ""; + + /** + * Container projectId. + * @member {string} projectId + * @memberof google.privacy.dlp.v2.Container + * @instance + */ + Container.prototype.projectId = ""; + + /** + * Container fullPath. + * @member {string} fullPath + * @memberof google.privacy.dlp.v2.Container + * @instance + */ + Container.prototype.fullPath = ""; + + /** + * Container rootPath. + * @member {string} rootPath + * @memberof google.privacy.dlp.v2.Container + * @instance + */ + Container.prototype.rootPath = ""; + + /** + * Container relativePath. + * @member {string} relativePath + * @memberof google.privacy.dlp.v2.Container + * @instance + */ + Container.prototype.relativePath = ""; + + /** + * Container updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.privacy.dlp.v2.Container + * @instance + */ + Container.prototype.updateTime = null; + + /** + * Container version. + * @member {string} version + * @memberof google.privacy.dlp.v2.Container + * @instance + */ + Container.prototype.version = ""; + + /** + * Creates a new Container instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.Container + * @static + * @param {google.privacy.dlp.v2.IContainer=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.Container} Container instance + */ + Container.create = function create(properties) { + return new Container(properties); + }; + + /** + * Encodes the specified Container message. Does not implicitly {@link google.privacy.dlp.v2.Container.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.Container + * @static + * @param {google.privacy.dlp.v2.IContainer} message Container message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Container.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.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.projectId); + if (message.fullPath != null && Object.hasOwnProperty.call(message, "fullPath")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.fullPath); + if (message.rootPath != null && Object.hasOwnProperty.call(message, "rootPath")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.rootPath); + if (message.relativePath != null && Object.hasOwnProperty.call(message, "relativePath")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.relativePath); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.version); + return writer; + }; + + /** + * Encodes the specified Container message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.Container.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.Container + * @static + * @param {google.privacy.dlp.v2.IContainer} message Container message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Container.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Container message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.Container + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.Container} Container + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Container.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.privacy.dlp.v2.Container(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.type = reader.string(); + break; + case 2: + message.projectId = reader.string(); + break; + case 3: + message.fullPath = reader.string(); + break; + case 4: + message.rootPath = reader.string(); + break; + case 5: + message.relativePath = reader.string(); + break; + case 6: + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 7: + message.version = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Container message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.Container + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.Container} Container + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Container.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Container message. + * @function verify + * @memberof google.privacy.dlp.v2.Container + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Container.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.projectId != null && message.hasOwnProperty("projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + if (message.fullPath != null && message.hasOwnProperty("fullPath")) + if (!$util.isString(message.fullPath)) + return "fullPath: string expected"; + if (message.rootPath != null && message.hasOwnProperty("rootPath")) + if (!$util.isString(message.rootPath)) + return "rootPath: string expected"; + if (message.relativePath != null && message.hasOwnProperty("relativePath")) + if (!$util.isString(message.relativePath)) + return "relativePath: string expected"; + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; + return null; + }; + + /** + * Creates a Container message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.Container + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.Container} Container + */ + Container.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.Container) + return object; + var message = new $root.google.privacy.dlp.v2.Container(); + if (object.type != null) + message.type = String(object.type); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.fullPath != null) + message.fullPath = String(object.fullPath); + if (object.rootPath != null) + message.rootPath = String(object.rootPath); + if (object.relativePath != null) + message.relativePath = String(object.relativePath); + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.privacy.dlp.v2.Container.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.version != null) + message.version = String(object.version); + return message; + }; + + /** + * Creates a plain object from a Container message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.Container + * @static + * @param {google.privacy.dlp.v2.Container} message Container + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Container.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = ""; + object.projectId = ""; + object.fullPath = ""; + object.rootPath = ""; + object.relativePath = ""; + object.updateTime = null; + object.version = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + if (message.fullPath != null && message.hasOwnProperty("fullPath")) + object.fullPath = message.fullPath; + if (message.rootPath != null && message.hasOwnProperty("rootPath")) + object.rootPath = message.rootPath; + if (message.relativePath != null && message.hasOwnProperty("relativePath")) + object.relativePath = message.relativePath; + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + return object; + }; + + /** + * Converts this Container to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.Container + * @instance + * @returns {Object.} JSON object + */ + Container.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Container; + })(); + + v2.Range = (function() { + + /** + * Properties of a Range. + * @memberof google.privacy.dlp.v2 + * @interface IRange + * @property {number|Long|null} [start] Range start + * @property {number|Long|null} [end] Range end + */ + + /** + * Constructs a new Range. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents a Range. + * @implements IRange + * @constructor + * @param {google.privacy.dlp.v2.IRange=} [properties] Properties to set + */ + function Range(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Range start. + * @member {number|Long} start + * @memberof google.privacy.dlp.v2.Range + * @instance + */ + Range.prototype.start = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Range end. + * @member {number|Long} end + * @memberof google.privacy.dlp.v2.Range + * @instance + */ + Range.prototype.end = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Range instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.Range + * @static + * @param {google.privacy.dlp.v2.IRange=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.Range} Range instance + */ + Range.create = function create(properties) { + return new Range(properties); + }; + + /** + * Encodes the specified Range message. Does not implicitly {@link google.privacy.dlp.v2.Range.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.Range + * @static + * @param {google.privacy.dlp.v2.IRange} message Range message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Range.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.end); + return writer; + }; + + /** + * Encodes the specified Range message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.Range.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.Range + * @static + * @param {google.privacy.dlp.v2.IRange} message Range message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Range.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Range message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.Range + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.Range} Range + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Range.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.privacy.dlp.v2.Range(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.start = reader.int64(); + break; + case 2: + message.end = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Range message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.Range + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.Range} Range + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Range.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Range message. + * @function verify + * @memberof google.privacy.dlp.v2.Range + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Range.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start) && !(message.start && $util.isInteger(message.start.low) && $util.isInteger(message.start.high))) + return "start: integer|Long expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end) && !(message.end && $util.isInteger(message.end.low) && $util.isInteger(message.end.high))) + return "end: integer|Long expected"; + return null; + }; + + /** + * Creates a Range message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.Range + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.Range} Range + */ + Range.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.Range) + return object; + var message = new $root.google.privacy.dlp.v2.Range(); + if (object.start != null) + if ($util.Long) + (message.start = $util.Long.fromValue(object.start)).unsigned = false; + else if (typeof object.start === "string") + message.start = parseInt(object.start, 10); + else if (typeof object.start === "number") + message.start = object.start; + else if (typeof object.start === "object") + message.start = new $util.LongBits(object.start.low >>> 0, object.start.high >>> 0).toNumber(); + if (object.end != null) + if ($util.Long) + (message.end = $util.Long.fromValue(object.end)).unsigned = false; + else if (typeof object.end === "string") + message.end = parseInt(object.end, 10); + else if (typeof object.end === "number") + message.end = object.end; + else if (typeof object.end === "object") + message.end = new $util.LongBits(object.end.low >>> 0, object.end.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a Range message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.Range + * @static + * @param {google.privacy.dlp.v2.Range} message Range + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Range.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.start = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.start = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.end = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.end = options.longs === String ? "0" : 0; + } + if (message.start != null && message.hasOwnProperty("start")) + if (typeof message.start === "number") + object.start = options.longs === String ? String(message.start) : message.start; + else + object.start = options.longs === String ? $util.Long.prototype.toString.call(message.start) : options.longs === Number ? new $util.LongBits(message.start.low >>> 0, message.start.high >>> 0).toNumber() : message.start; + if (message.end != null && message.hasOwnProperty("end")) + if (typeof message.end === "number") + object.end = options.longs === String ? String(message.end) : message.end; + else + object.end = options.longs === String ? $util.Long.prototype.toString.call(message.end) : options.longs === Number ? new $util.LongBits(message.end.low >>> 0, message.end.high >>> 0).toNumber() : message.end; + return object; + }; + + /** + * Converts this Range to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.Range + * @instance + * @returns {Object.} JSON object + */ + Range.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Range; + })(); + + v2.ImageLocation = (function() { + + /** + * Properties of an ImageLocation. + * @memberof google.privacy.dlp.v2 + * @interface IImageLocation + * @property {Array.|null} [boundingBoxes] ImageLocation boundingBoxes + */ + + /** + * Constructs a new ImageLocation. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents an ImageLocation. + * @implements IImageLocation + * @constructor + * @param {google.privacy.dlp.v2.IImageLocation=} [properties] Properties to set + */ + function ImageLocation(properties) { + this.boundingBoxes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ImageLocation boundingBoxes. + * @member {Array.} boundingBoxes + * @memberof google.privacy.dlp.v2.ImageLocation + * @instance + */ + ImageLocation.prototype.boundingBoxes = $util.emptyArray; + + /** + * Creates a new ImageLocation instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.ImageLocation + * @static + * @param {google.privacy.dlp.v2.IImageLocation=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.ImageLocation} ImageLocation instance + */ + ImageLocation.create = function create(properties) { + return new ImageLocation(properties); + }; + + /** + * Encodes the specified ImageLocation message. Does not implicitly {@link google.privacy.dlp.v2.ImageLocation.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.ImageLocation + * @static + * @param {google.privacy.dlp.v2.IImageLocation} message ImageLocation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageLocation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.boundingBoxes != null && message.boundingBoxes.length) + for (var i = 0; i < message.boundingBoxes.length; ++i) + $root.google.privacy.dlp.v2.BoundingBox.encode(message.boundingBoxes[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ImageLocation message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.ImageLocation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.ImageLocation + * @static + * @param {google.privacy.dlp.v2.IImageLocation} message ImageLocation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageLocation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImageLocation message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.ImageLocation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.ImageLocation} ImageLocation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageLocation.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.privacy.dlp.v2.ImageLocation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.boundingBoxes && message.boundingBoxes.length)) + message.boundingBoxes = []; + message.boundingBoxes.push($root.google.privacy.dlp.v2.BoundingBox.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImageLocation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.ImageLocation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.ImageLocation} ImageLocation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageLocation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImageLocation message. + * @function verify + * @memberof google.privacy.dlp.v2.ImageLocation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImageLocation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.boundingBoxes != null && message.hasOwnProperty("boundingBoxes")) { + if (!Array.isArray(message.boundingBoxes)) + return "boundingBoxes: array expected"; + for (var i = 0; i < message.boundingBoxes.length; ++i) { + var error = $root.google.privacy.dlp.v2.BoundingBox.verify(message.boundingBoxes[i]); + if (error) + return "boundingBoxes." + error; + } + } + return null; + }; + + /** + * Creates an ImageLocation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.ImageLocation + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.ImageLocation} ImageLocation + */ + ImageLocation.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.ImageLocation) + return object; + var message = new $root.google.privacy.dlp.v2.ImageLocation(); + if (object.boundingBoxes) { + if (!Array.isArray(object.boundingBoxes)) + throw TypeError(".google.privacy.dlp.v2.ImageLocation.boundingBoxes: array expected"); + message.boundingBoxes = []; + for (var i = 0; i < object.boundingBoxes.length; ++i) { + if (typeof object.boundingBoxes[i] !== "object") + throw TypeError(".google.privacy.dlp.v2.ImageLocation.boundingBoxes: object expected"); + message.boundingBoxes[i] = $root.google.privacy.dlp.v2.BoundingBox.fromObject(object.boundingBoxes[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an ImageLocation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.ImageLocation + * @static + * @param {google.privacy.dlp.v2.ImageLocation} message ImageLocation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImageLocation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.boundingBoxes = []; + if (message.boundingBoxes && message.boundingBoxes.length) { + object.boundingBoxes = []; + for (var j = 0; j < message.boundingBoxes.length; ++j) + object.boundingBoxes[j] = $root.google.privacy.dlp.v2.BoundingBox.toObject(message.boundingBoxes[j], options); + } + return object; + }; + + /** + * Converts this ImageLocation to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.ImageLocation + * @instance + * @returns {Object.} JSON object + */ + ImageLocation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ImageLocation; + })(); + + v2.BoundingBox = (function() { + + /** + * Properties of a BoundingBox. + * @memberof google.privacy.dlp.v2 + * @interface IBoundingBox + * @property {number|null} [top] BoundingBox top + * @property {number|null} [left] BoundingBox left + * @property {number|null} [width] BoundingBox width + * @property {number|null} [height] BoundingBox height + */ + + /** + * Constructs a new BoundingBox. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents a BoundingBox. + * @implements IBoundingBox + * @constructor + * @param {google.privacy.dlp.v2.IBoundingBox=} [properties] Properties to set + */ + function BoundingBox(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BoundingBox top. + * @member {number} top + * @memberof google.privacy.dlp.v2.BoundingBox + * @instance + */ + BoundingBox.prototype.top = 0; + + /** + * BoundingBox left. + * @member {number} left + * @memberof google.privacy.dlp.v2.BoundingBox + * @instance + */ + BoundingBox.prototype.left = 0; + + /** + * BoundingBox width. + * @member {number} width + * @memberof google.privacy.dlp.v2.BoundingBox + * @instance + */ + BoundingBox.prototype.width = 0; + + /** + * BoundingBox height. + * @member {number} height + * @memberof google.privacy.dlp.v2.BoundingBox + * @instance + */ + BoundingBox.prototype.height = 0; + + /** + * Creates a new BoundingBox instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.BoundingBox + * @static + * @param {google.privacy.dlp.v2.IBoundingBox=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.BoundingBox} BoundingBox instance + */ + BoundingBox.create = function create(properties) { + return new BoundingBox(properties); + }; + + /** + * Encodes the specified BoundingBox message. Does not implicitly {@link google.privacy.dlp.v2.BoundingBox.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.BoundingBox + * @static + * @param {google.privacy.dlp.v2.IBoundingBox} message BoundingBox message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoundingBox.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.top != null && Object.hasOwnProperty.call(message, "top")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.top); + if (message.left != null && Object.hasOwnProperty.call(message, "left")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.left); + if (message.width != null && Object.hasOwnProperty.call(message, "width")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.width); + if (message.height != null && Object.hasOwnProperty.call(message, "height")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.height); + return writer; + }; + + /** + * Encodes the specified BoundingBox message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.BoundingBox.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.BoundingBox + * @static + * @param {google.privacy.dlp.v2.IBoundingBox} message BoundingBox message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoundingBox.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BoundingBox message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.BoundingBox + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.BoundingBox} BoundingBox + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoundingBox.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.privacy.dlp.v2.BoundingBox(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.top = reader.int32(); + break; + case 2: + message.left = reader.int32(); + break; + case 3: + message.width = reader.int32(); + break; + case 4: + message.height = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BoundingBox message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.BoundingBox + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.BoundingBox} BoundingBox + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoundingBox.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BoundingBox message. + * @function verify + * @memberof google.privacy.dlp.v2.BoundingBox + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BoundingBox.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.top != null && message.hasOwnProperty("top")) + if (!$util.isInteger(message.top)) + return "top: integer expected"; + if (message.left != null && message.hasOwnProperty("left")) + if (!$util.isInteger(message.left)) + return "left: integer expected"; + if (message.width != null && message.hasOwnProperty("width")) + if (!$util.isInteger(message.width)) + return "width: integer expected"; + if (message.height != null && message.hasOwnProperty("height")) + if (!$util.isInteger(message.height)) + return "height: integer expected"; + return null; + }; + + /** + * Creates a BoundingBox message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.BoundingBox + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.BoundingBox} BoundingBox + */ + BoundingBox.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.BoundingBox) + return object; + var message = new $root.google.privacy.dlp.v2.BoundingBox(); + if (object.top != null) + message.top = object.top | 0; + if (object.left != null) + message.left = object.left | 0; + if (object.width != null) + message.width = object.width | 0; + if (object.height != null) + message.height = object.height | 0; + return message; + }; + + /** + * Creates a plain object from a BoundingBox message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.BoundingBox + * @static + * @param {google.privacy.dlp.v2.BoundingBox} message BoundingBox + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BoundingBox.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.top = 0; + object.left = 0; + object.width = 0; + object.height = 0; + } + if (message.top != null && message.hasOwnProperty("top")) + object.top = message.top; + if (message.left != null && message.hasOwnProperty("left")) + object.left = message.left; + if (message.width != null && message.hasOwnProperty("width")) + object.width = message.width; + if (message.height != null && message.hasOwnProperty("height")) + object.height = message.height; + return object; + }; + + /** + * Converts this BoundingBox to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.BoundingBox + * @instance + * @returns {Object.} JSON object + */ + BoundingBox.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return BoundingBox; + })(); + + v2.RedactImageRequest = (function() { + + /** + * Properties of a RedactImageRequest. + * @memberof google.privacy.dlp.v2 + * @interface IRedactImageRequest + * @property {string|null} [parent] RedactImageRequest parent + * @property {string|null} [locationId] RedactImageRequest locationId + * @property {google.privacy.dlp.v2.IInspectConfig|null} [inspectConfig] RedactImageRequest inspectConfig + * @property {Array.|null} [imageRedactionConfigs] RedactImageRequest imageRedactionConfigs + * @property {boolean|null} [includeFindings] RedactImageRequest includeFindings + * @property {google.privacy.dlp.v2.IByteContentItem|null} [byteItem] RedactImageRequest byteItem + */ + + /** + * Constructs a new RedactImageRequest. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents a RedactImageRequest. + * @implements IRedactImageRequest + * @constructor + * @param {google.privacy.dlp.v2.IRedactImageRequest=} [properties] Properties to set + */ + function RedactImageRequest(properties) { + this.imageRedactionConfigs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RedactImageRequest parent. + * @member {string} parent + * @memberof google.privacy.dlp.v2.RedactImageRequest + * @instance + */ + RedactImageRequest.prototype.parent = ""; + + /** + * RedactImageRequest locationId. + * @member {string} locationId + * @memberof google.privacy.dlp.v2.RedactImageRequest + * @instance + */ + RedactImageRequest.prototype.locationId = ""; + + /** + * RedactImageRequest inspectConfig. + * @member {google.privacy.dlp.v2.IInspectConfig|null|undefined} inspectConfig + * @memberof google.privacy.dlp.v2.RedactImageRequest + * @instance + */ + RedactImageRequest.prototype.inspectConfig = null; + + /** + * RedactImageRequest imageRedactionConfigs. + * @member {Array.} imageRedactionConfigs + * @memberof google.privacy.dlp.v2.RedactImageRequest + * @instance + */ + RedactImageRequest.prototype.imageRedactionConfigs = $util.emptyArray; + + /** + * RedactImageRequest includeFindings. + * @member {boolean} includeFindings + * @memberof google.privacy.dlp.v2.RedactImageRequest + * @instance + */ + RedactImageRequest.prototype.includeFindings = false; + + /** + * RedactImageRequest byteItem. + * @member {google.privacy.dlp.v2.IByteContentItem|null|undefined} byteItem + * @memberof google.privacy.dlp.v2.RedactImageRequest + * @instance + */ + RedactImageRequest.prototype.byteItem = null; + + /** + * Creates a new RedactImageRequest instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.RedactImageRequest + * @static + * @param {google.privacy.dlp.v2.IRedactImageRequest=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.RedactImageRequest} RedactImageRequest instance + */ + RedactImageRequest.create = function create(properties) { + return new RedactImageRequest(properties); + }; + + /** + * Encodes the specified RedactImageRequest message. Does not implicitly {@link google.privacy.dlp.v2.RedactImageRequest.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.RedactImageRequest + * @static + * @param {google.privacy.dlp.v2.IRedactImageRequest} message RedactImageRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RedactImageRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.inspectConfig != null && Object.hasOwnProperty.call(message, "inspectConfig")) + $root.google.privacy.dlp.v2.InspectConfig.encode(message.inspectConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.imageRedactionConfigs != null && message.imageRedactionConfigs.length) + for (var i = 0; i < message.imageRedactionConfigs.length; ++i) + $root.google.privacy.dlp.v2.RedactImageRequest.ImageRedactionConfig.encode(message.imageRedactionConfigs[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.includeFindings != null && Object.hasOwnProperty.call(message, "includeFindings")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.includeFindings); + if (message.byteItem != null && Object.hasOwnProperty.call(message, "byteItem")) + $root.google.privacy.dlp.v2.ByteContentItem.encode(message.byteItem, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.locationId != null && Object.hasOwnProperty.call(message, "locationId")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.locationId); + return writer; + }; + + /** + * Encodes the specified RedactImageRequest message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.RedactImageRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.RedactImageRequest + * @static + * @param {google.privacy.dlp.v2.IRedactImageRequest} message RedactImageRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RedactImageRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RedactImageRequest message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.RedactImageRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.RedactImageRequest} RedactImageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RedactImageRequest.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.privacy.dlp.v2.RedactImageRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 8: + message.locationId = reader.string(); + break; + case 2: + message.inspectConfig = $root.google.privacy.dlp.v2.InspectConfig.decode(reader, reader.uint32()); + break; + case 5: + if (!(message.imageRedactionConfigs && message.imageRedactionConfigs.length)) + message.imageRedactionConfigs = []; + message.imageRedactionConfigs.push($root.google.privacy.dlp.v2.RedactImageRequest.ImageRedactionConfig.decode(reader, reader.uint32())); + break; + case 6: + message.includeFindings = reader.bool(); + break; + case 7: + message.byteItem = $root.google.privacy.dlp.v2.ByteContentItem.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RedactImageRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.RedactImageRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.RedactImageRequest} RedactImageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RedactImageRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RedactImageRequest message. + * @function verify + * @memberof google.privacy.dlp.v2.RedactImageRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RedactImageRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.locationId != null && message.hasOwnProperty("locationId")) + if (!$util.isString(message.locationId)) + return "locationId: string expected"; + if (message.inspectConfig != null && message.hasOwnProperty("inspectConfig")) { + var error = $root.google.privacy.dlp.v2.InspectConfig.verify(message.inspectConfig); + if (error) + return "inspectConfig." + error; + } + if (message.imageRedactionConfigs != null && message.hasOwnProperty("imageRedactionConfigs")) { + if (!Array.isArray(message.imageRedactionConfigs)) + return "imageRedactionConfigs: array expected"; + for (var i = 0; i < message.imageRedactionConfigs.length; ++i) { + var error = $root.google.privacy.dlp.v2.RedactImageRequest.ImageRedactionConfig.verify(message.imageRedactionConfigs[i]); + if (error) + return "imageRedactionConfigs." + error; + } + } + if (message.includeFindings != null && message.hasOwnProperty("includeFindings")) + if (typeof message.includeFindings !== "boolean") + return "includeFindings: boolean expected"; + if (message.byteItem != null && message.hasOwnProperty("byteItem")) { + var error = $root.google.privacy.dlp.v2.ByteContentItem.verify(message.byteItem); + if (error) + return "byteItem." + error; + } + return null; + }; + + /** + * Creates a RedactImageRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.RedactImageRequest + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.RedactImageRequest} RedactImageRequest + */ + RedactImageRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.RedactImageRequest) + return object; + var message = new $root.google.privacy.dlp.v2.RedactImageRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.locationId != null) + message.locationId = String(object.locationId); + if (object.inspectConfig != null) { + if (typeof object.inspectConfig !== "object") + throw TypeError(".google.privacy.dlp.v2.RedactImageRequest.inspectConfig: object expected"); + message.inspectConfig = $root.google.privacy.dlp.v2.InspectConfig.fromObject(object.inspectConfig); + } + if (object.imageRedactionConfigs) { + if (!Array.isArray(object.imageRedactionConfigs)) + throw TypeError(".google.privacy.dlp.v2.RedactImageRequest.imageRedactionConfigs: array expected"); + message.imageRedactionConfigs = []; + for (var i = 0; i < object.imageRedactionConfigs.length; ++i) { + if (typeof object.imageRedactionConfigs[i] !== "object") + throw TypeError(".google.privacy.dlp.v2.RedactImageRequest.imageRedactionConfigs: object expected"); + message.imageRedactionConfigs[i] = $root.google.privacy.dlp.v2.RedactImageRequest.ImageRedactionConfig.fromObject(object.imageRedactionConfigs[i]); + } + } + if (object.includeFindings != null) + message.includeFindings = Boolean(object.includeFindings); + if (object.byteItem != null) { + if (typeof object.byteItem !== "object") + throw TypeError(".google.privacy.dlp.v2.RedactImageRequest.byteItem: object expected"); + message.byteItem = $root.google.privacy.dlp.v2.ByteContentItem.fromObject(object.byteItem); + } + return message; + }; + + /** + * Creates a plain object from a RedactImageRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.RedactImageRequest + * @static + * @param {google.privacy.dlp.v2.RedactImageRequest} message RedactImageRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RedactImageRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.imageRedactionConfigs = []; + if (options.defaults) { + object.parent = ""; + object.inspectConfig = null; + object.includeFindings = false; + object.byteItem = null; + object.locationId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.inspectConfig != null && message.hasOwnProperty("inspectConfig")) + object.inspectConfig = $root.google.privacy.dlp.v2.InspectConfig.toObject(message.inspectConfig, options); + if (message.imageRedactionConfigs && message.imageRedactionConfigs.length) { + object.imageRedactionConfigs = []; + for (var j = 0; j < message.imageRedactionConfigs.length; ++j) + object.imageRedactionConfigs[j] = $root.google.privacy.dlp.v2.RedactImageRequest.ImageRedactionConfig.toObject(message.imageRedactionConfigs[j], options); + } + if (message.includeFindings != null && message.hasOwnProperty("includeFindings")) + object.includeFindings = message.includeFindings; + if (message.byteItem != null && message.hasOwnProperty("byteItem")) + object.byteItem = $root.google.privacy.dlp.v2.ByteContentItem.toObject(message.byteItem, options); + if (message.locationId != null && message.hasOwnProperty("locationId")) + object.locationId = message.locationId; + return object; + }; + + /** + * Converts this RedactImageRequest to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.RedactImageRequest + * @instance + * @returns {Object.} JSON object + */ + RedactImageRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + RedactImageRequest.ImageRedactionConfig = (function() { + + /** + * Properties of an ImageRedactionConfig. + * @memberof google.privacy.dlp.v2.RedactImageRequest + * @interface IImageRedactionConfig + * @property {google.privacy.dlp.v2.IInfoType|null} [infoType] ImageRedactionConfig infoType + * @property {boolean|null} [redactAllText] ImageRedactionConfig redactAllText + * @property {google.privacy.dlp.v2.IColor|null} [redactionColor] ImageRedactionConfig redactionColor + */ + + /** + * Constructs a new ImageRedactionConfig. + * @memberof google.privacy.dlp.v2.RedactImageRequest + * @classdesc Represents an ImageRedactionConfig. + * @implements IImageRedactionConfig + * @constructor + * @param {google.privacy.dlp.v2.RedactImageRequest.IImageRedactionConfig=} [properties] Properties to set + */ + function ImageRedactionConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ImageRedactionConfig infoType. + * @member {google.privacy.dlp.v2.IInfoType|null|undefined} infoType + * @memberof google.privacy.dlp.v2.RedactImageRequest.ImageRedactionConfig + * @instance + */ + ImageRedactionConfig.prototype.infoType = null; + + /** + * ImageRedactionConfig redactAllText. + * @member {boolean} redactAllText + * @memberof google.privacy.dlp.v2.RedactImageRequest.ImageRedactionConfig + * @instance + */ + ImageRedactionConfig.prototype.redactAllText = false; + + /** + * ImageRedactionConfig redactionColor. + * @member {google.privacy.dlp.v2.IColor|null|undefined} redactionColor + * @memberof google.privacy.dlp.v2.RedactImageRequest.ImageRedactionConfig + * @instance + */ + ImageRedactionConfig.prototype.redactionColor = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ImageRedactionConfig target. + * @member {"infoType"|"redactAllText"|undefined} target + * @memberof google.privacy.dlp.v2.RedactImageRequest.ImageRedactionConfig + * @instance + */ + Object.defineProperty(ImageRedactionConfig.prototype, "target", { + get: $util.oneOfGetter($oneOfFields = ["infoType", "redactAllText"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ImageRedactionConfig instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.RedactImageRequest.ImageRedactionConfig + * @static + * @param {google.privacy.dlp.v2.RedactImageRequest.IImageRedactionConfig=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.RedactImageRequest.ImageRedactionConfig} ImageRedactionConfig instance + */ + ImageRedactionConfig.create = function create(properties) { + return new ImageRedactionConfig(properties); + }; + + /** + * Encodes the specified ImageRedactionConfig message. Does not implicitly {@link google.privacy.dlp.v2.RedactImageRequest.ImageRedactionConfig.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.RedactImageRequest.ImageRedactionConfig + * @static + * @param {google.privacy.dlp.v2.RedactImageRequest.IImageRedactionConfig} message ImageRedactionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageRedactionConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.infoType != null && Object.hasOwnProperty.call(message, "infoType")) + $root.google.privacy.dlp.v2.InfoType.encode(message.infoType, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.redactAllText != null && Object.hasOwnProperty.call(message, "redactAllText")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.redactAllText); + if (message.redactionColor != null && Object.hasOwnProperty.call(message, "redactionColor")) + $root.google.privacy.dlp.v2.Color.encode(message.redactionColor, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ImageRedactionConfig message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.RedactImageRequest.ImageRedactionConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.RedactImageRequest.ImageRedactionConfig + * @static + * @param {google.privacy.dlp.v2.RedactImageRequest.IImageRedactionConfig} message ImageRedactionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageRedactionConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImageRedactionConfig message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.RedactImageRequest.ImageRedactionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.RedactImageRequest.ImageRedactionConfig} ImageRedactionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageRedactionConfig.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.privacy.dlp.v2.RedactImageRequest.ImageRedactionConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.infoType = $root.google.privacy.dlp.v2.InfoType.decode(reader, reader.uint32()); + break; + case 2: + message.redactAllText = reader.bool(); + break; + case 3: + message.redactionColor = $root.google.privacy.dlp.v2.Color.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImageRedactionConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.RedactImageRequest.ImageRedactionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.RedactImageRequest.ImageRedactionConfig} ImageRedactionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageRedactionConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImageRedactionConfig message. + * @function verify + * @memberof google.privacy.dlp.v2.RedactImageRequest.ImageRedactionConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImageRedactionConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.infoType != null && message.hasOwnProperty("infoType")) { + properties.target = 1; + { + var error = $root.google.privacy.dlp.v2.InfoType.verify(message.infoType); + if (error) + return "infoType." + error; + } + } + if (message.redactAllText != null && message.hasOwnProperty("redactAllText")) { + if (properties.target === 1) + return "target: multiple values"; + properties.target = 1; + if (typeof message.redactAllText !== "boolean") + return "redactAllText: boolean expected"; + } + if (message.redactionColor != null && message.hasOwnProperty("redactionColor")) { + var error = $root.google.privacy.dlp.v2.Color.verify(message.redactionColor); + if (error) + return "redactionColor." + error; + } + return null; + }; + + /** + * Creates an ImageRedactionConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.RedactImageRequest.ImageRedactionConfig + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.RedactImageRequest.ImageRedactionConfig} ImageRedactionConfig + */ + ImageRedactionConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.RedactImageRequest.ImageRedactionConfig) + return object; + var message = new $root.google.privacy.dlp.v2.RedactImageRequest.ImageRedactionConfig(); + if (object.infoType != null) { + if (typeof object.infoType !== "object") + throw TypeError(".google.privacy.dlp.v2.RedactImageRequest.ImageRedactionConfig.infoType: object expected"); + message.infoType = $root.google.privacy.dlp.v2.InfoType.fromObject(object.infoType); + } + if (object.redactAllText != null) + message.redactAllText = Boolean(object.redactAllText); + if (object.redactionColor != null) { + if (typeof object.redactionColor !== "object") + throw TypeError(".google.privacy.dlp.v2.RedactImageRequest.ImageRedactionConfig.redactionColor: object expected"); + message.redactionColor = $root.google.privacy.dlp.v2.Color.fromObject(object.redactionColor); + } + return message; + }; + + /** + * Creates a plain object from an ImageRedactionConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.RedactImageRequest.ImageRedactionConfig + * @static + * @param {google.privacy.dlp.v2.RedactImageRequest.ImageRedactionConfig} message ImageRedactionConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImageRedactionConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.redactionColor = null; + if (message.infoType != null && message.hasOwnProperty("infoType")) { + object.infoType = $root.google.privacy.dlp.v2.InfoType.toObject(message.infoType, options); + if (options.oneofs) + object.target = "infoType"; + } + if (message.redactAllText != null && message.hasOwnProperty("redactAllText")) { + object.redactAllText = message.redactAllText; + if (options.oneofs) + object.target = "redactAllText"; + } + if (message.redactionColor != null && message.hasOwnProperty("redactionColor")) + object.redactionColor = $root.google.privacy.dlp.v2.Color.toObject(message.redactionColor, options); + return object; + }; + + /** + * Converts this ImageRedactionConfig to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.RedactImageRequest.ImageRedactionConfig + * @instance + * @returns {Object.} JSON object + */ + ImageRedactionConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ImageRedactionConfig; + })(); + + return RedactImageRequest; + })(); + + v2.Color = (function() { + + /** + * Properties of a Color. + * @memberof google.privacy.dlp.v2 + * @interface IColor + * @property {number|null} [red] Color red + * @property {number|null} [green] Color green + * @property {number|null} [blue] Color blue + */ + + /** + * Constructs a new Color. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents a Color. + * @implements IColor + * @constructor + * @param {google.privacy.dlp.v2.IColor=} [properties] Properties to set + */ + function Color(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Color red. + * @member {number} red + * @memberof google.privacy.dlp.v2.Color + * @instance + */ + Color.prototype.red = 0; + + /** + * Color green. + * @member {number} green + * @memberof google.privacy.dlp.v2.Color + * @instance + */ + Color.prototype.green = 0; + + /** + * Color blue. + * @member {number} blue + * @memberof google.privacy.dlp.v2.Color + * @instance + */ + Color.prototype.blue = 0; + + /** + * Creates a new Color instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.Color + * @static + * @param {google.privacy.dlp.v2.IColor=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.Color} Color instance + */ + Color.create = function create(properties) { + return new Color(properties); + }; + + /** + * Encodes the specified Color message. Does not implicitly {@link google.privacy.dlp.v2.Color.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.Color + * @static + * @param {google.privacy.dlp.v2.IColor} message Color message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Color.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.red != null && Object.hasOwnProperty.call(message, "red")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.red); + if (message.green != null && Object.hasOwnProperty.call(message, "green")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.green); + if (message.blue != null && Object.hasOwnProperty.call(message, "blue")) + writer.uint32(/* id 3, wireType 5 =*/29).float(message.blue); + return writer; + }; + + /** + * Encodes the specified Color message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.Color.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.Color + * @static + * @param {google.privacy.dlp.v2.IColor} message Color message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Color.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Color message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.Color + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.Color} Color + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Color.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.privacy.dlp.v2.Color(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.red = reader.float(); + break; + case 2: + message.green = reader.float(); + break; + case 3: + message.blue = reader.float(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Color message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.Color + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.Color} Color + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Color.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Color message. + * @function verify + * @memberof google.privacy.dlp.v2.Color + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Color.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.red != null && message.hasOwnProperty("red")) + if (typeof message.red !== "number") + return "red: number expected"; + if (message.green != null && message.hasOwnProperty("green")) + if (typeof message.green !== "number") + return "green: number expected"; + if (message.blue != null && message.hasOwnProperty("blue")) + if (typeof message.blue !== "number") + return "blue: number expected"; + return null; + }; + + /** + * Creates a Color message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.Color + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.Color} Color + */ + Color.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.Color) + return object; + var message = new $root.google.privacy.dlp.v2.Color(); + if (object.red != null) + message.red = Number(object.red); + if (object.green != null) + message.green = Number(object.green); + if (object.blue != null) + message.blue = Number(object.blue); + return message; + }; + + /** + * Creates a plain object from a Color message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.Color + * @static + * @param {google.privacy.dlp.v2.Color} message Color + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Color.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.red = 0; + object.green = 0; + object.blue = 0; + } + if (message.red != null && message.hasOwnProperty("red")) + object.red = options.json && !isFinite(message.red) ? String(message.red) : message.red; + if (message.green != null && message.hasOwnProperty("green")) + object.green = options.json && !isFinite(message.green) ? String(message.green) : message.green; + if (message.blue != null && message.hasOwnProperty("blue")) + object.blue = options.json && !isFinite(message.blue) ? String(message.blue) : message.blue; + return object; + }; + + /** + * Converts this Color to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.Color + * @instance + * @returns {Object.} JSON object + */ + Color.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Color; + })(); + + v2.RedactImageResponse = (function() { + + /** + * Properties of a RedactImageResponse. + * @memberof google.privacy.dlp.v2 + * @interface IRedactImageResponse + * @property {Uint8Array|null} [redactedImage] RedactImageResponse redactedImage + * @property {string|null} [extractedText] RedactImageResponse extractedText + * @property {google.privacy.dlp.v2.IInspectResult|null} [inspectResult] RedactImageResponse inspectResult + */ + + /** + * Constructs a new RedactImageResponse. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents a RedactImageResponse. + * @implements IRedactImageResponse + * @constructor + * @param {google.privacy.dlp.v2.IRedactImageResponse=} [properties] Properties to set + */ + function RedactImageResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RedactImageResponse redactedImage. + * @member {Uint8Array} redactedImage + * @memberof google.privacy.dlp.v2.RedactImageResponse + * @instance + */ + RedactImageResponse.prototype.redactedImage = $util.newBuffer([]); + + /** + * RedactImageResponse extractedText. + * @member {string} extractedText + * @memberof google.privacy.dlp.v2.RedactImageResponse + * @instance + */ + RedactImageResponse.prototype.extractedText = ""; + + /** + * RedactImageResponse inspectResult. + * @member {google.privacy.dlp.v2.IInspectResult|null|undefined} inspectResult + * @memberof google.privacy.dlp.v2.RedactImageResponse + * @instance + */ + RedactImageResponse.prototype.inspectResult = null; + + /** + * Creates a new RedactImageResponse instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.RedactImageResponse + * @static + * @param {google.privacy.dlp.v2.IRedactImageResponse=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.RedactImageResponse} RedactImageResponse instance + */ + RedactImageResponse.create = function create(properties) { + return new RedactImageResponse(properties); + }; + + /** + * Encodes the specified RedactImageResponse message. Does not implicitly {@link google.privacy.dlp.v2.RedactImageResponse.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.RedactImageResponse + * @static + * @param {google.privacy.dlp.v2.IRedactImageResponse} message RedactImageResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RedactImageResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.redactedImage != null && Object.hasOwnProperty.call(message, "redactedImage")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.redactedImage); + if (message.extractedText != null && Object.hasOwnProperty.call(message, "extractedText")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.extractedText); + if (message.inspectResult != null && Object.hasOwnProperty.call(message, "inspectResult")) + $root.google.privacy.dlp.v2.InspectResult.encode(message.inspectResult, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RedactImageResponse message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.RedactImageResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.RedactImageResponse + * @static + * @param {google.privacy.dlp.v2.IRedactImageResponse} message RedactImageResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RedactImageResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RedactImageResponse message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.RedactImageResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.RedactImageResponse} RedactImageResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RedactImageResponse.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.privacy.dlp.v2.RedactImageResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.redactedImage = reader.bytes(); + break; + case 2: + message.extractedText = reader.string(); + break; + case 3: + message.inspectResult = $root.google.privacy.dlp.v2.InspectResult.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RedactImageResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.RedactImageResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.RedactImageResponse} RedactImageResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RedactImageResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RedactImageResponse message. + * @function verify + * @memberof google.privacy.dlp.v2.RedactImageResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RedactImageResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.redactedImage != null && message.hasOwnProperty("redactedImage")) + if (!(message.redactedImage && typeof message.redactedImage.length === "number" || $util.isString(message.redactedImage))) + return "redactedImage: buffer expected"; + if (message.extractedText != null && message.hasOwnProperty("extractedText")) + if (!$util.isString(message.extractedText)) + return "extractedText: string expected"; + if (message.inspectResult != null && message.hasOwnProperty("inspectResult")) { + var error = $root.google.privacy.dlp.v2.InspectResult.verify(message.inspectResult); + if (error) + return "inspectResult." + error; + } + return null; + }; + + /** + * Creates a RedactImageResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.RedactImageResponse + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.RedactImageResponse} RedactImageResponse + */ + RedactImageResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.RedactImageResponse) + return object; + var message = new $root.google.privacy.dlp.v2.RedactImageResponse(); + if (object.redactedImage != null) + if (typeof object.redactedImage === "string") + $util.base64.decode(object.redactedImage, message.redactedImage = $util.newBuffer($util.base64.length(object.redactedImage)), 0); + else if (object.redactedImage.length) + message.redactedImage = object.redactedImage; + if (object.extractedText != null) + message.extractedText = String(object.extractedText); + if (object.inspectResult != null) { + if (typeof object.inspectResult !== "object") + throw TypeError(".google.privacy.dlp.v2.RedactImageResponse.inspectResult: object expected"); + message.inspectResult = $root.google.privacy.dlp.v2.InspectResult.fromObject(object.inspectResult); + } + return message; + }; + + /** + * Creates a plain object from a RedactImageResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.RedactImageResponse + * @static + * @param {google.privacy.dlp.v2.RedactImageResponse} message RedactImageResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RedactImageResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.redactedImage = ""; + else { + object.redactedImage = []; + if (options.bytes !== Array) + object.redactedImage = $util.newBuffer(object.redactedImage); + } + object.extractedText = ""; + object.inspectResult = null; + } + if (message.redactedImage != null && message.hasOwnProperty("redactedImage")) + object.redactedImage = options.bytes === String ? $util.base64.encode(message.redactedImage, 0, message.redactedImage.length) : options.bytes === Array ? Array.prototype.slice.call(message.redactedImage) : message.redactedImage; + if (message.extractedText != null && message.hasOwnProperty("extractedText")) + object.extractedText = message.extractedText; + if (message.inspectResult != null && message.hasOwnProperty("inspectResult")) + object.inspectResult = $root.google.privacy.dlp.v2.InspectResult.toObject(message.inspectResult, options); + return object; + }; + + /** + * Converts this RedactImageResponse to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.RedactImageResponse + * @instance + * @returns {Object.} JSON object + */ + RedactImageResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RedactImageResponse; + })(); + + v2.DeidentifyContentRequest = (function() { + + /** + * Properties of a DeidentifyContentRequest. + * @memberof google.privacy.dlp.v2 + * @interface IDeidentifyContentRequest + * @property {string|null} [parent] DeidentifyContentRequest parent + * @property {google.privacy.dlp.v2.IDeidentifyConfig|null} [deidentifyConfig] DeidentifyContentRequest deidentifyConfig + * @property {google.privacy.dlp.v2.IInspectConfig|null} [inspectConfig] DeidentifyContentRequest inspectConfig + * @property {google.privacy.dlp.v2.IContentItem|null} [item] DeidentifyContentRequest item + * @property {string|null} [inspectTemplateName] DeidentifyContentRequest inspectTemplateName + * @property {string|null} [deidentifyTemplateName] DeidentifyContentRequest deidentifyTemplateName + * @property {string|null} [locationId] DeidentifyContentRequest locationId + */ + + /** + * Constructs a new DeidentifyContentRequest. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents a DeidentifyContentRequest. + * @implements IDeidentifyContentRequest + * @constructor + * @param {google.privacy.dlp.v2.IDeidentifyContentRequest=} [properties] Properties to set + */ + function DeidentifyContentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeidentifyContentRequest parent. + * @member {string} parent + * @memberof google.privacy.dlp.v2.DeidentifyContentRequest + * @instance + */ + DeidentifyContentRequest.prototype.parent = ""; + + /** + * DeidentifyContentRequest deidentifyConfig. + * @member {google.privacy.dlp.v2.IDeidentifyConfig|null|undefined} deidentifyConfig + * @memberof google.privacy.dlp.v2.DeidentifyContentRequest + * @instance + */ + DeidentifyContentRequest.prototype.deidentifyConfig = null; + + /** + * DeidentifyContentRequest inspectConfig. + * @member {google.privacy.dlp.v2.IInspectConfig|null|undefined} inspectConfig + * @memberof google.privacy.dlp.v2.DeidentifyContentRequest + * @instance + */ + DeidentifyContentRequest.prototype.inspectConfig = null; + + /** + * DeidentifyContentRequest item. + * @member {google.privacy.dlp.v2.IContentItem|null|undefined} item + * @memberof google.privacy.dlp.v2.DeidentifyContentRequest + * @instance + */ + DeidentifyContentRequest.prototype.item = null; + + /** + * DeidentifyContentRequest inspectTemplateName. + * @member {string} inspectTemplateName + * @memberof google.privacy.dlp.v2.DeidentifyContentRequest + * @instance + */ + DeidentifyContentRequest.prototype.inspectTemplateName = ""; + + /** + * DeidentifyContentRequest deidentifyTemplateName. + * @member {string} deidentifyTemplateName + * @memberof google.privacy.dlp.v2.DeidentifyContentRequest + * @instance + */ + DeidentifyContentRequest.prototype.deidentifyTemplateName = ""; + + /** + * DeidentifyContentRequest locationId. + * @member {string} locationId + * @memberof google.privacy.dlp.v2.DeidentifyContentRequest + * @instance + */ + DeidentifyContentRequest.prototype.locationId = ""; + + /** + * Creates a new DeidentifyContentRequest instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.DeidentifyContentRequest + * @static + * @param {google.privacy.dlp.v2.IDeidentifyContentRequest=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.DeidentifyContentRequest} DeidentifyContentRequest instance + */ + DeidentifyContentRequest.create = function create(properties) { + return new DeidentifyContentRequest(properties); + }; + + /** + * Encodes the specified DeidentifyContentRequest message. Does not implicitly {@link google.privacy.dlp.v2.DeidentifyContentRequest.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.DeidentifyContentRequest + * @static + * @param {google.privacy.dlp.v2.IDeidentifyContentRequest} message DeidentifyContentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeidentifyContentRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.deidentifyConfig != null && Object.hasOwnProperty.call(message, "deidentifyConfig")) + $root.google.privacy.dlp.v2.DeidentifyConfig.encode(message.deidentifyConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.inspectConfig != null && Object.hasOwnProperty.call(message, "inspectConfig")) + $root.google.privacy.dlp.v2.InspectConfig.encode(message.inspectConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.item != null && Object.hasOwnProperty.call(message, "item")) + $root.google.privacy.dlp.v2.ContentItem.encode(message.item, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.inspectTemplateName != null && Object.hasOwnProperty.call(message, "inspectTemplateName")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.inspectTemplateName); + if (message.deidentifyTemplateName != null && Object.hasOwnProperty.call(message, "deidentifyTemplateName")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.deidentifyTemplateName); + if (message.locationId != null && Object.hasOwnProperty.call(message, "locationId")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.locationId); + return writer; + }; + + /** + * Encodes the specified DeidentifyContentRequest message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.DeidentifyContentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.DeidentifyContentRequest + * @static + * @param {google.privacy.dlp.v2.IDeidentifyContentRequest} message DeidentifyContentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeidentifyContentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeidentifyContentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.DeidentifyContentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.DeidentifyContentRequest} DeidentifyContentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeidentifyContentRequest.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.privacy.dlp.v2.DeidentifyContentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.deidentifyConfig = $root.google.privacy.dlp.v2.DeidentifyConfig.decode(reader, reader.uint32()); + break; + case 3: + message.inspectConfig = $root.google.privacy.dlp.v2.InspectConfig.decode(reader, reader.uint32()); + break; + case 4: + message.item = $root.google.privacy.dlp.v2.ContentItem.decode(reader, reader.uint32()); + break; + case 5: + message.inspectTemplateName = reader.string(); + break; + case 6: + message.deidentifyTemplateName = reader.string(); + break; + case 7: + message.locationId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeidentifyContentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.DeidentifyContentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.DeidentifyContentRequest} DeidentifyContentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeidentifyContentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeidentifyContentRequest message. + * @function verify + * @memberof google.privacy.dlp.v2.DeidentifyContentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeidentifyContentRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.deidentifyConfig != null && message.hasOwnProperty("deidentifyConfig")) { + var error = $root.google.privacy.dlp.v2.DeidentifyConfig.verify(message.deidentifyConfig); + if (error) + return "deidentifyConfig." + error; + } + if (message.inspectConfig != null && message.hasOwnProperty("inspectConfig")) { + var error = $root.google.privacy.dlp.v2.InspectConfig.verify(message.inspectConfig); + if (error) + return "inspectConfig." + error; + } + if (message.item != null && message.hasOwnProperty("item")) { + var error = $root.google.privacy.dlp.v2.ContentItem.verify(message.item); + if (error) + return "item." + error; + } + if (message.inspectTemplateName != null && message.hasOwnProperty("inspectTemplateName")) + if (!$util.isString(message.inspectTemplateName)) + return "inspectTemplateName: string expected"; + if (message.deidentifyTemplateName != null && message.hasOwnProperty("deidentifyTemplateName")) + if (!$util.isString(message.deidentifyTemplateName)) + return "deidentifyTemplateName: string expected"; + if (message.locationId != null && message.hasOwnProperty("locationId")) + if (!$util.isString(message.locationId)) + return "locationId: string expected"; + return null; + }; + + /** + * Creates a DeidentifyContentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.DeidentifyContentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.DeidentifyContentRequest} DeidentifyContentRequest + */ + DeidentifyContentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.DeidentifyContentRequest) + return object; + var message = new $root.google.privacy.dlp.v2.DeidentifyContentRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.deidentifyConfig != null) { + if (typeof object.deidentifyConfig !== "object") + throw TypeError(".google.privacy.dlp.v2.DeidentifyContentRequest.deidentifyConfig: object expected"); + message.deidentifyConfig = $root.google.privacy.dlp.v2.DeidentifyConfig.fromObject(object.deidentifyConfig); + } + if (object.inspectConfig != null) { + if (typeof object.inspectConfig !== "object") + throw TypeError(".google.privacy.dlp.v2.DeidentifyContentRequest.inspectConfig: object expected"); + message.inspectConfig = $root.google.privacy.dlp.v2.InspectConfig.fromObject(object.inspectConfig); + } + if (object.item != null) { + if (typeof object.item !== "object") + throw TypeError(".google.privacy.dlp.v2.DeidentifyContentRequest.item: object expected"); + message.item = $root.google.privacy.dlp.v2.ContentItem.fromObject(object.item); + } + if (object.inspectTemplateName != null) + message.inspectTemplateName = String(object.inspectTemplateName); + if (object.deidentifyTemplateName != null) + message.deidentifyTemplateName = String(object.deidentifyTemplateName); + if (object.locationId != null) + message.locationId = String(object.locationId); + return message; + }; + + /** + * Creates a plain object from a DeidentifyContentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.DeidentifyContentRequest + * @static + * @param {google.privacy.dlp.v2.DeidentifyContentRequest} message DeidentifyContentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeidentifyContentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.deidentifyConfig = null; + object.inspectConfig = null; + object.item = null; + object.inspectTemplateName = ""; + object.deidentifyTemplateName = ""; + object.locationId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.deidentifyConfig != null && message.hasOwnProperty("deidentifyConfig")) + object.deidentifyConfig = $root.google.privacy.dlp.v2.DeidentifyConfig.toObject(message.deidentifyConfig, options); + if (message.inspectConfig != null && message.hasOwnProperty("inspectConfig")) + object.inspectConfig = $root.google.privacy.dlp.v2.InspectConfig.toObject(message.inspectConfig, options); + if (message.item != null && message.hasOwnProperty("item")) + object.item = $root.google.privacy.dlp.v2.ContentItem.toObject(message.item, options); + if (message.inspectTemplateName != null && message.hasOwnProperty("inspectTemplateName")) + object.inspectTemplateName = message.inspectTemplateName; + if (message.deidentifyTemplateName != null && message.hasOwnProperty("deidentifyTemplateName")) + object.deidentifyTemplateName = message.deidentifyTemplateName; + if (message.locationId != null && message.hasOwnProperty("locationId")) + object.locationId = message.locationId; + return object; + }; + + /** + * Converts this DeidentifyContentRequest to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.DeidentifyContentRequest + * @instance + * @returns {Object.} JSON object + */ + DeidentifyContentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeidentifyContentRequest; + })(); + + v2.DeidentifyContentResponse = (function() { + + /** + * Properties of a DeidentifyContentResponse. + * @memberof google.privacy.dlp.v2 + * @interface IDeidentifyContentResponse + * @property {google.privacy.dlp.v2.IContentItem|null} [item] DeidentifyContentResponse item + * @property {google.privacy.dlp.v2.ITransformationOverview|null} [overview] DeidentifyContentResponse overview + */ + + /** + * Constructs a new DeidentifyContentResponse. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents a DeidentifyContentResponse. + * @implements IDeidentifyContentResponse + * @constructor + * @param {google.privacy.dlp.v2.IDeidentifyContentResponse=} [properties] Properties to set + */ + function DeidentifyContentResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeidentifyContentResponse item. + * @member {google.privacy.dlp.v2.IContentItem|null|undefined} item + * @memberof google.privacy.dlp.v2.DeidentifyContentResponse + * @instance + */ + DeidentifyContentResponse.prototype.item = null; + + /** + * DeidentifyContentResponse overview. + * @member {google.privacy.dlp.v2.ITransformationOverview|null|undefined} overview + * @memberof google.privacy.dlp.v2.DeidentifyContentResponse + * @instance + */ + DeidentifyContentResponse.prototype.overview = null; + + /** + * Creates a new DeidentifyContentResponse instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.DeidentifyContentResponse + * @static + * @param {google.privacy.dlp.v2.IDeidentifyContentResponse=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.DeidentifyContentResponse} DeidentifyContentResponse instance + */ + DeidentifyContentResponse.create = function create(properties) { + return new DeidentifyContentResponse(properties); + }; + + /** + * Encodes the specified DeidentifyContentResponse message. Does not implicitly {@link google.privacy.dlp.v2.DeidentifyContentResponse.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.DeidentifyContentResponse + * @static + * @param {google.privacy.dlp.v2.IDeidentifyContentResponse} message DeidentifyContentResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeidentifyContentResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.item != null && Object.hasOwnProperty.call(message, "item")) + $root.google.privacy.dlp.v2.ContentItem.encode(message.item, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.overview != null && Object.hasOwnProperty.call(message, "overview")) + $root.google.privacy.dlp.v2.TransformationOverview.encode(message.overview, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DeidentifyContentResponse message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.DeidentifyContentResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.DeidentifyContentResponse + * @static + * @param {google.privacy.dlp.v2.IDeidentifyContentResponse} message DeidentifyContentResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeidentifyContentResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeidentifyContentResponse message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.DeidentifyContentResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.DeidentifyContentResponse} DeidentifyContentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeidentifyContentResponse.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.privacy.dlp.v2.DeidentifyContentResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.item = $root.google.privacy.dlp.v2.ContentItem.decode(reader, reader.uint32()); + break; + case 2: + message.overview = $root.google.privacy.dlp.v2.TransformationOverview.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeidentifyContentResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.DeidentifyContentResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.DeidentifyContentResponse} DeidentifyContentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeidentifyContentResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeidentifyContentResponse message. + * @function verify + * @memberof google.privacy.dlp.v2.DeidentifyContentResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeidentifyContentResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.item != null && message.hasOwnProperty("item")) { + var error = $root.google.privacy.dlp.v2.ContentItem.verify(message.item); + if (error) + return "item." + error; + } + if (message.overview != null && message.hasOwnProperty("overview")) { + var error = $root.google.privacy.dlp.v2.TransformationOverview.verify(message.overview); + if (error) + return "overview." + error; + } + return null; + }; + + /** + * Creates a DeidentifyContentResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.DeidentifyContentResponse + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.DeidentifyContentResponse} DeidentifyContentResponse + */ + DeidentifyContentResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.DeidentifyContentResponse) + return object; + var message = new $root.google.privacy.dlp.v2.DeidentifyContentResponse(); + if (object.item != null) { + if (typeof object.item !== "object") + throw TypeError(".google.privacy.dlp.v2.DeidentifyContentResponse.item: object expected"); + message.item = $root.google.privacy.dlp.v2.ContentItem.fromObject(object.item); + } + if (object.overview != null) { + if (typeof object.overview !== "object") + throw TypeError(".google.privacy.dlp.v2.DeidentifyContentResponse.overview: object expected"); + message.overview = $root.google.privacy.dlp.v2.TransformationOverview.fromObject(object.overview); + } + return message; + }; + + /** + * Creates a plain object from a DeidentifyContentResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.DeidentifyContentResponse + * @static + * @param {google.privacy.dlp.v2.DeidentifyContentResponse} message DeidentifyContentResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeidentifyContentResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.item = null; + object.overview = null; + } + if (message.item != null && message.hasOwnProperty("item")) + object.item = $root.google.privacy.dlp.v2.ContentItem.toObject(message.item, options); + if (message.overview != null && message.hasOwnProperty("overview")) + object.overview = $root.google.privacy.dlp.v2.TransformationOverview.toObject(message.overview, options); + return object; + }; + + /** + * Converts this DeidentifyContentResponse to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.DeidentifyContentResponse + * @instance + * @returns {Object.} JSON object + */ + DeidentifyContentResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeidentifyContentResponse; + })(); + + v2.ReidentifyContentRequest = (function() { + + /** + * Properties of a ReidentifyContentRequest. + * @memberof google.privacy.dlp.v2 + * @interface IReidentifyContentRequest + * @property {string|null} [parent] ReidentifyContentRequest parent + * @property {google.privacy.dlp.v2.IDeidentifyConfig|null} [reidentifyConfig] ReidentifyContentRequest reidentifyConfig + * @property {google.privacy.dlp.v2.IInspectConfig|null} [inspectConfig] ReidentifyContentRequest inspectConfig + * @property {google.privacy.dlp.v2.IContentItem|null} [item] ReidentifyContentRequest item + * @property {string|null} [inspectTemplateName] ReidentifyContentRequest inspectTemplateName + * @property {string|null} [reidentifyTemplateName] ReidentifyContentRequest reidentifyTemplateName + * @property {string|null} [locationId] ReidentifyContentRequest locationId + */ + + /** + * Constructs a new ReidentifyContentRequest. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents a ReidentifyContentRequest. + * @implements IReidentifyContentRequest + * @constructor + * @param {google.privacy.dlp.v2.IReidentifyContentRequest=} [properties] Properties to set + */ + function ReidentifyContentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReidentifyContentRequest parent. + * @member {string} parent + * @memberof google.privacy.dlp.v2.ReidentifyContentRequest + * @instance + */ + ReidentifyContentRequest.prototype.parent = ""; + + /** + * ReidentifyContentRequest reidentifyConfig. + * @member {google.privacy.dlp.v2.IDeidentifyConfig|null|undefined} reidentifyConfig + * @memberof google.privacy.dlp.v2.ReidentifyContentRequest + * @instance + */ + ReidentifyContentRequest.prototype.reidentifyConfig = null; + + /** + * ReidentifyContentRequest inspectConfig. + * @member {google.privacy.dlp.v2.IInspectConfig|null|undefined} inspectConfig + * @memberof google.privacy.dlp.v2.ReidentifyContentRequest + * @instance + */ + ReidentifyContentRequest.prototype.inspectConfig = null; + + /** + * ReidentifyContentRequest item. + * @member {google.privacy.dlp.v2.IContentItem|null|undefined} item + * @memberof google.privacy.dlp.v2.ReidentifyContentRequest + * @instance + */ + ReidentifyContentRequest.prototype.item = null; + + /** + * ReidentifyContentRequest inspectTemplateName. + * @member {string} inspectTemplateName + * @memberof google.privacy.dlp.v2.ReidentifyContentRequest + * @instance + */ + ReidentifyContentRequest.prototype.inspectTemplateName = ""; + + /** + * ReidentifyContentRequest reidentifyTemplateName. + * @member {string} reidentifyTemplateName + * @memberof google.privacy.dlp.v2.ReidentifyContentRequest + * @instance + */ + ReidentifyContentRequest.prototype.reidentifyTemplateName = ""; + + /** + * ReidentifyContentRequest locationId. + * @member {string} locationId + * @memberof google.privacy.dlp.v2.ReidentifyContentRequest + * @instance + */ + ReidentifyContentRequest.prototype.locationId = ""; + + /** + * Creates a new ReidentifyContentRequest instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.ReidentifyContentRequest + * @static + * @param {google.privacy.dlp.v2.IReidentifyContentRequest=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.ReidentifyContentRequest} ReidentifyContentRequest instance + */ + ReidentifyContentRequest.create = function create(properties) { + return new ReidentifyContentRequest(properties); + }; + + /** + * Encodes the specified ReidentifyContentRequest message. Does not implicitly {@link google.privacy.dlp.v2.ReidentifyContentRequest.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.ReidentifyContentRequest + * @static + * @param {google.privacy.dlp.v2.IReidentifyContentRequest} message ReidentifyContentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReidentifyContentRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.reidentifyConfig != null && Object.hasOwnProperty.call(message, "reidentifyConfig")) + $root.google.privacy.dlp.v2.DeidentifyConfig.encode(message.reidentifyConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.inspectConfig != null && Object.hasOwnProperty.call(message, "inspectConfig")) + $root.google.privacy.dlp.v2.InspectConfig.encode(message.inspectConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.item != null && Object.hasOwnProperty.call(message, "item")) + $root.google.privacy.dlp.v2.ContentItem.encode(message.item, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.inspectTemplateName != null && Object.hasOwnProperty.call(message, "inspectTemplateName")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.inspectTemplateName); + if (message.reidentifyTemplateName != null && Object.hasOwnProperty.call(message, "reidentifyTemplateName")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.reidentifyTemplateName); + if (message.locationId != null && Object.hasOwnProperty.call(message, "locationId")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.locationId); + return writer; + }; + + /** + * Encodes the specified ReidentifyContentRequest message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.ReidentifyContentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.ReidentifyContentRequest + * @static + * @param {google.privacy.dlp.v2.IReidentifyContentRequest} message ReidentifyContentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReidentifyContentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReidentifyContentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.ReidentifyContentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.ReidentifyContentRequest} ReidentifyContentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReidentifyContentRequest.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.privacy.dlp.v2.ReidentifyContentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.reidentifyConfig = $root.google.privacy.dlp.v2.DeidentifyConfig.decode(reader, reader.uint32()); + break; + case 3: + message.inspectConfig = $root.google.privacy.dlp.v2.InspectConfig.decode(reader, reader.uint32()); + break; + case 4: + message.item = $root.google.privacy.dlp.v2.ContentItem.decode(reader, reader.uint32()); + break; + case 5: + message.inspectTemplateName = reader.string(); + break; + case 6: + message.reidentifyTemplateName = reader.string(); + break; + case 7: + message.locationId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReidentifyContentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.ReidentifyContentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.ReidentifyContentRequest} ReidentifyContentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReidentifyContentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReidentifyContentRequest message. + * @function verify + * @memberof google.privacy.dlp.v2.ReidentifyContentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReidentifyContentRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.reidentifyConfig != null && message.hasOwnProperty("reidentifyConfig")) { + var error = $root.google.privacy.dlp.v2.DeidentifyConfig.verify(message.reidentifyConfig); + if (error) + return "reidentifyConfig." + error; + } + if (message.inspectConfig != null && message.hasOwnProperty("inspectConfig")) { + var error = $root.google.privacy.dlp.v2.InspectConfig.verify(message.inspectConfig); + if (error) + return "inspectConfig." + error; + } + if (message.item != null && message.hasOwnProperty("item")) { + var error = $root.google.privacy.dlp.v2.ContentItem.verify(message.item); + if (error) + return "item." + error; + } + if (message.inspectTemplateName != null && message.hasOwnProperty("inspectTemplateName")) + if (!$util.isString(message.inspectTemplateName)) + return "inspectTemplateName: string expected"; + if (message.reidentifyTemplateName != null && message.hasOwnProperty("reidentifyTemplateName")) + if (!$util.isString(message.reidentifyTemplateName)) + return "reidentifyTemplateName: string expected"; + if (message.locationId != null && message.hasOwnProperty("locationId")) + if (!$util.isString(message.locationId)) + return "locationId: string expected"; + return null; + }; + + /** + * Creates a ReidentifyContentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.ReidentifyContentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.ReidentifyContentRequest} ReidentifyContentRequest + */ + ReidentifyContentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.ReidentifyContentRequest) + return object; + var message = new $root.google.privacy.dlp.v2.ReidentifyContentRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.reidentifyConfig != null) { + if (typeof object.reidentifyConfig !== "object") + throw TypeError(".google.privacy.dlp.v2.ReidentifyContentRequest.reidentifyConfig: object expected"); + message.reidentifyConfig = $root.google.privacy.dlp.v2.DeidentifyConfig.fromObject(object.reidentifyConfig); + } + if (object.inspectConfig != null) { + if (typeof object.inspectConfig !== "object") + throw TypeError(".google.privacy.dlp.v2.ReidentifyContentRequest.inspectConfig: object expected"); + message.inspectConfig = $root.google.privacy.dlp.v2.InspectConfig.fromObject(object.inspectConfig); + } + if (object.item != null) { + if (typeof object.item !== "object") + throw TypeError(".google.privacy.dlp.v2.ReidentifyContentRequest.item: object expected"); + message.item = $root.google.privacy.dlp.v2.ContentItem.fromObject(object.item); + } + if (object.inspectTemplateName != null) + message.inspectTemplateName = String(object.inspectTemplateName); + if (object.reidentifyTemplateName != null) + message.reidentifyTemplateName = String(object.reidentifyTemplateName); + if (object.locationId != null) + message.locationId = String(object.locationId); + return message; + }; + + /** + * Creates a plain object from a ReidentifyContentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.ReidentifyContentRequest + * @static + * @param {google.privacy.dlp.v2.ReidentifyContentRequest} message ReidentifyContentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReidentifyContentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.reidentifyConfig = null; + object.inspectConfig = null; + object.item = null; + object.inspectTemplateName = ""; + object.reidentifyTemplateName = ""; + object.locationId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.reidentifyConfig != null && message.hasOwnProperty("reidentifyConfig")) + object.reidentifyConfig = $root.google.privacy.dlp.v2.DeidentifyConfig.toObject(message.reidentifyConfig, options); + if (message.inspectConfig != null && message.hasOwnProperty("inspectConfig")) + object.inspectConfig = $root.google.privacy.dlp.v2.InspectConfig.toObject(message.inspectConfig, options); + if (message.item != null && message.hasOwnProperty("item")) + object.item = $root.google.privacy.dlp.v2.ContentItem.toObject(message.item, options); + if (message.inspectTemplateName != null && message.hasOwnProperty("inspectTemplateName")) + object.inspectTemplateName = message.inspectTemplateName; + if (message.reidentifyTemplateName != null && message.hasOwnProperty("reidentifyTemplateName")) + object.reidentifyTemplateName = message.reidentifyTemplateName; + if (message.locationId != null && message.hasOwnProperty("locationId")) + object.locationId = message.locationId; + return object; + }; + + /** + * Converts this ReidentifyContentRequest to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.ReidentifyContentRequest + * @instance + * @returns {Object.} JSON object + */ + ReidentifyContentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ReidentifyContentRequest; + })(); + + v2.ReidentifyContentResponse = (function() { + + /** + * Properties of a ReidentifyContentResponse. + * @memberof google.privacy.dlp.v2 + * @interface IReidentifyContentResponse + * @property {google.privacy.dlp.v2.IContentItem|null} [item] ReidentifyContentResponse item + * @property {google.privacy.dlp.v2.ITransformationOverview|null} [overview] ReidentifyContentResponse overview + */ + + /** + * Constructs a new ReidentifyContentResponse. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents a ReidentifyContentResponse. + * @implements IReidentifyContentResponse + * @constructor + * @param {google.privacy.dlp.v2.IReidentifyContentResponse=} [properties] Properties to set + */ + function ReidentifyContentResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReidentifyContentResponse item. + * @member {google.privacy.dlp.v2.IContentItem|null|undefined} item + * @memberof google.privacy.dlp.v2.ReidentifyContentResponse + * @instance + */ + ReidentifyContentResponse.prototype.item = null; + + /** + * ReidentifyContentResponse overview. + * @member {google.privacy.dlp.v2.ITransformationOverview|null|undefined} overview + * @memberof google.privacy.dlp.v2.ReidentifyContentResponse + * @instance + */ + ReidentifyContentResponse.prototype.overview = null; + + /** + * Creates a new ReidentifyContentResponse instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.ReidentifyContentResponse + * @static + * @param {google.privacy.dlp.v2.IReidentifyContentResponse=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.ReidentifyContentResponse} ReidentifyContentResponse instance + */ + ReidentifyContentResponse.create = function create(properties) { + return new ReidentifyContentResponse(properties); + }; + + /** + * Encodes the specified ReidentifyContentResponse message. Does not implicitly {@link google.privacy.dlp.v2.ReidentifyContentResponse.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.ReidentifyContentResponse + * @static + * @param {google.privacy.dlp.v2.IReidentifyContentResponse} message ReidentifyContentResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReidentifyContentResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.item != null && Object.hasOwnProperty.call(message, "item")) + $root.google.privacy.dlp.v2.ContentItem.encode(message.item, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.overview != null && Object.hasOwnProperty.call(message, "overview")) + $root.google.privacy.dlp.v2.TransformationOverview.encode(message.overview, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ReidentifyContentResponse message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.ReidentifyContentResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.ReidentifyContentResponse + * @static + * @param {google.privacy.dlp.v2.IReidentifyContentResponse} message ReidentifyContentResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReidentifyContentResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReidentifyContentResponse message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.ReidentifyContentResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.ReidentifyContentResponse} ReidentifyContentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReidentifyContentResponse.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.privacy.dlp.v2.ReidentifyContentResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.item = $root.google.privacy.dlp.v2.ContentItem.decode(reader, reader.uint32()); + break; + case 2: + message.overview = $root.google.privacy.dlp.v2.TransformationOverview.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReidentifyContentResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.ReidentifyContentResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.ReidentifyContentResponse} ReidentifyContentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReidentifyContentResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReidentifyContentResponse message. + * @function verify + * @memberof google.privacy.dlp.v2.ReidentifyContentResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReidentifyContentResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.item != null && message.hasOwnProperty("item")) { + var error = $root.google.privacy.dlp.v2.ContentItem.verify(message.item); + if (error) + return "item." + error; + } + if (message.overview != null && message.hasOwnProperty("overview")) { + var error = $root.google.privacy.dlp.v2.TransformationOverview.verify(message.overview); + if (error) + return "overview." + error; + } + return null; + }; + + /** + * Creates a ReidentifyContentResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.ReidentifyContentResponse + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.ReidentifyContentResponse} ReidentifyContentResponse + */ + ReidentifyContentResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.ReidentifyContentResponse) + return object; + var message = new $root.google.privacy.dlp.v2.ReidentifyContentResponse(); + if (object.item != null) { + if (typeof object.item !== "object") + throw TypeError(".google.privacy.dlp.v2.ReidentifyContentResponse.item: object expected"); + message.item = $root.google.privacy.dlp.v2.ContentItem.fromObject(object.item); + } + if (object.overview != null) { + if (typeof object.overview !== "object") + throw TypeError(".google.privacy.dlp.v2.ReidentifyContentResponse.overview: object expected"); + message.overview = $root.google.privacy.dlp.v2.TransformationOverview.fromObject(object.overview); + } + return message; + }; + + /** + * Creates a plain object from a ReidentifyContentResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.ReidentifyContentResponse + * @static + * @param {google.privacy.dlp.v2.ReidentifyContentResponse} message ReidentifyContentResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReidentifyContentResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.item = null; + object.overview = null; + } + if (message.item != null && message.hasOwnProperty("item")) + object.item = $root.google.privacy.dlp.v2.ContentItem.toObject(message.item, options); + if (message.overview != null && message.hasOwnProperty("overview")) + object.overview = $root.google.privacy.dlp.v2.TransformationOverview.toObject(message.overview, options); + return object; + }; + + /** + * Converts this ReidentifyContentResponse to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.ReidentifyContentResponse + * @instance + * @returns {Object.} JSON object + */ + ReidentifyContentResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ReidentifyContentResponse; + })(); + + v2.InspectContentRequest = (function() { + + /** + * Properties of an InspectContentRequest. + * @memberof google.privacy.dlp.v2 + * @interface IInspectContentRequest + * @property {string|null} [parent] InspectContentRequest parent + * @property {google.privacy.dlp.v2.IInspectConfig|null} [inspectConfig] InspectContentRequest inspectConfig + * @property {google.privacy.dlp.v2.IContentItem|null} [item] InspectContentRequest item + * @property {string|null} [inspectTemplateName] InspectContentRequest inspectTemplateName + * @property {string|null} [locationId] InspectContentRequest locationId + */ + + /** + * Constructs a new InspectContentRequest. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents an InspectContentRequest. + * @implements IInspectContentRequest + * @constructor + * @param {google.privacy.dlp.v2.IInspectContentRequest=} [properties] Properties to set + */ + function InspectContentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InspectContentRequest parent. + * @member {string} parent + * @memberof google.privacy.dlp.v2.InspectContentRequest + * @instance + */ + InspectContentRequest.prototype.parent = ""; + + /** + * InspectContentRequest inspectConfig. + * @member {google.privacy.dlp.v2.IInspectConfig|null|undefined} inspectConfig + * @memberof google.privacy.dlp.v2.InspectContentRequest + * @instance + */ + InspectContentRequest.prototype.inspectConfig = null; + + /** + * InspectContentRequest item. + * @member {google.privacy.dlp.v2.IContentItem|null|undefined} item + * @memberof google.privacy.dlp.v2.InspectContentRequest + * @instance + */ + InspectContentRequest.prototype.item = null; + + /** + * InspectContentRequest inspectTemplateName. + * @member {string} inspectTemplateName + * @memberof google.privacy.dlp.v2.InspectContentRequest + * @instance + */ + InspectContentRequest.prototype.inspectTemplateName = ""; + + /** + * InspectContentRequest locationId. + * @member {string} locationId + * @memberof google.privacy.dlp.v2.InspectContentRequest + * @instance + */ + InspectContentRequest.prototype.locationId = ""; + + /** + * Creates a new InspectContentRequest instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.InspectContentRequest + * @static + * @param {google.privacy.dlp.v2.IInspectContentRequest=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.InspectContentRequest} InspectContentRequest instance + */ + InspectContentRequest.create = function create(properties) { + return new InspectContentRequest(properties); + }; + + /** + * Encodes the specified InspectContentRequest message. Does not implicitly {@link google.privacy.dlp.v2.InspectContentRequest.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.InspectContentRequest + * @static + * @param {google.privacy.dlp.v2.IInspectContentRequest} message InspectContentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InspectContentRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.inspectConfig != null && Object.hasOwnProperty.call(message, "inspectConfig")) + $root.google.privacy.dlp.v2.InspectConfig.encode(message.inspectConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.item != null && Object.hasOwnProperty.call(message, "item")) + $root.google.privacy.dlp.v2.ContentItem.encode(message.item, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.inspectTemplateName != null && Object.hasOwnProperty.call(message, "inspectTemplateName")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.inspectTemplateName); + if (message.locationId != null && Object.hasOwnProperty.call(message, "locationId")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.locationId); + return writer; + }; + + /** + * Encodes the specified InspectContentRequest message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.InspectContentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.InspectContentRequest + * @static + * @param {google.privacy.dlp.v2.IInspectContentRequest} message InspectContentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InspectContentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InspectContentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.InspectContentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.InspectContentRequest} InspectContentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InspectContentRequest.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.privacy.dlp.v2.InspectContentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.inspectConfig = $root.google.privacy.dlp.v2.InspectConfig.decode(reader, reader.uint32()); + break; + case 3: + message.item = $root.google.privacy.dlp.v2.ContentItem.decode(reader, reader.uint32()); + break; + case 4: + message.inspectTemplateName = reader.string(); + break; + case 5: + message.locationId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InspectContentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.InspectContentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.InspectContentRequest} InspectContentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InspectContentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InspectContentRequest message. + * @function verify + * @memberof google.privacy.dlp.v2.InspectContentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InspectContentRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.inspectConfig != null && message.hasOwnProperty("inspectConfig")) { + var error = $root.google.privacy.dlp.v2.InspectConfig.verify(message.inspectConfig); + if (error) + return "inspectConfig." + error; + } + if (message.item != null && message.hasOwnProperty("item")) { + var error = $root.google.privacy.dlp.v2.ContentItem.verify(message.item); + if (error) + return "item." + error; + } + if (message.inspectTemplateName != null && message.hasOwnProperty("inspectTemplateName")) + if (!$util.isString(message.inspectTemplateName)) + return "inspectTemplateName: string expected"; + if (message.locationId != null && message.hasOwnProperty("locationId")) + if (!$util.isString(message.locationId)) + return "locationId: string expected"; + return null; + }; + + /** + * Creates an InspectContentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.InspectContentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.InspectContentRequest} InspectContentRequest + */ + InspectContentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.InspectContentRequest) + return object; + var message = new $root.google.privacy.dlp.v2.InspectContentRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.inspectConfig != null) { + if (typeof object.inspectConfig !== "object") + throw TypeError(".google.privacy.dlp.v2.InspectContentRequest.inspectConfig: object expected"); + message.inspectConfig = $root.google.privacy.dlp.v2.InspectConfig.fromObject(object.inspectConfig); + } + if (object.item != null) { + if (typeof object.item !== "object") + throw TypeError(".google.privacy.dlp.v2.InspectContentRequest.item: object expected"); + message.item = $root.google.privacy.dlp.v2.ContentItem.fromObject(object.item); + } + if (object.inspectTemplateName != null) + message.inspectTemplateName = String(object.inspectTemplateName); + if (object.locationId != null) + message.locationId = String(object.locationId); + return message; + }; + + /** + * Creates a plain object from an InspectContentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.InspectContentRequest + * @static + * @param {google.privacy.dlp.v2.InspectContentRequest} message InspectContentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InspectContentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.inspectConfig = null; + object.item = null; + object.inspectTemplateName = ""; + object.locationId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.inspectConfig != null && message.hasOwnProperty("inspectConfig")) + object.inspectConfig = $root.google.privacy.dlp.v2.InspectConfig.toObject(message.inspectConfig, options); + if (message.item != null && message.hasOwnProperty("item")) + object.item = $root.google.privacy.dlp.v2.ContentItem.toObject(message.item, options); + if (message.inspectTemplateName != null && message.hasOwnProperty("inspectTemplateName")) + object.inspectTemplateName = message.inspectTemplateName; + if (message.locationId != null && message.hasOwnProperty("locationId")) + object.locationId = message.locationId; + return object; + }; + + /** + * Converts this InspectContentRequest to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.InspectContentRequest + * @instance + * @returns {Object.} JSON object + */ + InspectContentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InspectContentRequest; + })(); + + v2.InspectContentResponse = (function() { + + /** + * Properties of an InspectContentResponse. + * @memberof google.privacy.dlp.v2 + * @interface IInspectContentResponse + * @property {google.privacy.dlp.v2.IInspectResult|null} [result] InspectContentResponse result + */ + + /** + * Constructs a new InspectContentResponse. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents an InspectContentResponse. + * @implements IInspectContentResponse + * @constructor + * @param {google.privacy.dlp.v2.IInspectContentResponse=} [properties] Properties to set + */ + function InspectContentResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InspectContentResponse result. + * @member {google.privacy.dlp.v2.IInspectResult|null|undefined} result + * @memberof google.privacy.dlp.v2.InspectContentResponse + * @instance + */ + InspectContentResponse.prototype.result = null; + + /** + * Creates a new InspectContentResponse instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.InspectContentResponse + * @static + * @param {google.privacy.dlp.v2.IInspectContentResponse=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.InspectContentResponse} InspectContentResponse instance + */ + InspectContentResponse.create = function create(properties) { + return new InspectContentResponse(properties); + }; + + /** + * Encodes the specified InspectContentResponse message. Does not implicitly {@link google.privacy.dlp.v2.InspectContentResponse.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.InspectContentResponse + * @static + * @param {google.privacy.dlp.v2.IInspectContentResponse} message InspectContentResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InspectContentResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.result != null && Object.hasOwnProperty.call(message, "result")) + $root.google.privacy.dlp.v2.InspectResult.encode(message.result, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified InspectContentResponse message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.InspectContentResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.InspectContentResponse + * @static + * @param {google.privacy.dlp.v2.IInspectContentResponse} message InspectContentResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InspectContentResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InspectContentResponse message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.InspectContentResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.InspectContentResponse} InspectContentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InspectContentResponse.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.privacy.dlp.v2.InspectContentResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.result = $root.google.privacy.dlp.v2.InspectResult.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InspectContentResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.InspectContentResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.InspectContentResponse} InspectContentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InspectContentResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InspectContentResponse message. + * @function verify + * @memberof google.privacy.dlp.v2.InspectContentResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InspectContentResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.result != null && message.hasOwnProperty("result")) { + var error = $root.google.privacy.dlp.v2.InspectResult.verify(message.result); + if (error) + return "result." + error; + } + return null; + }; + + /** + * Creates an InspectContentResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.InspectContentResponse + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.InspectContentResponse} InspectContentResponse + */ + InspectContentResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.InspectContentResponse) + return object; + var message = new $root.google.privacy.dlp.v2.InspectContentResponse(); + if (object.result != null) { + if (typeof object.result !== "object") + throw TypeError(".google.privacy.dlp.v2.InspectContentResponse.result: object expected"); + message.result = $root.google.privacy.dlp.v2.InspectResult.fromObject(object.result); + } + return message; + }; + + /** + * Creates a plain object from an InspectContentResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.InspectContentResponse + * @static + * @param {google.privacy.dlp.v2.InspectContentResponse} message InspectContentResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InspectContentResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.result = null; + if (message.result != null && message.hasOwnProperty("result")) + object.result = $root.google.privacy.dlp.v2.InspectResult.toObject(message.result, options); + return object; + }; + + /** + * Converts this InspectContentResponse to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.InspectContentResponse + * @instance + * @returns {Object.} JSON object + */ + InspectContentResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InspectContentResponse; + })(); + + v2.OutputStorageConfig = (function() { + + /** + * Properties of an OutputStorageConfig. + * @memberof google.privacy.dlp.v2 + * @interface IOutputStorageConfig + * @property {google.privacy.dlp.v2.IBigQueryTable|null} [table] OutputStorageConfig table + * @property {google.privacy.dlp.v2.OutputStorageConfig.OutputSchema|null} [outputSchema] OutputStorageConfig outputSchema + */ + + /** + * Constructs a new OutputStorageConfig. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents an OutputStorageConfig. + * @implements IOutputStorageConfig + * @constructor + * @param {google.privacy.dlp.v2.IOutputStorageConfig=} [properties] Properties to set + */ + function OutputStorageConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OutputStorageConfig table. + * @member {google.privacy.dlp.v2.IBigQueryTable|null|undefined} table + * @memberof google.privacy.dlp.v2.OutputStorageConfig + * @instance + */ + OutputStorageConfig.prototype.table = null; + + /** + * OutputStorageConfig outputSchema. + * @member {google.privacy.dlp.v2.OutputStorageConfig.OutputSchema} outputSchema + * @memberof google.privacy.dlp.v2.OutputStorageConfig + * @instance + */ + OutputStorageConfig.prototype.outputSchema = 0; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * OutputStorageConfig type. + * @member {"table"|undefined} type + * @memberof google.privacy.dlp.v2.OutputStorageConfig + * @instance + */ + Object.defineProperty(OutputStorageConfig.prototype, "type", { + get: $util.oneOfGetter($oneOfFields = ["table"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new OutputStorageConfig instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.OutputStorageConfig + * @static + * @param {google.privacy.dlp.v2.IOutputStorageConfig=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.OutputStorageConfig} OutputStorageConfig instance + */ + OutputStorageConfig.create = function create(properties) { + return new OutputStorageConfig(properties); + }; + + /** + * Encodes the specified OutputStorageConfig message. Does not implicitly {@link google.privacy.dlp.v2.OutputStorageConfig.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.OutputStorageConfig + * @static + * @param {google.privacy.dlp.v2.IOutputStorageConfig} message OutputStorageConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OutputStorageConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.table != null && Object.hasOwnProperty.call(message, "table")) + $root.google.privacy.dlp.v2.BigQueryTable.encode(message.table, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.outputSchema != null && Object.hasOwnProperty.call(message, "outputSchema")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.outputSchema); + return writer; + }; + + /** + * Encodes the specified OutputStorageConfig message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.OutputStorageConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.OutputStorageConfig + * @static + * @param {google.privacy.dlp.v2.IOutputStorageConfig} message OutputStorageConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OutputStorageConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OutputStorageConfig message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.OutputStorageConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.OutputStorageConfig} OutputStorageConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OutputStorageConfig.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.privacy.dlp.v2.OutputStorageConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.table = $root.google.privacy.dlp.v2.BigQueryTable.decode(reader, reader.uint32()); + break; + case 3: + message.outputSchema = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OutputStorageConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.OutputStorageConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.OutputStorageConfig} OutputStorageConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OutputStorageConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OutputStorageConfig message. + * @function verify + * @memberof google.privacy.dlp.v2.OutputStorageConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OutputStorageConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.table != null && message.hasOwnProperty("table")) { + properties.type = 1; + { + var error = $root.google.privacy.dlp.v2.BigQueryTable.verify(message.table); + if (error) + return "table." + error; + } + } + if (message.outputSchema != null && message.hasOwnProperty("outputSchema")) + switch (message.outputSchema) { + default: + return "outputSchema: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + return null; + }; + + /** + * Creates an OutputStorageConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.OutputStorageConfig + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.OutputStorageConfig} OutputStorageConfig + */ + OutputStorageConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.OutputStorageConfig) + return object; + var message = new $root.google.privacy.dlp.v2.OutputStorageConfig(); + if (object.table != null) { + if (typeof object.table !== "object") + throw TypeError(".google.privacy.dlp.v2.OutputStorageConfig.table: object expected"); + message.table = $root.google.privacy.dlp.v2.BigQueryTable.fromObject(object.table); + } + switch (object.outputSchema) { + case "OUTPUT_SCHEMA_UNSPECIFIED": + case 0: + message.outputSchema = 0; + break; + case "BASIC_COLUMNS": + case 1: + message.outputSchema = 1; + break; + case "GCS_COLUMNS": + case 2: + message.outputSchema = 2; + break; + case "DATASTORE_COLUMNS": + case 3: + message.outputSchema = 3; + break; + case "BIG_QUERY_COLUMNS": + case 4: + message.outputSchema = 4; + break; + case "ALL_COLUMNS": + case 5: + message.outputSchema = 5; + break; + } + return message; + }; + + /** + * Creates a plain object from an OutputStorageConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.OutputStorageConfig + * @static + * @param {google.privacy.dlp.v2.OutputStorageConfig} message OutputStorageConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OutputStorageConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.outputSchema = options.enums === String ? "OUTPUT_SCHEMA_UNSPECIFIED" : 0; + if (message.table != null && message.hasOwnProperty("table")) { + object.table = $root.google.privacy.dlp.v2.BigQueryTable.toObject(message.table, options); + if (options.oneofs) + object.type = "table"; + } + if (message.outputSchema != null && message.hasOwnProperty("outputSchema")) + object.outputSchema = options.enums === String ? $root.google.privacy.dlp.v2.OutputStorageConfig.OutputSchema[message.outputSchema] : message.outputSchema; + return object; + }; + + /** + * Converts this OutputStorageConfig to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.OutputStorageConfig + * @instance + * @returns {Object.} JSON object + */ + OutputStorageConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * OutputSchema enum. + * @name google.privacy.dlp.v2.OutputStorageConfig.OutputSchema + * @enum {number} + * @property {number} OUTPUT_SCHEMA_UNSPECIFIED=0 OUTPUT_SCHEMA_UNSPECIFIED value + * @property {number} BASIC_COLUMNS=1 BASIC_COLUMNS value + * @property {number} GCS_COLUMNS=2 GCS_COLUMNS value + * @property {number} DATASTORE_COLUMNS=3 DATASTORE_COLUMNS value + * @property {number} BIG_QUERY_COLUMNS=4 BIG_QUERY_COLUMNS value + * @property {number} ALL_COLUMNS=5 ALL_COLUMNS value + */ + OutputStorageConfig.OutputSchema = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "OUTPUT_SCHEMA_UNSPECIFIED"] = 0; + values[valuesById[1] = "BASIC_COLUMNS"] = 1; + values[valuesById[2] = "GCS_COLUMNS"] = 2; + values[valuesById[3] = "DATASTORE_COLUMNS"] = 3; + values[valuesById[4] = "BIG_QUERY_COLUMNS"] = 4; + values[valuesById[5] = "ALL_COLUMNS"] = 5; + return values; + })(); + + return OutputStorageConfig; + })(); + + v2.InfoTypeStats = (function() { + + /** + * Properties of an InfoTypeStats. + * @memberof google.privacy.dlp.v2 + * @interface IInfoTypeStats + * @property {google.privacy.dlp.v2.IInfoType|null} [infoType] InfoTypeStats infoType + * @property {number|Long|null} [count] InfoTypeStats count + */ + + /** + * Constructs a new InfoTypeStats. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents an InfoTypeStats. + * @implements IInfoTypeStats + * @constructor + * @param {google.privacy.dlp.v2.IInfoTypeStats=} [properties] Properties to set + */ + function InfoTypeStats(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InfoTypeStats infoType. + * @member {google.privacy.dlp.v2.IInfoType|null|undefined} infoType + * @memberof google.privacy.dlp.v2.InfoTypeStats + * @instance + */ + InfoTypeStats.prototype.infoType = null; + + /** + * InfoTypeStats count. + * @member {number|Long} count + * @memberof google.privacy.dlp.v2.InfoTypeStats + * @instance + */ + InfoTypeStats.prototype.count = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new InfoTypeStats instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.InfoTypeStats + * @static + * @param {google.privacy.dlp.v2.IInfoTypeStats=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.InfoTypeStats} InfoTypeStats instance + */ + InfoTypeStats.create = function create(properties) { + return new InfoTypeStats(properties); + }; + + /** + * Encodes the specified InfoTypeStats message. Does not implicitly {@link google.privacy.dlp.v2.InfoTypeStats.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.InfoTypeStats + * @static + * @param {google.privacy.dlp.v2.IInfoTypeStats} message InfoTypeStats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InfoTypeStats.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.infoType != null && Object.hasOwnProperty.call(message, "infoType")) + $root.google.privacy.dlp.v2.InfoType.encode(message.infoType, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.count != null && Object.hasOwnProperty.call(message, "count")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.count); + return writer; + }; + + /** + * Encodes the specified InfoTypeStats message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.InfoTypeStats.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.InfoTypeStats + * @static + * @param {google.privacy.dlp.v2.IInfoTypeStats} message InfoTypeStats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InfoTypeStats.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InfoTypeStats message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.InfoTypeStats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.InfoTypeStats} InfoTypeStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InfoTypeStats.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.privacy.dlp.v2.InfoTypeStats(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.infoType = $root.google.privacy.dlp.v2.InfoType.decode(reader, reader.uint32()); + break; + case 2: + message.count = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InfoTypeStats message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.InfoTypeStats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.InfoTypeStats} InfoTypeStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InfoTypeStats.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InfoTypeStats message. + * @function verify + * @memberof google.privacy.dlp.v2.InfoTypeStats + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InfoTypeStats.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.infoType != null && message.hasOwnProperty("infoType")) { + var error = $root.google.privacy.dlp.v2.InfoType.verify(message.infoType); + if (error) + return "infoType." + error; + } + if (message.count != null && message.hasOwnProperty("count")) + if (!$util.isInteger(message.count) && !(message.count && $util.isInteger(message.count.low) && $util.isInteger(message.count.high))) + return "count: integer|Long expected"; + return null; + }; + + /** + * Creates an InfoTypeStats message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.InfoTypeStats + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.InfoTypeStats} InfoTypeStats + */ + InfoTypeStats.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.InfoTypeStats) + return object; + var message = new $root.google.privacy.dlp.v2.InfoTypeStats(); + if (object.infoType != null) { + if (typeof object.infoType !== "object") + throw TypeError(".google.privacy.dlp.v2.InfoTypeStats.infoType: object expected"); + message.infoType = $root.google.privacy.dlp.v2.InfoType.fromObject(object.infoType); + } + if (object.count != null) + if ($util.Long) + (message.count = $util.Long.fromValue(object.count)).unsigned = false; + else if (typeof object.count === "string") + message.count = parseInt(object.count, 10); + else if (typeof object.count === "number") + message.count = object.count; + else if (typeof object.count === "object") + message.count = new $util.LongBits(object.count.low >>> 0, object.count.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from an InfoTypeStats message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.InfoTypeStats + * @static + * @param {google.privacy.dlp.v2.InfoTypeStats} message InfoTypeStats + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InfoTypeStats.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.infoType = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.count = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.count = options.longs === String ? "0" : 0; + } + if (message.infoType != null && message.hasOwnProperty("infoType")) + object.infoType = $root.google.privacy.dlp.v2.InfoType.toObject(message.infoType, options); + if (message.count != null && message.hasOwnProperty("count")) + if (typeof message.count === "number") + object.count = options.longs === String ? String(message.count) : message.count; + else + object.count = options.longs === String ? $util.Long.prototype.toString.call(message.count) : options.longs === Number ? new $util.LongBits(message.count.low >>> 0, message.count.high >>> 0).toNumber() : message.count; + return object; + }; + + /** + * Converts this InfoTypeStats to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.InfoTypeStats + * @instance + * @returns {Object.} JSON object + */ + InfoTypeStats.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InfoTypeStats; + })(); + + v2.InspectDataSourceDetails = (function() { + + /** + * Properties of an InspectDataSourceDetails. + * @memberof google.privacy.dlp.v2 + * @interface IInspectDataSourceDetails + * @property {google.privacy.dlp.v2.InspectDataSourceDetails.IRequestedOptions|null} [requestedOptions] InspectDataSourceDetails requestedOptions + * @property {google.privacy.dlp.v2.InspectDataSourceDetails.IResult|null} [result] InspectDataSourceDetails result + */ + + /** + * Constructs a new InspectDataSourceDetails. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents an InspectDataSourceDetails. + * @implements IInspectDataSourceDetails + * @constructor + * @param {google.privacy.dlp.v2.IInspectDataSourceDetails=} [properties] Properties to set + */ + function InspectDataSourceDetails(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InspectDataSourceDetails requestedOptions. + * @member {google.privacy.dlp.v2.InspectDataSourceDetails.IRequestedOptions|null|undefined} requestedOptions + * @memberof google.privacy.dlp.v2.InspectDataSourceDetails + * @instance + */ + InspectDataSourceDetails.prototype.requestedOptions = null; + + /** + * InspectDataSourceDetails result. + * @member {google.privacy.dlp.v2.InspectDataSourceDetails.IResult|null|undefined} result + * @memberof google.privacy.dlp.v2.InspectDataSourceDetails + * @instance + */ + InspectDataSourceDetails.prototype.result = null; + + /** + * Creates a new InspectDataSourceDetails instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.InspectDataSourceDetails + * @static + * @param {google.privacy.dlp.v2.IInspectDataSourceDetails=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.InspectDataSourceDetails} InspectDataSourceDetails instance + */ + InspectDataSourceDetails.create = function create(properties) { + return new InspectDataSourceDetails(properties); + }; + + /** + * Encodes the specified InspectDataSourceDetails message. Does not implicitly {@link google.privacy.dlp.v2.InspectDataSourceDetails.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.InspectDataSourceDetails + * @static + * @param {google.privacy.dlp.v2.IInspectDataSourceDetails} message InspectDataSourceDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InspectDataSourceDetails.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestedOptions != null && Object.hasOwnProperty.call(message, "requestedOptions")) + $root.google.privacy.dlp.v2.InspectDataSourceDetails.RequestedOptions.encode(message.requestedOptions, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.result != null && Object.hasOwnProperty.call(message, "result")) + $root.google.privacy.dlp.v2.InspectDataSourceDetails.Result.encode(message.result, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified InspectDataSourceDetails message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.InspectDataSourceDetails.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.InspectDataSourceDetails + * @static + * @param {google.privacy.dlp.v2.IInspectDataSourceDetails} message InspectDataSourceDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InspectDataSourceDetails.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InspectDataSourceDetails message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.InspectDataSourceDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.InspectDataSourceDetails} InspectDataSourceDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InspectDataSourceDetails.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.privacy.dlp.v2.InspectDataSourceDetails(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + message.requestedOptions = $root.google.privacy.dlp.v2.InspectDataSourceDetails.RequestedOptions.decode(reader, reader.uint32()); + break; + case 3: + message.result = $root.google.privacy.dlp.v2.InspectDataSourceDetails.Result.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InspectDataSourceDetails message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.InspectDataSourceDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.InspectDataSourceDetails} InspectDataSourceDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InspectDataSourceDetails.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InspectDataSourceDetails message. + * @function verify + * @memberof google.privacy.dlp.v2.InspectDataSourceDetails + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InspectDataSourceDetails.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.requestedOptions != null && message.hasOwnProperty("requestedOptions")) { + var error = $root.google.privacy.dlp.v2.InspectDataSourceDetails.RequestedOptions.verify(message.requestedOptions); + if (error) + return "requestedOptions." + error; + } + if (message.result != null && message.hasOwnProperty("result")) { + var error = $root.google.privacy.dlp.v2.InspectDataSourceDetails.Result.verify(message.result); + if (error) + return "result." + error; + } + return null; + }; + + /** + * Creates an InspectDataSourceDetails message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.InspectDataSourceDetails + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.InspectDataSourceDetails} InspectDataSourceDetails + */ + InspectDataSourceDetails.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.InspectDataSourceDetails) + return object; + var message = new $root.google.privacy.dlp.v2.InspectDataSourceDetails(); + if (object.requestedOptions != null) { + if (typeof object.requestedOptions !== "object") + throw TypeError(".google.privacy.dlp.v2.InspectDataSourceDetails.requestedOptions: object expected"); + message.requestedOptions = $root.google.privacy.dlp.v2.InspectDataSourceDetails.RequestedOptions.fromObject(object.requestedOptions); + } + if (object.result != null) { + if (typeof object.result !== "object") + throw TypeError(".google.privacy.dlp.v2.InspectDataSourceDetails.result: object expected"); + message.result = $root.google.privacy.dlp.v2.InspectDataSourceDetails.Result.fromObject(object.result); + } + return message; + }; + + /** + * Creates a plain object from an InspectDataSourceDetails message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.InspectDataSourceDetails + * @static + * @param {google.privacy.dlp.v2.InspectDataSourceDetails} message InspectDataSourceDetails + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InspectDataSourceDetails.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.requestedOptions = null; + object.result = null; + } + if (message.requestedOptions != null && message.hasOwnProperty("requestedOptions")) + object.requestedOptions = $root.google.privacy.dlp.v2.InspectDataSourceDetails.RequestedOptions.toObject(message.requestedOptions, options); + if (message.result != null && message.hasOwnProperty("result")) + object.result = $root.google.privacy.dlp.v2.InspectDataSourceDetails.Result.toObject(message.result, options); + return object; + }; + + /** + * Converts this InspectDataSourceDetails to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.InspectDataSourceDetails + * @instance + * @returns {Object.} JSON object + */ + InspectDataSourceDetails.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + InspectDataSourceDetails.RequestedOptions = (function() { + + /** + * Properties of a RequestedOptions. + * @memberof google.privacy.dlp.v2.InspectDataSourceDetails + * @interface IRequestedOptions + * @property {google.privacy.dlp.v2.IInspectTemplate|null} [snapshotInspectTemplate] RequestedOptions snapshotInspectTemplate + * @property {google.privacy.dlp.v2.IInspectJobConfig|null} [jobConfig] RequestedOptions jobConfig + */ + + /** + * Constructs a new RequestedOptions. + * @memberof google.privacy.dlp.v2.InspectDataSourceDetails + * @classdesc Represents a RequestedOptions. + * @implements IRequestedOptions + * @constructor + * @param {google.privacy.dlp.v2.InspectDataSourceDetails.IRequestedOptions=} [properties] Properties to set + */ + function RequestedOptions(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RequestedOptions snapshotInspectTemplate. + * @member {google.privacy.dlp.v2.IInspectTemplate|null|undefined} snapshotInspectTemplate + * @memberof google.privacy.dlp.v2.InspectDataSourceDetails.RequestedOptions + * @instance + */ + RequestedOptions.prototype.snapshotInspectTemplate = null; + + /** + * RequestedOptions jobConfig. + * @member {google.privacy.dlp.v2.IInspectJobConfig|null|undefined} jobConfig + * @memberof google.privacy.dlp.v2.InspectDataSourceDetails.RequestedOptions + * @instance + */ + RequestedOptions.prototype.jobConfig = null; + + /** + * Creates a new RequestedOptions instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.InspectDataSourceDetails.RequestedOptions + * @static + * @param {google.privacy.dlp.v2.InspectDataSourceDetails.IRequestedOptions=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.InspectDataSourceDetails.RequestedOptions} RequestedOptions instance + */ + RequestedOptions.create = function create(properties) { + return new RequestedOptions(properties); + }; + + /** + * Encodes the specified RequestedOptions message. Does not implicitly {@link google.privacy.dlp.v2.InspectDataSourceDetails.RequestedOptions.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.InspectDataSourceDetails.RequestedOptions + * @static + * @param {google.privacy.dlp.v2.InspectDataSourceDetails.IRequestedOptions} message RequestedOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RequestedOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.snapshotInspectTemplate != null && Object.hasOwnProperty.call(message, "snapshotInspectTemplate")) + $root.google.privacy.dlp.v2.InspectTemplate.encode(message.snapshotInspectTemplate, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.jobConfig != null && Object.hasOwnProperty.call(message, "jobConfig")) + $root.google.privacy.dlp.v2.InspectJobConfig.encode(message.jobConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RequestedOptions message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.InspectDataSourceDetails.RequestedOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.InspectDataSourceDetails.RequestedOptions + * @static + * @param {google.privacy.dlp.v2.InspectDataSourceDetails.IRequestedOptions} message RequestedOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RequestedOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RequestedOptions message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.InspectDataSourceDetails.RequestedOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.InspectDataSourceDetails.RequestedOptions} RequestedOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RequestedOptions.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.privacy.dlp.v2.InspectDataSourceDetails.RequestedOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.snapshotInspectTemplate = $root.google.privacy.dlp.v2.InspectTemplate.decode(reader, reader.uint32()); + break; + case 3: + message.jobConfig = $root.google.privacy.dlp.v2.InspectJobConfig.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RequestedOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.InspectDataSourceDetails.RequestedOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.InspectDataSourceDetails.RequestedOptions} RequestedOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RequestedOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RequestedOptions message. + * @function verify + * @memberof google.privacy.dlp.v2.InspectDataSourceDetails.RequestedOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RequestedOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.snapshotInspectTemplate != null && message.hasOwnProperty("snapshotInspectTemplate")) { + var error = $root.google.privacy.dlp.v2.InspectTemplate.verify(message.snapshotInspectTemplate); + if (error) + return "snapshotInspectTemplate." + error; + } + if (message.jobConfig != null && message.hasOwnProperty("jobConfig")) { + var error = $root.google.privacy.dlp.v2.InspectJobConfig.verify(message.jobConfig); + if (error) + return "jobConfig." + error; + } + return null; + }; + + /** + * Creates a RequestedOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.InspectDataSourceDetails.RequestedOptions + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.InspectDataSourceDetails.RequestedOptions} RequestedOptions + */ + RequestedOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.InspectDataSourceDetails.RequestedOptions) + return object; + var message = new $root.google.privacy.dlp.v2.InspectDataSourceDetails.RequestedOptions(); + if (object.snapshotInspectTemplate != null) { + if (typeof object.snapshotInspectTemplate !== "object") + throw TypeError(".google.privacy.dlp.v2.InspectDataSourceDetails.RequestedOptions.snapshotInspectTemplate: object expected"); + message.snapshotInspectTemplate = $root.google.privacy.dlp.v2.InspectTemplate.fromObject(object.snapshotInspectTemplate); + } + if (object.jobConfig != null) { + if (typeof object.jobConfig !== "object") + throw TypeError(".google.privacy.dlp.v2.InspectDataSourceDetails.RequestedOptions.jobConfig: object expected"); + message.jobConfig = $root.google.privacy.dlp.v2.InspectJobConfig.fromObject(object.jobConfig); + } + return message; + }; + + /** + * Creates a plain object from a RequestedOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.InspectDataSourceDetails.RequestedOptions + * @static + * @param {google.privacy.dlp.v2.InspectDataSourceDetails.RequestedOptions} message RequestedOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RequestedOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.snapshotInspectTemplate = null; + object.jobConfig = null; + } + if (message.snapshotInspectTemplate != null && message.hasOwnProperty("snapshotInspectTemplate")) + object.snapshotInspectTemplate = $root.google.privacy.dlp.v2.InspectTemplate.toObject(message.snapshotInspectTemplate, options); + if (message.jobConfig != null && message.hasOwnProperty("jobConfig")) + object.jobConfig = $root.google.privacy.dlp.v2.InspectJobConfig.toObject(message.jobConfig, options); + return object; + }; + + /** + * Converts this RequestedOptions to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.InspectDataSourceDetails.RequestedOptions + * @instance + * @returns {Object.} JSON object + */ + RequestedOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RequestedOptions; + })(); + + InspectDataSourceDetails.Result = (function() { + + /** + * Properties of a Result. + * @memberof google.privacy.dlp.v2.InspectDataSourceDetails + * @interface IResult + * @property {number|Long|null} [processedBytes] Result processedBytes + * @property {number|Long|null} [totalEstimatedBytes] Result totalEstimatedBytes + * @property {Array.|null} [infoTypeStats] Result infoTypeStats + * @property {google.privacy.dlp.v2.IHybridInspectStatistics|null} [hybridStats] Result hybridStats + */ + + /** + * Constructs a new Result. + * @memberof google.privacy.dlp.v2.InspectDataSourceDetails + * @classdesc Represents a Result. + * @implements IResult + * @constructor + * @param {google.privacy.dlp.v2.InspectDataSourceDetails.IResult=} [properties] Properties to set + */ + function Result(properties) { + this.infoTypeStats = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Result processedBytes. + * @member {number|Long} processedBytes + * @memberof google.privacy.dlp.v2.InspectDataSourceDetails.Result + * @instance + */ + Result.prototype.processedBytes = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Result totalEstimatedBytes. + * @member {number|Long} totalEstimatedBytes + * @memberof google.privacy.dlp.v2.InspectDataSourceDetails.Result + * @instance + */ + Result.prototype.totalEstimatedBytes = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Result infoTypeStats. + * @member {Array.} infoTypeStats + * @memberof google.privacy.dlp.v2.InspectDataSourceDetails.Result + * @instance + */ + Result.prototype.infoTypeStats = $util.emptyArray; + + /** + * Result hybridStats. + * @member {google.privacy.dlp.v2.IHybridInspectStatistics|null|undefined} hybridStats + * @memberof google.privacy.dlp.v2.InspectDataSourceDetails.Result + * @instance + */ + Result.prototype.hybridStats = null; + + /** + * Creates a new Result instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.InspectDataSourceDetails.Result + * @static + * @param {google.privacy.dlp.v2.InspectDataSourceDetails.IResult=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.InspectDataSourceDetails.Result} Result instance + */ + Result.create = function create(properties) { + return new Result(properties); + }; + + /** + * Encodes the specified Result message. Does not implicitly {@link google.privacy.dlp.v2.InspectDataSourceDetails.Result.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.InspectDataSourceDetails.Result + * @static + * @param {google.privacy.dlp.v2.InspectDataSourceDetails.IResult} message Result message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Result.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.processedBytes != null && Object.hasOwnProperty.call(message, "processedBytes")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.processedBytes); + if (message.totalEstimatedBytes != null && Object.hasOwnProperty.call(message, "totalEstimatedBytes")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.totalEstimatedBytes); + if (message.infoTypeStats != null && message.infoTypeStats.length) + for (var i = 0; i < message.infoTypeStats.length; ++i) + $root.google.privacy.dlp.v2.InfoTypeStats.encode(message.infoTypeStats[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.hybridStats != null && Object.hasOwnProperty.call(message, "hybridStats")) + $root.google.privacy.dlp.v2.HybridInspectStatistics.encode(message.hybridStats, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Result message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.InspectDataSourceDetails.Result.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.InspectDataSourceDetails.Result + * @static + * @param {google.privacy.dlp.v2.InspectDataSourceDetails.IResult} message Result message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Result.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Result message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.InspectDataSourceDetails.Result + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.InspectDataSourceDetails.Result} Result + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Result.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.privacy.dlp.v2.InspectDataSourceDetails.Result(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.processedBytes = reader.int64(); + break; + case 2: + message.totalEstimatedBytes = reader.int64(); + break; + case 3: + if (!(message.infoTypeStats && message.infoTypeStats.length)) + message.infoTypeStats = []; + message.infoTypeStats.push($root.google.privacy.dlp.v2.InfoTypeStats.decode(reader, reader.uint32())); + break; + case 7: + message.hybridStats = $root.google.privacy.dlp.v2.HybridInspectStatistics.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Result message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.InspectDataSourceDetails.Result + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.InspectDataSourceDetails.Result} Result + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Result.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Result message. + * @function verify + * @memberof google.privacy.dlp.v2.InspectDataSourceDetails.Result + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Result.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.processedBytes != null && message.hasOwnProperty("processedBytes")) + if (!$util.isInteger(message.processedBytes) && !(message.processedBytes && $util.isInteger(message.processedBytes.low) && $util.isInteger(message.processedBytes.high))) + return "processedBytes: integer|Long expected"; + if (message.totalEstimatedBytes != null && message.hasOwnProperty("totalEstimatedBytes")) + if (!$util.isInteger(message.totalEstimatedBytes) && !(message.totalEstimatedBytes && $util.isInteger(message.totalEstimatedBytes.low) && $util.isInteger(message.totalEstimatedBytes.high))) + return "totalEstimatedBytes: integer|Long expected"; + if (message.infoTypeStats != null && message.hasOwnProperty("infoTypeStats")) { + if (!Array.isArray(message.infoTypeStats)) + return "infoTypeStats: array expected"; + for (var i = 0; i < message.infoTypeStats.length; ++i) { + var error = $root.google.privacy.dlp.v2.InfoTypeStats.verify(message.infoTypeStats[i]); + if (error) + return "infoTypeStats." + error; + } + } + if (message.hybridStats != null && message.hasOwnProperty("hybridStats")) { + var error = $root.google.privacy.dlp.v2.HybridInspectStatistics.verify(message.hybridStats); + if (error) + return "hybridStats." + error; + } + return null; + }; + + /** + * Creates a Result message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.InspectDataSourceDetails.Result + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.InspectDataSourceDetails.Result} Result + */ + Result.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.InspectDataSourceDetails.Result) + return object; + var message = new $root.google.privacy.dlp.v2.InspectDataSourceDetails.Result(); + if (object.processedBytes != null) + if ($util.Long) + (message.processedBytes = $util.Long.fromValue(object.processedBytes)).unsigned = false; + else if (typeof object.processedBytes === "string") + message.processedBytes = parseInt(object.processedBytes, 10); + else if (typeof object.processedBytes === "number") + message.processedBytes = object.processedBytes; + else if (typeof object.processedBytes === "object") + message.processedBytes = new $util.LongBits(object.processedBytes.low >>> 0, object.processedBytes.high >>> 0).toNumber(); + if (object.totalEstimatedBytes != null) + if ($util.Long) + (message.totalEstimatedBytes = $util.Long.fromValue(object.totalEstimatedBytes)).unsigned = false; + else if (typeof object.totalEstimatedBytes === "string") + message.totalEstimatedBytes = parseInt(object.totalEstimatedBytes, 10); + else if (typeof object.totalEstimatedBytes === "number") + message.totalEstimatedBytes = object.totalEstimatedBytes; + else if (typeof object.totalEstimatedBytes === "object") + message.totalEstimatedBytes = new $util.LongBits(object.totalEstimatedBytes.low >>> 0, object.totalEstimatedBytes.high >>> 0).toNumber(); + if (object.infoTypeStats) { + if (!Array.isArray(object.infoTypeStats)) + throw TypeError(".google.privacy.dlp.v2.InspectDataSourceDetails.Result.infoTypeStats: array expected"); + message.infoTypeStats = []; + for (var i = 0; i < object.infoTypeStats.length; ++i) { + if (typeof object.infoTypeStats[i] !== "object") + throw TypeError(".google.privacy.dlp.v2.InspectDataSourceDetails.Result.infoTypeStats: object expected"); + message.infoTypeStats[i] = $root.google.privacy.dlp.v2.InfoTypeStats.fromObject(object.infoTypeStats[i]); + } + } + if (object.hybridStats != null) { + if (typeof object.hybridStats !== "object") + throw TypeError(".google.privacy.dlp.v2.InspectDataSourceDetails.Result.hybridStats: object expected"); + message.hybridStats = $root.google.privacy.dlp.v2.HybridInspectStatistics.fromObject(object.hybridStats); + } + return message; + }; + + /** + * Creates a plain object from a Result message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.InspectDataSourceDetails.Result + * @static + * @param {google.privacy.dlp.v2.InspectDataSourceDetails.Result} message Result + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Result.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.infoTypeStats = []; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.processedBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.processedBytes = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.totalEstimatedBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.totalEstimatedBytes = options.longs === String ? "0" : 0; + object.hybridStats = null; + } + if (message.processedBytes != null && message.hasOwnProperty("processedBytes")) + if (typeof message.processedBytes === "number") + object.processedBytes = options.longs === String ? String(message.processedBytes) : message.processedBytes; + else + object.processedBytes = options.longs === String ? $util.Long.prototype.toString.call(message.processedBytes) : options.longs === Number ? new $util.LongBits(message.processedBytes.low >>> 0, message.processedBytes.high >>> 0).toNumber() : message.processedBytes; + if (message.totalEstimatedBytes != null && message.hasOwnProperty("totalEstimatedBytes")) + if (typeof message.totalEstimatedBytes === "number") + object.totalEstimatedBytes = options.longs === String ? String(message.totalEstimatedBytes) : message.totalEstimatedBytes; + else + object.totalEstimatedBytes = options.longs === String ? $util.Long.prototype.toString.call(message.totalEstimatedBytes) : options.longs === Number ? new $util.LongBits(message.totalEstimatedBytes.low >>> 0, message.totalEstimatedBytes.high >>> 0).toNumber() : message.totalEstimatedBytes; + if (message.infoTypeStats && message.infoTypeStats.length) { + object.infoTypeStats = []; + for (var j = 0; j < message.infoTypeStats.length; ++j) + object.infoTypeStats[j] = $root.google.privacy.dlp.v2.InfoTypeStats.toObject(message.infoTypeStats[j], options); + } + if (message.hybridStats != null && message.hasOwnProperty("hybridStats")) + object.hybridStats = $root.google.privacy.dlp.v2.HybridInspectStatistics.toObject(message.hybridStats, options); + return object; + }; + + /** + * Converts this Result to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.InspectDataSourceDetails.Result + * @instance + * @returns {Object.} JSON object + */ + Result.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Result; + })(); + + return InspectDataSourceDetails; + })(); + + v2.HybridInspectStatistics = (function() { + + /** + * Properties of a HybridInspectStatistics. + * @memberof google.privacy.dlp.v2 + * @interface IHybridInspectStatistics + * @property {number|Long|null} [processedCount] HybridInspectStatistics processedCount + * @property {number|Long|null} [abortedCount] HybridInspectStatistics abortedCount + * @property {number|Long|null} [pendingCount] HybridInspectStatistics pendingCount + */ + + /** + * Constructs a new HybridInspectStatistics. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents a HybridInspectStatistics. + * @implements IHybridInspectStatistics + * @constructor + * @param {google.privacy.dlp.v2.IHybridInspectStatistics=} [properties] Properties to set + */ + function HybridInspectStatistics(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HybridInspectStatistics processedCount. + * @member {number|Long} processedCount + * @memberof google.privacy.dlp.v2.HybridInspectStatistics + * @instance + */ + HybridInspectStatistics.prototype.processedCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * HybridInspectStatistics abortedCount. + * @member {number|Long} abortedCount + * @memberof google.privacy.dlp.v2.HybridInspectStatistics + * @instance + */ + HybridInspectStatistics.prototype.abortedCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * HybridInspectStatistics pendingCount. + * @member {number|Long} pendingCount + * @memberof google.privacy.dlp.v2.HybridInspectStatistics + * @instance + */ + HybridInspectStatistics.prototype.pendingCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new HybridInspectStatistics instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.HybridInspectStatistics + * @static + * @param {google.privacy.dlp.v2.IHybridInspectStatistics=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.HybridInspectStatistics} HybridInspectStatistics instance + */ + HybridInspectStatistics.create = function create(properties) { + return new HybridInspectStatistics(properties); + }; + + /** + * Encodes the specified HybridInspectStatistics message. Does not implicitly {@link google.privacy.dlp.v2.HybridInspectStatistics.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.HybridInspectStatistics + * @static + * @param {google.privacy.dlp.v2.IHybridInspectStatistics} message HybridInspectStatistics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HybridInspectStatistics.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.processedCount != null && Object.hasOwnProperty.call(message, "processedCount")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.processedCount); + if (message.abortedCount != null && Object.hasOwnProperty.call(message, "abortedCount")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.abortedCount); + if (message.pendingCount != null && Object.hasOwnProperty.call(message, "pendingCount")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.pendingCount); + return writer; + }; + + /** + * Encodes the specified HybridInspectStatistics message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.HybridInspectStatistics.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.HybridInspectStatistics + * @static + * @param {google.privacy.dlp.v2.IHybridInspectStatistics} message HybridInspectStatistics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HybridInspectStatistics.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HybridInspectStatistics message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.HybridInspectStatistics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.HybridInspectStatistics} HybridInspectStatistics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HybridInspectStatistics.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.privacy.dlp.v2.HybridInspectStatistics(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.processedCount = reader.int64(); + break; + case 2: + message.abortedCount = reader.int64(); + break; + case 3: + message.pendingCount = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HybridInspectStatistics message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.HybridInspectStatistics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.HybridInspectStatistics} HybridInspectStatistics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HybridInspectStatistics.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HybridInspectStatistics message. + * @function verify + * @memberof google.privacy.dlp.v2.HybridInspectStatistics + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HybridInspectStatistics.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.processedCount != null && message.hasOwnProperty("processedCount")) + if (!$util.isInteger(message.processedCount) && !(message.processedCount && $util.isInteger(message.processedCount.low) && $util.isInteger(message.processedCount.high))) + return "processedCount: integer|Long expected"; + if (message.abortedCount != null && message.hasOwnProperty("abortedCount")) + if (!$util.isInteger(message.abortedCount) && !(message.abortedCount && $util.isInteger(message.abortedCount.low) && $util.isInteger(message.abortedCount.high))) + return "abortedCount: integer|Long expected"; + if (message.pendingCount != null && message.hasOwnProperty("pendingCount")) + if (!$util.isInteger(message.pendingCount) && !(message.pendingCount && $util.isInteger(message.pendingCount.low) && $util.isInteger(message.pendingCount.high))) + return "pendingCount: integer|Long expected"; + return null; + }; + + /** + * Creates a HybridInspectStatistics message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.HybridInspectStatistics + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.HybridInspectStatistics} HybridInspectStatistics + */ + HybridInspectStatistics.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.HybridInspectStatistics) + return object; + var message = new $root.google.privacy.dlp.v2.HybridInspectStatistics(); + if (object.processedCount != null) + if ($util.Long) + (message.processedCount = $util.Long.fromValue(object.processedCount)).unsigned = false; + else if (typeof object.processedCount === "string") + message.processedCount = parseInt(object.processedCount, 10); + else if (typeof object.processedCount === "number") + message.processedCount = object.processedCount; + else if (typeof object.processedCount === "object") + message.processedCount = new $util.LongBits(object.processedCount.low >>> 0, object.processedCount.high >>> 0).toNumber(); + if (object.abortedCount != null) + if ($util.Long) + (message.abortedCount = $util.Long.fromValue(object.abortedCount)).unsigned = false; + else if (typeof object.abortedCount === "string") + message.abortedCount = parseInt(object.abortedCount, 10); + else if (typeof object.abortedCount === "number") + message.abortedCount = object.abortedCount; + else if (typeof object.abortedCount === "object") + message.abortedCount = new $util.LongBits(object.abortedCount.low >>> 0, object.abortedCount.high >>> 0).toNumber(); + if (object.pendingCount != null) + if ($util.Long) + (message.pendingCount = $util.Long.fromValue(object.pendingCount)).unsigned = false; + else if (typeof object.pendingCount === "string") + message.pendingCount = parseInt(object.pendingCount, 10); + else if (typeof object.pendingCount === "number") + message.pendingCount = object.pendingCount; + else if (typeof object.pendingCount === "object") + message.pendingCount = new $util.LongBits(object.pendingCount.low >>> 0, object.pendingCount.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a HybridInspectStatistics message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.HybridInspectStatistics + * @static + * @param {google.privacy.dlp.v2.HybridInspectStatistics} message HybridInspectStatistics + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HybridInspectStatistics.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.processedCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.processedCount = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.abortedCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.abortedCount = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.pendingCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.pendingCount = options.longs === String ? "0" : 0; + } + if (message.processedCount != null && message.hasOwnProperty("processedCount")) + if (typeof message.processedCount === "number") + object.processedCount = options.longs === String ? String(message.processedCount) : message.processedCount; + else + object.processedCount = options.longs === String ? $util.Long.prototype.toString.call(message.processedCount) : options.longs === Number ? new $util.LongBits(message.processedCount.low >>> 0, message.processedCount.high >>> 0).toNumber() : message.processedCount; + if (message.abortedCount != null && message.hasOwnProperty("abortedCount")) + if (typeof message.abortedCount === "number") + object.abortedCount = options.longs === String ? String(message.abortedCount) : message.abortedCount; + else + object.abortedCount = options.longs === String ? $util.Long.prototype.toString.call(message.abortedCount) : options.longs === Number ? new $util.LongBits(message.abortedCount.low >>> 0, message.abortedCount.high >>> 0).toNumber() : message.abortedCount; + if (message.pendingCount != null && message.hasOwnProperty("pendingCount")) + if (typeof message.pendingCount === "number") + object.pendingCount = options.longs === String ? String(message.pendingCount) : message.pendingCount; + else + object.pendingCount = options.longs === String ? $util.Long.prototype.toString.call(message.pendingCount) : options.longs === Number ? new $util.LongBits(message.pendingCount.low >>> 0, message.pendingCount.high >>> 0).toNumber() : message.pendingCount; + return object; + }; + + /** + * Converts this HybridInspectStatistics to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.HybridInspectStatistics + * @instance + * @returns {Object.} JSON object + */ + HybridInspectStatistics.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return HybridInspectStatistics; + })(); + + v2.InfoTypeDescription = (function() { + + /** + * Properties of an InfoTypeDescription. + * @memberof google.privacy.dlp.v2 + * @interface IInfoTypeDescription + * @property {string|null} [name] InfoTypeDescription name + * @property {string|null} [displayName] InfoTypeDescription displayName + * @property {Array.|null} [supportedBy] InfoTypeDescription supportedBy + * @property {string|null} [description] InfoTypeDescription description + */ + + /** + * Constructs a new InfoTypeDescription. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents an InfoTypeDescription. + * @implements IInfoTypeDescription + * @constructor + * @param {google.privacy.dlp.v2.IInfoTypeDescription=} [properties] Properties to set + */ + function InfoTypeDescription(properties) { + this.supportedBy = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InfoTypeDescription name. + * @member {string} name + * @memberof google.privacy.dlp.v2.InfoTypeDescription + * @instance + */ + InfoTypeDescription.prototype.name = ""; + + /** + * InfoTypeDescription displayName. + * @member {string} displayName + * @memberof google.privacy.dlp.v2.InfoTypeDescription + * @instance + */ + InfoTypeDescription.prototype.displayName = ""; + + /** + * InfoTypeDescription supportedBy. + * @member {Array.} supportedBy + * @memberof google.privacy.dlp.v2.InfoTypeDescription + * @instance + */ + InfoTypeDescription.prototype.supportedBy = $util.emptyArray; + + /** + * InfoTypeDescription description. + * @member {string} description + * @memberof google.privacy.dlp.v2.InfoTypeDescription + * @instance + */ + InfoTypeDescription.prototype.description = ""; + + /** + * Creates a new InfoTypeDescription instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.InfoTypeDescription + * @static + * @param {google.privacy.dlp.v2.IInfoTypeDescription=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.InfoTypeDescription} InfoTypeDescription instance + */ + InfoTypeDescription.create = function create(properties) { + return new InfoTypeDescription(properties); + }; + + /** + * Encodes the specified InfoTypeDescription message. Does not implicitly {@link google.privacy.dlp.v2.InfoTypeDescription.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.InfoTypeDescription + * @static + * @param {google.privacy.dlp.v2.IInfoTypeDescription} message InfoTypeDescription message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InfoTypeDescription.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.supportedBy != null && message.supportedBy.length) { + writer.uint32(/* id 3, wireType 2 =*/26).fork(); + for (var i = 0; i < message.supportedBy.length; ++i) + writer.int32(message.supportedBy[i]); + writer.ldelim(); + } + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.description); + return writer; + }; + + /** + * Encodes the specified InfoTypeDescription message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.InfoTypeDescription.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.InfoTypeDescription + * @static + * @param {google.privacy.dlp.v2.IInfoTypeDescription} message InfoTypeDescription message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InfoTypeDescription.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InfoTypeDescription message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.InfoTypeDescription + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.InfoTypeDescription} InfoTypeDescription + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InfoTypeDescription.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.privacy.dlp.v2.InfoTypeDescription(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.displayName = reader.string(); + break; + case 3: + if (!(message.supportedBy && message.supportedBy.length)) + message.supportedBy = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.supportedBy.push(reader.int32()); + } else + message.supportedBy.push(reader.int32()); + break; + case 4: + message.description = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InfoTypeDescription message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.InfoTypeDescription + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.InfoTypeDescription} InfoTypeDescription + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InfoTypeDescription.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InfoTypeDescription message. + * @function verify + * @memberof google.privacy.dlp.v2.InfoTypeDescription + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InfoTypeDescription.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.supportedBy != null && message.hasOwnProperty("supportedBy")) { + if (!Array.isArray(message.supportedBy)) + return "supportedBy: array expected"; + for (var i = 0; i < message.supportedBy.length; ++i) + switch (message.supportedBy[i]) { + default: + return "supportedBy: enum value[] expected"; + case 0: + case 1: + case 2: + break; + } + } + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + return null; + }; + + /** + * Creates an InfoTypeDescription message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.InfoTypeDescription + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.InfoTypeDescription} InfoTypeDescription + */ + InfoTypeDescription.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.InfoTypeDescription) + return object; + var message = new $root.google.privacy.dlp.v2.InfoTypeDescription(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.supportedBy) { + if (!Array.isArray(object.supportedBy)) + throw TypeError(".google.privacy.dlp.v2.InfoTypeDescription.supportedBy: array expected"); + message.supportedBy = []; + for (var i = 0; i < object.supportedBy.length; ++i) + switch (object.supportedBy[i]) { + default: + case "ENUM_TYPE_UNSPECIFIED": + case 0: + message.supportedBy[i] = 0; + break; + case "INSPECT": + case 1: + message.supportedBy[i] = 1; + break; + case "RISK_ANALYSIS": + case 2: + message.supportedBy[i] = 2; + break; + } + } + if (object.description != null) + message.description = String(object.description); + return message; + }; + + /** + * Creates a plain object from an InfoTypeDescription message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.InfoTypeDescription + * @static + * @param {google.privacy.dlp.v2.InfoTypeDescription} message InfoTypeDescription + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InfoTypeDescription.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.supportedBy = []; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.description = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.supportedBy && message.supportedBy.length) { + object.supportedBy = []; + for (var j = 0; j < message.supportedBy.length; ++j) + object.supportedBy[j] = options.enums === String ? $root.google.privacy.dlp.v2.InfoTypeSupportedBy[message.supportedBy[j]] : message.supportedBy[j]; + } + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + return object; + }; + + /** + * Converts this InfoTypeDescription to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.InfoTypeDescription + * @instance + * @returns {Object.} JSON object + */ + InfoTypeDescription.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InfoTypeDescription; + })(); + + v2.ListInfoTypesRequest = (function() { + + /** + * Properties of a ListInfoTypesRequest. + * @memberof google.privacy.dlp.v2 + * @interface IListInfoTypesRequest + * @property {string|null} [parent] ListInfoTypesRequest parent + * @property {string|null} [languageCode] ListInfoTypesRequest languageCode + * @property {string|null} [filter] ListInfoTypesRequest filter + * @property {string|null} [locationId] ListInfoTypesRequest locationId + */ + + /** + * Constructs a new ListInfoTypesRequest. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents a ListInfoTypesRequest. + * @implements IListInfoTypesRequest + * @constructor + * @param {google.privacy.dlp.v2.IListInfoTypesRequest=} [properties] Properties to set + */ + function ListInfoTypesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListInfoTypesRequest parent. + * @member {string} parent + * @memberof google.privacy.dlp.v2.ListInfoTypesRequest + * @instance + */ + ListInfoTypesRequest.prototype.parent = ""; + + /** + * ListInfoTypesRequest languageCode. + * @member {string} languageCode + * @memberof google.privacy.dlp.v2.ListInfoTypesRequest + * @instance + */ + ListInfoTypesRequest.prototype.languageCode = ""; + + /** + * ListInfoTypesRequest filter. + * @member {string} filter + * @memberof google.privacy.dlp.v2.ListInfoTypesRequest + * @instance + */ + ListInfoTypesRequest.prototype.filter = ""; + + /** + * ListInfoTypesRequest locationId. + * @member {string} locationId + * @memberof google.privacy.dlp.v2.ListInfoTypesRequest + * @instance + */ + ListInfoTypesRequest.prototype.locationId = ""; + + /** + * Creates a new ListInfoTypesRequest instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.ListInfoTypesRequest + * @static + * @param {google.privacy.dlp.v2.IListInfoTypesRequest=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.ListInfoTypesRequest} ListInfoTypesRequest instance + */ + ListInfoTypesRequest.create = function create(properties) { + return new ListInfoTypesRequest(properties); + }; + + /** + * Encodes the specified ListInfoTypesRequest message. Does not implicitly {@link google.privacy.dlp.v2.ListInfoTypesRequest.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.ListInfoTypesRequest + * @static + * @param {google.privacy.dlp.v2.IListInfoTypesRequest} message ListInfoTypesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInfoTypesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.languageCode); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); + if (message.locationId != null && Object.hasOwnProperty.call(message, "locationId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.locationId); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.parent); + return writer; + }; + + /** + * Encodes the specified ListInfoTypesRequest message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.ListInfoTypesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.ListInfoTypesRequest + * @static + * @param {google.privacy.dlp.v2.IListInfoTypesRequest} message ListInfoTypesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInfoTypesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListInfoTypesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.ListInfoTypesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.ListInfoTypesRequest} ListInfoTypesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInfoTypesRequest.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.privacy.dlp.v2.ListInfoTypesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 4: + message.parent = reader.string(); + break; + case 1: + message.languageCode = reader.string(); + break; + case 2: + message.filter = reader.string(); + break; + case 3: + message.locationId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListInfoTypesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.ListInfoTypesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.ListInfoTypesRequest} ListInfoTypesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInfoTypesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListInfoTypesRequest message. + * @function verify + * @memberof google.privacy.dlp.v2.ListInfoTypesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListInfoTypesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.locationId != null && message.hasOwnProperty("locationId")) + if (!$util.isString(message.locationId)) + return "locationId: string expected"; + return null; + }; + + /** + * Creates a ListInfoTypesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.ListInfoTypesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.ListInfoTypesRequest} ListInfoTypesRequest + */ + ListInfoTypesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.ListInfoTypesRequest) + return object; + var message = new $root.google.privacy.dlp.v2.ListInfoTypesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + if (object.filter != null) + message.filter = String(object.filter); + if (object.locationId != null) + message.locationId = String(object.locationId); + return message; + }; + + /** + * Creates a plain object from a ListInfoTypesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.ListInfoTypesRequest + * @static + * @param {google.privacy.dlp.v2.ListInfoTypesRequest} message ListInfoTypesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListInfoTypesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.languageCode = ""; + object.filter = ""; + object.locationId = ""; + object.parent = ""; + } + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.locationId != null && message.hasOwnProperty("locationId")) + object.locationId = message.locationId; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + return object; + }; + + /** + * Converts this ListInfoTypesRequest to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.ListInfoTypesRequest + * @instance + * @returns {Object.} JSON object + */ + ListInfoTypesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListInfoTypesRequest; + })(); + + v2.ListInfoTypesResponse = (function() { + + /** + * Properties of a ListInfoTypesResponse. + * @memberof google.privacy.dlp.v2 + * @interface IListInfoTypesResponse + * @property {Array.|null} [infoTypes] ListInfoTypesResponse infoTypes + */ + + /** + * Constructs a new ListInfoTypesResponse. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents a ListInfoTypesResponse. + * @implements IListInfoTypesResponse + * @constructor + * @param {google.privacy.dlp.v2.IListInfoTypesResponse=} [properties] Properties to set + */ + function ListInfoTypesResponse(properties) { + this.infoTypes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListInfoTypesResponse infoTypes. + * @member {Array.} infoTypes + * @memberof google.privacy.dlp.v2.ListInfoTypesResponse + * @instance + */ + ListInfoTypesResponse.prototype.infoTypes = $util.emptyArray; + + /** + * Creates a new ListInfoTypesResponse instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.ListInfoTypesResponse + * @static + * @param {google.privacy.dlp.v2.IListInfoTypesResponse=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.ListInfoTypesResponse} ListInfoTypesResponse instance + */ + ListInfoTypesResponse.create = function create(properties) { + return new ListInfoTypesResponse(properties); + }; + + /** + * Encodes the specified ListInfoTypesResponse message. Does not implicitly {@link google.privacy.dlp.v2.ListInfoTypesResponse.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.ListInfoTypesResponse + * @static + * @param {google.privacy.dlp.v2.IListInfoTypesResponse} message ListInfoTypesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInfoTypesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.infoTypes != null && message.infoTypes.length) + for (var i = 0; i < message.infoTypes.length; ++i) + $root.google.privacy.dlp.v2.InfoTypeDescription.encode(message.infoTypes[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ListInfoTypesResponse message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.ListInfoTypesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.ListInfoTypesResponse + * @static + * @param {google.privacy.dlp.v2.IListInfoTypesResponse} message ListInfoTypesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInfoTypesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListInfoTypesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.ListInfoTypesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.ListInfoTypesResponse} ListInfoTypesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInfoTypesResponse.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.privacy.dlp.v2.ListInfoTypesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.infoTypes && message.infoTypes.length)) + message.infoTypes = []; + message.infoTypes.push($root.google.privacy.dlp.v2.InfoTypeDescription.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListInfoTypesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.ListInfoTypesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.ListInfoTypesResponse} ListInfoTypesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInfoTypesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListInfoTypesResponse message. + * @function verify + * @memberof google.privacy.dlp.v2.ListInfoTypesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListInfoTypesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.infoTypes != null && message.hasOwnProperty("infoTypes")) { + if (!Array.isArray(message.infoTypes)) + return "infoTypes: array expected"; + for (var i = 0; i < message.infoTypes.length; ++i) { + var error = $root.google.privacy.dlp.v2.InfoTypeDescription.verify(message.infoTypes[i]); + if (error) + return "infoTypes." + error; + } + } + return null; + }; + + /** + * Creates a ListInfoTypesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.ListInfoTypesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.ListInfoTypesResponse} ListInfoTypesResponse + */ + ListInfoTypesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.ListInfoTypesResponse) + return object; + var message = new $root.google.privacy.dlp.v2.ListInfoTypesResponse(); + if (object.infoTypes) { + if (!Array.isArray(object.infoTypes)) + throw TypeError(".google.privacy.dlp.v2.ListInfoTypesResponse.infoTypes: array expected"); + message.infoTypes = []; + for (var i = 0; i < object.infoTypes.length; ++i) { + if (typeof object.infoTypes[i] !== "object") + throw TypeError(".google.privacy.dlp.v2.ListInfoTypesResponse.infoTypes: object expected"); + message.infoTypes[i] = $root.google.privacy.dlp.v2.InfoTypeDescription.fromObject(object.infoTypes[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ListInfoTypesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.ListInfoTypesResponse + * @static + * @param {google.privacy.dlp.v2.ListInfoTypesResponse} message ListInfoTypesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListInfoTypesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.infoTypes = []; + if (message.infoTypes && message.infoTypes.length) { + object.infoTypes = []; + for (var j = 0; j < message.infoTypes.length; ++j) + object.infoTypes[j] = $root.google.privacy.dlp.v2.InfoTypeDescription.toObject(message.infoTypes[j], options); + } + return object; + }; + + /** + * Converts this ListInfoTypesResponse to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.ListInfoTypesResponse + * @instance + * @returns {Object.} JSON object + */ + ListInfoTypesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListInfoTypesResponse; + })(); + + v2.RiskAnalysisJobConfig = (function() { + + /** + * Properties of a RiskAnalysisJobConfig. + * @memberof google.privacy.dlp.v2 + * @interface IRiskAnalysisJobConfig + * @property {google.privacy.dlp.v2.IPrivacyMetric|null} [privacyMetric] RiskAnalysisJobConfig privacyMetric + * @property {google.privacy.dlp.v2.IBigQueryTable|null} [sourceTable] RiskAnalysisJobConfig sourceTable + * @property {Array.|null} [actions] RiskAnalysisJobConfig actions + */ + + /** + * Constructs a new RiskAnalysisJobConfig. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents a RiskAnalysisJobConfig. + * @implements IRiskAnalysisJobConfig + * @constructor + * @param {google.privacy.dlp.v2.IRiskAnalysisJobConfig=} [properties] Properties to set + */ + function RiskAnalysisJobConfig(properties) { + this.actions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RiskAnalysisJobConfig privacyMetric. + * @member {google.privacy.dlp.v2.IPrivacyMetric|null|undefined} privacyMetric + * @memberof google.privacy.dlp.v2.RiskAnalysisJobConfig + * @instance + */ + RiskAnalysisJobConfig.prototype.privacyMetric = null; + + /** + * RiskAnalysisJobConfig sourceTable. + * @member {google.privacy.dlp.v2.IBigQueryTable|null|undefined} sourceTable + * @memberof google.privacy.dlp.v2.RiskAnalysisJobConfig + * @instance + */ + RiskAnalysisJobConfig.prototype.sourceTable = null; + + /** + * RiskAnalysisJobConfig actions. + * @member {Array.} actions + * @memberof google.privacy.dlp.v2.RiskAnalysisJobConfig + * @instance + */ + RiskAnalysisJobConfig.prototype.actions = $util.emptyArray; + + /** + * Creates a new RiskAnalysisJobConfig instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.RiskAnalysisJobConfig + * @static + * @param {google.privacy.dlp.v2.IRiskAnalysisJobConfig=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.RiskAnalysisJobConfig} RiskAnalysisJobConfig instance + */ + RiskAnalysisJobConfig.create = function create(properties) { + return new RiskAnalysisJobConfig(properties); + }; + + /** + * Encodes the specified RiskAnalysisJobConfig message. Does not implicitly {@link google.privacy.dlp.v2.RiskAnalysisJobConfig.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.RiskAnalysisJobConfig + * @static + * @param {google.privacy.dlp.v2.IRiskAnalysisJobConfig} message RiskAnalysisJobConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RiskAnalysisJobConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.privacyMetric != null && Object.hasOwnProperty.call(message, "privacyMetric")) + $root.google.privacy.dlp.v2.PrivacyMetric.encode(message.privacyMetric, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.sourceTable != null && Object.hasOwnProperty.call(message, "sourceTable")) + $root.google.privacy.dlp.v2.BigQueryTable.encode(message.sourceTable, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.actions != null && message.actions.length) + for (var i = 0; i < message.actions.length; ++i) + $root.google.privacy.dlp.v2.Action.encode(message.actions[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RiskAnalysisJobConfig message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.RiskAnalysisJobConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.RiskAnalysisJobConfig + * @static + * @param {google.privacy.dlp.v2.IRiskAnalysisJobConfig} message RiskAnalysisJobConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RiskAnalysisJobConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RiskAnalysisJobConfig message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.RiskAnalysisJobConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.RiskAnalysisJobConfig} RiskAnalysisJobConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RiskAnalysisJobConfig.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.privacy.dlp.v2.RiskAnalysisJobConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.privacyMetric = $root.google.privacy.dlp.v2.PrivacyMetric.decode(reader, reader.uint32()); + break; + case 2: + message.sourceTable = $root.google.privacy.dlp.v2.BigQueryTable.decode(reader, reader.uint32()); + break; + case 3: + if (!(message.actions && message.actions.length)) + message.actions = []; + message.actions.push($root.google.privacy.dlp.v2.Action.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RiskAnalysisJobConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.RiskAnalysisJobConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.RiskAnalysisJobConfig} RiskAnalysisJobConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RiskAnalysisJobConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RiskAnalysisJobConfig message. + * @function verify + * @memberof google.privacy.dlp.v2.RiskAnalysisJobConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RiskAnalysisJobConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.privacyMetric != null && message.hasOwnProperty("privacyMetric")) { + var error = $root.google.privacy.dlp.v2.PrivacyMetric.verify(message.privacyMetric); + if (error) + return "privacyMetric." + error; + } + if (message.sourceTable != null && message.hasOwnProperty("sourceTable")) { + var error = $root.google.privacy.dlp.v2.BigQueryTable.verify(message.sourceTable); + if (error) + return "sourceTable." + error; + } + if (message.actions != null && message.hasOwnProperty("actions")) { + if (!Array.isArray(message.actions)) + return "actions: array expected"; + for (var i = 0; i < message.actions.length; ++i) { + var error = $root.google.privacy.dlp.v2.Action.verify(message.actions[i]); + if (error) + return "actions." + error; + } + } + return null; + }; + + /** + * Creates a RiskAnalysisJobConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.RiskAnalysisJobConfig + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.RiskAnalysisJobConfig} RiskAnalysisJobConfig + */ + RiskAnalysisJobConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.RiskAnalysisJobConfig) + return object; + var message = new $root.google.privacy.dlp.v2.RiskAnalysisJobConfig(); + if (object.privacyMetric != null) { + if (typeof object.privacyMetric !== "object") + throw TypeError(".google.privacy.dlp.v2.RiskAnalysisJobConfig.privacyMetric: object expected"); + message.privacyMetric = $root.google.privacy.dlp.v2.PrivacyMetric.fromObject(object.privacyMetric); + } + if (object.sourceTable != null) { + if (typeof object.sourceTable !== "object") + throw TypeError(".google.privacy.dlp.v2.RiskAnalysisJobConfig.sourceTable: object expected"); + message.sourceTable = $root.google.privacy.dlp.v2.BigQueryTable.fromObject(object.sourceTable); + } + if (object.actions) { + if (!Array.isArray(object.actions)) + throw TypeError(".google.privacy.dlp.v2.RiskAnalysisJobConfig.actions: array expected"); + message.actions = []; + for (var i = 0; i < object.actions.length; ++i) { + if (typeof object.actions[i] !== "object") + throw TypeError(".google.privacy.dlp.v2.RiskAnalysisJobConfig.actions: object expected"); + message.actions[i] = $root.google.privacy.dlp.v2.Action.fromObject(object.actions[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a RiskAnalysisJobConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.RiskAnalysisJobConfig + * @static + * @param {google.privacy.dlp.v2.RiskAnalysisJobConfig} message RiskAnalysisJobConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RiskAnalysisJobConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.actions = []; + if (options.defaults) { + object.privacyMetric = null; + object.sourceTable = null; + } + if (message.privacyMetric != null && message.hasOwnProperty("privacyMetric")) + object.privacyMetric = $root.google.privacy.dlp.v2.PrivacyMetric.toObject(message.privacyMetric, options); + if (message.sourceTable != null && message.hasOwnProperty("sourceTable")) + object.sourceTable = $root.google.privacy.dlp.v2.BigQueryTable.toObject(message.sourceTable, options); + if (message.actions && message.actions.length) { + object.actions = []; + for (var j = 0; j < message.actions.length; ++j) + object.actions[j] = $root.google.privacy.dlp.v2.Action.toObject(message.actions[j], options); + } + return object; + }; + + /** + * Converts this RiskAnalysisJobConfig to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.RiskAnalysisJobConfig + * @instance + * @returns {Object.} JSON object + */ + RiskAnalysisJobConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RiskAnalysisJobConfig; + })(); + + v2.QuasiId = (function() { + + /** + * Properties of a QuasiId. + * @memberof google.privacy.dlp.v2 + * @interface IQuasiId + * @property {google.privacy.dlp.v2.IFieldId|null} [field] QuasiId field + * @property {google.privacy.dlp.v2.IInfoType|null} [infoType] QuasiId infoType + * @property {string|null} [customTag] QuasiId customTag + * @property {google.protobuf.IEmpty|null} [inferred] QuasiId inferred + */ + + /** + * Constructs a new QuasiId. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents a QuasiId. + * @implements IQuasiId + * @constructor + * @param {google.privacy.dlp.v2.IQuasiId=} [properties] Properties to set + */ + function QuasiId(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QuasiId field. + * @member {google.privacy.dlp.v2.IFieldId|null|undefined} field + * @memberof google.privacy.dlp.v2.QuasiId + * @instance + */ + QuasiId.prototype.field = null; + + /** + * QuasiId infoType. + * @member {google.privacy.dlp.v2.IInfoType|null|undefined} infoType + * @memberof google.privacy.dlp.v2.QuasiId + * @instance + */ + QuasiId.prototype.infoType = null; + + /** + * QuasiId customTag. + * @member {string} customTag + * @memberof google.privacy.dlp.v2.QuasiId + * @instance + */ + QuasiId.prototype.customTag = ""; + + /** + * QuasiId inferred. + * @member {google.protobuf.IEmpty|null|undefined} inferred + * @memberof google.privacy.dlp.v2.QuasiId + * @instance + */ + QuasiId.prototype.inferred = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * QuasiId tag. + * @member {"infoType"|"customTag"|"inferred"|undefined} tag + * @memberof google.privacy.dlp.v2.QuasiId + * @instance + */ + Object.defineProperty(QuasiId.prototype, "tag", { + get: $util.oneOfGetter($oneOfFields = ["infoType", "customTag", "inferred"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new QuasiId instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.QuasiId + * @static + * @param {google.privacy.dlp.v2.IQuasiId=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.QuasiId} QuasiId instance + */ + QuasiId.create = function create(properties) { + return new QuasiId(properties); + }; + + /** + * Encodes the specified QuasiId message. Does not implicitly {@link google.privacy.dlp.v2.QuasiId.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.QuasiId + * @static + * @param {google.privacy.dlp.v2.IQuasiId} message QuasiId message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QuasiId.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.field != null && Object.hasOwnProperty.call(message, "field")) + $root.google.privacy.dlp.v2.FieldId.encode(message.field, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.infoType != null && Object.hasOwnProperty.call(message, "infoType")) + $root.google.privacy.dlp.v2.InfoType.encode(message.infoType, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.customTag != null && Object.hasOwnProperty.call(message, "customTag")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.customTag); + if (message.inferred != null && Object.hasOwnProperty.call(message, "inferred")) + $root.google.protobuf.Empty.encode(message.inferred, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QuasiId message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.QuasiId.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.QuasiId + * @static + * @param {google.privacy.dlp.v2.IQuasiId} message QuasiId message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QuasiId.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QuasiId message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.QuasiId + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.QuasiId} QuasiId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QuasiId.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.privacy.dlp.v2.QuasiId(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.field = $root.google.privacy.dlp.v2.FieldId.decode(reader, reader.uint32()); + break; + case 2: + message.infoType = $root.google.privacy.dlp.v2.InfoType.decode(reader, reader.uint32()); + break; + case 3: + message.customTag = reader.string(); + break; + case 4: + message.inferred = $root.google.protobuf.Empty.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QuasiId message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.QuasiId + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.QuasiId} QuasiId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QuasiId.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QuasiId message. + * @function verify + * @memberof google.privacy.dlp.v2.QuasiId + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QuasiId.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.field != null && message.hasOwnProperty("field")) { + var error = $root.google.privacy.dlp.v2.FieldId.verify(message.field); + if (error) + return "field." + error; + } + if (message.infoType != null && message.hasOwnProperty("infoType")) { + properties.tag = 1; + { + var error = $root.google.privacy.dlp.v2.InfoType.verify(message.infoType); + if (error) + return "infoType." + error; + } + } + if (message.customTag != null && message.hasOwnProperty("customTag")) { + if (properties.tag === 1) + return "tag: multiple values"; + properties.tag = 1; + if (!$util.isString(message.customTag)) + return "customTag: string expected"; + } + if (message.inferred != null && message.hasOwnProperty("inferred")) { + if (properties.tag === 1) + return "tag: multiple values"; + properties.tag = 1; + { + var error = $root.google.protobuf.Empty.verify(message.inferred); + if (error) + return "inferred." + error; + } + } + return null; + }; + + /** + * Creates a QuasiId message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.QuasiId + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.QuasiId} QuasiId + */ + QuasiId.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.QuasiId) + return object; + var message = new $root.google.privacy.dlp.v2.QuasiId(); + if (object.field != null) { + if (typeof object.field !== "object") + throw TypeError(".google.privacy.dlp.v2.QuasiId.field: object expected"); + message.field = $root.google.privacy.dlp.v2.FieldId.fromObject(object.field); + } + if (object.infoType != null) { + if (typeof object.infoType !== "object") + throw TypeError(".google.privacy.dlp.v2.QuasiId.infoType: object expected"); + message.infoType = $root.google.privacy.dlp.v2.InfoType.fromObject(object.infoType); + } + if (object.customTag != null) + message.customTag = String(object.customTag); + if (object.inferred != null) { + if (typeof object.inferred !== "object") + throw TypeError(".google.privacy.dlp.v2.QuasiId.inferred: object expected"); + message.inferred = $root.google.protobuf.Empty.fromObject(object.inferred); + } + return message; + }; + + /** + * Creates a plain object from a QuasiId message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.QuasiId + * @static + * @param {google.privacy.dlp.v2.QuasiId} message QuasiId + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QuasiId.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.field = null; + if (message.field != null && message.hasOwnProperty("field")) + object.field = $root.google.privacy.dlp.v2.FieldId.toObject(message.field, options); + if (message.infoType != null && message.hasOwnProperty("infoType")) { + object.infoType = $root.google.privacy.dlp.v2.InfoType.toObject(message.infoType, options); + if (options.oneofs) + object.tag = "infoType"; + } + if (message.customTag != null && message.hasOwnProperty("customTag")) { + object.customTag = message.customTag; + if (options.oneofs) + object.tag = "customTag"; + } + if (message.inferred != null && message.hasOwnProperty("inferred")) { + object.inferred = $root.google.protobuf.Empty.toObject(message.inferred, options); + if (options.oneofs) + object.tag = "inferred"; + } + return object; + }; + + /** + * Converts this QuasiId to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.QuasiId + * @instance + * @returns {Object.} JSON object + */ + QuasiId.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QuasiId; + })(); + + v2.StatisticalTable = (function() { + + /** + * Properties of a StatisticalTable. + * @memberof google.privacy.dlp.v2 + * @interface IStatisticalTable + * @property {google.privacy.dlp.v2.IBigQueryTable|null} [table] StatisticalTable table + * @property {Array.|null} [quasiIds] StatisticalTable quasiIds + * @property {google.privacy.dlp.v2.IFieldId|null} [relativeFrequency] StatisticalTable relativeFrequency + */ + + /** + * Constructs a new StatisticalTable. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents a StatisticalTable. + * @implements IStatisticalTable + * @constructor + * @param {google.privacy.dlp.v2.IStatisticalTable=} [properties] Properties to set + */ + function StatisticalTable(properties) { + this.quasiIds = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StatisticalTable table. + * @member {google.privacy.dlp.v2.IBigQueryTable|null|undefined} table + * @memberof google.privacy.dlp.v2.StatisticalTable + * @instance + */ + StatisticalTable.prototype.table = null; + + /** + * StatisticalTable quasiIds. + * @member {Array.} quasiIds + * @memberof google.privacy.dlp.v2.StatisticalTable + * @instance + */ + StatisticalTable.prototype.quasiIds = $util.emptyArray; + + /** + * StatisticalTable relativeFrequency. + * @member {google.privacy.dlp.v2.IFieldId|null|undefined} relativeFrequency + * @memberof google.privacy.dlp.v2.StatisticalTable + * @instance + */ + StatisticalTable.prototype.relativeFrequency = null; + + /** + * Creates a new StatisticalTable instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.StatisticalTable + * @static + * @param {google.privacy.dlp.v2.IStatisticalTable=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.StatisticalTable} StatisticalTable instance + */ + StatisticalTable.create = function create(properties) { + return new StatisticalTable(properties); + }; + + /** + * Encodes the specified StatisticalTable message. Does not implicitly {@link google.privacy.dlp.v2.StatisticalTable.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.StatisticalTable + * @static + * @param {google.privacy.dlp.v2.IStatisticalTable} message StatisticalTable message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StatisticalTable.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.quasiIds != null && message.quasiIds.length) + for (var i = 0; i < message.quasiIds.length; ++i) + $root.google.privacy.dlp.v2.StatisticalTable.QuasiIdentifierField.encode(message.quasiIds[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.relativeFrequency != null && Object.hasOwnProperty.call(message, "relativeFrequency")) + $root.google.privacy.dlp.v2.FieldId.encode(message.relativeFrequency, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.table != null && Object.hasOwnProperty.call(message, "table")) + $root.google.privacy.dlp.v2.BigQueryTable.encode(message.table, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified StatisticalTable message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.StatisticalTable.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.StatisticalTable + * @static + * @param {google.privacy.dlp.v2.IStatisticalTable} message StatisticalTable message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StatisticalTable.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StatisticalTable message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.StatisticalTable + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.StatisticalTable} StatisticalTable + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StatisticalTable.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.privacy.dlp.v2.StatisticalTable(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: + message.table = $root.google.privacy.dlp.v2.BigQueryTable.decode(reader, reader.uint32()); + break; + case 1: + if (!(message.quasiIds && message.quasiIds.length)) + message.quasiIds = []; + message.quasiIds.push($root.google.privacy.dlp.v2.StatisticalTable.QuasiIdentifierField.decode(reader, reader.uint32())); + break; + case 2: + message.relativeFrequency = $root.google.privacy.dlp.v2.FieldId.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StatisticalTable message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.StatisticalTable + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.StatisticalTable} StatisticalTable + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StatisticalTable.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StatisticalTable message. + * @function verify + * @memberof google.privacy.dlp.v2.StatisticalTable + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StatisticalTable.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.table != null && message.hasOwnProperty("table")) { + var error = $root.google.privacy.dlp.v2.BigQueryTable.verify(message.table); + if (error) + return "table." + error; + } + if (message.quasiIds != null && message.hasOwnProperty("quasiIds")) { + if (!Array.isArray(message.quasiIds)) + return "quasiIds: array expected"; + for (var i = 0; i < message.quasiIds.length; ++i) { + var error = $root.google.privacy.dlp.v2.StatisticalTable.QuasiIdentifierField.verify(message.quasiIds[i]); + if (error) + return "quasiIds." + error; + } + } + if (message.relativeFrequency != null && message.hasOwnProperty("relativeFrequency")) { + var error = $root.google.privacy.dlp.v2.FieldId.verify(message.relativeFrequency); + if (error) + return "relativeFrequency." + error; + } + return null; + }; + + /** + * Creates a StatisticalTable message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.StatisticalTable + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.StatisticalTable} StatisticalTable + */ + StatisticalTable.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.StatisticalTable) + return object; + var message = new $root.google.privacy.dlp.v2.StatisticalTable(); + if (object.table != null) { + if (typeof object.table !== "object") + throw TypeError(".google.privacy.dlp.v2.StatisticalTable.table: object expected"); + message.table = $root.google.privacy.dlp.v2.BigQueryTable.fromObject(object.table); + } + if (object.quasiIds) { + if (!Array.isArray(object.quasiIds)) + throw TypeError(".google.privacy.dlp.v2.StatisticalTable.quasiIds: array expected"); + message.quasiIds = []; + for (var i = 0; i < object.quasiIds.length; ++i) { + if (typeof object.quasiIds[i] !== "object") + throw TypeError(".google.privacy.dlp.v2.StatisticalTable.quasiIds: object expected"); + message.quasiIds[i] = $root.google.privacy.dlp.v2.StatisticalTable.QuasiIdentifierField.fromObject(object.quasiIds[i]); + } + } + if (object.relativeFrequency != null) { + if (typeof object.relativeFrequency !== "object") + throw TypeError(".google.privacy.dlp.v2.StatisticalTable.relativeFrequency: object expected"); + message.relativeFrequency = $root.google.privacy.dlp.v2.FieldId.fromObject(object.relativeFrequency); + } + return message; + }; + + /** + * Creates a plain object from a StatisticalTable message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.StatisticalTable + * @static + * @param {google.privacy.dlp.v2.StatisticalTable} message StatisticalTable + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StatisticalTable.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.quasiIds = []; + if (options.defaults) { + object.relativeFrequency = null; + object.table = null; + } + if (message.quasiIds && message.quasiIds.length) { + object.quasiIds = []; + for (var j = 0; j < message.quasiIds.length; ++j) + object.quasiIds[j] = $root.google.privacy.dlp.v2.StatisticalTable.QuasiIdentifierField.toObject(message.quasiIds[j], options); + } + if (message.relativeFrequency != null && message.hasOwnProperty("relativeFrequency")) + object.relativeFrequency = $root.google.privacy.dlp.v2.FieldId.toObject(message.relativeFrequency, options); + if (message.table != null && message.hasOwnProperty("table")) + object.table = $root.google.privacy.dlp.v2.BigQueryTable.toObject(message.table, options); + return object; + }; + + /** + * Converts this StatisticalTable to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.StatisticalTable + * @instance + * @returns {Object.} JSON object + */ + StatisticalTable.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + StatisticalTable.QuasiIdentifierField = (function() { + + /** + * Properties of a QuasiIdentifierField. + * @memberof google.privacy.dlp.v2.StatisticalTable + * @interface IQuasiIdentifierField + * @property {google.privacy.dlp.v2.IFieldId|null} [field] QuasiIdentifierField field + * @property {string|null} [customTag] QuasiIdentifierField customTag + */ + + /** + * Constructs a new QuasiIdentifierField. + * @memberof google.privacy.dlp.v2.StatisticalTable + * @classdesc Represents a QuasiIdentifierField. + * @implements IQuasiIdentifierField + * @constructor + * @param {google.privacy.dlp.v2.StatisticalTable.IQuasiIdentifierField=} [properties] Properties to set + */ + function QuasiIdentifierField(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QuasiIdentifierField field. + * @member {google.privacy.dlp.v2.IFieldId|null|undefined} field + * @memberof google.privacy.dlp.v2.StatisticalTable.QuasiIdentifierField + * @instance + */ + QuasiIdentifierField.prototype.field = null; + + /** + * QuasiIdentifierField customTag. + * @member {string} customTag + * @memberof google.privacy.dlp.v2.StatisticalTable.QuasiIdentifierField + * @instance + */ + QuasiIdentifierField.prototype.customTag = ""; + + /** + * Creates a new QuasiIdentifierField instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.StatisticalTable.QuasiIdentifierField + * @static + * @param {google.privacy.dlp.v2.StatisticalTable.IQuasiIdentifierField=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.StatisticalTable.QuasiIdentifierField} QuasiIdentifierField instance + */ + QuasiIdentifierField.create = function create(properties) { + return new QuasiIdentifierField(properties); + }; + + /** + * Encodes the specified QuasiIdentifierField message. Does not implicitly {@link google.privacy.dlp.v2.StatisticalTable.QuasiIdentifierField.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.StatisticalTable.QuasiIdentifierField + * @static + * @param {google.privacy.dlp.v2.StatisticalTable.IQuasiIdentifierField} message QuasiIdentifierField message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QuasiIdentifierField.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.field != null && Object.hasOwnProperty.call(message, "field")) + $root.google.privacy.dlp.v2.FieldId.encode(message.field, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.customTag != null && Object.hasOwnProperty.call(message, "customTag")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.customTag); + return writer; + }; + + /** + * Encodes the specified QuasiIdentifierField message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.StatisticalTable.QuasiIdentifierField.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.StatisticalTable.QuasiIdentifierField + * @static + * @param {google.privacy.dlp.v2.StatisticalTable.IQuasiIdentifierField} message QuasiIdentifierField message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QuasiIdentifierField.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QuasiIdentifierField message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.StatisticalTable.QuasiIdentifierField + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.StatisticalTable.QuasiIdentifierField} QuasiIdentifierField + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QuasiIdentifierField.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.privacy.dlp.v2.StatisticalTable.QuasiIdentifierField(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.field = $root.google.privacy.dlp.v2.FieldId.decode(reader, reader.uint32()); + break; + case 2: + message.customTag = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QuasiIdentifierField message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.StatisticalTable.QuasiIdentifierField + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.StatisticalTable.QuasiIdentifierField} QuasiIdentifierField + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QuasiIdentifierField.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QuasiIdentifierField message. + * @function verify + * @memberof google.privacy.dlp.v2.StatisticalTable.QuasiIdentifierField + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QuasiIdentifierField.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.field != null && message.hasOwnProperty("field")) { + var error = $root.google.privacy.dlp.v2.FieldId.verify(message.field); + if (error) + return "field." + error; + } + if (message.customTag != null && message.hasOwnProperty("customTag")) + if (!$util.isString(message.customTag)) + return "customTag: string expected"; + return null; + }; + + /** + * Creates a QuasiIdentifierField message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.StatisticalTable.QuasiIdentifierField + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.StatisticalTable.QuasiIdentifierField} QuasiIdentifierField + */ + QuasiIdentifierField.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.StatisticalTable.QuasiIdentifierField) + return object; + var message = new $root.google.privacy.dlp.v2.StatisticalTable.QuasiIdentifierField(); + if (object.field != null) { + if (typeof object.field !== "object") + throw TypeError(".google.privacy.dlp.v2.StatisticalTable.QuasiIdentifierField.field: object expected"); + message.field = $root.google.privacy.dlp.v2.FieldId.fromObject(object.field); + } + if (object.customTag != null) + message.customTag = String(object.customTag); + return message; + }; + + /** + * Creates a plain object from a QuasiIdentifierField message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.StatisticalTable.QuasiIdentifierField + * @static + * @param {google.privacy.dlp.v2.StatisticalTable.QuasiIdentifierField} message QuasiIdentifierField + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QuasiIdentifierField.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.field = null; + object.customTag = ""; + } + if (message.field != null && message.hasOwnProperty("field")) + object.field = $root.google.privacy.dlp.v2.FieldId.toObject(message.field, options); + if (message.customTag != null && message.hasOwnProperty("customTag")) + object.customTag = message.customTag; + return object; + }; + + /** + * Converts this QuasiIdentifierField to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.StatisticalTable.QuasiIdentifierField + * @instance + * @returns {Object.} JSON object + */ + QuasiIdentifierField.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QuasiIdentifierField; + })(); + + return StatisticalTable; + })(); + + v2.PrivacyMetric = (function() { + + /** + * Properties of a PrivacyMetric. + * @memberof google.privacy.dlp.v2 + * @interface IPrivacyMetric + * @property {google.privacy.dlp.v2.PrivacyMetric.INumericalStatsConfig|null} [numericalStatsConfig] PrivacyMetric numericalStatsConfig + * @property {google.privacy.dlp.v2.PrivacyMetric.ICategoricalStatsConfig|null} [categoricalStatsConfig] PrivacyMetric categoricalStatsConfig + * @property {google.privacy.dlp.v2.PrivacyMetric.IKAnonymityConfig|null} [kAnonymityConfig] PrivacyMetric kAnonymityConfig + * @property {google.privacy.dlp.v2.PrivacyMetric.ILDiversityConfig|null} [lDiversityConfig] PrivacyMetric lDiversityConfig + * @property {google.privacy.dlp.v2.PrivacyMetric.IKMapEstimationConfig|null} [kMapEstimationConfig] PrivacyMetric kMapEstimationConfig + * @property {google.privacy.dlp.v2.PrivacyMetric.IDeltaPresenceEstimationConfig|null} [deltaPresenceEstimationConfig] PrivacyMetric deltaPresenceEstimationConfig + */ + + /** + * Constructs a new PrivacyMetric. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents a PrivacyMetric. + * @implements IPrivacyMetric + * @constructor + * @param {google.privacy.dlp.v2.IPrivacyMetric=} [properties] Properties to set + */ + function PrivacyMetric(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PrivacyMetric numericalStatsConfig. + * @member {google.privacy.dlp.v2.PrivacyMetric.INumericalStatsConfig|null|undefined} numericalStatsConfig + * @memberof google.privacy.dlp.v2.PrivacyMetric + * @instance + */ + PrivacyMetric.prototype.numericalStatsConfig = null; + + /** + * PrivacyMetric categoricalStatsConfig. + * @member {google.privacy.dlp.v2.PrivacyMetric.ICategoricalStatsConfig|null|undefined} categoricalStatsConfig + * @memberof google.privacy.dlp.v2.PrivacyMetric + * @instance + */ + PrivacyMetric.prototype.categoricalStatsConfig = null; + + /** + * PrivacyMetric kAnonymityConfig. + * @member {google.privacy.dlp.v2.PrivacyMetric.IKAnonymityConfig|null|undefined} kAnonymityConfig + * @memberof google.privacy.dlp.v2.PrivacyMetric + * @instance + */ + PrivacyMetric.prototype.kAnonymityConfig = null; + + /** + * PrivacyMetric lDiversityConfig. + * @member {google.privacy.dlp.v2.PrivacyMetric.ILDiversityConfig|null|undefined} lDiversityConfig + * @memberof google.privacy.dlp.v2.PrivacyMetric + * @instance + */ + PrivacyMetric.prototype.lDiversityConfig = null; + + /** + * PrivacyMetric kMapEstimationConfig. + * @member {google.privacy.dlp.v2.PrivacyMetric.IKMapEstimationConfig|null|undefined} kMapEstimationConfig + * @memberof google.privacy.dlp.v2.PrivacyMetric + * @instance + */ + PrivacyMetric.prototype.kMapEstimationConfig = null; + + /** + * PrivacyMetric deltaPresenceEstimationConfig. + * @member {google.privacy.dlp.v2.PrivacyMetric.IDeltaPresenceEstimationConfig|null|undefined} deltaPresenceEstimationConfig + * @memberof google.privacy.dlp.v2.PrivacyMetric + * @instance + */ + PrivacyMetric.prototype.deltaPresenceEstimationConfig = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * PrivacyMetric type. + * @member {"numericalStatsConfig"|"categoricalStatsConfig"|"kAnonymityConfig"|"lDiversityConfig"|"kMapEstimationConfig"|"deltaPresenceEstimationConfig"|undefined} type + * @memberof google.privacy.dlp.v2.PrivacyMetric + * @instance + */ + Object.defineProperty(PrivacyMetric.prototype, "type", { + get: $util.oneOfGetter($oneOfFields = ["numericalStatsConfig", "categoricalStatsConfig", "kAnonymityConfig", "lDiversityConfig", "kMapEstimationConfig", "deltaPresenceEstimationConfig"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PrivacyMetric instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.PrivacyMetric + * @static + * @param {google.privacy.dlp.v2.IPrivacyMetric=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.PrivacyMetric} PrivacyMetric instance + */ + PrivacyMetric.create = function create(properties) { + return new PrivacyMetric(properties); + }; + + /** + * Encodes the specified PrivacyMetric message. Does not implicitly {@link google.privacy.dlp.v2.PrivacyMetric.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.PrivacyMetric + * @static + * @param {google.privacy.dlp.v2.IPrivacyMetric} message PrivacyMetric message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PrivacyMetric.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.numericalStatsConfig != null && Object.hasOwnProperty.call(message, "numericalStatsConfig")) + $root.google.privacy.dlp.v2.PrivacyMetric.NumericalStatsConfig.encode(message.numericalStatsConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.categoricalStatsConfig != null && Object.hasOwnProperty.call(message, "categoricalStatsConfig")) + $root.google.privacy.dlp.v2.PrivacyMetric.CategoricalStatsConfig.encode(message.categoricalStatsConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.kAnonymityConfig != null && Object.hasOwnProperty.call(message, "kAnonymityConfig")) + $root.google.privacy.dlp.v2.PrivacyMetric.KAnonymityConfig.encode(message.kAnonymityConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.lDiversityConfig != null && Object.hasOwnProperty.call(message, "lDiversityConfig")) + $root.google.privacy.dlp.v2.PrivacyMetric.LDiversityConfig.encode(message.lDiversityConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.kMapEstimationConfig != null && Object.hasOwnProperty.call(message, "kMapEstimationConfig")) + $root.google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.encode(message.kMapEstimationConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.deltaPresenceEstimationConfig != null && Object.hasOwnProperty.call(message, "deltaPresenceEstimationConfig")) + $root.google.privacy.dlp.v2.PrivacyMetric.DeltaPresenceEstimationConfig.encode(message.deltaPresenceEstimationConfig, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PrivacyMetric message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.PrivacyMetric.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.PrivacyMetric + * @static + * @param {google.privacy.dlp.v2.IPrivacyMetric} message PrivacyMetric message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PrivacyMetric.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PrivacyMetric message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.PrivacyMetric + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.PrivacyMetric} PrivacyMetric + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PrivacyMetric.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.privacy.dlp.v2.PrivacyMetric(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.numericalStatsConfig = $root.google.privacy.dlp.v2.PrivacyMetric.NumericalStatsConfig.decode(reader, reader.uint32()); + break; + case 2: + message.categoricalStatsConfig = $root.google.privacy.dlp.v2.PrivacyMetric.CategoricalStatsConfig.decode(reader, reader.uint32()); + break; + case 3: + message.kAnonymityConfig = $root.google.privacy.dlp.v2.PrivacyMetric.KAnonymityConfig.decode(reader, reader.uint32()); + break; + case 4: + message.lDiversityConfig = $root.google.privacy.dlp.v2.PrivacyMetric.LDiversityConfig.decode(reader, reader.uint32()); + break; + case 5: + message.kMapEstimationConfig = $root.google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.decode(reader, reader.uint32()); + break; + case 6: + message.deltaPresenceEstimationConfig = $root.google.privacy.dlp.v2.PrivacyMetric.DeltaPresenceEstimationConfig.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PrivacyMetric message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.PrivacyMetric + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.PrivacyMetric} PrivacyMetric + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PrivacyMetric.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PrivacyMetric message. + * @function verify + * @memberof google.privacy.dlp.v2.PrivacyMetric + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PrivacyMetric.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.numericalStatsConfig != null && message.hasOwnProperty("numericalStatsConfig")) { + properties.type = 1; + { + var error = $root.google.privacy.dlp.v2.PrivacyMetric.NumericalStatsConfig.verify(message.numericalStatsConfig); + if (error) + return "numericalStatsConfig." + error; + } + } + if (message.categoricalStatsConfig != null && message.hasOwnProperty("categoricalStatsConfig")) { + if (properties.type === 1) + return "type: multiple values"; + properties.type = 1; + { + var error = $root.google.privacy.dlp.v2.PrivacyMetric.CategoricalStatsConfig.verify(message.categoricalStatsConfig); + if (error) + return "categoricalStatsConfig." + error; + } + } + if (message.kAnonymityConfig != null && message.hasOwnProperty("kAnonymityConfig")) { + if (properties.type === 1) + return "type: multiple values"; + properties.type = 1; + { + var error = $root.google.privacy.dlp.v2.PrivacyMetric.KAnonymityConfig.verify(message.kAnonymityConfig); + if (error) + return "kAnonymityConfig." + error; + } + } + if (message.lDiversityConfig != null && message.hasOwnProperty("lDiversityConfig")) { + if (properties.type === 1) + return "type: multiple values"; + properties.type = 1; + { + var error = $root.google.privacy.dlp.v2.PrivacyMetric.LDiversityConfig.verify(message.lDiversityConfig); + if (error) + return "lDiversityConfig." + error; + } + } + if (message.kMapEstimationConfig != null && message.hasOwnProperty("kMapEstimationConfig")) { + if (properties.type === 1) + return "type: multiple values"; + properties.type = 1; + { + var error = $root.google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.verify(message.kMapEstimationConfig); + if (error) + return "kMapEstimationConfig." + error; + } + } + if (message.deltaPresenceEstimationConfig != null && message.hasOwnProperty("deltaPresenceEstimationConfig")) { + if (properties.type === 1) + return "type: multiple values"; + properties.type = 1; + { + var error = $root.google.privacy.dlp.v2.PrivacyMetric.DeltaPresenceEstimationConfig.verify(message.deltaPresenceEstimationConfig); + if (error) + return "deltaPresenceEstimationConfig." + error; + } + } + return null; + }; + + /** + * Creates a PrivacyMetric message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.PrivacyMetric + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.PrivacyMetric} PrivacyMetric + */ + PrivacyMetric.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.PrivacyMetric) + return object; + var message = new $root.google.privacy.dlp.v2.PrivacyMetric(); + if (object.numericalStatsConfig != null) { + if (typeof object.numericalStatsConfig !== "object") + throw TypeError(".google.privacy.dlp.v2.PrivacyMetric.numericalStatsConfig: object expected"); + message.numericalStatsConfig = $root.google.privacy.dlp.v2.PrivacyMetric.NumericalStatsConfig.fromObject(object.numericalStatsConfig); + } + if (object.categoricalStatsConfig != null) { + if (typeof object.categoricalStatsConfig !== "object") + throw TypeError(".google.privacy.dlp.v2.PrivacyMetric.categoricalStatsConfig: object expected"); + message.categoricalStatsConfig = $root.google.privacy.dlp.v2.PrivacyMetric.CategoricalStatsConfig.fromObject(object.categoricalStatsConfig); + } + if (object.kAnonymityConfig != null) { + if (typeof object.kAnonymityConfig !== "object") + throw TypeError(".google.privacy.dlp.v2.PrivacyMetric.kAnonymityConfig: object expected"); + message.kAnonymityConfig = $root.google.privacy.dlp.v2.PrivacyMetric.KAnonymityConfig.fromObject(object.kAnonymityConfig); + } + if (object.lDiversityConfig != null) { + if (typeof object.lDiversityConfig !== "object") + throw TypeError(".google.privacy.dlp.v2.PrivacyMetric.lDiversityConfig: object expected"); + message.lDiversityConfig = $root.google.privacy.dlp.v2.PrivacyMetric.LDiversityConfig.fromObject(object.lDiversityConfig); + } + if (object.kMapEstimationConfig != null) { + if (typeof object.kMapEstimationConfig !== "object") + throw TypeError(".google.privacy.dlp.v2.PrivacyMetric.kMapEstimationConfig: object expected"); + message.kMapEstimationConfig = $root.google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.fromObject(object.kMapEstimationConfig); + } + if (object.deltaPresenceEstimationConfig != null) { + if (typeof object.deltaPresenceEstimationConfig !== "object") + throw TypeError(".google.privacy.dlp.v2.PrivacyMetric.deltaPresenceEstimationConfig: object expected"); + message.deltaPresenceEstimationConfig = $root.google.privacy.dlp.v2.PrivacyMetric.DeltaPresenceEstimationConfig.fromObject(object.deltaPresenceEstimationConfig); + } + return message; + }; + + /** + * Creates a plain object from a PrivacyMetric message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.PrivacyMetric + * @static + * @param {google.privacy.dlp.v2.PrivacyMetric} message PrivacyMetric + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PrivacyMetric.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.numericalStatsConfig != null && message.hasOwnProperty("numericalStatsConfig")) { + object.numericalStatsConfig = $root.google.privacy.dlp.v2.PrivacyMetric.NumericalStatsConfig.toObject(message.numericalStatsConfig, options); + if (options.oneofs) + object.type = "numericalStatsConfig"; + } + if (message.categoricalStatsConfig != null && message.hasOwnProperty("categoricalStatsConfig")) { + object.categoricalStatsConfig = $root.google.privacy.dlp.v2.PrivacyMetric.CategoricalStatsConfig.toObject(message.categoricalStatsConfig, options); + if (options.oneofs) + object.type = "categoricalStatsConfig"; + } + if (message.kAnonymityConfig != null && message.hasOwnProperty("kAnonymityConfig")) { + object.kAnonymityConfig = $root.google.privacy.dlp.v2.PrivacyMetric.KAnonymityConfig.toObject(message.kAnonymityConfig, options); + if (options.oneofs) + object.type = "kAnonymityConfig"; + } + if (message.lDiversityConfig != null && message.hasOwnProperty("lDiversityConfig")) { + object.lDiversityConfig = $root.google.privacy.dlp.v2.PrivacyMetric.LDiversityConfig.toObject(message.lDiversityConfig, options); + if (options.oneofs) + object.type = "lDiversityConfig"; + } + if (message.kMapEstimationConfig != null && message.hasOwnProperty("kMapEstimationConfig")) { + object.kMapEstimationConfig = $root.google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.toObject(message.kMapEstimationConfig, options); + if (options.oneofs) + object.type = "kMapEstimationConfig"; + } + if (message.deltaPresenceEstimationConfig != null && message.hasOwnProperty("deltaPresenceEstimationConfig")) { + object.deltaPresenceEstimationConfig = $root.google.privacy.dlp.v2.PrivacyMetric.DeltaPresenceEstimationConfig.toObject(message.deltaPresenceEstimationConfig, options); + if (options.oneofs) + object.type = "deltaPresenceEstimationConfig"; + } + return object; + }; + + /** + * Converts this PrivacyMetric to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.PrivacyMetric + * @instance + * @returns {Object.} JSON object + */ + PrivacyMetric.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + PrivacyMetric.NumericalStatsConfig = (function() { + + /** + * Properties of a NumericalStatsConfig. + * @memberof google.privacy.dlp.v2.PrivacyMetric + * @interface INumericalStatsConfig + * @property {google.privacy.dlp.v2.IFieldId|null} [field] NumericalStatsConfig field + */ + + /** + * Constructs a new NumericalStatsConfig. + * @memberof google.privacy.dlp.v2.PrivacyMetric + * @classdesc Represents a NumericalStatsConfig. + * @implements INumericalStatsConfig + * @constructor + * @param {google.privacy.dlp.v2.PrivacyMetric.INumericalStatsConfig=} [properties] Properties to set + */ + function NumericalStatsConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NumericalStatsConfig field. + * @member {google.privacy.dlp.v2.IFieldId|null|undefined} field + * @memberof google.privacy.dlp.v2.PrivacyMetric.NumericalStatsConfig + * @instance + */ + NumericalStatsConfig.prototype.field = null; + + /** + * Creates a new NumericalStatsConfig instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.PrivacyMetric.NumericalStatsConfig + * @static + * @param {google.privacy.dlp.v2.PrivacyMetric.INumericalStatsConfig=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.PrivacyMetric.NumericalStatsConfig} NumericalStatsConfig instance + */ + NumericalStatsConfig.create = function create(properties) { + return new NumericalStatsConfig(properties); + }; + + /** + * Encodes the specified NumericalStatsConfig message. Does not implicitly {@link google.privacy.dlp.v2.PrivacyMetric.NumericalStatsConfig.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.PrivacyMetric.NumericalStatsConfig + * @static + * @param {google.privacy.dlp.v2.PrivacyMetric.INumericalStatsConfig} message NumericalStatsConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NumericalStatsConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.field != null && Object.hasOwnProperty.call(message, "field")) + $root.google.privacy.dlp.v2.FieldId.encode(message.field, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified NumericalStatsConfig message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.PrivacyMetric.NumericalStatsConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.PrivacyMetric.NumericalStatsConfig + * @static + * @param {google.privacy.dlp.v2.PrivacyMetric.INumericalStatsConfig} message NumericalStatsConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NumericalStatsConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NumericalStatsConfig message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.PrivacyMetric.NumericalStatsConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.PrivacyMetric.NumericalStatsConfig} NumericalStatsConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NumericalStatsConfig.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.privacy.dlp.v2.PrivacyMetric.NumericalStatsConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.field = $root.google.privacy.dlp.v2.FieldId.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NumericalStatsConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.PrivacyMetric.NumericalStatsConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.PrivacyMetric.NumericalStatsConfig} NumericalStatsConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NumericalStatsConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NumericalStatsConfig message. + * @function verify + * @memberof google.privacy.dlp.v2.PrivacyMetric.NumericalStatsConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NumericalStatsConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.field != null && message.hasOwnProperty("field")) { + var error = $root.google.privacy.dlp.v2.FieldId.verify(message.field); + if (error) + return "field." + error; + } + return null; + }; + + /** + * Creates a NumericalStatsConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.PrivacyMetric.NumericalStatsConfig + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.PrivacyMetric.NumericalStatsConfig} NumericalStatsConfig + */ + NumericalStatsConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.PrivacyMetric.NumericalStatsConfig) + return object; + var message = new $root.google.privacy.dlp.v2.PrivacyMetric.NumericalStatsConfig(); + if (object.field != null) { + if (typeof object.field !== "object") + throw TypeError(".google.privacy.dlp.v2.PrivacyMetric.NumericalStatsConfig.field: object expected"); + message.field = $root.google.privacy.dlp.v2.FieldId.fromObject(object.field); + } + return message; + }; + + /** + * Creates a plain object from a NumericalStatsConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.PrivacyMetric.NumericalStatsConfig + * @static + * @param {google.privacy.dlp.v2.PrivacyMetric.NumericalStatsConfig} message NumericalStatsConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NumericalStatsConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.field = null; + if (message.field != null && message.hasOwnProperty("field")) + object.field = $root.google.privacy.dlp.v2.FieldId.toObject(message.field, options); + return object; + }; + + /** + * Converts this NumericalStatsConfig to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.PrivacyMetric.NumericalStatsConfig + * @instance + * @returns {Object.} JSON object + */ + NumericalStatsConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return NumericalStatsConfig; + })(); + + PrivacyMetric.CategoricalStatsConfig = (function() { + + /** + * Properties of a CategoricalStatsConfig. + * @memberof google.privacy.dlp.v2.PrivacyMetric + * @interface ICategoricalStatsConfig + * @property {google.privacy.dlp.v2.IFieldId|null} [field] CategoricalStatsConfig field + */ + + /** + * Constructs a new CategoricalStatsConfig. + * @memberof google.privacy.dlp.v2.PrivacyMetric + * @classdesc Represents a CategoricalStatsConfig. + * @implements ICategoricalStatsConfig + * @constructor + * @param {google.privacy.dlp.v2.PrivacyMetric.ICategoricalStatsConfig=} [properties] Properties to set + */ + function CategoricalStatsConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CategoricalStatsConfig field. + * @member {google.privacy.dlp.v2.IFieldId|null|undefined} field + * @memberof google.privacy.dlp.v2.PrivacyMetric.CategoricalStatsConfig + * @instance + */ + CategoricalStatsConfig.prototype.field = null; + + /** + * Creates a new CategoricalStatsConfig instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.PrivacyMetric.CategoricalStatsConfig + * @static + * @param {google.privacy.dlp.v2.PrivacyMetric.ICategoricalStatsConfig=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.PrivacyMetric.CategoricalStatsConfig} CategoricalStatsConfig instance + */ + CategoricalStatsConfig.create = function create(properties) { + return new CategoricalStatsConfig(properties); + }; + + /** + * Encodes the specified CategoricalStatsConfig message. Does not implicitly {@link google.privacy.dlp.v2.PrivacyMetric.CategoricalStatsConfig.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.PrivacyMetric.CategoricalStatsConfig + * @static + * @param {google.privacy.dlp.v2.PrivacyMetric.ICategoricalStatsConfig} message CategoricalStatsConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CategoricalStatsConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.field != null && Object.hasOwnProperty.call(message, "field")) + $root.google.privacy.dlp.v2.FieldId.encode(message.field, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CategoricalStatsConfig message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.PrivacyMetric.CategoricalStatsConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.PrivacyMetric.CategoricalStatsConfig + * @static + * @param {google.privacy.dlp.v2.PrivacyMetric.ICategoricalStatsConfig} message CategoricalStatsConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CategoricalStatsConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CategoricalStatsConfig message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.PrivacyMetric.CategoricalStatsConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.PrivacyMetric.CategoricalStatsConfig} CategoricalStatsConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CategoricalStatsConfig.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.privacy.dlp.v2.PrivacyMetric.CategoricalStatsConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.field = $root.google.privacy.dlp.v2.FieldId.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CategoricalStatsConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.PrivacyMetric.CategoricalStatsConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.PrivacyMetric.CategoricalStatsConfig} CategoricalStatsConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CategoricalStatsConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CategoricalStatsConfig message. + * @function verify + * @memberof google.privacy.dlp.v2.PrivacyMetric.CategoricalStatsConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CategoricalStatsConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.field != null && message.hasOwnProperty("field")) { + var error = $root.google.privacy.dlp.v2.FieldId.verify(message.field); + if (error) + return "field." + error; + } + return null; + }; + + /** + * Creates a CategoricalStatsConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.PrivacyMetric.CategoricalStatsConfig + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.PrivacyMetric.CategoricalStatsConfig} CategoricalStatsConfig + */ + CategoricalStatsConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.PrivacyMetric.CategoricalStatsConfig) + return object; + var message = new $root.google.privacy.dlp.v2.PrivacyMetric.CategoricalStatsConfig(); + if (object.field != null) { + if (typeof object.field !== "object") + throw TypeError(".google.privacy.dlp.v2.PrivacyMetric.CategoricalStatsConfig.field: object expected"); + message.field = $root.google.privacy.dlp.v2.FieldId.fromObject(object.field); + } + return message; + }; + + /** + * Creates a plain object from a CategoricalStatsConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.PrivacyMetric.CategoricalStatsConfig + * @static + * @param {google.privacy.dlp.v2.PrivacyMetric.CategoricalStatsConfig} message CategoricalStatsConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CategoricalStatsConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.field = null; + if (message.field != null && message.hasOwnProperty("field")) + object.field = $root.google.privacy.dlp.v2.FieldId.toObject(message.field, options); + return object; + }; + + /** + * Converts this CategoricalStatsConfig to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.PrivacyMetric.CategoricalStatsConfig + * @instance + * @returns {Object.} JSON object + */ + CategoricalStatsConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CategoricalStatsConfig; + })(); + + PrivacyMetric.KAnonymityConfig = (function() { + + /** + * Properties of a KAnonymityConfig. + * @memberof google.privacy.dlp.v2.PrivacyMetric + * @interface IKAnonymityConfig + * @property {Array.|null} [quasiIds] KAnonymityConfig quasiIds + * @property {google.privacy.dlp.v2.IEntityId|null} [entityId] KAnonymityConfig entityId + */ + + /** + * Constructs a new KAnonymityConfig. + * @memberof google.privacy.dlp.v2.PrivacyMetric + * @classdesc Represents a KAnonymityConfig. + * @implements IKAnonymityConfig + * @constructor + * @param {google.privacy.dlp.v2.PrivacyMetric.IKAnonymityConfig=} [properties] Properties to set + */ + function KAnonymityConfig(properties) { + this.quasiIds = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * KAnonymityConfig quasiIds. + * @member {Array.} quasiIds + * @memberof google.privacy.dlp.v2.PrivacyMetric.KAnonymityConfig + * @instance + */ + KAnonymityConfig.prototype.quasiIds = $util.emptyArray; + + /** + * KAnonymityConfig entityId. + * @member {google.privacy.dlp.v2.IEntityId|null|undefined} entityId + * @memberof google.privacy.dlp.v2.PrivacyMetric.KAnonymityConfig + * @instance + */ + KAnonymityConfig.prototype.entityId = null; + + /** + * Creates a new KAnonymityConfig instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.PrivacyMetric.KAnonymityConfig + * @static + * @param {google.privacy.dlp.v2.PrivacyMetric.IKAnonymityConfig=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.PrivacyMetric.KAnonymityConfig} KAnonymityConfig instance + */ + KAnonymityConfig.create = function create(properties) { + return new KAnonymityConfig(properties); + }; + + /** + * Encodes the specified KAnonymityConfig message. Does not implicitly {@link google.privacy.dlp.v2.PrivacyMetric.KAnonymityConfig.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.PrivacyMetric.KAnonymityConfig + * @static + * @param {google.privacy.dlp.v2.PrivacyMetric.IKAnonymityConfig} message KAnonymityConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KAnonymityConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.quasiIds != null && message.quasiIds.length) + for (var i = 0; i < message.quasiIds.length; ++i) + $root.google.privacy.dlp.v2.FieldId.encode(message.quasiIds[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.entityId != null && Object.hasOwnProperty.call(message, "entityId")) + $root.google.privacy.dlp.v2.EntityId.encode(message.entityId, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified KAnonymityConfig message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.PrivacyMetric.KAnonymityConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.PrivacyMetric.KAnonymityConfig + * @static + * @param {google.privacy.dlp.v2.PrivacyMetric.IKAnonymityConfig} message KAnonymityConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KAnonymityConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a KAnonymityConfig message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.PrivacyMetric.KAnonymityConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.PrivacyMetric.KAnonymityConfig} KAnonymityConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KAnonymityConfig.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.privacy.dlp.v2.PrivacyMetric.KAnonymityConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.quasiIds && message.quasiIds.length)) + message.quasiIds = []; + message.quasiIds.push($root.google.privacy.dlp.v2.FieldId.decode(reader, reader.uint32())); + break; + case 2: + message.entityId = $root.google.privacy.dlp.v2.EntityId.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a KAnonymityConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.PrivacyMetric.KAnonymityConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.PrivacyMetric.KAnonymityConfig} KAnonymityConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KAnonymityConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a KAnonymityConfig message. + * @function verify + * @memberof google.privacy.dlp.v2.PrivacyMetric.KAnonymityConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + KAnonymityConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.quasiIds != null && message.hasOwnProperty("quasiIds")) { + if (!Array.isArray(message.quasiIds)) + return "quasiIds: array expected"; + for (var i = 0; i < message.quasiIds.length; ++i) { + var error = $root.google.privacy.dlp.v2.FieldId.verify(message.quasiIds[i]); + if (error) + return "quasiIds." + error; + } + } + if (message.entityId != null && message.hasOwnProperty("entityId")) { + var error = $root.google.privacy.dlp.v2.EntityId.verify(message.entityId); + if (error) + return "entityId." + error; + } + return null; + }; + + /** + * Creates a KAnonymityConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.PrivacyMetric.KAnonymityConfig + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.PrivacyMetric.KAnonymityConfig} KAnonymityConfig + */ + KAnonymityConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.PrivacyMetric.KAnonymityConfig) + return object; + var message = new $root.google.privacy.dlp.v2.PrivacyMetric.KAnonymityConfig(); + if (object.quasiIds) { + if (!Array.isArray(object.quasiIds)) + throw TypeError(".google.privacy.dlp.v2.PrivacyMetric.KAnonymityConfig.quasiIds: array expected"); + message.quasiIds = []; + for (var i = 0; i < object.quasiIds.length; ++i) { + if (typeof object.quasiIds[i] !== "object") + throw TypeError(".google.privacy.dlp.v2.PrivacyMetric.KAnonymityConfig.quasiIds: object expected"); + message.quasiIds[i] = $root.google.privacy.dlp.v2.FieldId.fromObject(object.quasiIds[i]); + } + } + if (object.entityId != null) { + if (typeof object.entityId !== "object") + throw TypeError(".google.privacy.dlp.v2.PrivacyMetric.KAnonymityConfig.entityId: object expected"); + message.entityId = $root.google.privacy.dlp.v2.EntityId.fromObject(object.entityId); + } + return message; + }; + + /** + * Creates a plain object from a KAnonymityConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.PrivacyMetric.KAnonymityConfig + * @static + * @param {google.privacy.dlp.v2.PrivacyMetric.KAnonymityConfig} message KAnonymityConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + KAnonymityConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.quasiIds = []; + if (options.defaults) + object.entityId = null; + if (message.quasiIds && message.quasiIds.length) { + object.quasiIds = []; + for (var j = 0; j < message.quasiIds.length; ++j) + object.quasiIds[j] = $root.google.privacy.dlp.v2.FieldId.toObject(message.quasiIds[j], options); + } + if (message.entityId != null && message.hasOwnProperty("entityId")) + object.entityId = $root.google.privacy.dlp.v2.EntityId.toObject(message.entityId, options); + return object; + }; + + /** + * Converts this KAnonymityConfig to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.PrivacyMetric.KAnonymityConfig + * @instance + * @returns {Object.} JSON object + */ + KAnonymityConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return KAnonymityConfig; + })(); + + PrivacyMetric.LDiversityConfig = (function() { + + /** + * Properties of a LDiversityConfig. + * @memberof google.privacy.dlp.v2.PrivacyMetric + * @interface ILDiversityConfig + * @property {Array.|null} [quasiIds] LDiversityConfig quasiIds + * @property {google.privacy.dlp.v2.IFieldId|null} [sensitiveAttribute] LDiversityConfig sensitiveAttribute + */ + + /** + * Constructs a new LDiversityConfig. + * @memberof google.privacy.dlp.v2.PrivacyMetric + * @classdesc Represents a LDiversityConfig. + * @implements ILDiversityConfig + * @constructor + * @param {google.privacy.dlp.v2.PrivacyMetric.ILDiversityConfig=} [properties] Properties to set + */ + function LDiversityConfig(properties) { + this.quasiIds = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LDiversityConfig quasiIds. + * @member {Array.} quasiIds + * @memberof google.privacy.dlp.v2.PrivacyMetric.LDiversityConfig + * @instance + */ + LDiversityConfig.prototype.quasiIds = $util.emptyArray; + + /** + * LDiversityConfig sensitiveAttribute. + * @member {google.privacy.dlp.v2.IFieldId|null|undefined} sensitiveAttribute + * @memberof google.privacy.dlp.v2.PrivacyMetric.LDiversityConfig + * @instance + */ + LDiversityConfig.prototype.sensitiveAttribute = null; + + /** + * Creates a new LDiversityConfig instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.PrivacyMetric.LDiversityConfig + * @static + * @param {google.privacy.dlp.v2.PrivacyMetric.ILDiversityConfig=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.PrivacyMetric.LDiversityConfig} LDiversityConfig instance + */ + LDiversityConfig.create = function create(properties) { + return new LDiversityConfig(properties); + }; + + /** + * Encodes the specified LDiversityConfig message. Does not implicitly {@link google.privacy.dlp.v2.PrivacyMetric.LDiversityConfig.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.PrivacyMetric.LDiversityConfig + * @static + * @param {google.privacy.dlp.v2.PrivacyMetric.ILDiversityConfig} message LDiversityConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LDiversityConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.quasiIds != null && message.quasiIds.length) + for (var i = 0; i < message.quasiIds.length; ++i) + $root.google.privacy.dlp.v2.FieldId.encode(message.quasiIds[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.sensitiveAttribute != null && Object.hasOwnProperty.call(message, "sensitiveAttribute")) + $root.google.privacy.dlp.v2.FieldId.encode(message.sensitiveAttribute, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified LDiversityConfig message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.PrivacyMetric.LDiversityConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.PrivacyMetric.LDiversityConfig + * @static + * @param {google.privacy.dlp.v2.PrivacyMetric.ILDiversityConfig} message LDiversityConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LDiversityConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LDiversityConfig message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.PrivacyMetric.LDiversityConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.PrivacyMetric.LDiversityConfig} LDiversityConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LDiversityConfig.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.privacy.dlp.v2.PrivacyMetric.LDiversityConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.quasiIds && message.quasiIds.length)) + message.quasiIds = []; + message.quasiIds.push($root.google.privacy.dlp.v2.FieldId.decode(reader, reader.uint32())); + break; + case 2: + message.sensitiveAttribute = $root.google.privacy.dlp.v2.FieldId.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LDiversityConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.PrivacyMetric.LDiversityConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.PrivacyMetric.LDiversityConfig} LDiversityConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LDiversityConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LDiversityConfig message. + * @function verify + * @memberof google.privacy.dlp.v2.PrivacyMetric.LDiversityConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LDiversityConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.quasiIds != null && message.hasOwnProperty("quasiIds")) { + if (!Array.isArray(message.quasiIds)) + return "quasiIds: array expected"; + for (var i = 0; i < message.quasiIds.length; ++i) { + var error = $root.google.privacy.dlp.v2.FieldId.verify(message.quasiIds[i]); + if (error) + return "quasiIds." + error; + } + } + if (message.sensitiveAttribute != null && message.hasOwnProperty("sensitiveAttribute")) { + var error = $root.google.privacy.dlp.v2.FieldId.verify(message.sensitiveAttribute); + if (error) + return "sensitiveAttribute." + error; + } + return null; + }; + + /** + * Creates a LDiversityConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.PrivacyMetric.LDiversityConfig + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.PrivacyMetric.LDiversityConfig} LDiversityConfig + */ + LDiversityConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.PrivacyMetric.LDiversityConfig) + return object; + var message = new $root.google.privacy.dlp.v2.PrivacyMetric.LDiversityConfig(); + if (object.quasiIds) { + if (!Array.isArray(object.quasiIds)) + throw TypeError(".google.privacy.dlp.v2.PrivacyMetric.LDiversityConfig.quasiIds: array expected"); + message.quasiIds = []; + for (var i = 0; i < object.quasiIds.length; ++i) { + if (typeof object.quasiIds[i] !== "object") + throw TypeError(".google.privacy.dlp.v2.PrivacyMetric.LDiversityConfig.quasiIds: object expected"); + message.quasiIds[i] = $root.google.privacy.dlp.v2.FieldId.fromObject(object.quasiIds[i]); + } + } + if (object.sensitiveAttribute != null) { + if (typeof object.sensitiveAttribute !== "object") + throw TypeError(".google.privacy.dlp.v2.PrivacyMetric.LDiversityConfig.sensitiveAttribute: object expected"); + message.sensitiveAttribute = $root.google.privacy.dlp.v2.FieldId.fromObject(object.sensitiveAttribute); + } + return message; + }; + + /** + * Creates a plain object from a LDiversityConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.PrivacyMetric.LDiversityConfig + * @static + * @param {google.privacy.dlp.v2.PrivacyMetric.LDiversityConfig} message LDiversityConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LDiversityConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.quasiIds = []; + if (options.defaults) + object.sensitiveAttribute = null; + if (message.quasiIds && message.quasiIds.length) { + object.quasiIds = []; + for (var j = 0; j < message.quasiIds.length; ++j) + object.quasiIds[j] = $root.google.privacy.dlp.v2.FieldId.toObject(message.quasiIds[j], options); + } + if (message.sensitiveAttribute != null && message.hasOwnProperty("sensitiveAttribute")) + object.sensitiveAttribute = $root.google.privacy.dlp.v2.FieldId.toObject(message.sensitiveAttribute, options); + return object; + }; + + /** + * Converts this LDiversityConfig to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.PrivacyMetric.LDiversityConfig + * @instance + * @returns {Object.} JSON object + */ + LDiversityConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return LDiversityConfig; + })(); + + PrivacyMetric.KMapEstimationConfig = (function() { + + /** + * Properties of a KMapEstimationConfig. + * @memberof google.privacy.dlp.v2.PrivacyMetric + * @interface IKMapEstimationConfig + * @property {Array.|null} [quasiIds] KMapEstimationConfig quasiIds + * @property {string|null} [regionCode] KMapEstimationConfig regionCode + * @property {Array.|null} [auxiliaryTables] KMapEstimationConfig auxiliaryTables + */ + + /** + * Constructs a new KMapEstimationConfig. + * @memberof google.privacy.dlp.v2.PrivacyMetric + * @classdesc Represents a KMapEstimationConfig. + * @implements IKMapEstimationConfig + * @constructor + * @param {google.privacy.dlp.v2.PrivacyMetric.IKMapEstimationConfig=} [properties] Properties to set + */ + function KMapEstimationConfig(properties) { + this.quasiIds = []; + this.auxiliaryTables = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * KMapEstimationConfig quasiIds. + * @member {Array.} quasiIds + * @memberof google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig + * @instance + */ + KMapEstimationConfig.prototype.quasiIds = $util.emptyArray; + + /** + * KMapEstimationConfig regionCode. + * @member {string} regionCode + * @memberof google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig + * @instance + */ + KMapEstimationConfig.prototype.regionCode = ""; + + /** + * KMapEstimationConfig auxiliaryTables. + * @member {Array.} auxiliaryTables + * @memberof google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig + * @instance + */ + KMapEstimationConfig.prototype.auxiliaryTables = $util.emptyArray; + + /** + * Creates a new KMapEstimationConfig instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig + * @static + * @param {google.privacy.dlp.v2.PrivacyMetric.IKMapEstimationConfig=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig} KMapEstimationConfig instance + */ + KMapEstimationConfig.create = function create(properties) { + return new KMapEstimationConfig(properties); + }; + + /** + * Encodes the specified KMapEstimationConfig message. Does not implicitly {@link google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig + * @static + * @param {google.privacy.dlp.v2.PrivacyMetric.IKMapEstimationConfig} message KMapEstimationConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KMapEstimationConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.quasiIds != null && message.quasiIds.length) + for (var i = 0; i < message.quasiIds.length; ++i) + $root.google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.TaggedField.encode(message.quasiIds[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.regionCode != null && Object.hasOwnProperty.call(message, "regionCode")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.regionCode); + if (message.auxiliaryTables != null && message.auxiliaryTables.length) + for (var i = 0; i < message.auxiliaryTables.length; ++i) + $root.google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.AuxiliaryTable.encode(message.auxiliaryTables[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified KMapEstimationConfig message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig + * @static + * @param {google.privacy.dlp.v2.PrivacyMetric.IKMapEstimationConfig} message KMapEstimationConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KMapEstimationConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a KMapEstimationConfig message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig} KMapEstimationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KMapEstimationConfig.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.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.quasiIds && message.quasiIds.length)) + message.quasiIds = []; + message.quasiIds.push($root.google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.TaggedField.decode(reader, reader.uint32())); + break; + case 2: + message.regionCode = reader.string(); + break; + case 3: + if (!(message.auxiliaryTables && message.auxiliaryTables.length)) + message.auxiliaryTables = []; + message.auxiliaryTables.push($root.google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.AuxiliaryTable.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a KMapEstimationConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig} KMapEstimationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KMapEstimationConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a KMapEstimationConfig message. + * @function verify + * @memberof google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + KMapEstimationConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.quasiIds != null && message.hasOwnProperty("quasiIds")) { + if (!Array.isArray(message.quasiIds)) + return "quasiIds: array expected"; + for (var i = 0; i < message.quasiIds.length; ++i) { + var error = $root.google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.TaggedField.verify(message.quasiIds[i]); + if (error) + return "quasiIds." + error; + } + } + if (message.regionCode != null && message.hasOwnProperty("regionCode")) + if (!$util.isString(message.regionCode)) + return "regionCode: string expected"; + if (message.auxiliaryTables != null && message.hasOwnProperty("auxiliaryTables")) { + if (!Array.isArray(message.auxiliaryTables)) + return "auxiliaryTables: array expected"; + for (var i = 0; i < message.auxiliaryTables.length; ++i) { + var error = $root.google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.AuxiliaryTable.verify(message.auxiliaryTables[i]); + if (error) + return "auxiliaryTables." + error; + } + } + return null; + }; + + /** + * Creates a KMapEstimationConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig} KMapEstimationConfig + */ + KMapEstimationConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig) + return object; + var message = new $root.google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig(); + if (object.quasiIds) { + if (!Array.isArray(object.quasiIds)) + throw TypeError(".google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.quasiIds: array expected"); + message.quasiIds = []; + for (var i = 0; i < object.quasiIds.length; ++i) { + if (typeof object.quasiIds[i] !== "object") + throw TypeError(".google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.quasiIds: object expected"); + message.quasiIds[i] = $root.google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.TaggedField.fromObject(object.quasiIds[i]); + } + } + if (object.regionCode != null) + message.regionCode = String(object.regionCode); + if (object.auxiliaryTables) { + if (!Array.isArray(object.auxiliaryTables)) + throw TypeError(".google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.auxiliaryTables: array expected"); + message.auxiliaryTables = []; + for (var i = 0; i < object.auxiliaryTables.length; ++i) { + if (typeof object.auxiliaryTables[i] !== "object") + throw TypeError(".google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.auxiliaryTables: object expected"); + message.auxiliaryTables[i] = $root.google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.AuxiliaryTable.fromObject(object.auxiliaryTables[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a KMapEstimationConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig + * @static + * @param {google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig} message KMapEstimationConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + KMapEstimationConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.quasiIds = []; + object.auxiliaryTables = []; + } + if (options.defaults) + object.regionCode = ""; + if (message.quasiIds && message.quasiIds.length) { + object.quasiIds = []; + for (var j = 0; j < message.quasiIds.length; ++j) + object.quasiIds[j] = $root.google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.TaggedField.toObject(message.quasiIds[j], options); + } + if (message.regionCode != null && message.hasOwnProperty("regionCode")) + object.regionCode = message.regionCode; + if (message.auxiliaryTables && message.auxiliaryTables.length) { + object.auxiliaryTables = []; + for (var j = 0; j < message.auxiliaryTables.length; ++j) + object.auxiliaryTables[j] = $root.google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.AuxiliaryTable.toObject(message.auxiliaryTables[j], options); + } + return object; + }; + + /** + * Converts this KMapEstimationConfig to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig + * @instance + * @returns {Object.} JSON object + */ + KMapEstimationConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + KMapEstimationConfig.TaggedField = (function() { + + /** + * Properties of a TaggedField. + * @memberof google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig + * @interface ITaggedField + * @property {google.privacy.dlp.v2.IFieldId|null} [field] TaggedField field + * @property {google.privacy.dlp.v2.IInfoType|null} [infoType] TaggedField infoType + * @property {string|null} [customTag] TaggedField customTag + * @property {google.protobuf.IEmpty|null} [inferred] TaggedField inferred + */ + + /** + * Constructs a new TaggedField. + * @memberof google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig + * @classdesc Represents a TaggedField. + * @implements ITaggedField + * @constructor + * @param {google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.ITaggedField=} [properties] Properties to set + */ + function TaggedField(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TaggedField field. + * @member {google.privacy.dlp.v2.IFieldId|null|undefined} field + * @memberof google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.TaggedField + * @instance + */ + TaggedField.prototype.field = null; + + /** + * TaggedField infoType. + * @member {google.privacy.dlp.v2.IInfoType|null|undefined} infoType + * @memberof google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.TaggedField + * @instance + */ + TaggedField.prototype.infoType = null; + + /** + * TaggedField customTag. + * @member {string} customTag + * @memberof google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.TaggedField + * @instance + */ + TaggedField.prototype.customTag = ""; + + /** + * TaggedField inferred. + * @member {google.protobuf.IEmpty|null|undefined} inferred + * @memberof google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.TaggedField + * @instance + */ + TaggedField.prototype.inferred = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * TaggedField tag. + * @member {"infoType"|"customTag"|"inferred"|undefined} tag + * @memberof google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.TaggedField + * @instance + */ + Object.defineProperty(TaggedField.prototype, "tag", { + get: $util.oneOfGetter($oneOfFields = ["infoType", "customTag", "inferred"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TaggedField instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.TaggedField + * @static + * @param {google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.ITaggedField=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.TaggedField} TaggedField instance + */ + TaggedField.create = function create(properties) { + return new TaggedField(properties); + }; + + /** + * Encodes the specified TaggedField message. Does not implicitly {@link google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.TaggedField.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.TaggedField + * @static + * @param {google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.ITaggedField} message TaggedField message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TaggedField.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.field != null && Object.hasOwnProperty.call(message, "field")) + $root.google.privacy.dlp.v2.FieldId.encode(message.field, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.infoType != null && Object.hasOwnProperty.call(message, "infoType")) + $root.google.privacy.dlp.v2.InfoType.encode(message.infoType, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.customTag != null && Object.hasOwnProperty.call(message, "customTag")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.customTag); + if (message.inferred != null && Object.hasOwnProperty.call(message, "inferred")) + $root.google.protobuf.Empty.encode(message.inferred, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TaggedField message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.TaggedField.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.TaggedField + * @static + * @param {google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.ITaggedField} message TaggedField message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TaggedField.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TaggedField message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.TaggedField + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.TaggedField} TaggedField + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TaggedField.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.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.TaggedField(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.field = $root.google.privacy.dlp.v2.FieldId.decode(reader, reader.uint32()); + break; + case 2: + message.infoType = $root.google.privacy.dlp.v2.InfoType.decode(reader, reader.uint32()); + break; + case 3: + message.customTag = reader.string(); + break; + case 4: + message.inferred = $root.google.protobuf.Empty.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TaggedField message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.TaggedField + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.TaggedField} TaggedField + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TaggedField.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TaggedField message. + * @function verify + * @memberof google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.TaggedField + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TaggedField.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.field != null && message.hasOwnProperty("field")) { + var error = $root.google.privacy.dlp.v2.FieldId.verify(message.field); + if (error) + return "field." + error; + } + if (message.infoType != null && message.hasOwnProperty("infoType")) { + properties.tag = 1; + { + var error = $root.google.privacy.dlp.v2.InfoType.verify(message.infoType); + if (error) + return "infoType." + error; + } + } + if (message.customTag != null && message.hasOwnProperty("customTag")) { + if (properties.tag === 1) + return "tag: multiple values"; + properties.tag = 1; + if (!$util.isString(message.customTag)) + return "customTag: string expected"; + } + if (message.inferred != null && message.hasOwnProperty("inferred")) { + if (properties.tag === 1) + return "tag: multiple values"; + properties.tag = 1; + { + var error = $root.google.protobuf.Empty.verify(message.inferred); + if (error) + return "inferred." + error; + } + } + return null; + }; + + /** + * Creates a TaggedField message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.TaggedField + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.TaggedField} TaggedField + */ + TaggedField.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.TaggedField) + return object; + var message = new $root.google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.TaggedField(); + if (object.field != null) { + if (typeof object.field !== "object") + throw TypeError(".google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.TaggedField.field: object expected"); + message.field = $root.google.privacy.dlp.v2.FieldId.fromObject(object.field); + } + if (object.infoType != null) { + if (typeof object.infoType !== "object") + throw TypeError(".google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.TaggedField.infoType: object expected"); + message.infoType = $root.google.privacy.dlp.v2.InfoType.fromObject(object.infoType); + } + if (object.customTag != null) + message.customTag = String(object.customTag); + if (object.inferred != null) { + if (typeof object.inferred !== "object") + throw TypeError(".google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.TaggedField.inferred: object expected"); + message.inferred = $root.google.protobuf.Empty.fromObject(object.inferred); + } + return message; + }; + + /** + * Creates a plain object from a TaggedField message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.TaggedField + * @static + * @param {google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.TaggedField} message TaggedField + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TaggedField.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.field = null; + if (message.field != null && message.hasOwnProperty("field")) + object.field = $root.google.privacy.dlp.v2.FieldId.toObject(message.field, options); + if (message.infoType != null && message.hasOwnProperty("infoType")) { + object.infoType = $root.google.privacy.dlp.v2.InfoType.toObject(message.infoType, options); + if (options.oneofs) + object.tag = "infoType"; + } + if (message.customTag != null && message.hasOwnProperty("customTag")) { + object.customTag = message.customTag; + if (options.oneofs) + object.tag = "customTag"; + } + if (message.inferred != null && message.hasOwnProperty("inferred")) { + object.inferred = $root.google.protobuf.Empty.toObject(message.inferred, options); + if (options.oneofs) + object.tag = "inferred"; + } + return object; + }; + + /** + * Converts this TaggedField to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.TaggedField + * @instance + * @returns {Object.} JSON object + */ + TaggedField.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TaggedField; + })(); + + KMapEstimationConfig.AuxiliaryTable = (function() { + + /** + * Properties of an AuxiliaryTable. + * @memberof google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig + * @interface IAuxiliaryTable + * @property {google.privacy.dlp.v2.IBigQueryTable|null} [table] AuxiliaryTable table + * @property {Array.|null} [quasiIds] AuxiliaryTable quasiIds + * @property {google.privacy.dlp.v2.IFieldId|null} [relativeFrequency] AuxiliaryTable relativeFrequency + */ + + /** + * Constructs a new AuxiliaryTable. + * @memberof google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig + * @classdesc Represents an AuxiliaryTable. + * @implements IAuxiliaryTable + * @constructor + * @param {google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.IAuxiliaryTable=} [properties] Properties to set + */ + function AuxiliaryTable(properties) { + this.quasiIds = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AuxiliaryTable table. + * @member {google.privacy.dlp.v2.IBigQueryTable|null|undefined} table + * @memberof google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.AuxiliaryTable + * @instance + */ + AuxiliaryTable.prototype.table = null; + + /** + * AuxiliaryTable quasiIds. + * @member {Array.} quasiIds + * @memberof google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.AuxiliaryTable + * @instance + */ + AuxiliaryTable.prototype.quasiIds = $util.emptyArray; + + /** + * AuxiliaryTable relativeFrequency. + * @member {google.privacy.dlp.v2.IFieldId|null|undefined} relativeFrequency + * @memberof google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.AuxiliaryTable + * @instance + */ + AuxiliaryTable.prototype.relativeFrequency = null; + + /** + * Creates a new AuxiliaryTable instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.AuxiliaryTable + * @static + * @param {google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.IAuxiliaryTable=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.AuxiliaryTable} AuxiliaryTable instance + */ + AuxiliaryTable.create = function create(properties) { + return new AuxiliaryTable(properties); + }; + + /** + * Encodes the specified AuxiliaryTable message. Does not implicitly {@link google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.AuxiliaryTable.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.AuxiliaryTable + * @static + * @param {google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.IAuxiliaryTable} message AuxiliaryTable message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuxiliaryTable.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.quasiIds != null && message.quasiIds.length) + for (var i = 0; i < message.quasiIds.length; ++i) + $root.google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.AuxiliaryTable.QuasiIdField.encode(message.quasiIds[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.relativeFrequency != null && Object.hasOwnProperty.call(message, "relativeFrequency")) + $root.google.privacy.dlp.v2.FieldId.encode(message.relativeFrequency, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.table != null && Object.hasOwnProperty.call(message, "table")) + $root.google.privacy.dlp.v2.BigQueryTable.encode(message.table, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AuxiliaryTable message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.AuxiliaryTable.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.AuxiliaryTable + * @static + * @param {google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.IAuxiliaryTable} message AuxiliaryTable message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuxiliaryTable.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AuxiliaryTable message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.AuxiliaryTable + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.AuxiliaryTable} AuxiliaryTable + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuxiliaryTable.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.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.AuxiliaryTable(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: + message.table = $root.google.privacy.dlp.v2.BigQueryTable.decode(reader, reader.uint32()); + break; + case 1: + if (!(message.quasiIds && message.quasiIds.length)) + message.quasiIds = []; + message.quasiIds.push($root.google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.AuxiliaryTable.QuasiIdField.decode(reader, reader.uint32())); + break; + case 2: + message.relativeFrequency = $root.google.privacy.dlp.v2.FieldId.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AuxiliaryTable message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.AuxiliaryTable + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.AuxiliaryTable} AuxiliaryTable + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuxiliaryTable.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AuxiliaryTable message. + * @function verify + * @memberof google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.AuxiliaryTable + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AuxiliaryTable.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.table != null && message.hasOwnProperty("table")) { + var error = $root.google.privacy.dlp.v2.BigQueryTable.verify(message.table); + if (error) + return "table." + error; + } + if (message.quasiIds != null && message.hasOwnProperty("quasiIds")) { + if (!Array.isArray(message.quasiIds)) + return "quasiIds: array expected"; + for (var i = 0; i < message.quasiIds.length; ++i) { + var error = $root.google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.AuxiliaryTable.QuasiIdField.verify(message.quasiIds[i]); + if (error) + return "quasiIds." + error; + } + } + if (message.relativeFrequency != null && message.hasOwnProperty("relativeFrequency")) { + var error = $root.google.privacy.dlp.v2.FieldId.verify(message.relativeFrequency); + if (error) + return "relativeFrequency." + error; + } + return null; + }; + + /** + * Creates an AuxiliaryTable message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.AuxiliaryTable + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.AuxiliaryTable} AuxiliaryTable + */ + AuxiliaryTable.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.AuxiliaryTable) + return object; + var message = new $root.google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.AuxiliaryTable(); + if (object.table != null) { + if (typeof object.table !== "object") + throw TypeError(".google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.AuxiliaryTable.table: object expected"); + message.table = $root.google.privacy.dlp.v2.BigQueryTable.fromObject(object.table); + } + if (object.quasiIds) { + if (!Array.isArray(object.quasiIds)) + throw TypeError(".google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.AuxiliaryTable.quasiIds: array expected"); + message.quasiIds = []; + for (var i = 0; i < object.quasiIds.length; ++i) { + if (typeof object.quasiIds[i] !== "object") + throw TypeError(".google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.AuxiliaryTable.quasiIds: object expected"); + message.quasiIds[i] = $root.google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.AuxiliaryTable.QuasiIdField.fromObject(object.quasiIds[i]); + } + } + if (object.relativeFrequency != null) { + if (typeof object.relativeFrequency !== "object") + throw TypeError(".google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.AuxiliaryTable.relativeFrequency: object expected"); + message.relativeFrequency = $root.google.privacy.dlp.v2.FieldId.fromObject(object.relativeFrequency); + } + return message; + }; + + /** + * Creates a plain object from an AuxiliaryTable message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.AuxiliaryTable + * @static + * @param {google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.AuxiliaryTable} message AuxiliaryTable + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AuxiliaryTable.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.quasiIds = []; + if (options.defaults) { + object.relativeFrequency = null; + object.table = null; + } + if (message.quasiIds && message.quasiIds.length) { + object.quasiIds = []; + for (var j = 0; j < message.quasiIds.length; ++j) + object.quasiIds[j] = $root.google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.AuxiliaryTable.QuasiIdField.toObject(message.quasiIds[j], options); + } + if (message.relativeFrequency != null && message.hasOwnProperty("relativeFrequency")) + object.relativeFrequency = $root.google.privacy.dlp.v2.FieldId.toObject(message.relativeFrequency, options); + if (message.table != null && message.hasOwnProperty("table")) + object.table = $root.google.privacy.dlp.v2.BigQueryTable.toObject(message.table, options); + return object; + }; + + /** + * Converts this AuxiliaryTable to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.AuxiliaryTable + * @instance + * @returns {Object.} JSON object + */ + AuxiliaryTable.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + AuxiliaryTable.QuasiIdField = (function() { + + /** + * Properties of a QuasiIdField. + * @memberof google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.AuxiliaryTable + * @interface IQuasiIdField + * @property {google.privacy.dlp.v2.IFieldId|null} [field] QuasiIdField field + * @property {string|null} [customTag] QuasiIdField customTag + */ + + /** + * Constructs a new QuasiIdField. + * @memberof google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.AuxiliaryTable + * @classdesc Represents a QuasiIdField. + * @implements IQuasiIdField + * @constructor + * @param {google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.AuxiliaryTable.IQuasiIdField=} [properties] Properties to set + */ + function QuasiIdField(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QuasiIdField field. + * @member {google.privacy.dlp.v2.IFieldId|null|undefined} field + * @memberof google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.AuxiliaryTable.QuasiIdField + * @instance + */ + QuasiIdField.prototype.field = null; + + /** + * QuasiIdField customTag. + * @member {string} customTag + * @memberof google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.AuxiliaryTable.QuasiIdField + * @instance + */ + QuasiIdField.prototype.customTag = ""; + + /** + * Creates a new QuasiIdField instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.AuxiliaryTable.QuasiIdField + * @static + * @param {google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.AuxiliaryTable.IQuasiIdField=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.AuxiliaryTable.QuasiIdField} QuasiIdField instance + */ + QuasiIdField.create = function create(properties) { + return new QuasiIdField(properties); + }; + + /** + * Encodes the specified QuasiIdField message. Does not implicitly {@link google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.AuxiliaryTable.QuasiIdField.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.AuxiliaryTable.QuasiIdField + * @static + * @param {google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.AuxiliaryTable.IQuasiIdField} message QuasiIdField message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QuasiIdField.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.field != null && Object.hasOwnProperty.call(message, "field")) + $root.google.privacy.dlp.v2.FieldId.encode(message.field, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.customTag != null && Object.hasOwnProperty.call(message, "customTag")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.customTag); + return writer; + }; + + /** + * Encodes the specified QuasiIdField message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.AuxiliaryTable.QuasiIdField.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.AuxiliaryTable.QuasiIdField + * @static + * @param {google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.AuxiliaryTable.IQuasiIdField} message QuasiIdField message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QuasiIdField.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QuasiIdField message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.AuxiliaryTable.QuasiIdField + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.AuxiliaryTable.QuasiIdField} QuasiIdField + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QuasiIdField.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.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.AuxiliaryTable.QuasiIdField(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.field = $root.google.privacy.dlp.v2.FieldId.decode(reader, reader.uint32()); + break; + case 2: + message.customTag = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QuasiIdField message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.AuxiliaryTable.QuasiIdField + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.AuxiliaryTable.QuasiIdField} QuasiIdField + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QuasiIdField.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QuasiIdField message. + * @function verify + * @memberof google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.AuxiliaryTable.QuasiIdField + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QuasiIdField.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.field != null && message.hasOwnProperty("field")) { + var error = $root.google.privacy.dlp.v2.FieldId.verify(message.field); + if (error) + return "field." + error; + } + if (message.customTag != null && message.hasOwnProperty("customTag")) + if (!$util.isString(message.customTag)) + return "customTag: string expected"; + return null; + }; + + /** + * Creates a QuasiIdField message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.AuxiliaryTable.QuasiIdField + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.AuxiliaryTable.QuasiIdField} QuasiIdField + */ + QuasiIdField.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.AuxiliaryTable.QuasiIdField) + return object; + var message = new $root.google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.AuxiliaryTable.QuasiIdField(); + if (object.field != null) { + if (typeof object.field !== "object") + throw TypeError(".google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.AuxiliaryTable.QuasiIdField.field: object expected"); + message.field = $root.google.privacy.dlp.v2.FieldId.fromObject(object.field); + } + if (object.customTag != null) + message.customTag = String(object.customTag); + return message; + }; + + /** + * Creates a plain object from a QuasiIdField message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.AuxiliaryTable.QuasiIdField + * @static + * @param {google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.AuxiliaryTable.QuasiIdField} message QuasiIdField + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QuasiIdField.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.field = null; + object.customTag = ""; + } + if (message.field != null && message.hasOwnProperty("field")) + object.field = $root.google.privacy.dlp.v2.FieldId.toObject(message.field, options); + if (message.customTag != null && message.hasOwnProperty("customTag")) + object.customTag = message.customTag; + return object; + }; + + /** + * Converts this QuasiIdField to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.AuxiliaryTable.QuasiIdField + * @instance + * @returns {Object.} JSON object + */ + QuasiIdField.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QuasiIdField; + })(); + + return AuxiliaryTable; + })(); + + return KMapEstimationConfig; + })(); + + PrivacyMetric.DeltaPresenceEstimationConfig = (function() { + + /** + * Properties of a DeltaPresenceEstimationConfig. + * @memberof google.privacy.dlp.v2.PrivacyMetric + * @interface IDeltaPresenceEstimationConfig + * @property {Array.|null} [quasiIds] DeltaPresenceEstimationConfig quasiIds + * @property {string|null} [regionCode] DeltaPresenceEstimationConfig regionCode + * @property {Array.|null} [auxiliaryTables] DeltaPresenceEstimationConfig auxiliaryTables + */ + + /** + * Constructs a new DeltaPresenceEstimationConfig. + * @memberof google.privacy.dlp.v2.PrivacyMetric + * @classdesc Represents a DeltaPresenceEstimationConfig. + * @implements IDeltaPresenceEstimationConfig + * @constructor + * @param {google.privacy.dlp.v2.PrivacyMetric.IDeltaPresenceEstimationConfig=} [properties] Properties to set + */ + function DeltaPresenceEstimationConfig(properties) { + this.quasiIds = []; + this.auxiliaryTables = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeltaPresenceEstimationConfig quasiIds. + * @member {Array.} quasiIds + * @memberof google.privacy.dlp.v2.PrivacyMetric.DeltaPresenceEstimationConfig + * @instance + */ + DeltaPresenceEstimationConfig.prototype.quasiIds = $util.emptyArray; + + /** + * DeltaPresenceEstimationConfig regionCode. + * @member {string} regionCode + * @memberof google.privacy.dlp.v2.PrivacyMetric.DeltaPresenceEstimationConfig + * @instance + */ + DeltaPresenceEstimationConfig.prototype.regionCode = ""; + + /** + * DeltaPresenceEstimationConfig auxiliaryTables. + * @member {Array.} auxiliaryTables + * @memberof google.privacy.dlp.v2.PrivacyMetric.DeltaPresenceEstimationConfig + * @instance + */ + DeltaPresenceEstimationConfig.prototype.auxiliaryTables = $util.emptyArray; + + /** + * Creates a new DeltaPresenceEstimationConfig instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.PrivacyMetric.DeltaPresenceEstimationConfig + * @static + * @param {google.privacy.dlp.v2.PrivacyMetric.IDeltaPresenceEstimationConfig=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.PrivacyMetric.DeltaPresenceEstimationConfig} DeltaPresenceEstimationConfig instance + */ + DeltaPresenceEstimationConfig.create = function create(properties) { + return new DeltaPresenceEstimationConfig(properties); + }; + + /** + * Encodes the specified DeltaPresenceEstimationConfig message. Does not implicitly {@link google.privacy.dlp.v2.PrivacyMetric.DeltaPresenceEstimationConfig.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.PrivacyMetric.DeltaPresenceEstimationConfig + * @static + * @param {google.privacy.dlp.v2.PrivacyMetric.IDeltaPresenceEstimationConfig} message DeltaPresenceEstimationConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeltaPresenceEstimationConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.quasiIds != null && message.quasiIds.length) + for (var i = 0; i < message.quasiIds.length; ++i) + $root.google.privacy.dlp.v2.QuasiId.encode(message.quasiIds[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.regionCode != null && Object.hasOwnProperty.call(message, "regionCode")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.regionCode); + if (message.auxiliaryTables != null && message.auxiliaryTables.length) + for (var i = 0; i < message.auxiliaryTables.length; ++i) + $root.google.privacy.dlp.v2.StatisticalTable.encode(message.auxiliaryTables[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DeltaPresenceEstimationConfig message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.PrivacyMetric.DeltaPresenceEstimationConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.PrivacyMetric.DeltaPresenceEstimationConfig + * @static + * @param {google.privacy.dlp.v2.PrivacyMetric.IDeltaPresenceEstimationConfig} message DeltaPresenceEstimationConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeltaPresenceEstimationConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeltaPresenceEstimationConfig message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.PrivacyMetric.DeltaPresenceEstimationConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.PrivacyMetric.DeltaPresenceEstimationConfig} DeltaPresenceEstimationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeltaPresenceEstimationConfig.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.privacy.dlp.v2.PrivacyMetric.DeltaPresenceEstimationConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.quasiIds && message.quasiIds.length)) + message.quasiIds = []; + message.quasiIds.push($root.google.privacy.dlp.v2.QuasiId.decode(reader, reader.uint32())); + break; + case 2: + message.regionCode = reader.string(); + break; + case 3: + if (!(message.auxiliaryTables && message.auxiliaryTables.length)) + message.auxiliaryTables = []; + message.auxiliaryTables.push($root.google.privacy.dlp.v2.StatisticalTable.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeltaPresenceEstimationConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.PrivacyMetric.DeltaPresenceEstimationConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.PrivacyMetric.DeltaPresenceEstimationConfig} DeltaPresenceEstimationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeltaPresenceEstimationConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeltaPresenceEstimationConfig message. + * @function verify + * @memberof google.privacy.dlp.v2.PrivacyMetric.DeltaPresenceEstimationConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeltaPresenceEstimationConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.quasiIds != null && message.hasOwnProperty("quasiIds")) { + if (!Array.isArray(message.quasiIds)) + return "quasiIds: array expected"; + for (var i = 0; i < message.quasiIds.length; ++i) { + var error = $root.google.privacy.dlp.v2.QuasiId.verify(message.quasiIds[i]); + if (error) + return "quasiIds." + error; + } + } + if (message.regionCode != null && message.hasOwnProperty("regionCode")) + if (!$util.isString(message.regionCode)) + return "regionCode: string expected"; + if (message.auxiliaryTables != null && message.hasOwnProperty("auxiliaryTables")) { + if (!Array.isArray(message.auxiliaryTables)) + return "auxiliaryTables: array expected"; + for (var i = 0; i < message.auxiliaryTables.length; ++i) { + var error = $root.google.privacy.dlp.v2.StatisticalTable.verify(message.auxiliaryTables[i]); + if (error) + return "auxiliaryTables." + error; + } + } + return null; + }; + + /** + * Creates a DeltaPresenceEstimationConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.PrivacyMetric.DeltaPresenceEstimationConfig + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.PrivacyMetric.DeltaPresenceEstimationConfig} DeltaPresenceEstimationConfig + */ + DeltaPresenceEstimationConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.PrivacyMetric.DeltaPresenceEstimationConfig) + return object; + var message = new $root.google.privacy.dlp.v2.PrivacyMetric.DeltaPresenceEstimationConfig(); + if (object.quasiIds) { + if (!Array.isArray(object.quasiIds)) + throw TypeError(".google.privacy.dlp.v2.PrivacyMetric.DeltaPresenceEstimationConfig.quasiIds: array expected"); + message.quasiIds = []; + for (var i = 0; i < object.quasiIds.length; ++i) { + if (typeof object.quasiIds[i] !== "object") + throw TypeError(".google.privacy.dlp.v2.PrivacyMetric.DeltaPresenceEstimationConfig.quasiIds: object expected"); + message.quasiIds[i] = $root.google.privacy.dlp.v2.QuasiId.fromObject(object.quasiIds[i]); + } + } + if (object.regionCode != null) + message.regionCode = String(object.regionCode); + if (object.auxiliaryTables) { + if (!Array.isArray(object.auxiliaryTables)) + throw TypeError(".google.privacy.dlp.v2.PrivacyMetric.DeltaPresenceEstimationConfig.auxiliaryTables: array expected"); + message.auxiliaryTables = []; + for (var i = 0; i < object.auxiliaryTables.length; ++i) { + if (typeof object.auxiliaryTables[i] !== "object") + throw TypeError(".google.privacy.dlp.v2.PrivacyMetric.DeltaPresenceEstimationConfig.auxiliaryTables: object expected"); + message.auxiliaryTables[i] = $root.google.privacy.dlp.v2.StatisticalTable.fromObject(object.auxiliaryTables[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a DeltaPresenceEstimationConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.PrivacyMetric.DeltaPresenceEstimationConfig + * @static + * @param {google.privacy.dlp.v2.PrivacyMetric.DeltaPresenceEstimationConfig} message DeltaPresenceEstimationConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeltaPresenceEstimationConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.quasiIds = []; + object.auxiliaryTables = []; + } + if (options.defaults) + object.regionCode = ""; + if (message.quasiIds && message.quasiIds.length) { + object.quasiIds = []; + for (var j = 0; j < message.quasiIds.length; ++j) + object.quasiIds[j] = $root.google.privacy.dlp.v2.QuasiId.toObject(message.quasiIds[j], options); + } + if (message.regionCode != null && message.hasOwnProperty("regionCode")) + object.regionCode = message.regionCode; + if (message.auxiliaryTables && message.auxiliaryTables.length) { + object.auxiliaryTables = []; + for (var j = 0; j < message.auxiliaryTables.length; ++j) + object.auxiliaryTables[j] = $root.google.privacy.dlp.v2.StatisticalTable.toObject(message.auxiliaryTables[j], options); + } + return object; + }; + + /** + * Converts this DeltaPresenceEstimationConfig to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.PrivacyMetric.DeltaPresenceEstimationConfig + * @instance + * @returns {Object.} JSON object + */ + DeltaPresenceEstimationConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeltaPresenceEstimationConfig; + })(); + + return PrivacyMetric; + })(); + + v2.AnalyzeDataSourceRiskDetails = (function() { + + /** + * Properties of an AnalyzeDataSourceRiskDetails. + * @memberof google.privacy.dlp.v2 + * @interface IAnalyzeDataSourceRiskDetails + * @property {google.privacy.dlp.v2.IPrivacyMetric|null} [requestedPrivacyMetric] AnalyzeDataSourceRiskDetails requestedPrivacyMetric + * @property {google.privacy.dlp.v2.IBigQueryTable|null} [requestedSourceTable] AnalyzeDataSourceRiskDetails requestedSourceTable + * @property {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.INumericalStatsResult|null} [numericalStatsResult] AnalyzeDataSourceRiskDetails numericalStatsResult + * @property {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.ICategoricalStatsResult|null} [categoricalStatsResult] AnalyzeDataSourceRiskDetails categoricalStatsResult + * @property {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.IKAnonymityResult|null} [kAnonymityResult] AnalyzeDataSourceRiskDetails kAnonymityResult + * @property {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.ILDiversityResult|null} [lDiversityResult] AnalyzeDataSourceRiskDetails lDiversityResult + * @property {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.IKMapEstimationResult|null} [kMapEstimationResult] AnalyzeDataSourceRiskDetails kMapEstimationResult + * @property {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.IDeltaPresenceEstimationResult|null} [deltaPresenceEstimationResult] AnalyzeDataSourceRiskDetails deltaPresenceEstimationResult + * @property {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.IRequestedRiskAnalysisOptions|null} [requestedOptions] AnalyzeDataSourceRiskDetails requestedOptions + */ + + /** + * Constructs a new AnalyzeDataSourceRiskDetails. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents an AnalyzeDataSourceRiskDetails. + * @implements IAnalyzeDataSourceRiskDetails + * @constructor + * @param {google.privacy.dlp.v2.IAnalyzeDataSourceRiskDetails=} [properties] Properties to set + */ + function AnalyzeDataSourceRiskDetails(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AnalyzeDataSourceRiskDetails requestedPrivacyMetric. + * @member {google.privacy.dlp.v2.IPrivacyMetric|null|undefined} requestedPrivacyMetric + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails + * @instance + */ + AnalyzeDataSourceRiskDetails.prototype.requestedPrivacyMetric = null; + + /** + * AnalyzeDataSourceRiskDetails requestedSourceTable. + * @member {google.privacy.dlp.v2.IBigQueryTable|null|undefined} requestedSourceTable + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails + * @instance + */ + AnalyzeDataSourceRiskDetails.prototype.requestedSourceTable = null; + + /** + * AnalyzeDataSourceRiskDetails numericalStatsResult. + * @member {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.INumericalStatsResult|null|undefined} numericalStatsResult + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails + * @instance + */ + AnalyzeDataSourceRiskDetails.prototype.numericalStatsResult = null; + + /** + * AnalyzeDataSourceRiskDetails categoricalStatsResult. + * @member {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.ICategoricalStatsResult|null|undefined} categoricalStatsResult + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails + * @instance + */ + AnalyzeDataSourceRiskDetails.prototype.categoricalStatsResult = null; + + /** + * AnalyzeDataSourceRiskDetails kAnonymityResult. + * @member {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.IKAnonymityResult|null|undefined} kAnonymityResult + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails + * @instance + */ + AnalyzeDataSourceRiskDetails.prototype.kAnonymityResult = null; + + /** + * AnalyzeDataSourceRiskDetails lDiversityResult. + * @member {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.ILDiversityResult|null|undefined} lDiversityResult + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails + * @instance + */ + AnalyzeDataSourceRiskDetails.prototype.lDiversityResult = null; + + /** + * AnalyzeDataSourceRiskDetails kMapEstimationResult. + * @member {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.IKMapEstimationResult|null|undefined} kMapEstimationResult + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails + * @instance + */ + AnalyzeDataSourceRiskDetails.prototype.kMapEstimationResult = null; + + /** + * AnalyzeDataSourceRiskDetails deltaPresenceEstimationResult. + * @member {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.IDeltaPresenceEstimationResult|null|undefined} deltaPresenceEstimationResult + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails + * @instance + */ + AnalyzeDataSourceRiskDetails.prototype.deltaPresenceEstimationResult = null; + + /** + * AnalyzeDataSourceRiskDetails requestedOptions. + * @member {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.IRequestedRiskAnalysisOptions|null|undefined} requestedOptions + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails + * @instance + */ + AnalyzeDataSourceRiskDetails.prototype.requestedOptions = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AnalyzeDataSourceRiskDetails result. + * @member {"numericalStatsResult"|"categoricalStatsResult"|"kAnonymityResult"|"lDiversityResult"|"kMapEstimationResult"|"deltaPresenceEstimationResult"|undefined} result + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails + * @instance + */ + Object.defineProperty(AnalyzeDataSourceRiskDetails.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["numericalStatsResult", "categoricalStatsResult", "kAnonymityResult", "lDiversityResult", "kMapEstimationResult", "deltaPresenceEstimationResult"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AnalyzeDataSourceRiskDetails instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails + * @static + * @param {google.privacy.dlp.v2.IAnalyzeDataSourceRiskDetails=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails} AnalyzeDataSourceRiskDetails instance + */ + AnalyzeDataSourceRiskDetails.create = function create(properties) { + return new AnalyzeDataSourceRiskDetails(properties); + }; + + /** + * Encodes the specified AnalyzeDataSourceRiskDetails message. Does not implicitly {@link google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails + * @static + * @param {google.privacy.dlp.v2.IAnalyzeDataSourceRiskDetails} message AnalyzeDataSourceRiskDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnalyzeDataSourceRiskDetails.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestedPrivacyMetric != null && Object.hasOwnProperty.call(message, "requestedPrivacyMetric")) + $root.google.privacy.dlp.v2.PrivacyMetric.encode(message.requestedPrivacyMetric, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.requestedSourceTable != null && Object.hasOwnProperty.call(message, "requestedSourceTable")) + $root.google.privacy.dlp.v2.BigQueryTable.encode(message.requestedSourceTable, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.numericalStatsResult != null && Object.hasOwnProperty.call(message, "numericalStatsResult")) + $root.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.NumericalStatsResult.encode(message.numericalStatsResult, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.categoricalStatsResult != null && Object.hasOwnProperty.call(message, "categoricalStatsResult")) + $root.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.CategoricalStatsResult.encode(message.categoricalStatsResult, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.kAnonymityResult != null && Object.hasOwnProperty.call(message, "kAnonymityResult")) + $root.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResult.encode(message.kAnonymityResult, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.lDiversityResult != null && Object.hasOwnProperty.call(message, "lDiversityResult")) + $root.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.LDiversityResult.encode(message.lDiversityResult, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.kMapEstimationResult != null && Object.hasOwnProperty.call(message, "kMapEstimationResult")) + $root.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult.encode(message.kMapEstimationResult, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.deltaPresenceEstimationResult != null && Object.hasOwnProperty.call(message, "deltaPresenceEstimationResult")) + $root.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.DeltaPresenceEstimationResult.encode(message.deltaPresenceEstimationResult, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.requestedOptions != null && Object.hasOwnProperty.call(message, "requestedOptions")) + $root.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.RequestedRiskAnalysisOptions.encode(message.requestedOptions, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AnalyzeDataSourceRiskDetails message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails + * @static + * @param {google.privacy.dlp.v2.IAnalyzeDataSourceRiskDetails} message AnalyzeDataSourceRiskDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnalyzeDataSourceRiskDetails.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AnalyzeDataSourceRiskDetails message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails} AnalyzeDataSourceRiskDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnalyzeDataSourceRiskDetails.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.privacy.dlp.v2.AnalyzeDataSourceRiskDetails(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.requestedPrivacyMetric = $root.google.privacy.dlp.v2.PrivacyMetric.decode(reader, reader.uint32()); + break; + case 2: + message.requestedSourceTable = $root.google.privacy.dlp.v2.BigQueryTable.decode(reader, reader.uint32()); + break; + case 3: + message.numericalStatsResult = $root.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.NumericalStatsResult.decode(reader, reader.uint32()); + break; + case 4: + message.categoricalStatsResult = $root.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.CategoricalStatsResult.decode(reader, reader.uint32()); + break; + case 5: + message.kAnonymityResult = $root.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResult.decode(reader, reader.uint32()); + break; + case 6: + message.lDiversityResult = $root.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.LDiversityResult.decode(reader, reader.uint32()); + break; + case 7: + message.kMapEstimationResult = $root.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult.decode(reader, reader.uint32()); + break; + case 9: + message.deltaPresenceEstimationResult = $root.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.DeltaPresenceEstimationResult.decode(reader, reader.uint32()); + break; + case 10: + message.requestedOptions = $root.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.RequestedRiskAnalysisOptions.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AnalyzeDataSourceRiskDetails message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails} AnalyzeDataSourceRiskDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnalyzeDataSourceRiskDetails.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AnalyzeDataSourceRiskDetails message. + * @function verify + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AnalyzeDataSourceRiskDetails.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.requestedPrivacyMetric != null && message.hasOwnProperty("requestedPrivacyMetric")) { + var error = $root.google.privacy.dlp.v2.PrivacyMetric.verify(message.requestedPrivacyMetric); + if (error) + return "requestedPrivacyMetric." + error; + } + if (message.requestedSourceTable != null && message.hasOwnProperty("requestedSourceTable")) { + var error = $root.google.privacy.dlp.v2.BigQueryTable.verify(message.requestedSourceTable); + if (error) + return "requestedSourceTable." + error; + } + if (message.numericalStatsResult != null && message.hasOwnProperty("numericalStatsResult")) { + properties.result = 1; + { + var error = $root.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.NumericalStatsResult.verify(message.numericalStatsResult); + if (error) + return "numericalStatsResult." + error; + } + } + if (message.categoricalStatsResult != null && message.hasOwnProperty("categoricalStatsResult")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.CategoricalStatsResult.verify(message.categoricalStatsResult); + if (error) + return "categoricalStatsResult." + error; + } + } + if (message.kAnonymityResult != null && message.hasOwnProperty("kAnonymityResult")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResult.verify(message.kAnonymityResult); + if (error) + return "kAnonymityResult." + error; + } + } + if (message.lDiversityResult != null && message.hasOwnProperty("lDiversityResult")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.LDiversityResult.verify(message.lDiversityResult); + if (error) + return "lDiversityResult." + error; + } + } + if (message.kMapEstimationResult != null && message.hasOwnProperty("kMapEstimationResult")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult.verify(message.kMapEstimationResult); + if (error) + return "kMapEstimationResult." + error; + } + } + if (message.deltaPresenceEstimationResult != null && message.hasOwnProperty("deltaPresenceEstimationResult")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.DeltaPresenceEstimationResult.verify(message.deltaPresenceEstimationResult); + if (error) + return "deltaPresenceEstimationResult." + error; + } + } + if (message.requestedOptions != null && message.hasOwnProperty("requestedOptions")) { + var error = $root.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.RequestedRiskAnalysisOptions.verify(message.requestedOptions); + if (error) + return "requestedOptions." + error; + } + return null; + }; + + /** + * Creates an AnalyzeDataSourceRiskDetails message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails} AnalyzeDataSourceRiskDetails + */ + AnalyzeDataSourceRiskDetails.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails) + return object; + var message = new $root.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails(); + if (object.requestedPrivacyMetric != null) { + if (typeof object.requestedPrivacyMetric !== "object") + throw TypeError(".google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.requestedPrivacyMetric: object expected"); + message.requestedPrivacyMetric = $root.google.privacy.dlp.v2.PrivacyMetric.fromObject(object.requestedPrivacyMetric); + } + if (object.requestedSourceTable != null) { + if (typeof object.requestedSourceTable !== "object") + throw TypeError(".google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.requestedSourceTable: object expected"); + message.requestedSourceTable = $root.google.privacy.dlp.v2.BigQueryTable.fromObject(object.requestedSourceTable); + } + if (object.numericalStatsResult != null) { + if (typeof object.numericalStatsResult !== "object") + throw TypeError(".google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.numericalStatsResult: object expected"); + message.numericalStatsResult = $root.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.NumericalStatsResult.fromObject(object.numericalStatsResult); + } + if (object.categoricalStatsResult != null) { + if (typeof object.categoricalStatsResult !== "object") + throw TypeError(".google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.categoricalStatsResult: object expected"); + message.categoricalStatsResult = $root.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.CategoricalStatsResult.fromObject(object.categoricalStatsResult); + } + if (object.kAnonymityResult != null) { + if (typeof object.kAnonymityResult !== "object") + throw TypeError(".google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.kAnonymityResult: object expected"); + message.kAnonymityResult = $root.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResult.fromObject(object.kAnonymityResult); + } + if (object.lDiversityResult != null) { + if (typeof object.lDiversityResult !== "object") + throw TypeError(".google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.lDiversityResult: object expected"); + message.lDiversityResult = $root.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.LDiversityResult.fromObject(object.lDiversityResult); + } + if (object.kMapEstimationResult != null) { + if (typeof object.kMapEstimationResult !== "object") + throw TypeError(".google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.kMapEstimationResult: object expected"); + message.kMapEstimationResult = $root.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult.fromObject(object.kMapEstimationResult); + } + if (object.deltaPresenceEstimationResult != null) { + if (typeof object.deltaPresenceEstimationResult !== "object") + throw TypeError(".google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.deltaPresenceEstimationResult: object expected"); + message.deltaPresenceEstimationResult = $root.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.DeltaPresenceEstimationResult.fromObject(object.deltaPresenceEstimationResult); + } + if (object.requestedOptions != null) { + if (typeof object.requestedOptions !== "object") + throw TypeError(".google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.requestedOptions: object expected"); + message.requestedOptions = $root.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.RequestedRiskAnalysisOptions.fromObject(object.requestedOptions); + } + return message; + }; + + /** + * Creates a plain object from an AnalyzeDataSourceRiskDetails message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails + * @static + * @param {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails} message AnalyzeDataSourceRiskDetails + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AnalyzeDataSourceRiskDetails.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.requestedPrivacyMetric = null; + object.requestedSourceTable = null; + object.requestedOptions = null; + } + if (message.requestedPrivacyMetric != null && message.hasOwnProperty("requestedPrivacyMetric")) + object.requestedPrivacyMetric = $root.google.privacy.dlp.v2.PrivacyMetric.toObject(message.requestedPrivacyMetric, options); + if (message.requestedSourceTable != null && message.hasOwnProperty("requestedSourceTable")) + object.requestedSourceTable = $root.google.privacy.dlp.v2.BigQueryTable.toObject(message.requestedSourceTable, options); + if (message.numericalStatsResult != null && message.hasOwnProperty("numericalStatsResult")) { + object.numericalStatsResult = $root.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.NumericalStatsResult.toObject(message.numericalStatsResult, options); + if (options.oneofs) + object.result = "numericalStatsResult"; + } + if (message.categoricalStatsResult != null && message.hasOwnProperty("categoricalStatsResult")) { + object.categoricalStatsResult = $root.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.CategoricalStatsResult.toObject(message.categoricalStatsResult, options); + if (options.oneofs) + object.result = "categoricalStatsResult"; + } + if (message.kAnonymityResult != null && message.hasOwnProperty("kAnonymityResult")) { + object.kAnonymityResult = $root.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResult.toObject(message.kAnonymityResult, options); + if (options.oneofs) + object.result = "kAnonymityResult"; + } + if (message.lDiversityResult != null && message.hasOwnProperty("lDiversityResult")) { + object.lDiversityResult = $root.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.LDiversityResult.toObject(message.lDiversityResult, options); + if (options.oneofs) + object.result = "lDiversityResult"; + } + if (message.kMapEstimationResult != null && message.hasOwnProperty("kMapEstimationResult")) { + object.kMapEstimationResult = $root.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult.toObject(message.kMapEstimationResult, options); + if (options.oneofs) + object.result = "kMapEstimationResult"; + } + if (message.deltaPresenceEstimationResult != null && message.hasOwnProperty("deltaPresenceEstimationResult")) { + object.deltaPresenceEstimationResult = $root.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.DeltaPresenceEstimationResult.toObject(message.deltaPresenceEstimationResult, options); + if (options.oneofs) + object.result = "deltaPresenceEstimationResult"; + } + if (message.requestedOptions != null && message.hasOwnProperty("requestedOptions")) + object.requestedOptions = $root.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.RequestedRiskAnalysisOptions.toObject(message.requestedOptions, options); + return object; + }; + + /** + * Converts this AnalyzeDataSourceRiskDetails to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails + * @instance + * @returns {Object.} JSON object + */ + AnalyzeDataSourceRiskDetails.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + AnalyzeDataSourceRiskDetails.NumericalStatsResult = (function() { + + /** + * Properties of a NumericalStatsResult. + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails + * @interface INumericalStatsResult + * @property {google.privacy.dlp.v2.IValue|null} [minValue] NumericalStatsResult minValue + * @property {google.privacy.dlp.v2.IValue|null} [maxValue] NumericalStatsResult maxValue + * @property {Array.|null} [quantileValues] NumericalStatsResult quantileValues + */ + + /** + * Constructs a new NumericalStatsResult. + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails + * @classdesc Represents a NumericalStatsResult. + * @implements INumericalStatsResult + * @constructor + * @param {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.INumericalStatsResult=} [properties] Properties to set + */ + function NumericalStatsResult(properties) { + this.quantileValues = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NumericalStatsResult minValue. + * @member {google.privacy.dlp.v2.IValue|null|undefined} minValue + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.NumericalStatsResult + * @instance + */ + NumericalStatsResult.prototype.minValue = null; + + /** + * NumericalStatsResult maxValue. + * @member {google.privacy.dlp.v2.IValue|null|undefined} maxValue + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.NumericalStatsResult + * @instance + */ + NumericalStatsResult.prototype.maxValue = null; + + /** + * NumericalStatsResult quantileValues. + * @member {Array.} quantileValues + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.NumericalStatsResult + * @instance + */ + NumericalStatsResult.prototype.quantileValues = $util.emptyArray; + + /** + * Creates a new NumericalStatsResult instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.NumericalStatsResult + * @static + * @param {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.INumericalStatsResult=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.NumericalStatsResult} NumericalStatsResult instance + */ + NumericalStatsResult.create = function create(properties) { + return new NumericalStatsResult(properties); + }; + + /** + * Encodes the specified NumericalStatsResult message. Does not implicitly {@link google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.NumericalStatsResult.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.NumericalStatsResult + * @static + * @param {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.INumericalStatsResult} message NumericalStatsResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NumericalStatsResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.minValue != null && Object.hasOwnProperty.call(message, "minValue")) + $root.google.privacy.dlp.v2.Value.encode(message.minValue, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.maxValue != null && Object.hasOwnProperty.call(message, "maxValue")) + $root.google.privacy.dlp.v2.Value.encode(message.maxValue, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.quantileValues != null && message.quantileValues.length) + for (var i = 0; i < message.quantileValues.length; ++i) + $root.google.privacy.dlp.v2.Value.encode(message.quantileValues[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified NumericalStatsResult message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.NumericalStatsResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.NumericalStatsResult + * @static + * @param {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.INumericalStatsResult} message NumericalStatsResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NumericalStatsResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NumericalStatsResult message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.NumericalStatsResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.NumericalStatsResult} NumericalStatsResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NumericalStatsResult.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.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.NumericalStatsResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.minValue = $root.google.privacy.dlp.v2.Value.decode(reader, reader.uint32()); + break; + case 2: + message.maxValue = $root.google.privacy.dlp.v2.Value.decode(reader, reader.uint32()); + break; + case 4: + if (!(message.quantileValues && message.quantileValues.length)) + message.quantileValues = []; + message.quantileValues.push($root.google.privacy.dlp.v2.Value.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NumericalStatsResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.NumericalStatsResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.NumericalStatsResult} NumericalStatsResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NumericalStatsResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NumericalStatsResult message. + * @function verify + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.NumericalStatsResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NumericalStatsResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.minValue != null && message.hasOwnProperty("minValue")) { + var error = $root.google.privacy.dlp.v2.Value.verify(message.minValue); + if (error) + return "minValue." + error; + } + if (message.maxValue != null && message.hasOwnProperty("maxValue")) { + var error = $root.google.privacy.dlp.v2.Value.verify(message.maxValue); + if (error) + return "maxValue." + error; + } + if (message.quantileValues != null && message.hasOwnProperty("quantileValues")) { + if (!Array.isArray(message.quantileValues)) + return "quantileValues: array expected"; + for (var i = 0; i < message.quantileValues.length; ++i) { + var error = $root.google.privacy.dlp.v2.Value.verify(message.quantileValues[i]); + if (error) + return "quantileValues." + error; + } + } + return null; + }; + + /** + * Creates a NumericalStatsResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.NumericalStatsResult + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.NumericalStatsResult} NumericalStatsResult + */ + NumericalStatsResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.NumericalStatsResult) + return object; + var message = new $root.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.NumericalStatsResult(); + if (object.minValue != null) { + if (typeof object.minValue !== "object") + throw TypeError(".google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.NumericalStatsResult.minValue: object expected"); + message.minValue = $root.google.privacy.dlp.v2.Value.fromObject(object.minValue); + } + if (object.maxValue != null) { + if (typeof object.maxValue !== "object") + throw TypeError(".google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.NumericalStatsResult.maxValue: object expected"); + message.maxValue = $root.google.privacy.dlp.v2.Value.fromObject(object.maxValue); + } + if (object.quantileValues) { + if (!Array.isArray(object.quantileValues)) + throw TypeError(".google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.NumericalStatsResult.quantileValues: array expected"); + message.quantileValues = []; + for (var i = 0; i < object.quantileValues.length; ++i) { + if (typeof object.quantileValues[i] !== "object") + throw TypeError(".google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.NumericalStatsResult.quantileValues: object expected"); + message.quantileValues[i] = $root.google.privacy.dlp.v2.Value.fromObject(object.quantileValues[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a NumericalStatsResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.NumericalStatsResult + * @static + * @param {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.NumericalStatsResult} message NumericalStatsResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NumericalStatsResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.quantileValues = []; + if (options.defaults) { + object.minValue = null; + object.maxValue = null; + } + if (message.minValue != null && message.hasOwnProperty("minValue")) + object.minValue = $root.google.privacy.dlp.v2.Value.toObject(message.minValue, options); + if (message.maxValue != null && message.hasOwnProperty("maxValue")) + object.maxValue = $root.google.privacy.dlp.v2.Value.toObject(message.maxValue, options); + if (message.quantileValues && message.quantileValues.length) { + object.quantileValues = []; + for (var j = 0; j < message.quantileValues.length; ++j) + object.quantileValues[j] = $root.google.privacy.dlp.v2.Value.toObject(message.quantileValues[j], options); + } + return object; + }; + + /** + * Converts this NumericalStatsResult to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.NumericalStatsResult + * @instance + * @returns {Object.} JSON object + */ + NumericalStatsResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return NumericalStatsResult; + })(); + + AnalyzeDataSourceRiskDetails.CategoricalStatsResult = (function() { + + /** + * Properties of a CategoricalStatsResult. + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails + * @interface ICategoricalStatsResult + * @property {Array.|null} [valueFrequencyHistogramBuckets] CategoricalStatsResult valueFrequencyHistogramBuckets + */ + + /** + * Constructs a new CategoricalStatsResult. + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails + * @classdesc Represents a CategoricalStatsResult. + * @implements ICategoricalStatsResult + * @constructor + * @param {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.ICategoricalStatsResult=} [properties] Properties to set + */ + function CategoricalStatsResult(properties) { + this.valueFrequencyHistogramBuckets = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CategoricalStatsResult valueFrequencyHistogramBuckets. + * @member {Array.} valueFrequencyHistogramBuckets + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.CategoricalStatsResult + * @instance + */ + CategoricalStatsResult.prototype.valueFrequencyHistogramBuckets = $util.emptyArray; + + /** + * Creates a new CategoricalStatsResult instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.CategoricalStatsResult + * @static + * @param {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.ICategoricalStatsResult=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.CategoricalStatsResult} CategoricalStatsResult instance + */ + CategoricalStatsResult.create = function create(properties) { + return new CategoricalStatsResult(properties); + }; + + /** + * Encodes the specified CategoricalStatsResult message. Does not implicitly {@link google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.CategoricalStatsResult.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.CategoricalStatsResult + * @static + * @param {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.ICategoricalStatsResult} message CategoricalStatsResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CategoricalStatsResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.valueFrequencyHistogramBuckets != null && message.valueFrequencyHistogramBuckets.length) + for (var i = 0; i < message.valueFrequencyHistogramBuckets.length; ++i) + $root.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.CategoricalStatsResult.CategoricalStatsHistogramBucket.encode(message.valueFrequencyHistogramBuckets[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CategoricalStatsResult message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.CategoricalStatsResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.CategoricalStatsResult + * @static + * @param {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.ICategoricalStatsResult} message CategoricalStatsResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CategoricalStatsResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CategoricalStatsResult message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.CategoricalStatsResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.CategoricalStatsResult} CategoricalStatsResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CategoricalStatsResult.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.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.CategoricalStatsResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 5: + if (!(message.valueFrequencyHistogramBuckets && message.valueFrequencyHistogramBuckets.length)) + message.valueFrequencyHistogramBuckets = []; + message.valueFrequencyHistogramBuckets.push($root.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.CategoricalStatsResult.CategoricalStatsHistogramBucket.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CategoricalStatsResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.CategoricalStatsResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.CategoricalStatsResult} CategoricalStatsResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CategoricalStatsResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CategoricalStatsResult message. + * @function verify + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.CategoricalStatsResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CategoricalStatsResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.valueFrequencyHistogramBuckets != null && message.hasOwnProperty("valueFrequencyHistogramBuckets")) { + if (!Array.isArray(message.valueFrequencyHistogramBuckets)) + return "valueFrequencyHistogramBuckets: array expected"; + for (var i = 0; i < message.valueFrequencyHistogramBuckets.length; ++i) { + var error = $root.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.CategoricalStatsResult.CategoricalStatsHistogramBucket.verify(message.valueFrequencyHistogramBuckets[i]); + if (error) + return "valueFrequencyHistogramBuckets." + error; + } + } + return null; + }; + + /** + * Creates a CategoricalStatsResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.CategoricalStatsResult + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.CategoricalStatsResult} CategoricalStatsResult + */ + CategoricalStatsResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.CategoricalStatsResult) + return object; + var message = new $root.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.CategoricalStatsResult(); + if (object.valueFrequencyHistogramBuckets) { + if (!Array.isArray(object.valueFrequencyHistogramBuckets)) + throw TypeError(".google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.CategoricalStatsResult.valueFrequencyHistogramBuckets: array expected"); + message.valueFrequencyHistogramBuckets = []; + for (var i = 0; i < object.valueFrequencyHistogramBuckets.length; ++i) { + if (typeof object.valueFrequencyHistogramBuckets[i] !== "object") + throw TypeError(".google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.CategoricalStatsResult.valueFrequencyHistogramBuckets: object expected"); + message.valueFrequencyHistogramBuckets[i] = $root.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.CategoricalStatsResult.CategoricalStatsHistogramBucket.fromObject(object.valueFrequencyHistogramBuckets[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a CategoricalStatsResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.CategoricalStatsResult + * @static + * @param {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.CategoricalStatsResult} message CategoricalStatsResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CategoricalStatsResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.valueFrequencyHistogramBuckets = []; + if (message.valueFrequencyHistogramBuckets && message.valueFrequencyHistogramBuckets.length) { + object.valueFrequencyHistogramBuckets = []; + for (var j = 0; j < message.valueFrequencyHistogramBuckets.length; ++j) + object.valueFrequencyHistogramBuckets[j] = $root.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.CategoricalStatsResult.CategoricalStatsHistogramBucket.toObject(message.valueFrequencyHistogramBuckets[j], options); + } + return object; + }; + + /** + * Converts this CategoricalStatsResult to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.CategoricalStatsResult + * @instance + * @returns {Object.} JSON object + */ + CategoricalStatsResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + CategoricalStatsResult.CategoricalStatsHistogramBucket = (function() { + + /** + * Properties of a CategoricalStatsHistogramBucket. + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.CategoricalStatsResult + * @interface ICategoricalStatsHistogramBucket + * @property {number|Long|null} [valueFrequencyLowerBound] CategoricalStatsHistogramBucket valueFrequencyLowerBound + * @property {number|Long|null} [valueFrequencyUpperBound] CategoricalStatsHistogramBucket valueFrequencyUpperBound + * @property {number|Long|null} [bucketSize] CategoricalStatsHistogramBucket bucketSize + * @property {Array.|null} [bucketValues] CategoricalStatsHistogramBucket bucketValues + * @property {number|Long|null} [bucketValueCount] CategoricalStatsHistogramBucket bucketValueCount + */ + + /** + * Constructs a new CategoricalStatsHistogramBucket. + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.CategoricalStatsResult + * @classdesc Represents a CategoricalStatsHistogramBucket. + * @implements ICategoricalStatsHistogramBucket + * @constructor + * @param {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.CategoricalStatsResult.ICategoricalStatsHistogramBucket=} [properties] Properties to set + */ + function CategoricalStatsHistogramBucket(properties) { + this.bucketValues = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CategoricalStatsHistogramBucket valueFrequencyLowerBound. + * @member {number|Long} valueFrequencyLowerBound + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.CategoricalStatsResult.CategoricalStatsHistogramBucket + * @instance + */ + CategoricalStatsHistogramBucket.prototype.valueFrequencyLowerBound = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * CategoricalStatsHistogramBucket valueFrequencyUpperBound. + * @member {number|Long} valueFrequencyUpperBound + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.CategoricalStatsResult.CategoricalStatsHistogramBucket + * @instance + */ + CategoricalStatsHistogramBucket.prototype.valueFrequencyUpperBound = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * CategoricalStatsHistogramBucket bucketSize. + * @member {number|Long} bucketSize + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.CategoricalStatsResult.CategoricalStatsHistogramBucket + * @instance + */ + CategoricalStatsHistogramBucket.prototype.bucketSize = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * CategoricalStatsHistogramBucket bucketValues. + * @member {Array.} bucketValues + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.CategoricalStatsResult.CategoricalStatsHistogramBucket + * @instance + */ + CategoricalStatsHistogramBucket.prototype.bucketValues = $util.emptyArray; + + /** + * CategoricalStatsHistogramBucket bucketValueCount. + * @member {number|Long} bucketValueCount + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.CategoricalStatsResult.CategoricalStatsHistogramBucket + * @instance + */ + CategoricalStatsHistogramBucket.prototype.bucketValueCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new CategoricalStatsHistogramBucket instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.CategoricalStatsResult.CategoricalStatsHistogramBucket + * @static + * @param {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.CategoricalStatsResult.ICategoricalStatsHistogramBucket=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.CategoricalStatsResult.CategoricalStatsHistogramBucket} CategoricalStatsHistogramBucket instance + */ + CategoricalStatsHistogramBucket.create = function create(properties) { + return new CategoricalStatsHistogramBucket(properties); + }; + + /** + * Encodes the specified CategoricalStatsHistogramBucket message. Does not implicitly {@link google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.CategoricalStatsResult.CategoricalStatsHistogramBucket.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.CategoricalStatsResult.CategoricalStatsHistogramBucket + * @static + * @param {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.CategoricalStatsResult.ICategoricalStatsHistogramBucket} message CategoricalStatsHistogramBucket message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CategoricalStatsHistogramBucket.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.valueFrequencyLowerBound != null && Object.hasOwnProperty.call(message, "valueFrequencyLowerBound")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.valueFrequencyLowerBound); + if (message.valueFrequencyUpperBound != null && Object.hasOwnProperty.call(message, "valueFrequencyUpperBound")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.valueFrequencyUpperBound); + if (message.bucketSize != null && Object.hasOwnProperty.call(message, "bucketSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.bucketSize); + if (message.bucketValues != null && message.bucketValues.length) + for (var i = 0; i < message.bucketValues.length; ++i) + $root.google.privacy.dlp.v2.ValueFrequency.encode(message.bucketValues[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.bucketValueCount != null && Object.hasOwnProperty.call(message, "bucketValueCount")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.bucketValueCount); + return writer; + }; + + /** + * Encodes the specified CategoricalStatsHistogramBucket message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.CategoricalStatsResult.CategoricalStatsHistogramBucket.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.CategoricalStatsResult.CategoricalStatsHistogramBucket + * @static + * @param {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.CategoricalStatsResult.ICategoricalStatsHistogramBucket} message CategoricalStatsHistogramBucket message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CategoricalStatsHistogramBucket.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CategoricalStatsHistogramBucket message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.CategoricalStatsResult.CategoricalStatsHistogramBucket + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.CategoricalStatsResult.CategoricalStatsHistogramBucket} CategoricalStatsHistogramBucket + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CategoricalStatsHistogramBucket.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.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.CategoricalStatsResult.CategoricalStatsHistogramBucket(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.valueFrequencyLowerBound = reader.int64(); + break; + case 2: + message.valueFrequencyUpperBound = reader.int64(); + break; + case 3: + message.bucketSize = reader.int64(); + break; + case 4: + if (!(message.bucketValues && message.bucketValues.length)) + message.bucketValues = []; + message.bucketValues.push($root.google.privacy.dlp.v2.ValueFrequency.decode(reader, reader.uint32())); + break; + case 5: + message.bucketValueCount = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CategoricalStatsHistogramBucket message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.CategoricalStatsResult.CategoricalStatsHistogramBucket + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.CategoricalStatsResult.CategoricalStatsHistogramBucket} CategoricalStatsHistogramBucket + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CategoricalStatsHistogramBucket.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CategoricalStatsHistogramBucket message. + * @function verify + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.CategoricalStatsResult.CategoricalStatsHistogramBucket + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CategoricalStatsHistogramBucket.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.valueFrequencyLowerBound != null && message.hasOwnProperty("valueFrequencyLowerBound")) + if (!$util.isInteger(message.valueFrequencyLowerBound) && !(message.valueFrequencyLowerBound && $util.isInteger(message.valueFrequencyLowerBound.low) && $util.isInteger(message.valueFrequencyLowerBound.high))) + return "valueFrequencyLowerBound: integer|Long expected"; + if (message.valueFrequencyUpperBound != null && message.hasOwnProperty("valueFrequencyUpperBound")) + if (!$util.isInteger(message.valueFrequencyUpperBound) && !(message.valueFrequencyUpperBound && $util.isInteger(message.valueFrequencyUpperBound.low) && $util.isInteger(message.valueFrequencyUpperBound.high))) + return "valueFrequencyUpperBound: integer|Long expected"; + if (message.bucketSize != null && message.hasOwnProperty("bucketSize")) + if (!$util.isInteger(message.bucketSize) && !(message.bucketSize && $util.isInteger(message.bucketSize.low) && $util.isInteger(message.bucketSize.high))) + return "bucketSize: integer|Long expected"; + if (message.bucketValues != null && message.hasOwnProperty("bucketValues")) { + if (!Array.isArray(message.bucketValues)) + return "bucketValues: array expected"; + for (var i = 0; i < message.bucketValues.length; ++i) { + var error = $root.google.privacy.dlp.v2.ValueFrequency.verify(message.bucketValues[i]); + if (error) + return "bucketValues." + error; + } + } + if (message.bucketValueCount != null && message.hasOwnProperty("bucketValueCount")) + if (!$util.isInteger(message.bucketValueCount) && !(message.bucketValueCount && $util.isInteger(message.bucketValueCount.low) && $util.isInteger(message.bucketValueCount.high))) + return "bucketValueCount: integer|Long expected"; + return null; + }; + + /** + * Creates a CategoricalStatsHistogramBucket message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.CategoricalStatsResult.CategoricalStatsHistogramBucket + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.CategoricalStatsResult.CategoricalStatsHistogramBucket} CategoricalStatsHistogramBucket + */ + CategoricalStatsHistogramBucket.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.CategoricalStatsResult.CategoricalStatsHistogramBucket) + return object; + var message = new $root.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.CategoricalStatsResult.CategoricalStatsHistogramBucket(); + if (object.valueFrequencyLowerBound != null) + if ($util.Long) + (message.valueFrequencyLowerBound = $util.Long.fromValue(object.valueFrequencyLowerBound)).unsigned = false; + else if (typeof object.valueFrequencyLowerBound === "string") + message.valueFrequencyLowerBound = parseInt(object.valueFrequencyLowerBound, 10); + else if (typeof object.valueFrequencyLowerBound === "number") + message.valueFrequencyLowerBound = object.valueFrequencyLowerBound; + else if (typeof object.valueFrequencyLowerBound === "object") + message.valueFrequencyLowerBound = new $util.LongBits(object.valueFrequencyLowerBound.low >>> 0, object.valueFrequencyLowerBound.high >>> 0).toNumber(); + if (object.valueFrequencyUpperBound != null) + if ($util.Long) + (message.valueFrequencyUpperBound = $util.Long.fromValue(object.valueFrequencyUpperBound)).unsigned = false; + else if (typeof object.valueFrequencyUpperBound === "string") + message.valueFrequencyUpperBound = parseInt(object.valueFrequencyUpperBound, 10); + else if (typeof object.valueFrequencyUpperBound === "number") + message.valueFrequencyUpperBound = object.valueFrequencyUpperBound; + else if (typeof object.valueFrequencyUpperBound === "object") + message.valueFrequencyUpperBound = new $util.LongBits(object.valueFrequencyUpperBound.low >>> 0, object.valueFrequencyUpperBound.high >>> 0).toNumber(); + if (object.bucketSize != null) + if ($util.Long) + (message.bucketSize = $util.Long.fromValue(object.bucketSize)).unsigned = false; + else if (typeof object.bucketSize === "string") + message.bucketSize = parseInt(object.bucketSize, 10); + else if (typeof object.bucketSize === "number") + message.bucketSize = object.bucketSize; + else if (typeof object.bucketSize === "object") + message.bucketSize = new $util.LongBits(object.bucketSize.low >>> 0, object.bucketSize.high >>> 0).toNumber(); + if (object.bucketValues) { + if (!Array.isArray(object.bucketValues)) + throw TypeError(".google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.CategoricalStatsResult.CategoricalStatsHistogramBucket.bucketValues: array expected"); + message.bucketValues = []; + for (var i = 0; i < object.bucketValues.length; ++i) { + if (typeof object.bucketValues[i] !== "object") + throw TypeError(".google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.CategoricalStatsResult.CategoricalStatsHistogramBucket.bucketValues: object expected"); + message.bucketValues[i] = $root.google.privacy.dlp.v2.ValueFrequency.fromObject(object.bucketValues[i]); + } + } + if (object.bucketValueCount != null) + if ($util.Long) + (message.bucketValueCount = $util.Long.fromValue(object.bucketValueCount)).unsigned = false; + else if (typeof object.bucketValueCount === "string") + message.bucketValueCount = parseInt(object.bucketValueCount, 10); + else if (typeof object.bucketValueCount === "number") + message.bucketValueCount = object.bucketValueCount; + else if (typeof object.bucketValueCount === "object") + message.bucketValueCount = new $util.LongBits(object.bucketValueCount.low >>> 0, object.bucketValueCount.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a CategoricalStatsHistogramBucket message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.CategoricalStatsResult.CategoricalStatsHistogramBucket + * @static + * @param {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.CategoricalStatsResult.CategoricalStatsHistogramBucket} message CategoricalStatsHistogramBucket + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CategoricalStatsHistogramBucket.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.bucketValues = []; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.valueFrequencyLowerBound = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.valueFrequencyLowerBound = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.valueFrequencyUpperBound = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.valueFrequencyUpperBound = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.bucketSize = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.bucketSize = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.bucketValueCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.bucketValueCount = options.longs === String ? "0" : 0; + } + if (message.valueFrequencyLowerBound != null && message.hasOwnProperty("valueFrequencyLowerBound")) + if (typeof message.valueFrequencyLowerBound === "number") + object.valueFrequencyLowerBound = options.longs === String ? String(message.valueFrequencyLowerBound) : message.valueFrequencyLowerBound; + else + object.valueFrequencyLowerBound = options.longs === String ? $util.Long.prototype.toString.call(message.valueFrequencyLowerBound) : options.longs === Number ? new $util.LongBits(message.valueFrequencyLowerBound.low >>> 0, message.valueFrequencyLowerBound.high >>> 0).toNumber() : message.valueFrequencyLowerBound; + if (message.valueFrequencyUpperBound != null && message.hasOwnProperty("valueFrequencyUpperBound")) + if (typeof message.valueFrequencyUpperBound === "number") + object.valueFrequencyUpperBound = options.longs === String ? String(message.valueFrequencyUpperBound) : message.valueFrequencyUpperBound; + else + object.valueFrequencyUpperBound = options.longs === String ? $util.Long.prototype.toString.call(message.valueFrequencyUpperBound) : options.longs === Number ? new $util.LongBits(message.valueFrequencyUpperBound.low >>> 0, message.valueFrequencyUpperBound.high >>> 0).toNumber() : message.valueFrequencyUpperBound; + if (message.bucketSize != null && message.hasOwnProperty("bucketSize")) + if (typeof message.bucketSize === "number") + object.bucketSize = options.longs === String ? String(message.bucketSize) : message.bucketSize; + else + object.bucketSize = options.longs === String ? $util.Long.prototype.toString.call(message.bucketSize) : options.longs === Number ? new $util.LongBits(message.bucketSize.low >>> 0, message.bucketSize.high >>> 0).toNumber() : message.bucketSize; + if (message.bucketValues && message.bucketValues.length) { + object.bucketValues = []; + for (var j = 0; j < message.bucketValues.length; ++j) + object.bucketValues[j] = $root.google.privacy.dlp.v2.ValueFrequency.toObject(message.bucketValues[j], options); + } + if (message.bucketValueCount != null && message.hasOwnProperty("bucketValueCount")) + if (typeof message.bucketValueCount === "number") + object.bucketValueCount = options.longs === String ? String(message.bucketValueCount) : message.bucketValueCount; + else + object.bucketValueCount = options.longs === String ? $util.Long.prototype.toString.call(message.bucketValueCount) : options.longs === Number ? new $util.LongBits(message.bucketValueCount.low >>> 0, message.bucketValueCount.high >>> 0).toNumber() : message.bucketValueCount; + return object; + }; + + /** + * Converts this CategoricalStatsHistogramBucket to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.CategoricalStatsResult.CategoricalStatsHistogramBucket + * @instance + * @returns {Object.} JSON object + */ + CategoricalStatsHistogramBucket.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CategoricalStatsHistogramBucket; + })(); + + return CategoricalStatsResult; + })(); + + AnalyzeDataSourceRiskDetails.KAnonymityResult = (function() { + + /** + * Properties of a KAnonymityResult. + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails + * @interface IKAnonymityResult + * @property {Array.|null} [equivalenceClassHistogramBuckets] KAnonymityResult equivalenceClassHistogramBuckets + */ + + /** + * Constructs a new KAnonymityResult. + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails + * @classdesc Represents a KAnonymityResult. + * @implements IKAnonymityResult + * @constructor + * @param {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.IKAnonymityResult=} [properties] Properties to set + */ + function KAnonymityResult(properties) { + this.equivalenceClassHistogramBuckets = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * KAnonymityResult equivalenceClassHistogramBuckets. + * @member {Array.} equivalenceClassHistogramBuckets + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResult + * @instance + */ + KAnonymityResult.prototype.equivalenceClassHistogramBuckets = $util.emptyArray; + + /** + * Creates a new KAnonymityResult instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResult + * @static + * @param {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.IKAnonymityResult=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResult} KAnonymityResult instance + */ + KAnonymityResult.create = function create(properties) { + return new KAnonymityResult(properties); + }; + + /** + * Encodes the specified KAnonymityResult message. Does not implicitly {@link google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResult.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResult + * @static + * @param {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.IKAnonymityResult} message KAnonymityResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KAnonymityResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.equivalenceClassHistogramBuckets != null && message.equivalenceClassHistogramBuckets.length) + for (var i = 0; i < message.equivalenceClassHistogramBuckets.length; ++i) + $root.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResult.KAnonymityHistogramBucket.encode(message.equivalenceClassHistogramBuckets[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified KAnonymityResult message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResult + * @static + * @param {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.IKAnonymityResult} message KAnonymityResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KAnonymityResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a KAnonymityResult message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResult} KAnonymityResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KAnonymityResult.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.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 5: + if (!(message.equivalenceClassHistogramBuckets && message.equivalenceClassHistogramBuckets.length)) + message.equivalenceClassHistogramBuckets = []; + message.equivalenceClassHistogramBuckets.push($root.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResult.KAnonymityHistogramBucket.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a KAnonymityResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResult} KAnonymityResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KAnonymityResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a KAnonymityResult message. + * @function verify + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + KAnonymityResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.equivalenceClassHistogramBuckets != null && message.hasOwnProperty("equivalenceClassHistogramBuckets")) { + if (!Array.isArray(message.equivalenceClassHistogramBuckets)) + return "equivalenceClassHistogramBuckets: array expected"; + for (var i = 0; i < message.equivalenceClassHistogramBuckets.length; ++i) { + var error = $root.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResult.KAnonymityHistogramBucket.verify(message.equivalenceClassHistogramBuckets[i]); + if (error) + return "equivalenceClassHistogramBuckets." + error; + } + } + return null; + }; + + /** + * Creates a KAnonymityResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResult + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResult} KAnonymityResult + */ + KAnonymityResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResult) + return object; + var message = new $root.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResult(); + if (object.equivalenceClassHistogramBuckets) { + if (!Array.isArray(object.equivalenceClassHistogramBuckets)) + throw TypeError(".google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResult.equivalenceClassHistogramBuckets: array expected"); + message.equivalenceClassHistogramBuckets = []; + for (var i = 0; i < object.equivalenceClassHistogramBuckets.length; ++i) { + if (typeof object.equivalenceClassHistogramBuckets[i] !== "object") + throw TypeError(".google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResult.equivalenceClassHistogramBuckets: object expected"); + message.equivalenceClassHistogramBuckets[i] = $root.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResult.KAnonymityHistogramBucket.fromObject(object.equivalenceClassHistogramBuckets[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a KAnonymityResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResult + * @static + * @param {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResult} message KAnonymityResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + KAnonymityResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.equivalenceClassHistogramBuckets = []; + if (message.equivalenceClassHistogramBuckets && message.equivalenceClassHistogramBuckets.length) { + object.equivalenceClassHistogramBuckets = []; + for (var j = 0; j < message.equivalenceClassHistogramBuckets.length; ++j) + object.equivalenceClassHistogramBuckets[j] = $root.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResult.KAnonymityHistogramBucket.toObject(message.equivalenceClassHistogramBuckets[j], options); + } + return object; + }; + + /** + * Converts this KAnonymityResult to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResult + * @instance + * @returns {Object.} JSON object + */ + KAnonymityResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + KAnonymityResult.KAnonymityEquivalenceClass = (function() { + + /** + * Properties of a KAnonymityEquivalenceClass. + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResult + * @interface IKAnonymityEquivalenceClass + * @property {Array.|null} [quasiIdsValues] KAnonymityEquivalenceClass quasiIdsValues + * @property {number|Long|null} [equivalenceClassSize] KAnonymityEquivalenceClass equivalenceClassSize + */ + + /** + * Constructs a new KAnonymityEquivalenceClass. + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResult + * @classdesc Represents a KAnonymityEquivalenceClass. + * @implements IKAnonymityEquivalenceClass + * @constructor + * @param {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResult.IKAnonymityEquivalenceClass=} [properties] Properties to set + */ + function KAnonymityEquivalenceClass(properties) { + this.quasiIdsValues = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * KAnonymityEquivalenceClass quasiIdsValues. + * @member {Array.} quasiIdsValues + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResult.KAnonymityEquivalenceClass + * @instance + */ + KAnonymityEquivalenceClass.prototype.quasiIdsValues = $util.emptyArray; + + /** + * KAnonymityEquivalenceClass equivalenceClassSize. + * @member {number|Long} equivalenceClassSize + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResult.KAnonymityEquivalenceClass + * @instance + */ + KAnonymityEquivalenceClass.prototype.equivalenceClassSize = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new KAnonymityEquivalenceClass instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResult.KAnonymityEquivalenceClass + * @static + * @param {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResult.IKAnonymityEquivalenceClass=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResult.KAnonymityEquivalenceClass} KAnonymityEquivalenceClass instance + */ + KAnonymityEquivalenceClass.create = function create(properties) { + return new KAnonymityEquivalenceClass(properties); + }; + + /** + * Encodes the specified KAnonymityEquivalenceClass message. Does not implicitly {@link google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResult.KAnonymityEquivalenceClass.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResult.KAnonymityEquivalenceClass + * @static + * @param {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResult.IKAnonymityEquivalenceClass} message KAnonymityEquivalenceClass message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KAnonymityEquivalenceClass.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.quasiIdsValues != null && message.quasiIdsValues.length) + for (var i = 0; i < message.quasiIdsValues.length; ++i) + $root.google.privacy.dlp.v2.Value.encode(message.quasiIdsValues[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.equivalenceClassSize != null && Object.hasOwnProperty.call(message, "equivalenceClassSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.equivalenceClassSize); + return writer; + }; + + /** + * Encodes the specified KAnonymityEquivalenceClass message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResult.KAnonymityEquivalenceClass.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResult.KAnonymityEquivalenceClass + * @static + * @param {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResult.IKAnonymityEquivalenceClass} message KAnonymityEquivalenceClass message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KAnonymityEquivalenceClass.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a KAnonymityEquivalenceClass message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResult.KAnonymityEquivalenceClass + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResult.KAnonymityEquivalenceClass} KAnonymityEquivalenceClass + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KAnonymityEquivalenceClass.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.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResult.KAnonymityEquivalenceClass(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.quasiIdsValues && message.quasiIdsValues.length)) + message.quasiIdsValues = []; + message.quasiIdsValues.push($root.google.privacy.dlp.v2.Value.decode(reader, reader.uint32())); + break; + case 2: + message.equivalenceClassSize = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a KAnonymityEquivalenceClass message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResult.KAnonymityEquivalenceClass + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResult.KAnonymityEquivalenceClass} KAnonymityEquivalenceClass + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KAnonymityEquivalenceClass.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a KAnonymityEquivalenceClass message. + * @function verify + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResult.KAnonymityEquivalenceClass + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + KAnonymityEquivalenceClass.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.quasiIdsValues != null && message.hasOwnProperty("quasiIdsValues")) { + if (!Array.isArray(message.quasiIdsValues)) + return "quasiIdsValues: array expected"; + for (var i = 0; i < message.quasiIdsValues.length; ++i) { + var error = $root.google.privacy.dlp.v2.Value.verify(message.quasiIdsValues[i]); + if (error) + return "quasiIdsValues." + error; + } + } + if (message.equivalenceClassSize != null && message.hasOwnProperty("equivalenceClassSize")) + if (!$util.isInteger(message.equivalenceClassSize) && !(message.equivalenceClassSize && $util.isInteger(message.equivalenceClassSize.low) && $util.isInteger(message.equivalenceClassSize.high))) + return "equivalenceClassSize: integer|Long expected"; + return null; + }; + + /** + * Creates a KAnonymityEquivalenceClass message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResult.KAnonymityEquivalenceClass + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResult.KAnonymityEquivalenceClass} KAnonymityEquivalenceClass + */ + KAnonymityEquivalenceClass.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResult.KAnonymityEquivalenceClass) + return object; + var message = new $root.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResult.KAnonymityEquivalenceClass(); + if (object.quasiIdsValues) { + if (!Array.isArray(object.quasiIdsValues)) + throw TypeError(".google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResult.KAnonymityEquivalenceClass.quasiIdsValues: array expected"); + message.quasiIdsValues = []; + for (var i = 0; i < object.quasiIdsValues.length; ++i) { + if (typeof object.quasiIdsValues[i] !== "object") + throw TypeError(".google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResult.KAnonymityEquivalenceClass.quasiIdsValues: object expected"); + message.quasiIdsValues[i] = $root.google.privacy.dlp.v2.Value.fromObject(object.quasiIdsValues[i]); + } + } + if (object.equivalenceClassSize != null) + if ($util.Long) + (message.equivalenceClassSize = $util.Long.fromValue(object.equivalenceClassSize)).unsigned = false; + else if (typeof object.equivalenceClassSize === "string") + message.equivalenceClassSize = parseInt(object.equivalenceClassSize, 10); + else if (typeof object.equivalenceClassSize === "number") + message.equivalenceClassSize = object.equivalenceClassSize; + else if (typeof object.equivalenceClassSize === "object") + message.equivalenceClassSize = new $util.LongBits(object.equivalenceClassSize.low >>> 0, object.equivalenceClassSize.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a KAnonymityEquivalenceClass message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResult.KAnonymityEquivalenceClass + * @static + * @param {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResult.KAnonymityEquivalenceClass} message KAnonymityEquivalenceClass + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + KAnonymityEquivalenceClass.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.quasiIdsValues = []; + if (options.defaults) + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.equivalenceClassSize = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.equivalenceClassSize = options.longs === String ? "0" : 0; + if (message.quasiIdsValues && message.quasiIdsValues.length) { + object.quasiIdsValues = []; + for (var j = 0; j < message.quasiIdsValues.length; ++j) + object.quasiIdsValues[j] = $root.google.privacy.dlp.v2.Value.toObject(message.quasiIdsValues[j], options); + } + if (message.equivalenceClassSize != null && message.hasOwnProperty("equivalenceClassSize")) + if (typeof message.equivalenceClassSize === "number") + object.equivalenceClassSize = options.longs === String ? String(message.equivalenceClassSize) : message.equivalenceClassSize; + else + object.equivalenceClassSize = options.longs === String ? $util.Long.prototype.toString.call(message.equivalenceClassSize) : options.longs === Number ? new $util.LongBits(message.equivalenceClassSize.low >>> 0, message.equivalenceClassSize.high >>> 0).toNumber() : message.equivalenceClassSize; + return object; + }; + + /** + * Converts this KAnonymityEquivalenceClass to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResult.KAnonymityEquivalenceClass + * @instance + * @returns {Object.} JSON object + */ + KAnonymityEquivalenceClass.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return KAnonymityEquivalenceClass; + })(); + + KAnonymityResult.KAnonymityHistogramBucket = (function() { + + /** + * Properties of a KAnonymityHistogramBucket. + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResult + * @interface IKAnonymityHistogramBucket + * @property {number|Long|null} [equivalenceClassSizeLowerBound] KAnonymityHistogramBucket equivalenceClassSizeLowerBound + * @property {number|Long|null} [equivalenceClassSizeUpperBound] KAnonymityHistogramBucket equivalenceClassSizeUpperBound + * @property {number|Long|null} [bucketSize] KAnonymityHistogramBucket bucketSize + * @property {Array.|null} [bucketValues] KAnonymityHistogramBucket bucketValues + * @property {number|Long|null} [bucketValueCount] KAnonymityHistogramBucket bucketValueCount + */ + + /** + * Constructs a new KAnonymityHistogramBucket. + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResult + * @classdesc Represents a KAnonymityHistogramBucket. + * @implements IKAnonymityHistogramBucket + * @constructor + * @param {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResult.IKAnonymityHistogramBucket=} [properties] Properties to set + */ + function KAnonymityHistogramBucket(properties) { + this.bucketValues = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * KAnonymityHistogramBucket equivalenceClassSizeLowerBound. + * @member {number|Long} equivalenceClassSizeLowerBound + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResult.KAnonymityHistogramBucket + * @instance + */ + KAnonymityHistogramBucket.prototype.equivalenceClassSizeLowerBound = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * KAnonymityHistogramBucket equivalenceClassSizeUpperBound. + * @member {number|Long} equivalenceClassSizeUpperBound + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResult.KAnonymityHistogramBucket + * @instance + */ + KAnonymityHistogramBucket.prototype.equivalenceClassSizeUpperBound = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * KAnonymityHistogramBucket bucketSize. + * @member {number|Long} bucketSize + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResult.KAnonymityHistogramBucket + * @instance + */ + KAnonymityHistogramBucket.prototype.bucketSize = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * KAnonymityHistogramBucket bucketValues. + * @member {Array.} bucketValues + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResult.KAnonymityHistogramBucket + * @instance + */ + KAnonymityHistogramBucket.prototype.bucketValues = $util.emptyArray; + + /** + * KAnonymityHistogramBucket bucketValueCount. + * @member {number|Long} bucketValueCount + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResult.KAnonymityHistogramBucket + * @instance + */ + KAnonymityHistogramBucket.prototype.bucketValueCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new KAnonymityHistogramBucket instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResult.KAnonymityHistogramBucket + * @static + * @param {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResult.IKAnonymityHistogramBucket=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResult.KAnonymityHistogramBucket} KAnonymityHistogramBucket instance + */ + KAnonymityHistogramBucket.create = function create(properties) { + return new KAnonymityHistogramBucket(properties); + }; + + /** + * Encodes the specified KAnonymityHistogramBucket message. Does not implicitly {@link google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResult.KAnonymityHistogramBucket.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResult.KAnonymityHistogramBucket + * @static + * @param {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResult.IKAnonymityHistogramBucket} message KAnonymityHistogramBucket message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KAnonymityHistogramBucket.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.equivalenceClassSizeLowerBound != null && Object.hasOwnProperty.call(message, "equivalenceClassSizeLowerBound")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.equivalenceClassSizeLowerBound); + if (message.equivalenceClassSizeUpperBound != null && Object.hasOwnProperty.call(message, "equivalenceClassSizeUpperBound")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.equivalenceClassSizeUpperBound); + if (message.bucketSize != null && Object.hasOwnProperty.call(message, "bucketSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.bucketSize); + if (message.bucketValues != null && message.bucketValues.length) + for (var i = 0; i < message.bucketValues.length; ++i) + $root.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResult.KAnonymityEquivalenceClass.encode(message.bucketValues[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.bucketValueCount != null && Object.hasOwnProperty.call(message, "bucketValueCount")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.bucketValueCount); + return writer; + }; + + /** + * Encodes the specified KAnonymityHistogramBucket message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResult.KAnonymityHistogramBucket.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResult.KAnonymityHistogramBucket + * @static + * @param {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResult.IKAnonymityHistogramBucket} message KAnonymityHistogramBucket message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KAnonymityHistogramBucket.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a KAnonymityHistogramBucket message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResult.KAnonymityHistogramBucket + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResult.KAnonymityHistogramBucket} KAnonymityHistogramBucket + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KAnonymityHistogramBucket.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.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResult.KAnonymityHistogramBucket(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.equivalenceClassSizeLowerBound = reader.int64(); + break; + case 2: + message.equivalenceClassSizeUpperBound = reader.int64(); + break; + case 3: + message.bucketSize = reader.int64(); + break; + case 4: + if (!(message.bucketValues && message.bucketValues.length)) + message.bucketValues = []; + message.bucketValues.push($root.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResult.KAnonymityEquivalenceClass.decode(reader, reader.uint32())); + break; + case 5: + message.bucketValueCount = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a KAnonymityHistogramBucket message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResult.KAnonymityHistogramBucket + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResult.KAnonymityHistogramBucket} KAnonymityHistogramBucket + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KAnonymityHistogramBucket.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a KAnonymityHistogramBucket message. + * @function verify + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResult.KAnonymityHistogramBucket + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + KAnonymityHistogramBucket.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.equivalenceClassSizeLowerBound != null && message.hasOwnProperty("equivalenceClassSizeLowerBound")) + if (!$util.isInteger(message.equivalenceClassSizeLowerBound) && !(message.equivalenceClassSizeLowerBound && $util.isInteger(message.equivalenceClassSizeLowerBound.low) && $util.isInteger(message.equivalenceClassSizeLowerBound.high))) + return "equivalenceClassSizeLowerBound: integer|Long expected"; + if (message.equivalenceClassSizeUpperBound != null && message.hasOwnProperty("equivalenceClassSizeUpperBound")) + if (!$util.isInteger(message.equivalenceClassSizeUpperBound) && !(message.equivalenceClassSizeUpperBound && $util.isInteger(message.equivalenceClassSizeUpperBound.low) && $util.isInteger(message.equivalenceClassSizeUpperBound.high))) + return "equivalenceClassSizeUpperBound: integer|Long expected"; + if (message.bucketSize != null && message.hasOwnProperty("bucketSize")) + if (!$util.isInteger(message.bucketSize) && !(message.bucketSize && $util.isInteger(message.bucketSize.low) && $util.isInteger(message.bucketSize.high))) + return "bucketSize: integer|Long expected"; + if (message.bucketValues != null && message.hasOwnProperty("bucketValues")) { + if (!Array.isArray(message.bucketValues)) + return "bucketValues: array expected"; + for (var i = 0; i < message.bucketValues.length; ++i) { + var error = $root.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResult.KAnonymityEquivalenceClass.verify(message.bucketValues[i]); + if (error) + return "bucketValues." + error; + } + } + if (message.bucketValueCount != null && message.hasOwnProperty("bucketValueCount")) + if (!$util.isInteger(message.bucketValueCount) && !(message.bucketValueCount && $util.isInteger(message.bucketValueCount.low) && $util.isInteger(message.bucketValueCount.high))) + return "bucketValueCount: integer|Long expected"; + return null; + }; + + /** + * Creates a KAnonymityHistogramBucket message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResult.KAnonymityHistogramBucket + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResult.KAnonymityHistogramBucket} KAnonymityHistogramBucket + */ + KAnonymityHistogramBucket.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResult.KAnonymityHistogramBucket) + return object; + var message = new $root.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResult.KAnonymityHistogramBucket(); + if (object.equivalenceClassSizeLowerBound != null) + if ($util.Long) + (message.equivalenceClassSizeLowerBound = $util.Long.fromValue(object.equivalenceClassSizeLowerBound)).unsigned = false; + else if (typeof object.equivalenceClassSizeLowerBound === "string") + message.equivalenceClassSizeLowerBound = parseInt(object.equivalenceClassSizeLowerBound, 10); + else if (typeof object.equivalenceClassSizeLowerBound === "number") + message.equivalenceClassSizeLowerBound = object.equivalenceClassSizeLowerBound; + else if (typeof object.equivalenceClassSizeLowerBound === "object") + message.equivalenceClassSizeLowerBound = new $util.LongBits(object.equivalenceClassSizeLowerBound.low >>> 0, object.equivalenceClassSizeLowerBound.high >>> 0).toNumber(); + if (object.equivalenceClassSizeUpperBound != null) + if ($util.Long) + (message.equivalenceClassSizeUpperBound = $util.Long.fromValue(object.equivalenceClassSizeUpperBound)).unsigned = false; + else if (typeof object.equivalenceClassSizeUpperBound === "string") + message.equivalenceClassSizeUpperBound = parseInt(object.equivalenceClassSizeUpperBound, 10); + else if (typeof object.equivalenceClassSizeUpperBound === "number") + message.equivalenceClassSizeUpperBound = object.equivalenceClassSizeUpperBound; + else if (typeof object.equivalenceClassSizeUpperBound === "object") + message.equivalenceClassSizeUpperBound = new $util.LongBits(object.equivalenceClassSizeUpperBound.low >>> 0, object.equivalenceClassSizeUpperBound.high >>> 0).toNumber(); + if (object.bucketSize != null) + if ($util.Long) + (message.bucketSize = $util.Long.fromValue(object.bucketSize)).unsigned = false; + else if (typeof object.bucketSize === "string") + message.bucketSize = parseInt(object.bucketSize, 10); + else if (typeof object.bucketSize === "number") + message.bucketSize = object.bucketSize; + else if (typeof object.bucketSize === "object") + message.bucketSize = new $util.LongBits(object.bucketSize.low >>> 0, object.bucketSize.high >>> 0).toNumber(); + if (object.bucketValues) { + if (!Array.isArray(object.bucketValues)) + throw TypeError(".google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResult.KAnonymityHistogramBucket.bucketValues: array expected"); + message.bucketValues = []; + for (var i = 0; i < object.bucketValues.length; ++i) { + if (typeof object.bucketValues[i] !== "object") + throw TypeError(".google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResult.KAnonymityHistogramBucket.bucketValues: object expected"); + message.bucketValues[i] = $root.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResult.KAnonymityEquivalenceClass.fromObject(object.bucketValues[i]); + } + } + if (object.bucketValueCount != null) + if ($util.Long) + (message.bucketValueCount = $util.Long.fromValue(object.bucketValueCount)).unsigned = false; + else if (typeof object.bucketValueCount === "string") + message.bucketValueCount = parseInt(object.bucketValueCount, 10); + else if (typeof object.bucketValueCount === "number") + message.bucketValueCount = object.bucketValueCount; + else if (typeof object.bucketValueCount === "object") + message.bucketValueCount = new $util.LongBits(object.bucketValueCount.low >>> 0, object.bucketValueCount.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a KAnonymityHistogramBucket message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResult.KAnonymityHistogramBucket + * @static + * @param {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResult.KAnonymityHistogramBucket} message KAnonymityHistogramBucket + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + KAnonymityHistogramBucket.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.bucketValues = []; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.equivalenceClassSizeLowerBound = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.equivalenceClassSizeLowerBound = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.equivalenceClassSizeUpperBound = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.equivalenceClassSizeUpperBound = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.bucketSize = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.bucketSize = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.bucketValueCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.bucketValueCount = options.longs === String ? "0" : 0; + } + if (message.equivalenceClassSizeLowerBound != null && message.hasOwnProperty("equivalenceClassSizeLowerBound")) + if (typeof message.equivalenceClassSizeLowerBound === "number") + object.equivalenceClassSizeLowerBound = options.longs === String ? String(message.equivalenceClassSizeLowerBound) : message.equivalenceClassSizeLowerBound; + else + object.equivalenceClassSizeLowerBound = options.longs === String ? $util.Long.prototype.toString.call(message.equivalenceClassSizeLowerBound) : options.longs === Number ? new $util.LongBits(message.equivalenceClassSizeLowerBound.low >>> 0, message.equivalenceClassSizeLowerBound.high >>> 0).toNumber() : message.equivalenceClassSizeLowerBound; + if (message.equivalenceClassSizeUpperBound != null && message.hasOwnProperty("equivalenceClassSizeUpperBound")) + if (typeof message.equivalenceClassSizeUpperBound === "number") + object.equivalenceClassSizeUpperBound = options.longs === String ? String(message.equivalenceClassSizeUpperBound) : message.equivalenceClassSizeUpperBound; + else + object.equivalenceClassSizeUpperBound = options.longs === String ? $util.Long.prototype.toString.call(message.equivalenceClassSizeUpperBound) : options.longs === Number ? new $util.LongBits(message.equivalenceClassSizeUpperBound.low >>> 0, message.equivalenceClassSizeUpperBound.high >>> 0).toNumber() : message.equivalenceClassSizeUpperBound; + if (message.bucketSize != null && message.hasOwnProperty("bucketSize")) + if (typeof message.bucketSize === "number") + object.bucketSize = options.longs === String ? String(message.bucketSize) : message.bucketSize; + else + object.bucketSize = options.longs === String ? $util.Long.prototype.toString.call(message.bucketSize) : options.longs === Number ? new $util.LongBits(message.bucketSize.low >>> 0, message.bucketSize.high >>> 0).toNumber() : message.bucketSize; + if (message.bucketValues && message.bucketValues.length) { + object.bucketValues = []; + for (var j = 0; j < message.bucketValues.length; ++j) + object.bucketValues[j] = $root.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResult.KAnonymityEquivalenceClass.toObject(message.bucketValues[j], options); + } + if (message.bucketValueCount != null && message.hasOwnProperty("bucketValueCount")) + if (typeof message.bucketValueCount === "number") + object.bucketValueCount = options.longs === String ? String(message.bucketValueCount) : message.bucketValueCount; + else + object.bucketValueCount = options.longs === String ? $util.Long.prototype.toString.call(message.bucketValueCount) : options.longs === Number ? new $util.LongBits(message.bucketValueCount.low >>> 0, message.bucketValueCount.high >>> 0).toNumber() : message.bucketValueCount; + return object; + }; + + /** + * Converts this KAnonymityHistogramBucket to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResult.KAnonymityHistogramBucket + * @instance + * @returns {Object.} JSON object + */ + KAnonymityHistogramBucket.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return KAnonymityHistogramBucket; + })(); + + return KAnonymityResult; + })(); + + AnalyzeDataSourceRiskDetails.LDiversityResult = (function() { + + /** + * Properties of a LDiversityResult. + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails + * @interface ILDiversityResult + * @property {Array.|null} [sensitiveValueFrequencyHistogramBuckets] LDiversityResult sensitiveValueFrequencyHistogramBuckets + */ + + /** + * Constructs a new LDiversityResult. + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails + * @classdesc Represents a LDiversityResult. + * @implements ILDiversityResult + * @constructor + * @param {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.ILDiversityResult=} [properties] Properties to set + */ + function LDiversityResult(properties) { + this.sensitiveValueFrequencyHistogramBuckets = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LDiversityResult sensitiveValueFrequencyHistogramBuckets. + * @member {Array.} sensitiveValueFrequencyHistogramBuckets + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.LDiversityResult + * @instance + */ + LDiversityResult.prototype.sensitiveValueFrequencyHistogramBuckets = $util.emptyArray; + + /** + * Creates a new LDiversityResult instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.LDiversityResult + * @static + * @param {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.ILDiversityResult=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.LDiversityResult} LDiversityResult instance + */ + LDiversityResult.create = function create(properties) { + return new LDiversityResult(properties); + }; + + /** + * Encodes the specified LDiversityResult message. Does not implicitly {@link google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.LDiversityResult.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.LDiversityResult + * @static + * @param {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.ILDiversityResult} message LDiversityResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LDiversityResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sensitiveValueFrequencyHistogramBuckets != null && message.sensitiveValueFrequencyHistogramBuckets.length) + for (var i = 0; i < message.sensitiveValueFrequencyHistogramBuckets.length; ++i) + $root.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.LDiversityResult.LDiversityHistogramBucket.encode(message.sensitiveValueFrequencyHistogramBuckets[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified LDiversityResult message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.LDiversityResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.LDiversityResult + * @static + * @param {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.ILDiversityResult} message LDiversityResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LDiversityResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LDiversityResult message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.LDiversityResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.LDiversityResult} LDiversityResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LDiversityResult.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.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.LDiversityResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 5: + if (!(message.sensitiveValueFrequencyHistogramBuckets && message.sensitiveValueFrequencyHistogramBuckets.length)) + message.sensitiveValueFrequencyHistogramBuckets = []; + message.sensitiveValueFrequencyHistogramBuckets.push($root.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.LDiversityResult.LDiversityHistogramBucket.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LDiversityResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.LDiversityResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.LDiversityResult} LDiversityResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LDiversityResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LDiversityResult message. + * @function verify + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.LDiversityResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LDiversityResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.sensitiveValueFrequencyHistogramBuckets != null && message.hasOwnProperty("sensitiveValueFrequencyHistogramBuckets")) { + if (!Array.isArray(message.sensitiveValueFrequencyHistogramBuckets)) + return "sensitiveValueFrequencyHistogramBuckets: array expected"; + for (var i = 0; i < message.sensitiveValueFrequencyHistogramBuckets.length; ++i) { + var error = $root.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.LDiversityResult.LDiversityHistogramBucket.verify(message.sensitiveValueFrequencyHistogramBuckets[i]); + if (error) + return "sensitiveValueFrequencyHistogramBuckets." + error; + } + } + return null; + }; + + /** + * Creates a LDiversityResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.LDiversityResult + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.LDiversityResult} LDiversityResult + */ + LDiversityResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.LDiversityResult) + return object; + var message = new $root.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.LDiversityResult(); + if (object.sensitiveValueFrequencyHistogramBuckets) { + if (!Array.isArray(object.sensitiveValueFrequencyHistogramBuckets)) + throw TypeError(".google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.LDiversityResult.sensitiveValueFrequencyHistogramBuckets: array expected"); + message.sensitiveValueFrequencyHistogramBuckets = []; + for (var i = 0; i < object.sensitiveValueFrequencyHistogramBuckets.length; ++i) { + if (typeof object.sensitiveValueFrequencyHistogramBuckets[i] !== "object") + throw TypeError(".google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.LDiversityResult.sensitiveValueFrequencyHistogramBuckets: object expected"); + message.sensitiveValueFrequencyHistogramBuckets[i] = $root.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.LDiversityResult.LDiversityHistogramBucket.fromObject(object.sensitiveValueFrequencyHistogramBuckets[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a LDiversityResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.LDiversityResult + * @static + * @param {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.LDiversityResult} message LDiversityResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LDiversityResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.sensitiveValueFrequencyHistogramBuckets = []; + if (message.sensitiveValueFrequencyHistogramBuckets && message.sensitiveValueFrequencyHistogramBuckets.length) { + object.sensitiveValueFrequencyHistogramBuckets = []; + for (var j = 0; j < message.sensitiveValueFrequencyHistogramBuckets.length; ++j) + object.sensitiveValueFrequencyHistogramBuckets[j] = $root.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.LDiversityResult.LDiversityHistogramBucket.toObject(message.sensitiveValueFrequencyHistogramBuckets[j], options); + } + return object; + }; + + /** + * Converts this LDiversityResult to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.LDiversityResult + * @instance + * @returns {Object.} JSON object + */ + LDiversityResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + LDiversityResult.LDiversityEquivalenceClass = (function() { + + /** + * Properties of a LDiversityEquivalenceClass. + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.LDiversityResult + * @interface ILDiversityEquivalenceClass + * @property {Array.|null} [quasiIdsValues] LDiversityEquivalenceClass quasiIdsValues + * @property {number|Long|null} [equivalenceClassSize] LDiversityEquivalenceClass equivalenceClassSize + * @property {number|Long|null} [numDistinctSensitiveValues] LDiversityEquivalenceClass numDistinctSensitiveValues + * @property {Array.|null} [topSensitiveValues] LDiversityEquivalenceClass topSensitiveValues + */ + + /** + * Constructs a new LDiversityEquivalenceClass. + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.LDiversityResult + * @classdesc Represents a LDiversityEquivalenceClass. + * @implements ILDiversityEquivalenceClass + * @constructor + * @param {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.LDiversityResult.ILDiversityEquivalenceClass=} [properties] Properties to set + */ + function LDiversityEquivalenceClass(properties) { + this.quasiIdsValues = []; + this.topSensitiveValues = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LDiversityEquivalenceClass quasiIdsValues. + * @member {Array.} quasiIdsValues + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.LDiversityResult.LDiversityEquivalenceClass + * @instance + */ + LDiversityEquivalenceClass.prototype.quasiIdsValues = $util.emptyArray; + + /** + * LDiversityEquivalenceClass equivalenceClassSize. + * @member {number|Long} equivalenceClassSize + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.LDiversityResult.LDiversityEquivalenceClass + * @instance + */ + LDiversityEquivalenceClass.prototype.equivalenceClassSize = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * LDiversityEquivalenceClass numDistinctSensitiveValues. + * @member {number|Long} numDistinctSensitiveValues + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.LDiversityResult.LDiversityEquivalenceClass + * @instance + */ + LDiversityEquivalenceClass.prototype.numDistinctSensitiveValues = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * LDiversityEquivalenceClass topSensitiveValues. + * @member {Array.} topSensitiveValues + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.LDiversityResult.LDiversityEquivalenceClass + * @instance + */ + LDiversityEquivalenceClass.prototype.topSensitiveValues = $util.emptyArray; + + /** + * Creates a new LDiversityEquivalenceClass instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.LDiversityResult.LDiversityEquivalenceClass + * @static + * @param {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.LDiversityResult.ILDiversityEquivalenceClass=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.LDiversityResult.LDiversityEquivalenceClass} LDiversityEquivalenceClass instance + */ + LDiversityEquivalenceClass.create = function create(properties) { + return new LDiversityEquivalenceClass(properties); + }; + + /** + * Encodes the specified LDiversityEquivalenceClass message. Does not implicitly {@link google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.LDiversityResult.LDiversityEquivalenceClass.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.LDiversityResult.LDiversityEquivalenceClass + * @static + * @param {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.LDiversityResult.ILDiversityEquivalenceClass} message LDiversityEquivalenceClass message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LDiversityEquivalenceClass.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.quasiIdsValues != null && message.quasiIdsValues.length) + for (var i = 0; i < message.quasiIdsValues.length; ++i) + $root.google.privacy.dlp.v2.Value.encode(message.quasiIdsValues[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.equivalenceClassSize != null && Object.hasOwnProperty.call(message, "equivalenceClassSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.equivalenceClassSize); + if (message.numDistinctSensitiveValues != null && Object.hasOwnProperty.call(message, "numDistinctSensitiveValues")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.numDistinctSensitiveValues); + if (message.topSensitiveValues != null && message.topSensitiveValues.length) + for (var i = 0; i < message.topSensitiveValues.length; ++i) + $root.google.privacy.dlp.v2.ValueFrequency.encode(message.topSensitiveValues[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified LDiversityEquivalenceClass message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.LDiversityResult.LDiversityEquivalenceClass.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.LDiversityResult.LDiversityEquivalenceClass + * @static + * @param {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.LDiversityResult.ILDiversityEquivalenceClass} message LDiversityEquivalenceClass message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LDiversityEquivalenceClass.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LDiversityEquivalenceClass message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.LDiversityResult.LDiversityEquivalenceClass + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.LDiversityResult.LDiversityEquivalenceClass} LDiversityEquivalenceClass + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LDiversityEquivalenceClass.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.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.LDiversityResult.LDiversityEquivalenceClass(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.quasiIdsValues && message.quasiIdsValues.length)) + message.quasiIdsValues = []; + message.quasiIdsValues.push($root.google.privacy.dlp.v2.Value.decode(reader, reader.uint32())); + break; + case 2: + message.equivalenceClassSize = reader.int64(); + break; + case 3: + message.numDistinctSensitiveValues = reader.int64(); + break; + case 4: + if (!(message.topSensitiveValues && message.topSensitiveValues.length)) + message.topSensitiveValues = []; + message.topSensitiveValues.push($root.google.privacy.dlp.v2.ValueFrequency.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LDiversityEquivalenceClass message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.LDiversityResult.LDiversityEquivalenceClass + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.LDiversityResult.LDiversityEquivalenceClass} LDiversityEquivalenceClass + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LDiversityEquivalenceClass.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LDiversityEquivalenceClass message. + * @function verify + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.LDiversityResult.LDiversityEquivalenceClass + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LDiversityEquivalenceClass.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.quasiIdsValues != null && message.hasOwnProperty("quasiIdsValues")) { + if (!Array.isArray(message.quasiIdsValues)) + return "quasiIdsValues: array expected"; + for (var i = 0; i < message.quasiIdsValues.length; ++i) { + var error = $root.google.privacy.dlp.v2.Value.verify(message.quasiIdsValues[i]); + if (error) + return "quasiIdsValues." + error; + } + } + if (message.equivalenceClassSize != null && message.hasOwnProperty("equivalenceClassSize")) + if (!$util.isInteger(message.equivalenceClassSize) && !(message.equivalenceClassSize && $util.isInteger(message.equivalenceClassSize.low) && $util.isInteger(message.equivalenceClassSize.high))) + return "equivalenceClassSize: integer|Long expected"; + if (message.numDistinctSensitiveValues != null && message.hasOwnProperty("numDistinctSensitiveValues")) + if (!$util.isInteger(message.numDistinctSensitiveValues) && !(message.numDistinctSensitiveValues && $util.isInteger(message.numDistinctSensitiveValues.low) && $util.isInteger(message.numDistinctSensitiveValues.high))) + return "numDistinctSensitiveValues: integer|Long expected"; + if (message.topSensitiveValues != null && message.hasOwnProperty("topSensitiveValues")) { + if (!Array.isArray(message.topSensitiveValues)) + return "topSensitiveValues: array expected"; + for (var i = 0; i < message.topSensitiveValues.length; ++i) { + var error = $root.google.privacy.dlp.v2.ValueFrequency.verify(message.topSensitiveValues[i]); + if (error) + return "topSensitiveValues." + error; + } + } + return null; + }; + + /** + * Creates a LDiversityEquivalenceClass message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.LDiversityResult.LDiversityEquivalenceClass + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.LDiversityResult.LDiversityEquivalenceClass} LDiversityEquivalenceClass + */ + LDiversityEquivalenceClass.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.LDiversityResult.LDiversityEquivalenceClass) + return object; + var message = new $root.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.LDiversityResult.LDiversityEquivalenceClass(); + if (object.quasiIdsValues) { + if (!Array.isArray(object.quasiIdsValues)) + throw TypeError(".google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.LDiversityResult.LDiversityEquivalenceClass.quasiIdsValues: array expected"); + message.quasiIdsValues = []; + for (var i = 0; i < object.quasiIdsValues.length; ++i) { + if (typeof object.quasiIdsValues[i] !== "object") + throw TypeError(".google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.LDiversityResult.LDiversityEquivalenceClass.quasiIdsValues: object expected"); + message.quasiIdsValues[i] = $root.google.privacy.dlp.v2.Value.fromObject(object.quasiIdsValues[i]); + } + } + if (object.equivalenceClassSize != null) + if ($util.Long) + (message.equivalenceClassSize = $util.Long.fromValue(object.equivalenceClassSize)).unsigned = false; + else if (typeof object.equivalenceClassSize === "string") + message.equivalenceClassSize = parseInt(object.equivalenceClassSize, 10); + else if (typeof object.equivalenceClassSize === "number") + message.equivalenceClassSize = object.equivalenceClassSize; + else if (typeof object.equivalenceClassSize === "object") + message.equivalenceClassSize = new $util.LongBits(object.equivalenceClassSize.low >>> 0, object.equivalenceClassSize.high >>> 0).toNumber(); + if (object.numDistinctSensitiveValues != null) + if ($util.Long) + (message.numDistinctSensitiveValues = $util.Long.fromValue(object.numDistinctSensitiveValues)).unsigned = false; + else if (typeof object.numDistinctSensitiveValues === "string") + message.numDistinctSensitiveValues = parseInt(object.numDistinctSensitiveValues, 10); + else if (typeof object.numDistinctSensitiveValues === "number") + message.numDistinctSensitiveValues = object.numDistinctSensitiveValues; + else if (typeof object.numDistinctSensitiveValues === "object") + message.numDistinctSensitiveValues = new $util.LongBits(object.numDistinctSensitiveValues.low >>> 0, object.numDistinctSensitiveValues.high >>> 0).toNumber(); + if (object.topSensitiveValues) { + if (!Array.isArray(object.topSensitiveValues)) + throw TypeError(".google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.LDiversityResult.LDiversityEquivalenceClass.topSensitiveValues: array expected"); + message.topSensitiveValues = []; + for (var i = 0; i < object.topSensitiveValues.length; ++i) { + if (typeof object.topSensitiveValues[i] !== "object") + throw TypeError(".google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.LDiversityResult.LDiversityEquivalenceClass.topSensitiveValues: object expected"); + message.topSensitiveValues[i] = $root.google.privacy.dlp.v2.ValueFrequency.fromObject(object.topSensitiveValues[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a LDiversityEquivalenceClass message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.LDiversityResult.LDiversityEquivalenceClass + * @static + * @param {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.LDiversityResult.LDiversityEquivalenceClass} message LDiversityEquivalenceClass + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LDiversityEquivalenceClass.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.quasiIdsValues = []; + object.topSensitiveValues = []; + } + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.equivalenceClassSize = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.equivalenceClassSize = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.numDistinctSensitiveValues = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.numDistinctSensitiveValues = options.longs === String ? "0" : 0; + } + if (message.quasiIdsValues && message.quasiIdsValues.length) { + object.quasiIdsValues = []; + for (var j = 0; j < message.quasiIdsValues.length; ++j) + object.quasiIdsValues[j] = $root.google.privacy.dlp.v2.Value.toObject(message.quasiIdsValues[j], options); + } + if (message.equivalenceClassSize != null && message.hasOwnProperty("equivalenceClassSize")) + if (typeof message.equivalenceClassSize === "number") + object.equivalenceClassSize = options.longs === String ? String(message.equivalenceClassSize) : message.equivalenceClassSize; + else + object.equivalenceClassSize = options.longs === String ? $util.Long.prototype.toString.call(message.equivalenceClassSize) : options.longs === Number ? new $util.LongBits(message.equivalenceClassSize.low >>> 0, message.equivalenceClassSize.high >>> 0).toNumber() : message.equivalenceClassSize; + if (message.numDistinctSensitiveValues != null && message.hasOwnProperty("numDistinctSensitiveValues")) + if (typeof message.numDistinctSensitiveValues === "number") + object.numDistinctSensitiveValues = options.longs === String ? String(message.numDistinctSensitiveValues) : message.numDistinctSensitiveValues; + else + object.numDistinctSensitiveValues = options.longs === String ? $util.Long.prototype.toString.call(message.numDistinctSensitiveValues) : options.longs === Number ? new $util.LongBits(message.numDistinctSensitiveValues.low >>> 0, message.numDistinctSensitiveValues.high >>> 0).toNumber() : message.numDistinctSensitiveValues; + if (message.topSensitiveValues && message.topSensitiveValues.length) { + object.topSensitiveValues = []; + for (var j = 0; j < message.topSensitiveValues.length; ++j) + object.topSensitiveValues[j] = $root.google.privacy.dlp.v2.ValueFrequency.toObject(message.topSensitiveValues[j], options); + } + return object; + }; + + /** + * Converts this LDiversityEquivalenceClass to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.LDiversityResult.LDiversityEquivalenceClass + * @instance + * @returns {Object.} JSON object + */ + LDiversityEquivalenceClass.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return LDiversityEquivalenceClass; + })(); + + LDiversityResult.LDiversityHistogramBucket = (function() { + + /** + * Properties of a LDiversityHistogramBucket. + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.LDiversityResult + * @interface ILDiversityHistogramBucket + * @property {number|Long|null} [sensitiveValueFrequencyLowerBound] LDiversityHistogramBucket sensitiveValueFrequencyLowerBound + * @property {number|Long|null} [sensitiveValueFrequencyUpperBound] LDiversityHistogramBucket sensitiveValueFrequencyUpperBound + * @property {number|Long|null} [bucketSize] LDiversityHistogramBucket bucketSize + * @property {Array.|null} [bucketValues] LDiversityHistogramBucket bucketValues + * @property {number|Long|null} [bucketValueCount] LDiversityHistogramBucket bucketValueCount + */ + + /** + * Constructs a new LDiversityHistogramBucket. + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.LDiversityResult + * @classdesc Represents a LDiversityHistogramBucket. + * @implements ILDiversityHistogramBucket + * @constructor + * @param {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.LDiversityResult.ILDiversityHistogramBucket=} [properties] Properties to set + */ + function LDiversityHistogramBucket(properties) { + this.bucketValues = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LDiversityHistogramBucket sensitiveValueFrequencyLowerBound. + * @member {number|Long} sensitiveValueFrequencyLowerBound + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.LDiversityResult.LDiversityHistogramBucket + * @instance + */ + LDiversityHistogramBucket.prototype.sensitiveValueFrequencyLowerBound = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * LDiversityHistogramBucket sensitiveValueFrequencyUpperBound. + * @member {number|Long} sensitiveValueFrequencyUpperBound + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.LDiversityResult.LDiversityHistogramBucket + * @instance + */ + LDiversityHistogramBucket.prototype.sensitiveValueFrequencyUpperBound = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * LDiversityHistogramBucket bucketSize. + * @member {number|Long} bucketSize + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.LDiversityResult.LDiversityHistogramBucket + * @instance + */ + LDiversityHistogramBucket.prototype.bucketSize = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * LDiversityHistogramBucket bucketValues. + * @member {Array.} bucketValues + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.LDiversityResult.LDiversityHistogramBucket + * @instance + */ + LDiversityHistogramBucket.prototype.bucketValues = $util.emptyArray; + + /** + * LDiversityHistogramBucket bucketValueCount. + * @member {number|Long} bucketValueCount + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.LDiversityResult.LDiversityHistogramBucket + * @instance + */ + LDiversityHistogramBucket.prototype.bucketValueCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new LDiversityHistogramBucket instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.LDiversityResult.LDiversityHistogramBucket + * @static + * @param {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.LDiversityResult.ILDiversityHistogramBucket=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.LDiversityResult.LDiversityHistogramBucket} LDiversityHistogramBucket instance + */ + LDiversityHistogramBucket.create = function create(properties) { + return new LDiversityHistogramBucket(properties); + }; + + /** + * Encodes the specified LDiversityHistogramBucket message. Does not implicitly {@link google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.LDiversityResult.LDiversityHistogramBucket.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.LDiversityResult.LDiversityHistogramBucket + * @static + * @param {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.LDiversityResult.ILDiversityHistogramBucket} message LDiversityHistogramBucket message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LDiversityHistogramBucket.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sensitiveValueFrequencyLowerBound != null && Object.hasOwnProperty.call(message, "sensitiveValueFrequencyLowerBound")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.sensitiveValueFrequencyLowerBound); + if (message.sensitiveValueFrequencyUpperBound != null && Object.hasOwnProperty.call(message, "sensitiveValueFrequencyUpperBound")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.sensitiveValueFrequencyUpperBound); + if (message.bucketSize != null && Object.hasOwnProperty.call(message, "bucketSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.bucketSize); + if (message.bucketValues != null && message.bucketValues.length) + for (var i = 0; i < message.bucketValues.length; ++i) + $root.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.LDiversityResult.LDiversityEquivalenceClass.encode(message.bucketValues[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.bucketValueCount != null && Object.hasOwnProperty.call(message, "bucketValueCount")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.bucketValueCount); + return writer; + }; + + /** + * Encodes the specified LDiversityHistogramBucket message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.LDiversityResult.LDiversityHistogramBucket.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.LDiversityResult.LDiversityHistogramBucket + * @static + * @param {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.LDiversityResult.ILDiversityHistogramBucket} message LDiversityHistogramBucket message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LDiversityHistogramBucket.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LDiversityHistogramBucket message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.LDiversityResult.LDiversityHistogramBucket + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.LDiversityResult.LDiversityHistogramBucket} LDiversityHistogramBucket + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LDiversityHistogramBucket.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.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.LDiversityResult.LDiversityHistogramBucket(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sensitiveValueFrequencyLowerBound = reader.int64(); + break; + case 2: + message.sensitiveValueFrequencyUpperBound = reader.int64(); + break; + case 3: + message.bucketSize = reader.int64(); + break; + case 4: + if (!(message.bucketValues && message.bucketValues.length)) + message.bucketValues = []; + message.bucketValues.push($root.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.LDiversityResult.LDiversityEquivalenceClass.decode(reader, reader.uint32())); + break; + case 5: + message.bucketValueCount = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LDiversityHistogramBucket message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.LDiversityResult.LDiversityHistogramBucket + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.LDiversityResult.LDiversityHistogramBucket} LDiversityHistogramBucket + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LDiversityHistogramBucket.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LDiversityHistogramBucket message. + * @function verify + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.LDiversityResult.LDiversityHistogramBucket + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LDiversityHistogramBucket.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.sensitiveValueFrequencyLowerBound != null && message.hasOwnProperty("sensitiveValueFrequencyLowerBound")) + if (!$util.isInteger(message.sensitiveValueFrequencyLowerBound) && !(message.sensitiveValueFrequencyLowerBound && $util.isInteger(message.sensitiveValueFrequencyLowerBound.low) && $util.isInteger(message.sensitiveValueFrequencyLowerBound.high))) + return "sensitiveValueFrequencyLowerBound: integer|Long expected"; + if (message.sensitiveValueFrequencyUpperBound != null && message.hasOwnProperty("sensitiveValueFrequencyUpperBound")) + if (!$util.isInteger(message.sensitiveValueFrequencyUpperBound) && !(message.sensitiveValueFrequencyUpperBound && $util.isInteger(message.sensitiveValueFrequencyUpperBound.low) && $util.isInteger(message.sensitiveValueFrequencyUpperBound.high))) + return "sensitiveValueFrequencyUpperBound: integer|Long expected"; + if (message.bucketSize != null && message.hasOwnProperty("bucketSize")) + if (!$util.isInteger(message.bucketSize) && !(message.bucketSize && $util.isInteger(message.bucketSize.low) && $util.isInteger(message.bucketSize.high))) + return "bucketSize: integer|Long expected"; + if (message.bucketValues != null && message.hasOwnProperty("bucketValues")) { + if (!Array.isArray(message.bucketValues)) + return "bucketValues: array expected"; + for (var i = 0; i < message.bucketValues.length; ++i) { + var error = $root.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.LDiversityResult.LDiversityEquivalenceClass.verify(message.bucketValues[i]); + if (error) + return "bucketValues." + error; + } + } + if (message.bucketValueCount != null && message.hasOwnProperty("bucketValueCount")) + if (!$util.isInteger(message.bucketValueCount) && !(message.bucketValueCount && $util.isInteger(message.bucketValueCount.low) && $util.isInteger(message.bucketValueCount.high))) + return "bucketValueCount: integer|Long expected"; + return null; + }; + + /** + * Creates a LDiversityHistogramBucket message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.LDiversityResult.LDiversityHistogramBucket + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.LDiversityResult.LDiversityHistogramBucket} LDiversityHistogramBucket + */ + LDiversityHistogramBucket.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.LDiversityResult.LDiversityHistogramBucket) + return object; + var message = new $root.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.LDiversityResult.LDiversityHistogramBucket(); + if (object.sensitiveValueFrequencyLowerBound != null) + if ($util.Long) + (message.sensitiveValueFrequencyLowerBound = $util.Long.fromValue(object.sensitiveValueFrequencyLowerBound)).unsigned = false; + else if (typeof object.sensitiveValueFrequencyLowerBound === "string") + message.sensitiveValueFrequencyLowerBound = parseInt(object.sensitiveValueFrequencyLowerBound, 10); + else if (typeof object.sensitiveValueFrequencyLowerBound === "number") + message.sensitiveValueFrequencyLowerBound = object.sensitiveValueFrequencyLowerBound; + else if (typeof object.sensitiveValueFrequencyLowerBound === "object") + message.sensitiveValueFrequencyLowerBound = new $util.LongBits(object.sensitiveValueFrequencyLowerBound.low >>> 0, object.sensitiveValueFrequencyLowerBound.high >>> 0).toNumber(); + if (object.sensitiveValueFrequencyUpperBound != null) + if ($util.Long) + (message.sensitiveValueFrequencyUpperBound = $util.Long.fromValue(object.sensitiveValueFrequencyUpperBound)).unsigned = false; + else if (typeof object.sensitiveValueFrequencyUpperBound === "string") + message.sensitiveValueFrequencyUpperBound = parseInt(object.sensitiveValueFrequencyUpperBound, 10); + else if (typeof object.sensitiveValueFrequencyUpperBound === "number") + message.sensitiveValueFrequencyUpperBound = object.sensitiveValueFrequencyUpperBound; + else if (typeof object.sensitiveValueFrequencyUpperBound === "object") + message.sensitiveValueFrequencyUpperBound = new $util.LongBits(object.sensitiveValueFrequencyUpperBound.low >>> 0, object.sensitiveValueFrequencyUpperBound.high >>> 0).toNumber(); + if (object.bucketSize != null) + if ($util.Long) + (message.bucketSize = $util.Long.fromValue(object.bucketSize)).unsigned = false; + else if (typeof object.bucketSize === "string") + message.bucketSize = parseInt(object.bucketSize, 10); + else if (typeof object.bucketSize === "number") + message.bucketSize = object.bucketSize; + else if (typeof object.bucketSize === "object") + message.bucketSize = new $util.LongBits(object.bucketSize.low >>> 0, object.bucketSize.high >>> 0).toNumber(); + if (object.bucketValues) { + if (!Array.isArray(object.bucketValues)) + throw TypeError(".google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.LDiversityResult.LDiversityHistogramBucket.bucketValues: array expected"); + message.bucketValues = []; + for (var i = 0; i < object.bucketValues.length; ++i) { + if (typeof object.bucketValues[i] !== "object") + throw TypeError(".google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.LDiversityResult.LDiversityHistogramBucket.bucketValues: object expected"); + message.bucketValues[i] = $root.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.LDiversityResult.LDiversityEquivalenceClass.fromObject(object.bucketValues[i]); + } + } + if (object.bucketValueCount != null) + if ($util.Long) + (message.bucketValueCount = $util.Long.fromValue(object.bucketValueCount)).unsigned = false; + else if (typeof object.bucketValueCount === "string") + message.bucketValueCount = parseInt(object.bucketValueCount, 10); + else if (typeof object.bucketValueCount === "number") + message.bucketValueCount = object.bucketValueCount; + else if (typeof object.bucketValueCount === "object") + message.bucketValueCount = new $util.LongBits(object.bucketValueCount.low >>> 0, object.bucketValueCount.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a LDiversityHistogramBucket message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.LDiversityResult.LDiversityHistogramBucket + * @static + * @param {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.LDiversityResult.LDiversityHistogramBucket} message LDiversityHistogramBucket + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LDiversityHistogramBucket.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.bucketValues = []; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.sensitiveValueFrequencyLowerBound = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.sensitiveValueFrequencyLowerBound = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.sensitiveValueFrequencyUpperBound = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.sensitiveValueFrequencyUpperBound = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.bucketSize = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.bucketSize = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.bucketValueCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.bucketValueCount = options.longs === String ? "0" : 0; + } + if (message.sensitiveValueFrequencyLowerBound != null && message.hasOwnProperty("sensitiveValueFrequencyLowerBound")) + if (typeof message.sensitiveValueFrequencyLowerBound === "number") + object.sensitiveValueFrequencyLowerBound = options.longs === String ? String(message.sensitiveValueFrequencyLowerBound) : message.sensitiveValueFrequencyLowerBound; + else + object.sensitiveValueFrequencyLowerBound = options.longs === String ? $util.Long.prototype.toString.call(message.sensitiveValueFrequencyLowerBound) : options.longs === Number ? new $util.LongBits(message.sensitiveValueFrequencyLowerBound.low >>> 0, message.sensitiveValueFrequencyLowerBound.high >>> 0).toNumber() : message.sensitiveValueFrequencyLowerBound; + if (message.sensitiveValueFrequencyUpperBound != null && message.hasOwnProperty("sensitiveValueFrequencyUpperBound")) + if (typeof message.sensitiveValueFrequencyUpperBound === "number") + object.sensitiveValueFrequencyUpperBound = options.longs === String ? String(message.sensitiveValueFrequencyUpperBound) : message.sensitiveValueFrequencyUpperBound; + else + object.sensitiveValueFrequencyUpperBound = options.longs === String ? $util.Long.prototype.toString.call(message.sensitiveValueFrequencyUpperBound) : options.longs === Number ? new $util.LongBits(message.sensitiveValueFrequencyUpperBound.low >>> 0, message.sensitiveValueFrequencyUpperBound.high >>> 0).toNumber() : message.sensitiveValueFrequencyUpperBound; + if (message.bucketSize != null && message.hasOwnProperty("bucketSize")) + if (typeof message.bucketSize === "number") + object.bucketSize = options.longs === String ? String(message.bucketSize) : message.bucketSize; + else + object.bucketSize = options.longs === String ? $util.Long.prototype.toString.call(message.bucketSize) : options.longs === Number ? new $util.LongBits(message.bucketSize.low >>> 0, message.bucketSize.high >>> 0).toNumber() : message.bucketSize; + if (message.bucketValues && message.bucketValues.length) { + object.bucketValues = []; + for (var j = 0; j < message.bucketValues.length; ++j) + object.bucketValues[j] = $root.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.LDiversityResult.LDiversityEquivalenceClass.toObject(message.bucketValues[j], options); + } + if (message.bucketValueCount != null && message.hasOwnProperty("bucketValueCount")) + if (typeof message.bucketValueCount === "number") + object.bucketValueCount = options.longs === String ? String(message.bucketValueCount) : message.bucketValueCount; + else + object.bucketValueCount = options.longs === String ? $util.Long.prototype.toString.call(message.bucketValueCount) : options.longs === Number ? new $util.LongBits(message.bucketValueCount.low >>> 0, message.bucketValueCount.high >>> 0).toNumber() : message.bucketValueCount; + return object; + }; + + /** + * Converts this LDiversityHistogramBucket to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.LDiversityResult.LDiversityHistogramBucket + * @instance + * @returns {Object.} JSON object + */ + LDiversityHistogramBucket.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return LDiversityHistogramBucket; + })(); + + return LDiversityResult; + })(); + + AnalyzeDataSourceRiskDetails.KMapEstimationResult = (function() { + + /** + * Properties of a KMapEstimationResult. + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails + * @interface IKMapEstimationResult + * @property {Array.|null} [kMapEstimationHistogram] KMapEstimationResult kMapEstimationHistogram + */ + + /** + * Constructs a new KMapEstimationResult. + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails + * @classdesc Represents a KMapEstimationResult. + * @implements IKMapEstimationResult + * @constructor + * @param {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.IKMapEstimationResult=} [properties] Properties to set + */ + function KMapEstimationResult(properties) { + this.kMapEstimationHistogram = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * KMapEstimationResult kMapEstimationHistogram. + * @member {Array.} kMapEstimationHistogram + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult + * @instance + */ + KMapEstimationResult.prototype.kMapEstimationHistogram = $util.emptyArray; + + /** + * Creates a new KMapEstimationResult instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult + * @static + * @param {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.IKMapEstimationResult=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult} KMapEstimationResult instance + */ + KMapEstimationResult.create = function create(properties) { + return new KMapEstimationResult(properties); + }; + + /** + * Encodes the specified KMapEstimationResult message. Does not implicitly {@link google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult + * @static + * @param {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.IKMapEstimationResult} message KMapEstimationResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KMapEstimationResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.kMapEstimationHistogram != null && message.kMapEstimationHistogram.length) + for (var i = 0; i < message.kMapEstimationHistogram.length; ++i) + $root.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult.KMapEstimationHistogramBucket.encode(message.kMapEstimationHistogram[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified KMapEstimationResult message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult + * @static + * @param {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.IKMapEstimationResult} message KMapEstimationResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KMapEstimationResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a KMapEstimationResult message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult} KMapEstimationResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KMapEstimationResult.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.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.kMapEstimationHistogram && message.kMapEstimationHistogram.length)) + message.kMapEstimationHistogram = []; + message.kMapEstimationHistogram.push($root.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult.KMapEstimationHistogramBucket.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a KMapEstimationResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult} KMapEstimationResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KMapEstimationResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a KMapEstimationResult message. + * @function verify + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + KMapEstimationResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.kMapEstimationHistogram != null && message.hasOwnProperty("kMapEstimationHistogram")) { + if (!Array.isArray(message.kMapEstimationHistogram)) + return "kMapEstimationHistogram: array expected"; + for (var i = 0; i < message.kMapEstimationHistogram.length; ++i) { + var error = $root.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult.KMapEstimationHistogramBucket.verify(message.kMapEstimationHistogram[i]); + if (error) + return "kMapEstimationHistogram." + error; + } + } + return null; + }; + + /** + * Creates a KMapEstimationResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult} KMapEstimationResult + */ + KMapEstimationResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult) + return object; + var message = new $root.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult(); + if (object.kMapEstimationHistogram) { + if (!Array.isArray(object.kMapEstimationHistogram)) + throw TypeError(".google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult.kMapEstimationHistogram: array expected"); + message.kMapEstimationHistogram = []; + for (var i = 0; i < object.kMapEstimationHistogram.length; ++i) { + if (typeof object.kMapEstimationHistogram[i] !== "object") + throw TypeError(".google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult.kMapEstimationHistogram: object expected"); + message.kMapEstimationHistogram[i] = $root.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult.KMapEstimationHistogramBucket.fromObject(object.kMapEstimationHistogram[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a KMapEstimationResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult + * @static + * @param {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult} message KMapEstimationResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + KMapEstimationResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.kMapEstimationHistogram = []; + if (message.kMapEstimationHistogram && message.kMapEstimationHistogram.length) { + object.kMapEstimationHistogram = []; + for (var j = 0; j < message.kMapEstimationHistogram.length; ++j) + object.kMapEstimationHistogram[j] = $root.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult.KMapEstimationHistogramBucket.toObject(message.kMapEstimationHistogram[j], options); + } + return object; + }; + + /** + * Converts this KMapEstimationResult to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult + * @instance + * @returns {Object.} JSON object + */ + KMapEstimationResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + KMapEstimationResult.KMapEstimationQuasiIdValues = (function() { + + /** + * Properties of a KMapEstimationQuasiIdValues. + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult + * @interface IKMapEstimationQuasiIdValues + * @property {Array.|null} [quasiIdsValues] KMapEstimationQuasiIdValues quasiIdsValues + * @property {number|Long|null} [estimatedAnonymity] KMapEstimationQuasiIdValues estimatedAnonymity + */ + + /** + * Constructs a new KMapEstimationQuasiIdValues. + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult + * @classdesc Represents a KMapEstimationQuasiIdValues. + * @implements IKMapEstimationQuasiIdValues + * @constructor + * @param {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult.IKMapEstimationQuasiIdValues=} [properties] Properties to set + */ + function KMapEstimationQuasiIdValues(properties) { + this.quasiIdsValues = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * KMapEstimationQuasiIdValues quasiIdsValues. + * @member {Array.} quasiIdsValues + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult.KMapEstimationQuasiIdValues + * @instance + */ + KMapEstimationQuasiIdValues.prototype.quasiIdsValues = $util.emptyArray; + + /** + * KMapEstimationQuasiIdValues estimatedAnonymity. + * @member {number|Long} estimatedAnonymity + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult.KMapEstimationQuasiIdValues + * @instance + */ + KMapEstimationQuasiIdValues.prototype.estimatedAnonymity = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new KMapEstimationQuasiIdValues instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult.KMapEstimationQuasiIdValues + * @static + * @param {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult.IKMapEstimationQuasiIdValues=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult.KMapEstimationQuasiIdValues} KMapEstimationQuasiIdValues instance + */ + KMapEstimationQuasiIdValues.create = function create(properties) { + return new KMapEstimationQuasiIdValues(properties); + }; + + /** + * Encodes the specified KMapEstimationQuasiIdValues message. Does not implicitly {@link google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult.KMapEstimationQuasiIdValues.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult.KMapEstimationQuasiIdValues + * @static + * @param {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult.IKMapEstimationQuasiIdValues} message KMapEstimationQuasiIdValues message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KMapEstimationQuasiIdValues.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.quasiIdsValues != null && message.quasiIdsValues.length) + for (var i = 0; i < message.quasiIdsValues.length; ++i) + $root.google.privacy.dlp.v2.Value.encode(message.quasiIdsValues[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.estimatedAnonymity != null && Object.hasOwnProperty.call(message, "estimatedAnonymity")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.estimatedAnonymity); + return writer; + }; + + /** + * Encodes the specified KMapEstimationQuasiIdValues message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult.KMapEstimationQuasiIdValues.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult.KMapEstimationQuasiIdValues + * @static + * @param {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult.IKMapEstimationQuasiIdValues} message KMapEstimationQuasiIdValues message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KMapEstimationQuasiIdValues.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a KMapEstimationQuasiIdValues message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult.KMapEstimationQuasiIdValues + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult.KMapEstimationQuasiIdValues} KMapEstimationQuasiIdValues + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KMapEstimationQuasiIdValues.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.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult.KMapEstimationQuasiIdValues(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.quasiIdsValues && message.quasiIdsValues.length)) + message.quasiIdsValues = []; + message.quasiIdsValues.push($root.google.privacy.dlp.v2.Value.decode(reader, reader.uint32())); + break; + case 2: + message.estimatedAnonymity = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a KMapEstimationQuasiIdValues message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult.KMapEstimationQuasiIdValues + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult.KMapEstimationQuasiIdValues} KMapEstimationQuasiIdValues + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KMapEstimationQuasiIdValues.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a KMapEstimationQuasiIdValues message. + * @function verify + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult.KMapEstimationQuasiIdValues + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + KMapEstimationQuasiIdValues.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.quasiIdsValues != null && message.hasOwnProperty("quasiIdsValues")) { + if (!Array.isArray(message.quasiIdsValues)) + return "quasiIdsValues: array expected"; + for (var i = 0; i < message.quasiIdsValues.length; ++i) { + var error = $root.google.privacy.dlp.v2.Value.verify(message.quasiIdsValues[i]); + if (error) + return "quasiIdsValues." + error; + } + } + if (message.estimatedAnonymity != null && message.hasOwnProperty("estimatedAnonymity")) + if (!$util.isInteger(message.estimatedAnonymity) && !(message.estimatedAnonymity && $util.isInteger(message.estimatedAnonymity.low) && $util.isInteger(message.estimatedAnonymity.high))) + return "estimatedAnonymity: integer|Long expected"; + return null; + }; + + /** + * Creates a KMapEstimationQuasiIdValues message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult.KMapEstimationQuasiIdValues + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult.KMapEstimationQuasiIdValues} KMapEstimationQuasiIdValues + */ + KMapEstimationQuasiIdValues.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult.KMapEstimationQuasiIdValues) + return object; + var message = new $root.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult.KMapEstimationQuasiIdValues(); + if (object.quasiIdsValues) { + if (!Array.isArray(object.quasiIdsValues)) + throw TypeError(".google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult.KMapEstimationQuasiIdValues.quasiIdsValues: array expected"); + message.quasiIdsValues = []; + for (var i = 0; i < object.quasiIdsValues.length; ++i) { + if (typeof object.quasiIdsValues[i] !== "object") + throw TypeError(".google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult.KMapEstimationQuasiIdValues.quasiIdsValues: object expected"); + message.quasiIdsValues[i] = $root.google.privacy.dlp.v2.Value.fromObject(object.quasiIdsValues[i]); + } + } + if (object.estimatedAnonymity != null) + if ($util.Long) + (message.estimatedAnonymity = $util.Long.fromValue(object.estimatedAnonymity)).unsigned = false; + else if (typeof object.estimatedAnonymity === "string") + message.estimatedAnonymity = parseInt(object.estimatedAnonymity, 10); + else if (typeof object.estimatedAnonymity === "number") + message.estimatedAnonymity = object.estimatedAnonymity; + else if (typeof object.estimatedAnonymity === "object") + message.estimatedAnonymity = new $util.LongBits(object.estimatedAnonymity.low >>> 0, object.estimatedAnonymity.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a KMapEstimationQuasiIdValues message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult.KMapEstimationQuasiIdValues + * @static + * @param {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult.KMapEstimationQuasiIdValues} message KMapEstimationQuasiIdValues + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + KMapEstimationQuasiIdValues.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.quasiIdsValues = []; + if (options.defaults) + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.estimatedAnonymity = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.estimatedAnonymity = options.longs === String ? "0" : 0; + if (message.quasiIdsValues && message.quasiIdsValues.length) { + object.quasiIdsValues = []; + for (var j = 0; j < message.quasiIdsValues.length; ++j) + object.quasiIdsValues[j] = $root.google.privacy.dlp.v2.Value.toObject(message.quasiIdsValues[j], options); + } + if (message.estimatedAnonymity != null && message.hasOwnProperty("estimatedAnonymity")) + if (typeof message.estimatedAnonymity === "number") + object.estimatedAnonymity = options.longs === String ? String(message.estimatedAnonymity) : message.estimatedAnonymity; + else + object.estimatedAnonymity = options.longs === String ? $util.Long.prototype.toString.call(message.estimatedAnonymity) : options.longs === Number ? new $util.LongBits(message.estimatedAnonymity.low >>> 0, message.estimatedAnonymity.high >>> 0).toNumber() : message.estimatedAnonymity; + return object; + }; + + /** + * Converts this KMapEstimationQuasiIdValues to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult.KMapEstimationQuasiIdValues + * @instance + * @returns {Object.} JSON object + */ + KMapEstimationQuasiIdValues.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return KMapEstimationQuasiIdValues; + })(); + + KMapEstimationResult.KMapEstimationHistogramBucket = (function() { + + /** + * Properties of a KMapEstimationHistogramBucket. + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult + * @interface IKMapEstimationHistogramBucket + * @property {number|Long|null} [minAnonymity] KMapEstimationHistogramBucket minAnonymity + * @property {number|Long|null} [maxAnonymity] KMapEstimationHistogramBucket maxAnonymity + * @property {number|Long|null} [bucketSize] KMapEstimationHistogramBucket bucketSize + * @property {Array.|null} [bucketValues] KMapEstimationHistogramBucket bucketValues + * @property {number|Long|null} [bucketValueCount] KMapEstimationHistogramBucket bucketValueCount + */ + + /** + * Constructs a new KMapEstimationHistogramBucket. + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult + * @classdesc Represents a KMapEstimationHistogramBucket. + * @implements IKMapEstimationHistogramBucket + * @constructor + * @param {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult.IKMapEstimationHistogramBucket=} [properties] Properties to set + */ + function KMapEstimationHistogramBucket(properties) { + this.bucketValues = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * KMapEstimationHistogramBucket minAnonymity. + * @member {number|Long} minAnonymity + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult.KMapEstimationHistogramBucket + * @instance + */ + KMapEstimationHistogramBucket.prototype.minAnonymity = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * KMapEstimationHistogramBucket maxAnonymity. + * @member {number|Long} maxAnonymity + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult.KMapEstimationHistogramBucket + * @instance + */ + KMapEstimationHistogramBucket.prototype.maxAnonymity = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * KMapEstimationHistogramBucket bucketSize. + * @member {number|Long} bucketSize + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult.KMapEstimationHistogramBucket + * @instance + */ + KMapEstimationHistogramBucket.prototype.bucketSize = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * KMapEstimationHistogramBucket bucketValues. + * @member {Array.} bucketValues + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult.KMapEstimationHistogramBucket + * @instance + */ + KMapEstimationHistogramBucket.prototype.bucketValues = $util.emptyArray; + + /** + * KMapEstimationHistogramBucket bucketValueCount. + * @member {number|Long} bucketValueCount + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult.KMapEstimationHistogramBucket + * @instance + */ + KMapEstimationHistogramBucket.prototype.bucketValueCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new KMapEstimationHistogramBucket instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult.KMapEstimationHistogramBucket + * @static + * @param {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult.IKMapEstimationHistogramBucket=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult.KMapEstimationHistogramBucket} KMapEstimationHistogramBucket instance + */ + KMapEstimationHistogramBucket.create = function create(properties) { + return new KMapEstimationHistogramBucket(properties); + }; + + /** + * Encodes the specified KMapEstimationHistogramBucket message. Does not implicitly {@link google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult.KMapEstimationHistogramBucket.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult.KMapEstimationHistogramBucket + * @static + * @param {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult.IKMapEstimationHistogramBucket} message KMapEstimationHistogramBucket message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KMapEstimationHistogramBucket.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.minAnonymity != null && Object.hasOwnProperty.call(message, "minAnonymity")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.minAnonymity); + if (message.maxAnonymity != null && Object.hasOwnProperty.call(message, "maxAnonymity")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.maxAnonymity); + if (message.bucketSize != null && Object.hasOwnProperty.call(message, "bucketSize")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.bucketSize); + if (message.bucketValues != null && message.bucketValues.length) + for (var i = 0; i < message.bucketValues.length; ++i) + $root.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult.KMapEstimationQuasiIdValues.encode(message.bucketValues[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.bucketValueCount != null && Object.hasOwnProperty.call(message, "bucketValueCount")) + writer.uint32(/* id 7, wireType 0 =*/56).int64(message.bucketValueCount); + return writer; + }; + + /** + * Encodes the specified KMapEstimationHistogramBucket message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult.KMapEstimationHistogramBucket.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult.KMapEstimationHistogramBucket + * @static + * @param {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult.IKMapEstimationHistogramBucket} message KMapEstimationHistogramBucket message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KMapEstimationHistogramBucket.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a KMapEstimationHistogramBucket message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult.KMapEstimationHistogramBucket + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult.KMapEstimationHistogramBucket} KMapEstimationHistogramBucket + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KMapEstimationHistogramBucket.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.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult.KMapEstimationHistogramBucket(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.minAnonymity = reader.int64(); + break; + case 2: + message.maxAnonymity = reader.int64(); + break; + case 5: + message.bucketSize = reader.int64(); + break; + case 6: + if (!(message.bucketValues && message.bucketValues.length)) + message.bucketValues = []; + message.bucketValues.push($root.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult.KMapEstimationQuasiIdValues.decode(reader, reader.uint32())); + break; + case 7: + message.bucketValueCount = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a KMapEstimationHistogramBucket message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult.KMapEstimationHistogramBucket + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult.KMapEstimationHistogramBucket} KMapEstimationHistogramBucket + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KMapEstimationHistogramBucket.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a KMapEstimationHistogramBucket message. + * @function verify + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult.KMapEstimationHistogramBucket + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + KMapEstimationHistogramBucket.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.minAnonymity != null && message.hasOwnProperty("minAnonymity")) + if (!$util.isInteger(message.minAnonymity) && !(message.minAnonymity && $util.isInteger(message.minAnonymity.low) && $util.isInteger(message.minAnonymity.high))) + return "minAnonymity: integer|Long expected"; + if (message.maxAnonymity != null && message.hasOwnProperty("maxAnonymity")) + if (!$util.isInteger(message.maxAnonymity) && !(message.maxAnonymity && $util.isInteger(message.maxAnonymity.low) && $util.isInteger(message.maxAnonymity.high))) + return "maxAnonymity: integer|Long expected"; + if (message.bucketSize != null && message.hasOwnProperty("bucketSize")) + if (!$util.isInteger(message.bucketSize) && !(message.bucketSize && $util.isInteger(message.bucketSize.low) && $util.isInteger(message.bucketSize.high))) + return "bucketSize: integer|Long expected"; + if (message.bucketValues != null && message.hasOwnProperty("bucketValues")) { + if (!Array.isArray(message.bucketValues)) + return "bucketValues: array expected"; + for (var i = 0; i < message.bucketValues.length; ++i) { + var error = $root.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult.KMapEstimationQuasiIdValues.verify(message.bucketValues[i]); + if (error) + return "bucketValues." + error; + } + } + if (message.bucketValueCount != null && message.hasOwnProperty("bucketValueCount")) + if (!$util.isInteger(message.bucketValueCount) && !(message.bucketValueCount && $util.isInteger(message.bucketValueCount.low) && $util.isInteger(message.bucketValueCount.high))) + return "bucketValueCount: integer|Long expected"; + return null; + }; + + /** + * Creates a KMapEstimationHistogramBucket message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult.KMapEstimationHistogramBucket + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult.KMapEstimationHistogramBucket} KMapEstimationHistogramBucket + */ + KMapEstimationHistogramBucket.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult.KMapEstimationHistogramBucket) + return object; + var message = new $root.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult.KMapEstimationHistogramBucket(); + if (object.minAnonymity != null) + if ($util.Long) + (message.minAnonymity = $util.Long.fromValue(object.minAnonymity)).unsigned = false; + else if (typeof object.minAnonymity === "string") + message.minAnonymity = parseInt(object.minAnonymity, 10); + else if (typeof object.minAnonymity === "number") + message.minAnonymity = object.minAnonymity; + else if (typeof object.minAnonymity === "object") + message.minAnonymity = new $util.LongBits(object.minAnonymity.low >>> 0, object.minAnonymity.high >>> 0).toNumber(); + if (object.maxAnonymity != null) + if ($util.Long) + (message.maxAnonymity = $util.Long.fromValue(object.maxAnonymity)).unsigned = false; + else if (typeof object.maxAnonymity === "string") + message.maxAnonymity = parseInt(object.maxAnonymity, 10); + else if (typeof object.maxAnonymity === "number") + message.maxAnonymity = object.maxAnonymity; + else if (typeof object.maxAnonymity === "object") + message.maxAnonymity = new $util.LongBits(object.maxAnonymity.low >>> 0, object.maxAnonymity.high >>> 0).toNumber(); + if (object.bucketSize != null) + if ($util.Long) + (message.bucketSize = $util.Long.fromValue(object.bucketSize)).unsigned = false; + else if (typeof object.bucketSize === "string") + message.bucketSize = parseInt(object.bucketSize, 10); + else if (typeof object.bucketSize === "number") + message.bucketSize = object.bucketSize; + else if (typeof object.bucketSize === "object") + message.bucketSize = new $util.LongBits(object.bucketSize.low >>> 0, object.bucketSize.high >>> 0).toNumber(); + if (object.bucketValues) { + if (!Array.isArray(object.bucketValues)) + throw TypeError(".google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult.KMapEstimationHistogramBucket.bucketValues: array expected"); + message.bucketValues = []; + for (var i = 0; i < object.bucketValues.length; ++i) { + if (typeof object.bucketValues[i] !== "object") + throw TypeError(".google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult.KMapEstimationHistogramBucket.bucketValues: object expected"); + message.bucketValues[i] = $root.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult.KMapEstimationQuasiIdValues.fromObject(object.bucketValues[i]); + } + } + if (object.bucketValueCount != null) + if ($util.Long) + (message.bucketValueCount = $util.Long.fromValue(object.bucketValueCount)).unsigned = false; + else if (typeof object.bucketValueCount === "string") + message.bucketValueCount = parseInt(object.bucketValueCount, 10); + else if (typeof object.bucketValueCount === "number") + message.bucketValueCount = object.bucketValueCount; + else if (typeof object.bucketValueCount === "object") + message.bucketValueCount = new $util.LongBits(object.bucketValueCount.low >>> 0, object.bucketValueCount.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a KMapEstimationHistogramBucket message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult.KMapEstimationHistogramBucket + * @static + * @param {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult.KMapEstimationHistogramBucket} message KMapEstimationHistogramBucket + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + KMapEstimationHistogramBucket.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.bucketValues = []; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.minAnonymity = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.minAnonymity = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.maxAnonymity = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.maxAnonymity = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.bucketSize = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.bucketSize = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.bucketValueCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.bucketValueCount = options.longs === String ? "0" : 0; + } + if (message.minAnonymity != null && message.hasOwnProperty("minAnonymity")) + if (typeof message.minAnonymity === "number") + object.minAnonymity = options.longs === String ? String(message.minAnonymity) : message.minAnonymity; + else + object.minAnonymity = options.longs === String ? $util.Long.prototype.toString.call(message.minAnonymity) : options.longs === Number ? new $util.LongBits(message.minAnonymity.low >>> 0, message.minAnonymity.high >>> 0).toNumber() : message.minAnonymity; + if (message.maxAnonymity != null && message.hasOwnProperty("maxAnonymity")) + if (typeof message.maxAnonymity === "number") + object.maxAnonymity = options.longs === String ? String(message.maxAnonymity) : message.maxAnonymity; + else + object.maxAnonymity = options.longs === String ? $util.Long.prototype.toString.call(message.maxAnonymity) : options.longs === Number ? new $util.LongBits(message.maxAnonymity.low >>> 0, message.maxAnonymity.high >>> 0).toNumber() : message.maxAnonymity; + if (message.bucketSize != null && message.hasOwnProperty("bucketSize")) + if (typeof message.bucketSize === "number") + object.bucketSize = options.longs === String ? String(message.bucketSize) : message.bucketSize; + else + object.bucketSize = options.longs === String ? $util.Long.prototype.toString.call(message.bucketSize) : options.longs === Number ? new $util.LongBits(message.bucketSize.low >>> 0, message.bucketSize.high >>> 0).toNumber() : message.bucketSize; + if (message.bucketValues && message.bucketValues.length) { + object.bucketValues = []; + for (var j = 0; j < message.bucketValues.length; ++j) + object.bucketValues[j] = $root.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult.KMapEstimationQuasiIdValues.toObject(message.bucketValues[j], options); + } + if (message.bucketValueCount != null && message.hasOwnProperty("bucketValueCount")) + if (typeof message.bucketValueCount === "number") + object.bucketValueCount = options.longs === String ? String(message.bucketValueCount) : message.bucketValueCount; + else + object.bucketValueCount = options.longs === String ? $util.Long.prototype.toString.call(message.bucketValueCount) : options.longs === Number ? new $util.LongBits(message.bucketValueCount.low >>> 0, message.bucketValueCount.high >>> 0).toNumber() : message.bucketValueCount; + return object; + }; + + /** + * Converts this KMapEstimationHistogramBucket to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult.KMapEstimationHistogramBucket + * @instance + * @returns {Object.} JSON object + */ + KMapEstimationHistogramBucket.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return KMapEstimationHistogramBucket; + })(); + + return KMapEstimationResult; + })(); + + AnalyzeDataSourceRiskDetails.DeltaPresenceEstimationResult = (function() { + + /** + * Properties of a DeltaPresenceEstimationResult. + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails + * @interface IDeltaPresenceEstimationResult + * @property {Array.|null} [deltaPresenceEstimationHistogram] DeltaPresenceEstimationResult deltaPresenceEstimationHistogram + */ + + /** + * Constructs a new DeltaPresenceEstimationResult. + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails + * @classdesc Represents a DeltaPresenceEstimationResult. + * @implements IDeltaPresenceEstimationResult + * @constructor + * @param {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.IDeltaPresenceEstimationResult=} [properties] Properties to set + */ + function DeltaPresenceEstimationResult(properties) { + this.deltaPresenceEstimationHistogram = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeltaPresenceEstimationResult deltaPresenceEstimationHistogram. + * @member {Array.} deltaPresenceEstimationHistogram + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.DeltaPresenceEstimationResult + * @instance + */ + DeltaPresenceEstimationResult.prototype.deltaPresenceEstimationHistogram = $util.emptyArray; + + /** + * Creates a new DeltaPresenceEstimationResult instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.DeltaPresenceEstimationResult + * @static + * @param {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.IDeltaPresenceEstimationResult=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.DeltaPresenceEstimationResult} DeltaPresenceEstimationResult instance + */ + DeltaPresenceEstimationResult.create = function create(properties) { + return new DeltaPresenceEstimationResult(properties); + }; + + /** + * Encodes the specified DeltaPresenceEstimationResult message. Does not implicitly {@link google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.DeltaPresenceEstimationResult.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.DeltaPresenceEstimationResult + * @static + * @param {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.IDeltaPresenceEstimationResult} message DeltaPresenceEstimationResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeltaPresenceEstimationResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deltaPresenceEstimationHistogram != null && message.deltaPresenceEstimationHistogram.length) + for (var i = 0; i < message.deltaPresenceEstimationHistogram.length; ++i) + $root.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.DeltaPresenceEstimationResult.DeltaPresenceEstimationHistogramBucket.encode(message.deltaPresenceEstimationHistogram[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DeltaPresenceEstimationResult message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.DeltaPresenceEstimationResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.DeltaPresenceEstimationResult + * @static + * @param {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.IDeltaPresenceEstimationResult} message DeltaPresenceEstimationResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeltaPresenceEstimationResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeltaPresenceEstimationResult message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.DeltaPresenceEstimationResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.DeltaPresenceEstimationResult} DeltaPresenceEstimationResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeltaPresenceEstimationResult.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.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.DeltaPresenceEstimationResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.deltaPresenceEstimationHistogram && message.deltaPresenceEstimationHistogram.length)) + message.deltaPresenceEstimationHistogram = []; + message.deltaPresenceEstimationHistogram.push($root.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.DeltaPresenceEstimationResult.DeltaPresenceEstimationHistogramBucket.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeltaPresenceEstimationResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.DeltaPresenceEstimationResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.DeltaPresenceEstimationResult} DeltaPresenceEstimationResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeltaPresenceEstimationResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeltaPresenceEstimationResult message. + * @function verify + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.DeltaPresenceEstimationResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeltaPresenceEstimationResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deltaPresenceEstimationHistogram != null && message.hasOwnProperty("deltaPresenceEstimationHistogram")) { + if (!Array.isArray(message.deltaPresenceEstimationHistogram)) + return "deltaPresenceEstimationHistogram: array expected"; + for (var i = 0; i < message.deltaPresenceEstimationHistogram.length; ++i) { + var error = $root.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.DeltaPresenceEstimationResult.DeltaPresenceEstimationHistogramBucket.verify(message.deltaPresenceEstimationHistogram[i]); + if (error) + return "deltaPresenceEstimationHistogram." + error; + } + } + return null; + }; + + /** + * Creates a DeltaPresenceEstimationResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.DeltaPresenceEstimationResult + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.DeltaPresenceEstimationResult} DeltaPresenceEstimationResult + */ + DeltaPresenceEstimationResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.DeltaPresenceEstimationResult) + return object; + var message = new $root.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.DeltaPresenceEstimationResult(); + if (object.deltaPresenceEstimationHistogram) { + if (!Array.isArray(object.deltaPresenceEstimationHistogram)) + throw TypeError(".google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.DeltaPresenceEstimationResult.deltaPresenceEstimationHistogram: array expected"); + message.deltaPresenceEstimationHistogram = []; + for (var i = 0; i < object.deltaPresenceEstimationHistogram.length; ++i) { + if (typeof object.deltaPresenceEstimationHistogram[i] !== "object") + throw TypeError(".google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.DeltaPresenceEstimationResult.deltaPresenceEstimationHistogram: object expected"); + message.deltaPresenceEstimationHistogram[i] = $root.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.DeltaPresenceEstimationResult.DeltaPresenceEstimationHistogramBucket.fromObject(object.deltaPresenceEstimationHistogram[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a DeltaPresenceEstimationResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.DeltaPresenceEstimationResult + * @static + * @param {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.DeltaPresenceEstimationResult} message DeltaPresenceEstimationResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeltaPresenceEstimationResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.deltaPresenceEstimationHistogram = []; + if (message.deltaPresenceEstimationHistogram && message.deltaPresenceEstimationHistogram.length) { + object.deltaPresenceEstimationHistogram = []; + for (var j = 0; j < message.deltaPresenceEstimationHistogram.length; ++j) + object.deltaPresenceEstimationHistogram[j] = $root.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.DeltaPresenceEstimationResult.DeltaPresenceEstimationHistogramBucket.toObject(message.deltaPresenceEstimationHistogram[j], options); + } + return object; + }; + + /** + * Converts this DeltaPresenceEstimationResult to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.DeltaPresenceEstimationResult + * @instance + * @returns {Object.} JSON object + */ + DeltaPresenceEstimationResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + DeltaPresenceEstimationResult.DeltaPresenceEstimationQuasiIdValues = (function() { + + /** + * Properties of a DeltaPresenceEstimationQuasiIdValues. + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.DeltaPresenceEstimationResult + * @interface IDeltaPresenceEstimationQuasiIdValues + * @property {Array.|null} [quasiIdsValues] DeltaPresenceEstimationQuasiIdValues quasiIdsValues + * @property {number|null} [estimatedProbability] DeltaPresenceEstimationQuasiIdValues estimatedProbability + */ + + /** + * Constructs a new DeltaPresenceEstimationQuasiIdValues. + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.DeltaPresenceEstimationResult + * @classdesc Represents a DeltaPresenceEstimationQuasiIdValues. + * @implements IDeltaPresenceEstimationQuasiIdValues + * @constructor + * @param {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.DeltaPresenceEstimationResult.IDeltaPresenceEstimationQuasiIdValues=} [properties] Properties to set + */ + function DeltaPresenceEstimationQuasiIdValues(properties) { + this.quasiIdsValues = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeltaPresenceEstimationQuasiIdValues quasiIdsValues. + * @member {Array.} quasiIdsValues + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.DeltaPresenceEstimationResult.DeltaPresenceEstimationQuasiIdValues + * @instance + */ + DeltaPresenceEstimationQuasiIdValues.prototype.quasiIdsValues = $util.emptyArray; + + /** + * DeltaPresenceEstimationQuasiIdValues estimatedProbability. + * @member {number} estimatedProbability + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.DeltaPresenceEstimationResult.DeltaPresenceEstimationQuasiIdValues + * @instance + */ + DeltaPresenceEstimationQuasiIdValues.prototype.estimatedProbability = 0; + + /** + * Creates a new DeltaPresenceEstimationQuasiIdValues instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.DeltaPresenceEstimationResult.DeltaPresenceEstimationQuasiIdValues + * @static + * @param {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.DeltaPresenceEstimationResult.IDeltaPresenceEstimationQuasiIdValues=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.DeltaPresenceEstimationResult.DeltaPresenceEstimationQuasiIdValues} DeltaPresenceEstimationQuasiIdValues instance + */ + DeltaPresenceEstimationQuasiIdValues.create = function create(properties) { + return new DeltaPresenceEstimationQuasiIdValues(properties); + }; + + /** + * Encodes the specified DeltaPresenceEstimationQuasiIdValues message. Does not implicitly {@link google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.DeltaPresenceEstimationResult.DeltaPresenceEstimationQuasiIdValues.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.DeltaPresenceEstimationResult.DeltaPresenceEstimationQuasiIdValues + * @static + * @param {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.DeltaPresenceEstimationResult.IDeltaPresenceEstimationQuasiIdValues} message DeltaPresenceEstimationQuasiIdValues message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeltaPresenceEstimationQuasiIdValues.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.quasiIdsValues != null && message.quasiIdsValues.length) + for (var i = 0; i < message.quasiIdsValues.length; ++i) + $root.google.privacy.dlp.v2.Value.encode(message.quasiIdsValues[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.estimatedProbability != null && Object.hasOwnProperty.call(message, "estimatedProbability")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.estimatedProbability); + return writer; + }; + + /** + * Encodes the specified DeltaPresenceEstimationQuasiIdValues message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.DeltaPresenceEstimationResult.DeltaPresenceEstimationQuasiIdValues.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.DeltaPresenceEstimationResult.DeltaPresenceEstimationQuasiIdValues + * @static + * @param {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.DeltaPresenceEstimationResult.IDeltaPresenceEstimationQuasiIdValues} message DeltaPresenceEstimationQuasiIdValues message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeltaPresenceEstimationQuasiIdValues.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeltaPresenceEstimationQuasiIdValues message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.DeltaPresenceEstimationResult.DeltaPresenceEstimationQuasiIdValues + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.DeltaPresenceEstimationResult.DeltaPresenceEstimationQuasiIdValues} DeltaPresenceEstimationQuasiIdValues + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeltaPresenceEstimationQuasiIdValues.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.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.DeltaPresenceEstimationResult.DeltaPresenceEstimationQuasiIdValues(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.quasiIdsValues && message.quasiIdsValues.length)) + message.quasiIdsValues = []; + message.quasiIdsValues.push($root.google.privacy.dlp.v2.Value.decode(reader, reader.uint32())); + break; + case 2: + message.estimatedProbability = reader.double(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeltaPresenceEstimationQuasiIdValues message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.DeltaPresenceEstimationResult.DeltaPresenceEstimationQuasiIdValues + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.DeltaPresenceEstimationResult.DeltaPresenceEstimationQuasiIdValues} DeltaPresenceEstimationQuasiIdValues + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeltaPresenceEstimationQuasiIdValues.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeltaPresenceEstimationQuasiIdValues message. + * @function verify + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.DeltaPresenceEstimationResult.DeltaPresenceEstimationQuasiIdValues + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeltaPresenceEstimationQuasiIdValues.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.quasiIdsValues != null && message.hasOwnProperty("quasiIdsValues")) { + if (!Array.isArray(message.quasiIdsValues)) + return "quasiIdsValues: array expected"; + for (var i = 0; i < message.quasiIdsValues.length; ++i) { + var error = $root.google.privacy.dlp.v2.Value.verify(message.quasiIdsValues[i]); + if (error) + return "quasiIdsValues." + error; + } + } + if (message.estimatedProbability != null && message.hasOwnProperty("estimatedProbability")) + if (typeof message.estimatedProbability !== "number") + return "estimatedProbability: number expected"; + return null; + }; + + /** + * Creates a DeltaPresenceEstimationQuasiIdValues message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.DeltaPresenceEstimationResult.DeltaPresenceEstimationQuasiIdValues + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.DeltaPresenceEstimationResult.DeltaPresenceEstimationQuasiIdValues} DeltaPresenceEstimationQuasiIdValues + */ + DeltaPresenceEstimationQuasiIdValues.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.DeltaPresenceEstimationResult.DeltaPresenceEstimationQuasiIdValues) + return object; + var message = new $root.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.DeltaPresenceEstimationResult.DeltaPresenceEstimationQuasiIdValues(); + if (object.quasiIdsValues) { + if (!Array.isArray(object.quasiIdsValues)) + throw TypeError(".google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.DeltaPresenceEstimationResult.DeltaPresenceEstimationQuasiIdValues.quasiIdsValues: array expected"); + message.quasiIdsValues = []; + for (var i = 0; i < object.quasiIdsValues.length; ++i) { + if (typeof object.quasiIdsValues[i] !== "object") + throw TypeError(".google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.DeltaPresenceEstimationResult.DeltaPresenceEstimationQuasiIdValues.quasiIdsValues: object expected"); + message.quasiIdsValues[i] = $root.google.privacy.dlp.v2.Value.fromObject(object.quasiIdsValues[i]); + } + } + if (object.estimatedProbability != null) + message.estimatedProbability = Number(object.estimatedProbability); + return message; + }; + + /** + * Creates a plain object from a DeltaPresenceEstimationQuasiIdValues message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.DeltaPresenceEstimationResult.DeltaPresenceEstimationQuasiIdValues + * @static + * @param {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.DeltaPresenceEstimationResult.DeltaPresenceEstimationQuasiIdValues} message DeltaPresenceEstimationQuasiIdValues + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeltaPresenceEstimationQuasiIdValues.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.quasiIdsValues = []; + if (options.defaults) + object.estimatedProbability = 0; + if (message.quasiIdsValues && message.quasiIdsValues.length) { + object.quasiIdsValues = []; + for (var j = 0; j < message.quasiIdsValues.length; ++j) + object.quasiIdsValues[j] = $root.google.privacy.dlp.v2.Value.toObject(message.quasiIdsValues[j], options); + } + if (message.estimatedProbability != null && message.hasOwnProperty("estimatedProbability")) + object.estimatedProbability = options.json && !isFinite(message.estimatedProbability) ? String(message.estimatedProbability) : message.estimatedProbability; + return object; + }; + + /** + * Converts this DeltaPresenceEstimationQuasiIdValues to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.DeltaPresenceEstimationResult.DeltaPresenceEstimationQuasiIdValues + * @instance + * @returns {Object.} JSON object + */ + DeltaPresenceEstimationQuasiIdValues.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeltaPresenceEstimationQuasiIdValues; + })(); + + DeltaPresenceEstimationResult.DeltaPresenceEstimationHistogramBucket = (function() { + + /** + * Properties of a DeltaPresenceEstimationHistogramBucket. + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.DeltaPresenceEstimationResult + * @interface IDeltaPresenceEstimationHistogramBucket + * @property {number|null} [minProbability] DeltaPresenceEstimationHistogramBucket minProbability + * @property {number|null} [maxProbability] DeltaPresenceEstimationHistogramBucket maxProbability + * @property {number|Long|null} [bucketSize] DeltaPresenceEstimationHistogramBucket bucketSize + * @property {Array.|null} [bucketValues] DeltaPresenceEstimationHistogramBucket bucketValues + * @property {number|Long|null} [bucketValueCount] DeltaPresenceEstimationHistogramBucket bucketValueCount + */ + + /** + * Constructs a new DeltaPresenceEstimationHistogramBucket. + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.DeltaPresenceEstimationResult + * @classdesc Represents a DeltaPresenceEstimationHistogramBucket. + * @implements IDeltaPresenceEstimationHistogramBucket + * @constructor + * @param {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.DeltaPresenceEstimationResult.IDeltaPresenceEstimationHistogramBucket=} [properties] Properties to set + */ + function DeltaPresenceEstimationHistogramBucket(properties) { + this.bucketValues = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeltaPresenceEstimationHistogramBucket minProbability. + * @member {number} minProbability + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.DeltaPresenceEstimationResult.DeltaPresenceEstimationHistogramBucket + * @instance + */ + DeltaPresenceEstimationHistogramBucket.prototype.minProbability = 0; + + /** + * DeltaPresenceEstimationHistogramBucket maxProbability. + * @member {number} maxProbability + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.DeltaPresenceEstimationResult.DeltaPresenceEstimationHistogramBucket + * @instance + */ + DeltaPresenceEstimationHistogramBucket.prototype.maxProbability = 0; + + /** + * DeltaPresenceEstimationHistogramBucket bucketSize. + * @member {number|Long} bucketSize + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.DeltaPresenceEstimationResult.DeltaPresenceEstimationHistogramBucket + * @instance + */ + DeltaPresenceEstimationHistogramBucket.prototype.bucketSize = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * DeltaPresenceEstimationHistogramBucket bucketValues. + * @member {Array.} bucketValues + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.DeltaPresenceEstimationResult.DeltaPresenceEstimationHistogramBucket + * @instance + */ + DeltaPresenceEstimationHistogramBucket.prototype.bucketValues = $util.emptyArray; + + /** + * DeltaPresenceEstimationHistogramBucket bucketValueCount. + * @member {number|Long} bucketValueCount + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.DeltaPresenceEstimationResult.DeltaPresenceEstimationHistogramBucket + * @instance + */ + DeltaPresenceEstimationHistogramBucket.prototype.bucketValueCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new DeltaPresenceEstimationHistogramBucket instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.DeltaPresenceEstimationResult.DeltaPresenceEstimationHistogramBucket + * @static + * @param {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.DeltaPresenceEstimationResult.IDeltaPresenceEstimationHistogramBucket=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.DeltaPresenceEstimationResult.DeltaPresenceEstimationHistogramBucket} DeltaPresenceEstimationHistogramBucket instance + */ + DeltaPresenceEstimationHistogramBucket.create = function create(properties) { + return new DeltaPresenceEstimationHistogramBucket(properties); + }; + + /** + * Encodes the specified DeltaPresenceEstimationHistogramBucket message. Does not implicitly {@link google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.DeltaPresenceEstimationResult.DeltaPresenceEstimationHistogramBucket.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.DeltaPresenceEstimationResult.DeltaPresenceEstimationHistogramBucket + * @static + * @param {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.DeltaPresenceEstimationResult.IDeltaPresenceEstimationHistogramBucket} message DeltaPresenceEstimationHistogramBucket message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeltaPresenceEstimationHistogramBucket.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.minProbability != null && Object.hasOwnProperty.call(message, "minProbability")) + writer.uint32(/* id 1, wireType 1 =*/9).double(message.minProbability); + if (message.maxProbability != null && Object.hasOwnProperty.call(message, "maxProbability")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.maxProbability); + if (message.bucketSize != null && Object.hasOwnProperty.call(message, "bucketSize")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.bucketSize); + if (message.bucketValues != null && message.bucketValues.length) + for (var i = 0; i < message.bucketValues.length; ++i) + $root.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.DeltaPresenceEstimationResult.DeltaPresenceEstimationQuasiIdValues.encode(message.bucketValues[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.bucketValueCount != null && Object.hasOwnProperty.call(message, "bucketValueCount")) + writer.uint32(/* id 7, wireType 0 =*/56).int64(message.bucketValueCount); + return writer; + }; + + /** + * Encodes the specified DeltaPresenceEstimationHistogramBucket message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.DeltaPresenceEstimationResult.DeltaPresenceEstimationHistogramBucket.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.DeltaPresenceEstimationResult.DeltaPresenceEstimationHistogramBucket + * @static + * @param {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.DeltaPresenceEstimationResult.IDeltaPresenceEstimationHistogramBucket} message DeltaPresenceEstimationHistogramBucket message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeltaPresenceEstimationHistogramBucket.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeltaPresenceEstimationHistogramBucket message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.DeltaPresenceEstimationResult.DeltaPresenceEstimationHistogramBucket + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.DeltaPresenceEstimationResult.DeltaPresenceEstimationHistogramBucket} DeltaPresenceEstimationHistogramBucket + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeltaPresenceEstimationHistogramBucket.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.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.DeltaPresenceEstimationResult.DeltaPresenceEstimationHistogramBucket(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.minProbability = reader.double(); + break; + case 2: + message.maxProbability = reader.double(); + break; + case 5: + message.bucketSize = reader.int64(); + break; + case 6: + if (!(message.bucketValues && message.bucketValues.length)) + message.bucketValues = []; + message.bucketValues.push($root.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.DeltaPresenceEstimationResult.DeltaPresenceEstimationQuasiIdValues.decode(reader, reader.uint32())); + break; + case 7: + message.bucketValueCount = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeltaPresenceEstimationHistogramBucket message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.DeltaPresenceEstimationResult.DeltaPresenceEstimationHistogramBucket + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.DeltaPresenceEstimationResult.DeltaPresenceEstimationHistogramBucket} DeltaPresenceEstimationHistogramBucket + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeltaPresenceEstimationHistogramBucket.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeltaPresenceEstimationHistogramBucket message. + * @function verify + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.DeltaPresenceEstimationResult.DeltaPresenceEstimationHistogramBucket + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeltaPresenceEstimationHistogramBucket.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.minProbability != null && message.hasOwnProperty("minProbability")) + if (typeof message.minProbability !== "number") + return "minProbability: number expected"; + if (message.maxProbability != null && message.hasOwnProperty("maxProbability")) + if (typeof message.maxProbability !== "number") + return "maxProbability: number expected"; + if (message.bucketSize != null && message.hasOwnProperty("bucketSize")) + if (!$util.isInteger(message.bucketSize) && !(message.bucketSize && $util.isInteger(message.bucketSize.low) && $util.isInteger(message.bucketSize.high))) + return "bucketSize: integer|Long expected"; + if (message.bucketValues != null && message.hasOwnProperty("bucketValues")) { + if (!Array.isArray(message.bucketValues)) + return "bucketValues: array expected"; + for (var i = 0; i < message.bucketValues.length; ++i) { + var error = $root.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.DeltaPresenceEstimationResult.DeltaPresenceEstimationQuasiIdValues.verify(message.bucketValues[i]); + if (error) + return "bucketValues." + error; + } + } + if (message.bucketValueCount != null && message.hasOwnProperty("bucketValueCount")) + if (!$util.isInteger(message.bucketValueCount) && !(message.bucketValueCount && $util.isInteger(message.bucketValueCount.low) && $util.isInteger(message.bucketValueCount.high))) + return "bucketValueCount: integer|Long expected"; + return null; + }; + + /** + * Creates a DeltaPresenceEstimationHistogramBucket message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.DeltaPresenceEstimationResult.DeltaPresenceEstimationHistogramBucket + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.DeltaPresenceEstimationResult.DeltaPresenceEstimationHistogramBucket} DeltaPresenceEstimationHistogramBucket + */ + DeltaPresenceEstimationHistogramBucket.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.DeltaPresenceEstimationResult.DeltaPresenceEstimationHistogramBucket) + return object; + var message = new $root.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.DeltaPresenceEstimationResult.DeltaPresenceEstimationHistogramBucket(); + if (object.minProbability != null) + message.minProbability = Number(object.minProbability); + if (object.maxProbability != null) + message.maxProbability = Number(object.maxProbability); + if (object.bucketSize != null) + if ($util.Long) + (message.bucketSize = $util.Long.fromValue(object.bucketSize)).unsigned = false; + else if (typeof object.bucketSize === "string") + message.bucketSize = parseInt(object.bucketSize, 10); + else if (typeof object.bucketSize === "number") + message.bucketSize = object.bucketSize; + else if (typeof object.bucketSize === "object") + message.bucketSize = new $util.LongBits(object.bucketSize.low >>> 0, object.bucketSize.high >>> 0).toNumber(); + if (object.bucketValues) { + if (!Array.isArray(object.bucketValues)) + throw TypeError(".google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.DeltaPresenceEstimationResult.DeltaPresenceEstimationHistogramBucket.bucketValues: array expected"); + message.bucketValues = []; + for (var i = 0; i < object.bucketValues.length; ++i) { + if (typeof object.bucketValues[i] !== "object") + throw TypeError(".google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.DeltaPresenceEstimationResult.DeltaPresenceEstimationHistogramBucket.bucketValues: object expected"); + message.bucketValues[i] = $root.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.DeltaPresenceEstimationResult.DeltaPresenceEstimationQuasiIdValues.fromObject(object.bucketValues[i]); + } + } + if (object.bucketValueCount != null) + if ($util.Long) + (message.bucketValueCount = $util.Long.fromValue(object.bucketValueCount)).unsigned = false; + else if (typeof object.bucketValueCount === "string") + message.bucketValueCount = parseInt(object.bucketValueCount, 10); + else if (typeof object.bucketValueCount === "number") + message.bucketValueCount = object.bucketValueCount; + else if (typeof object.bucketValueCount === "object") + message.bucketValueCount = new $util.LongBits(object.bucketValueCount.low >>> 0, object.bucketValueCount.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a DeltaPresenceEstimationHistogramBucket message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.DeltaPresenceEstimationResult.DeltaPresenceEstimationHistogramBucket + * @static + * @param {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.DeltaPresenceEstimationResult.DeltaPresenceEstimationHistogramBucket} message DeltaPresenceEstimationHistogramBucket + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeltaPresenceEstimationHistogramBucket.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.bucketValues = []; + if (options.defaults) { + object.minProbability = 0; + object.maxProbability = 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.bucketSize = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.bucketSize = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.bucketValueCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.bucketValueCount = options.longs === String ? "0" : 0; + } + if (message.minProbability != null && message.hasOwnProperty("minProbability")) + object.minProbability = options.json && !isFinite(message.minProbability) ? String(message.minProbability) : message.minProbability; + if (message.maxProbability != null && message.hasOwnProperty("maxProbability")) + object.maxProbability = options.json && !isFinite(message.maxProbability) ? String(message.maxProbability) : message.maxProbability; + if (message.bucketSize != null && message.hasOwnProperty("bucketSize")) + if (typeof message.bucketSize === "number") + object.bucketSize = options.longs === String ? String(message.bucketSize) : message.bucketSize; + else + object.bucketSize = options.longs === String ? $util.Long.prototype.toString.call(message.bucketSize) : options.longs === Number ? new $util.LongBits(message.bucketSize.low >>> 0, message.bucketSize.high >>> 0).toNumber() : message.bucketSize; + if (message.bucketValues && message.bucketValues.length) { + object.bucketValues = []; + for (var j = 0; j < message.bucketValues.length; ++j) + object.bucketValues[j] = $root.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.DeltaPresenceEstimationResult.DeltaPresenceEstimationQuasiIdValues.toObject(message.bucketValues[j], options); + } + if (message.bucketValueCount != null && message.hasOwnProperty("bucketValueCount")) + if (typeof message.bucketValueCount === "number") + object.bucketValueCount = options.longs === String ? String(message.bucketValueCount) : message.bucketValueCount; + else + object.bucketValueCount = options.longs === String ? $util.Long.prototype.toString.call(message.bucketValueCount) : options.longs === Number ? new $util.LongBits(message.bucketValueCount.low >>> 0, message.bucketValueCount.high >>> 0).toNumber() : message.bucketValueCount; + return object; + }; + + /** + * Converts this DeltaPresenceEstimationHistogramBucket to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.DeltaPresenceEstimationResult.DeltaPresenceEstimationHistogramBucket + * @instance + * @returns {Object.} JSON object + */ + DeltaPresenceEstimationHistogramBucket.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeltaPresenceEstimationHistogramBucket; + })(); + + return DeltaPresenceEstimationResult; + })(); + + AnalyzeDataSourceRiskDetails.RequestedRiskAnalysisOptions = (function() { + + /** + * Properties of a RequestedRiskAnalysisOptions. + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails + * @interface IRequestedRiskAnalysisOptions + * @property {google.privacy.dlp.v2.IRiskAnalysisJobConfig|null} [jobConfig] RequestedRiskAnalysisOptions jobConfig + */ + + /** + * Constructs a new RequestedRiskAnalysisOptions. + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails + * @classdesc Represents a RequestedRiskAnalysisOptions. + * @implements IRequestedRiskAnalysisOptions + * @constructor + * @param {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.IRequestedRiskAnalysisOptions=} [properties] Properties to set + */ + function RequestedRiskAnalysisOptions(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RequestedRiskAnalysisOptions jobConfig. + * @member {google.privacy.dlp.v2.IRiskAnalysisJobConfig|null|undefined} jobConfig + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.RequestedRiskAnalysisOptions + * @instance + */ + RequestedRiskAnalysisOptions.prototype.jobConfig = null; + + /** + * Creates a new RequestedRiskAnalysisOptions instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.RequestedRiskAnalysisOptions + * @static + * @param {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.IRequestedRiskAnalysisOptions=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.RequestedRiskAnalysisOptions} RequestedRiskAnalysisOptions instance + */ + RequestedRiskAnalysisOptions.create = function create(properties) { + return new RequestedRiskAnalysisOptions(properties); + }; + + /** + * Encodes the specified RequestedRiskAnalysisOptions message. Does not implicitly {@link google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.RequestedRiskAnalysisOptions.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.RequestedRiskAnalysisOptions + * @static + * @param {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.IRequestedRiskAnalysisOptions} message RequestedRiskAnalysisOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RequestedRiskAnalysisOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.jobConfig != null && Object.hasOwnProperty.call(message, "jobConfig")) + $root.google.privacy.dlp.v2.RiskAnalysisJobConfig.encode(message.jobConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RequestedRiskAnalysisOptions message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.RequestedRiskAnalysisOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.RequestedRiskAnalysisOptions + * @static + * @param {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.IRequestedRiskAnalysisOptions} message RequestedRiskAnalysisOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RequestedRiskAnalysisOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RequestedRiskAnalysisOptions message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.RequestedRiskAnalysisOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.RequestedRiskAnalysisOptions} RequestedRiskAnalysisOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RequestedRiskAnalysisOptions.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.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.RequestedRiskAnalysisOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.jobConfig = $root.google.privacy.dlp.v2.RiskAnalysisJobConfig.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RequestedRiskAnalysisOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.RequestedRiskAnalysisOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.RequestedRiskAnalysisOptions} RequestedRiskAnalysisOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RequestedRiskAnalysisOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RequestedRiskAnalysisOptions message. + * @function verify + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.RequestedRiskAnalysisOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RequestedRiskAnalysisOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.jobConfig != null && message.hasOwnProperty("jobConfig")) { + var error = $root.google.privacy.dlp.v2.RiskAnalysisJobConfig.verify(message.jobConfig); + if (error) + return "jobConfig." + error; + } + return null; + }; + + /** + * Creates a RequestedRiskAnalysisOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.RequestedRiskAnalysisOptions + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.RequestedRiskAnalysisOptions} RequestedRiskAnalysisOptions + */ + RequestedRiskAnalysisOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.RequestedRiskAnalysisOptions) + return object; + var message = new $root.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.RequestedRiskAnalysisOptions(); + if (object.jobConfig != null) { + if (typeof object.jobConfig !== "object") + throw TypeError(".google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.RequestedRiskAnalysisOptions.jobConfig: object expected"); + message.jobConfig = $root.google.privacy.dlp.v2.RiskAnalysisJobConfig.fromObject(object.jobConfig); + } + return message; + }; + + /** + * Creates a plain object from a RequestedRiskAnalysisOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.RequestedRiskAnalysisOptions + * @static + * @param {google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.RequestedRiskAnalysisOptions} message RequestedRiskAnalysisOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RequestedRiskAnalysisOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.jobConfig = null; + if (message.jobConfig != null && message.hasOwnProperty("jobConfig")) + object.jobConfig = $root.google.privacy.dlp.v2.RiskAnalysisJobConfig.toObject(message.jobConfig, options); + return object; + }; + + /** + * Converts this RequestedRiskAnalysisOptions to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.RequestedRiskAnalysisOptions + * @instance + * @returns {Object.} JSON object + */ + RequestedRiskAnalysisOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RequestedRiskAnalysisOptions; + })(); + + return AnalyzeDataSourceRiskDetails; + })(); + + v2.ValueFrequency = (function() { + + /** + * Properties of a ValueFrequency. + * @memberof google.privacy.dlp.v2 + * @interface IValueFrequency + * @property {google.privacy.dlp.v2.IValue|null} [value] ValueFrequency value + * @property {number|Long|null} [count] ValueFrequency count + */ + + /** + * Constructs a new ValueFrequency. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents a ValueFrequency. + * @implements IValueFrequency + * @constructor + * @param {google.privacy.dlp.v2.IValueFrequency=} [properties] Properties to set + */ + function ValueFrequency(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ValueFrequency value. + * @member {google.privacy.dlp.v2.IValue|null|undefined} value + * @memberof google.privacy.dlp.v2.ValueFrequency + * @instance + */ + ValueFrequency.prototype.value = null; + + /** + * ValueFrequency count. + * @member {number|Long} count + * @memberof google.privacy.dlp.v2.ValueFrequency + * @instance + */ + ValueFrequency.prototype.count = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ValueFrequency instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.ValueFrequency + * @static + * @param {google.privacy.dlp.v2.IValueFrequency=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.ValueFrequency} ValueFrequency instance + */ + ValueFrequency.create = function create(properties) { + return new ValueFrequency(properties); + }; + + /** + * Encodes the specified ValueFrequency message. Does not implicitly {@link google.privacy.dlp.v2.ValueFrequency.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.ValueFrequency + * @static + * @param {google.privacy.dlp.v2.IValueFrequency} message ValueFrequency message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ValueFrequency.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + $root.google.privacy.dlp.v2.Value.encode(message.value, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.count != null && Object.hasOwnProperty.call(message, "count")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.count); + return writer; + }; + + /** + * Encodes the specified ValueFrequency message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.ValueFrequency.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.ValueFrequency + * @static + * @param {google.privacy.dlp.v2.IValueFrequency} message ValueFrequency message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ValueFrequency.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ValueFrequency message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.ValueFrequency + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.ValueFrequency} ValueFrequency + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ValueFrequency.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.privacy.dlp.v2.ValueFrequency(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.value = $root.google.privacy.dlp.v2.Value.decode(reader, reader.uint32()); + break; + case 2: + message.count = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ValueFrequency message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.ValueFrequency + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.ValueFrequency} ValueFrequency + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ValueFrequency.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ValueFrequency message. + * @function verify + * @memberof google.privacy.dlp.v2.ValueFrequency + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ValueFrequency.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) { + var error = $root.google.privacy.dlp.v2.Value.verify(message.value); + if (error) + return "value." + error; + } + if (message.count != null && message.hasOwnProperty("count")) + if (!$util.isInteger(message.count) && !(message.count && $util.isInteger(message.count.low) && $util.isInteger(message.count.high))) + return "count: integer|Long expected"; + return null; + }; + + /** + * Creates a ValueFrequency message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.ValueFrequency + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.ValueFrequency} ValueFrequency + */ + ValueFrequency.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.ValueFrequency) + return object; + var message = new $root.google.privacy.dlp.v2.ValueFrequency(); + if (object.value != null) { + if (typeof object.value !== "object") + throw TypeError(".google.privacy.dlp.v2.ValueFrequency.value: object expected"); + message.value = $root.google.privacy.dlp.v2.Value.fromObject(object.value); + } + if (object.count != null) + if ($util.Long) + (message.count = $util.Long.fromValue(object.count)).unsigned = false; + else if (typeof object.count === "string") + message.count = parseInt(object.count, 10); + else if (typeof object.count === "number") + message.count = object.count; + else if (typeof object.count === "object") + message.count = new $util.LongBits(object.count.low >>> 0, object.count.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a ValueFrequency message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.ValueFrequency + * @static + * @param {google.privacy.dlp.v2.ValueFrequency} message ValueFrequency + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ValueFrequency.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.value = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.count = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.count = options.longs === String ? "0" : 0; + } + if (message.value != null && message.hasOwnProperty("value")) + object.value = $root.google.privacy.dlp.v2.Value.toObject(message.value, options); + if (message.count != null && message.hasOwnProperty("count")) + if (typeof message.count === "number") + object.count = options.longs === String ? String(message.count) : message.count; + else + object.count = options.longs === String ? $util.Long.prototype.toString.call(message.count) : options.longs === Number ? new $util.LongBits(message.count.low >>> 0, message.count.high >>> 0).toNumber() : message.count; + return object; + }; + + /** + * Converts this ValueFrequency to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.ValueFrequency + * @instance + * @returns {Object.} JSON object + */ + ValueFrequency.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ValueFrequency; + })(); + + v2.Value = (function() { + + /** + * Properties of a Value. + * @memberof google.privacy.dlp.v2 + * @interface IValue + * @property {number|Long|null} [integerValue] Value integerValue + * @property {number|null} [floatValue] Value floatValue + * @property {string|null} [stringValue] Value stringValue + * @property {boolean|null} [booleanValue] Value booleanValue + * @property {google.protobuf.ITimestamp|null} [timestampValue] Value timestampValue + * @property {google.type.ITimeOfDay|null} [timeValue] Value timeValue + * @property {google.type.IDate|null} [dateValue] Value dateValue + * @property {google.type.DayOfWeek|null} [dayOfWeekValue] Value dayOfWeekValue + */ + + /** + * Constructs a new Value. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents a Value. + * @implements IValue + * @constructor + * @param {google.privacy.dlp.v2.IValue=} [properties] Properties to set + */ + function Value(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Value integerValue. + * @member {number|Long} integerValue + * @memberof google.privacy.dlp.v2.Value + * @instance + */ + Value.prototype.integerValue = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Value floatValue. + * @member {number} floatValue + * @memberof google.privacy.dlp.v2.Value + * @instance + */ + Value.prototype.floatValue = 0; + + /** + * Value stringValue. + * @member {string} stringValue + * @memberof google.privacy.dlp.v2.Value + * @instance + */ + Value.prototype.stringValue = ""; + + /** + * Value booleanValue. + * @member {boolean} booleanValue + * @memberof google.privacy.dlp.v2.Value + * @instance + */ + Value.prototype.booleanValue = false; + + /** + * Value timestampValue. + * @member {google.protobuf.ITimestamp|null|undefined} timestampValue + * @memberof google.privacy.dlp.v2.Value + * @instance + */ + Value.prototype.timestampValue = null; + + /** + * Value timeValue. + * @member {google.type.ITimeOfDay|null|undefined} timeValue + * @memberof google.privacy.dlp.v2.Value + * @instance + */ + Value.prototype.timeValue = null; + + /** + * Value dateValue. + * @member {google.type.IDate|null|undefined} dateValue + * @memberof google.privacy.dlp.v2.Value + * @instance + */ + Value.prototype.dateValue = null; + + /** + * Value dayOfWeekValue. + * @member {google.type.DayOfWeek} dayOfWeekValue + * @memberof google.privacy.dlp.v2.Value + * @instance + */ + Value.prototype.dayOfWeekValue = 0; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Value type. + * @member {"integerValue"|"floatValue"|"stringValue"|"booleanValue"|"timestampValue"|"timeValue"|"dateValue"|"dayOfWeekValue"|undefined} type + * @memberof google.privacy.dlp.v2.Value + * @instance + */ + Object.defineProperty(Value.prototype, "type", { + get: $util.oneOfGetter($oneOfFields = ["integerValue", "floatValue", "stringValue", "booleanValue", "timestampValue", "timeValue", "dateValue", "dayOfWeekValue"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Value instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.Value + * @static + * @param {google.privacy.dlp.v2.IValue=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.Value} Value instance + */ + Value.create = function create(properties) { + return new Value(properties); + }; + + /** + * Encodes the specified Value message. Does not implicitly {@link google.privacy.dlp.v2.Value.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.Value + * @static + * @param {google.privacy.dlp.v2.IValue} message Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.integerValue != null && Object.hasOwnProperty.call(message, "integerValue")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.integerValue); + if (message.floatValue != null && Object.hasOwnProperty.call(message, "floatValue")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.floatValue); + if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.stringValue); + if (message.booleanValue != null && Object.hasOwnProperty.call(message, "booleanValue")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.booleanValue); + if (message.timestampValue != null && Object.hasOwnProperty.call(message, "timestampValue")) + $root.google.protobuf.Timestamp.encode(message.timestampValue, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.timeValue != null && Object.hasOwnProperty.call(message, "timeValue")) + $root.google.type.TimeOfDay.encode(message.timeValue, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.dateValue != null && Object.hasOwnProperty.call(message, "dateValue")) + $root.google.type.Date.encode(message.dateValue, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.dayOfWeekValue != null && Object.hasOwnProperty.call(message, "dayOfWeekValue")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.dayOfWeekValue); + return writer; + }; + + /** + * Encodes the specified Value message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.Value + * @static + * @param {google.privacy.dlp.v2.IValue} message Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Value message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.Value} Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Value.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.privacy.dlp.v2.Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.integerValue = reader.int64(); + break; + case 2: + message.floatValue = reader.double(); + break; + case 3: + message.stringValue = reader.string(); + break; + case 4: + message.booleanValue = reader.bool(); + break; + case 5: + message.timestampValue = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 6: + message.timeValue = $root.google.type.TimeOfDay.decode(reader, reader.uint32()); + break; + case 7: + message.dateValue = $root.google.type.Date.decode(reader, reader.uint32()); + break; + case 8: + message.dayOfWeekValue = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.Value} Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Value message. + * @function verify + * @memberof google.privacy.dlp.v2.Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.integerValue != null && message.hasOwnProperty("integerValue")) { + properties.type = 1; + if (!$util.isInteger(message.integerValue) && !(message.integerValue && $util.isInteger(message.integerValue.low) && $util.isInteger(message.integerValue.high))) + return "integerValue: integer|Long expected"; + } + if (message.floatValue != null && message.hasOwnProperty("floatValue")) { + if (properties.type === 1) + return "type: multiple values"; + properties.type = 1; + if (typeof message.floatValue !== "number") + return "floatValue: number expected"; + } + if (message.stringValue != null && message.hasOwnProperty("stringValue")) { + if (properties.type === 1) + return "type: multiple values"; + properties.type = 1; + if (!$util.isString(message.stringValue)) + return "stringValue: string expected"; + } + if (message.booleanValue != null && message.hasOwnProperty("booleanValue")) { + if (properties.type === 1) + return "type: multiple values"; + properties.type = 1; + if (typeof message.booleanValue !== "boolean") + return "booleanValue: boolean expected"; + } + if (message.timestampValue != null && message.hasOwnProperty("timestampValue")) { + if (properties.type === 1) + return "type: multiple values"; + properties.type = 1; + { + var error = $root.google.protobuf.Timestamp.verify(message.timestampValue); + if (error) + return "timestampValue." + error; + } + } + if (message.timeValue != null && message.hasOwnProperty("timeValue")) { + if (properties.type === 1) + return "type: multiple values"; + properties.type = 1; + { + var error = $root.google.type.TimeOfDay.verify(message.timeValue); + if (error) + return "timeValue." + error; + } + } + if (message.dateValue != null && message.hasOwnProperty("dateValue")) { + if (properties.type === 1) + return "type: multiple values"; + properties.type = 1; + { + var error = $root.google.type.Date.verify(message.dateValue); + if (error) + return "dateValue." + error; + } + } + if (message.dayOfWeekValue != null && message.hasOwnProperty("dayOfWeekValue")) { + if (properties.type === 1) + return "type: multiple values"; + properties.type = 1; + switch (message.dayOfWeekValue) { + default: + return "dayOfWeekValue: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + break; + } + } + return null; + }; + + /** + * Creates a Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.Value + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.Value} Value + */ + Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.Value) + return object; + var message = new $root.google.privacy.dlp.v2.Value(); + if (object.integerValue != null) + if ($util.Long) + (message.integerValue = $util.Long.fromValue(object.integerValue)).unsigned = false; + else if (typeof object.integerValue === "string") + message.integerValue = parseInt(object.integerValue, 10); + else if (typeof object.integerValue === "number") + message.integerValue = object.integerValue; + else if (typeof object.integerValue === "object") + message.integerValue = new $util.LongBits(object.integerValue.low >>> 0, object.integerValue.high >>> 0).toNumber(); + if (object.floatValue != null) + message.floatValue = Number(object.floatValue); + if (object.stringValue != null) + message.stringValue = String(object.stringValue); + if (object.booleanValue != null) + message.booleanValue = Boolean(object.booleanValue); + if (object.timestampValue != null) { + if (typeof object.timestampValue !== "object") + throw TypeError(".google.privacy.dlp.v2.Value.timestampValue: object expected"); + message.timestampValue = $root.google.protobuf.Timestamp.fromObject(object.timestampValue); + } + if (object.timeValue != null) { + if (typeof object.timeValue !== "object") + throw TypeError(".google.privacy.dlp.v2.Value.timeValue: object expected"); + message.timeValue = $root.google.type.TimeOfDay.fromObject(object.timeValue); + } + if (object.dateValue != null) { + if (typeof object.dateValue !== "object") + throw TypeError(".google.privacy.dlp.v2.Value.dateValue: object expected"); + message.dateValue = $root.google.type.Date.fromObject(object.dateValue); + } + switch (object.dayOfWeekValue) { + case "DAY_OF_WEEK_UNSPECIFIED": + case 0: + message.dayOfWeekValue = 0; + break; + case "MONDAY": + case 1: + message.dayOfWeekValue = 1; + break; + case "TUESDAY": + case 2: + message.dayOfWeekValue = 2; + break; + case "WEDNESDAY": + case 3: + message.dayOfWeekValue = 3; + break; + case "THURSDAY": + case 4: + message.dayOfWeekValue = 4; + break; + case "FRIDAY": + case 5: + message.dayOfWeekValue = 5; + break; + case "SATURDAY": + case 6: + message.dayOfWeekValue = 6; + break; + case "SUNDAY": + case 7: + message.dayOfWeekValue = 7; + break; + } + return message; + }; + + /** + * Creates a plain object from a Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.Value + * @static + * @param {google.privacy.dlp.v2.Value} message Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Value.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.integerValue != null && message.hasOwnProperty("integerValue")) { + if (typeof message.integerValue === "number") + object.integerValue = options.longs === String ? String(message.integerValue) : message.integerValue; + else + object.integerValue = options.longs === String ? $util.Long.prototype.toString.call(message.integerValue) : options.longs === Number ? new $util.LongBits(message.integerValue.low >>> 0, message.integerValue.high >>> 0).toNumber() : message.integerValue; + if (options.oneofs) + object.type = "integerValue"; + } + if (message.floatValue != null && message.hasOwnProperty("floatValue")) { + object.floatValue = options.json && !isFinite(message.floatValue) ? String(message.floatValue) : message.floatValue; + if (options.oneofs) + object.type = "floatValue"; + } + if (message.stringValue != null && message.hasOwnProperty("stringValue")) { + object.stringValue = message.stringValue; + if (options.oneofs) + object.type = "stringValue"; + } + if (message.booleanValue != null && message.hasOwnProperty("booleanValue")) { + object.booleanValue = message.booleanValue; + if (options.oneofs) + object.type = "booleanValue"; + } + if (message.timestampValue != null && message.hasOwnProperty("timestampValue")) { + object.timestampValue = $root.google.protobuf.Timestamp.toObject(message.timestampValue, options); + if (options.oneofs) + object.type = "timestampValue"; + } + if (message.timeValue != null && message.hasOwnProperty("timeValue")) { + object.timeValue = $root.google.type.TimeOfDay.toObject(message.timeValue, options); + if (options.oneofs) + object.type = "timeValue"; + } + if (message.dateValue != null && message.hasOwnProperty("dateValue")) { + object.dateValue = $root.google.type.Date.toObject(message.dateValue, options); + if (options.oneofs) + object.type = "dateValue"; + } + if (message.dayOfWeekValue != null && message.hasOwnProperty("dayOfWeekValue")) { + object.dayOfWeekValue = options.enums === String ? $root.google.type.DayOfWeek[message.dayOfWeekValue] : message.dayOfWeekValue; + if (options.oneofs) + object.type = "dayOfWeekValue"; + } + return object; + }; + + /** + * Converts this Value to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.Value + * @instance + * @returns {Object.} JSON object + */ + Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Value; + })(); + + v2.QuoteInfo = (function() { + + /** + * Properties of a QuoteInfo. + * @memberof google.privacy.dlp.v2 + * @interface IQuoteInfo + * @property {google.privacy.dlp.v2.IDateTime|null} [dateTime] QuoteInfo dateTime + */ + + /** + * Constructs a new QuoteInfo. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents a QuoteInfo. + * @implements IQuoteInfo + * @constructor + * @param {google.privacy.dlp.v2.IQuoteInfo=} [properties] Properties to set + */ + function QuoteInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QuoteInfo dateTime. + * @member {google.privacy.dlp.v2.IDateTime|null|undefined} dateTime + * @memberof google.privacy.dlp.v2.QuoteInfo + * @instance + */ + QuoteInfo.prototype.dateTime = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * QuoteInfo parsedQuote. + * @member {"dateTime"|undefined} parsedQuote + * @memberof google.privacy.dlp.v2.QuoteInfo + * @instance + */ + Object.defineProperty(QuoteInfo.prototype, "parsedQuote", { + get: $util.oneOfGetter($oneOfFields = ["dateTime"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new QuoteInfo instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.QuoteInfo + * @static + * @param {google.privacy.dlp.v2.IQuoteInfo=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.QuoteInfo} QuoteInfo instance + */ + QuoteInfo.create = function create(properties) { + return new QuoteInfo(properties); + }; + + /** + * Encodes the specified QuoteInfo message. Does not implicitly {@link google.privacy.dlp.v2.QuoteInfo.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.QuoteInfo + * @static + * @param {google.privacy.dlp.v2.IQuoteInfo} message QuoteInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QuoteInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dateTime != null && Object.hasOwnProperty.call(message, "dateTime")) + $root.google.privacy.dlp.v2.DateTime.encode(message.dateTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QuoteInfo message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.QuoteInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.QuoteInfo + * @static + * @param {google.privacy.dlp.v2.IQuoteInfo} message QuoteInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QuoteInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QuoteInfo message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.QuoteInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.QuoteInfo} QuoteInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QuoteInfo.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.privacy.dlp.v2.QuoteInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + message.dateTime = $root.google.privacy.dlp.v2.DateTime.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QuoteInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.QuoteInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.QuoteInfo} QuoteInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QuoteInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QuoteInfo message. + * @function verify + * @memberof google.privacy.dlp.v2.QuoteInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QuoteInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.dateTime != null && message.hasOwnProperty("dateTime")) { + properties.parsedQuote = 1; + { + var error = $root.google.privacy.dlp.v2.DateTime.verify(message.dateTime); + if (error) + return "dateTime." + error; + } + } + return null; + }; + + /** + * Creates a QuoteInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.QuoteInfo + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.QuoteInfo} QuoteInfo + */ + QuoteInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.QuoteInfo) + return object; + var message = new $root.google.privacy.dlp.v2.QuoteInfo(); + if (object.dateTime != null) { + if (typeof object.dateTime !== "object") + throw TypeError(".google.privacy.dlp.v2.QuoteInfo.dateTime: object expected"); + message.dateTime = $root.google.privacy.dlp.v2.DateTime.fromObject(object.dateTime); + } + return message; + }; + + /** + * Creates a plain object from a QuoteInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.QuoteInfo + * @static + * @param {google.privacy.dlp.v2.QuoteInfo} message QuoteInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QuoteInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.dateTime != null && message.hasOwnProperty("dateTime")) { + object.dateTime = $root.google.privacy.dlp.v2.DateTime.toObject(message.dateTime, options); + if (options.oneofs) + object.parsedQuote = "dateTime"; + } + return object; + }; + + /** + * Converts this QuoteInfo to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.QuoteInfo + * @instance + * @returns {Object.} JSON object + */ + QuoteInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QuoteInfo; + })(); + + v2.DateTime = (function() { + + /** + * Properties of a DateTime. + * @memberof google.privacy.dlp.v2 + * @interface IDateTime + * @property {google.type.IDate|null} [date] DateTime date + * @property {google.type.DayOfWeek|null} [dayOfWeek] DateTime dayOfWeek + * @property {google.type.ITimeOfDay|null} [time] DateTime time + * @property {google.privacy.dlp.v2.DateTime.ITimeZone|null} [timeZone] DateTime timeZone + */ + + /** + * Constructs a new DateTime. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents a DateTime. + * @implements IDateTime + * @constructor + * @param {google.privacy.dlp.v2.IDateTime=} [properties] Properties to set + */ + function DateTime(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DateTime date. + * @member {google.type.IDate|null|undefined} date + * @memberof google.privacy.dlp.v2.DateTime + * @instance + */ + DateTime.prototype.date = null; + + /** + * DateTime dayOfWeek. + * @member {google.type.DayOfWeek} dayOfWeek + * @memberof google.privacy.dlp.v2.DateTime + * @instance + */ + DateTime.prototype.dayOfWeek = 0; + + /** + * DateTime time. + * @member {google.type.ITimeOfDay|null|undefined} time + * @memberof google.privacy.dlp.v2.DateTime + * @instance + */ + DateTime.prototype.time = null; + + /** + * DateTime timeZone. + * @member {google.privacy.dlp.v2.DateTime.ITimeZone|null|undefined} timeZone + * @memberof google.privacy.dlp.v2.DateTime + * @instance + */ + DateTime.prototype.timeZone = null; + + /** + * Creates a new DateTime instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.DateTime + * @static + * @param {google.privacy.dlp.v2.IDateTime=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.DateTime} DateTime instance + */ + DateTime.create = function create(properties) { + return new DateTime(properties); + }; + + /** + * Encodes the specified DateTime message. Does not implicitly {@link google.privacy.dlp.v2.DateTime.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.DateTime + * @static + * @param {google.privacy.dlp.v2.IDateTime} message DateTime message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DateTime.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.date != null && Object.hasOwnProperty.call(message, "date")) + $root.google.type.Date.encode(message.date, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.dayOfWeek != null && Object.hasOwnProperty.call(message, "dayOfWeek")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.dayOfWeek); + if (message.time != null && Object.hasOwnProperty.call(message, "time")) + $root.google.type.TimeOfDay.encode(message.time, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.timeZone != null && Object.hasOwnProperty.call(message, "timeZone")) + $root.google.privacy.dlp.v2.DateTime.TimeZone.encode(message.timeZone, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DateTime message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.DateTime.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.DateTime + * @static + * @param {google.privacy.dlp.v2.IDateTime} message DateTime message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DateTime.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DateTime message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.DateTime + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.DateTime} DateTime + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DateTime.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.privacy.dlp.v2.DateTime(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.date = $root.google.type.Date.decode(reader, reader.uint32()); + break; + case 2: + message.dayOfWeek = reader.int32(); + break; + case 3: + message.time = $root.google.type.TimeOfDay.decode(reader, reader.uint32()); + break; + case 4: + message.timeZone = $root.google.privacy.dlp.v2.DateTime.TimeZone.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DateTime message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.DateTime + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.DateTime} DateTime + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DateTime.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DateTime message. + * @function verify + * @memberof google.privacy.dlp.v2.DateTime + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DateTime.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.date != null && message.hasOwnProperty("date")) { + var error = $root.google.type.Date.verify(message.date); + if (error) + return "date." + error; + } + if (message.dayOfWeek != null && message.hasOwnProperty("dayOfWeek")) + switch (message.dayOfWeek) { + default: + return "dayOfWeek: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + break; + } + if (message.time != null && message.hasOwnProperty("time")) { + var error = $root.google.type.TimeOfDay.verify(message.time); + if (error) + return "time." + error; + } + if (message.timeZone != null && message.hasOwnProperty("timeZone")) { + var error = $root.google.privacy.dlp.v2.DateTime.TimeZone.verify(message.timeZone); + if (error) + return "timeZone." + error; + } + return null; + }; + + /** + * Creates a DateTime message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.DateTime + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.DateTime} DateTime + */ + DateTime.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.DateTime) + return object; + var message = new $root.google.privacy.dlp.v2.DateTime(); + if (object.date != null) { + if (typeof object.date !== "object") + throw TypeError(".google.privacy.dlp.v2.DateTime.date: object expected"); + message.date = $root.google.type.Date.fromObject(object.date); + } + switch (object.dayOfWeek) { + case "DAY_OF_WEEK_UNSPECIFIED": + case 0: + message.dayOfWeek = 0; + break; + case "MONDAY": + case 1: + message.dayOfWeek = 1; + break; + case "TUESDAY": + case 2: + message.dayOfWeek = 2; + break; + case "WEDNESDAY": + case 3: + message.dayOfWeek = 3; + break; + case "THURSDAY": + case 4: + message.dayOfWeek = 4; + break; + case "FRIDAY": + case 5: + message.dayOfWeek = 5; + break; + case "SATURDAY": + case 6: + message.dayOfWeek = 6; + break; + case "SUNDAY": + case 7: + message.dayOfWeek = 7; + break; + } + if (object.time != null) { + if (typeof object.time !== "object") + throw TypeError(".google.privacy.dlp.v2.DateTime.time: object expected"); + message.time = $root.google.type.TimeOfDay.fromObject(object.time); + } + if (object.timeZone != null) { + if (typeof object.timeZone !== "object") + throw TypeError(".google.privacy.dlp.v2.DateTime.timeZone: object expected"); + message.timeZone = $root.google.privacy.dlp.v2.DateTime.TimeZone.fromObject(object.timeZone); + } + return message; + }; + + /** + * Creates a plain object from a DateTime message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.DateTime + * @static + * @param {google.privacy.dlp.v2.DateTime} message DateTime + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DateTime.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.date = null; + object.dayOfWeek = options.enums === String ? "DAY_OF_WEEK_UNSPECIFIED" : 0; + object.time = null; + object.timeZone = null; + } + if (message.date != null && message.hasOwnProperty("date")) + object.date = $root.google.type.Date.toObject(message.date, options); + if (message.dayOfWeek != null && message.hasOwnProperty("dayOfWeek")) + object.dayOfWeek = options.enums === String ? $root.google.type.DayOfWeek[message.dayOfWeek] : message.dayOfWeek; + if (message.time != null && message.hasOwnProperty("time")) + object.time = $root.google.type.TimeOfDay.toObject(message.time, options); + if (message.timeZone != null && message.hasOwnProperty("timeZone")) + object.timeZone = $root.google.privacy.dlp.v2.DateTime.TimeZone.toObject(message.timeZone, options); + return object; + }; + + /** + * Converts this DateTime to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.DateTime + * @instance + * @returns {Object.} JSON object + */ + DateTime.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + DateTime.TimeZone = (function() { + + /** + * Properties of a TimeZone. + * @memberof google.privacy.dlp.v2.DateTime + * @interface ITimeZone + * @property {number|null} [offsetMinutes] TimeZone offsetMinutes + */ + + /** + * Constructs a new TimeZone. + * @memberof google.privacy.dlp.v2.DateTime + * @classdesc Represents a TimeZone. + * @implements ITimeZone + * @constructor + * @param {google.privacy.dlp.v2.DateTime.ITimeZone=} [properties] Properties to set + */ + function TimeZone(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TimeZone offsetMinutes. + * @member {number} offsetMinutes + * @memberof google.privacy.dlp.v2.DateTime.TimeZone + * @instance + */ + TimeZone.prototype.offsetMinutes = 0; + + /** + * Creates a new TimeZone instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.DateTime.TimeZone + * @static + * @param {google.privacy.dlp.v2.DateTime.ITimeZone=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.DateTime.TimeZone} TimeZone instance + */ + TimeZone.create = function create(properties) { + return new TimeZone(properties); + }; + + /** + * Encodes the specified TimeZone message. Does not implicitly {@link google.privacy.dlp.v2.DateTime.TimeZone.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.DateTime.TimeZone + * @static + * @param {google.privacy.dlp.v2.DateTime.ITimeZone} message TimeZone message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimeZone.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.offsetMinutes != null && Object.hasOwnProperty.call(message, "offsetMinutes")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.offsetMinutes); + return writer; + }; + + /** + * Encodes the specified TimeZone message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.DateTime.TimeZone.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.DateTime.TimeZone + * @static + * @param {google.privacy.dlp.v2.DateTime.ITimeZone} message TimeZone message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimeZone.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TimeZone message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.DateTime.TimeZone + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.DateTime.TimeZone} TimeZone + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimeZone.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.privacy.dlp.v2.DateTime.TimeZone(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.offsetMinutes = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TimeZone message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.DateTime.TimeZone + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.DateTime.TimeZone} TimeZone + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimeZone.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TimeZone message. + * @function verify + * @memberof google.privacy.dlp.v2.DateTime.TimeZone + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TimeZone.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.offsetMinutes != null && message.hasOwnProperty("offsetMinutes")) + if (!$util.isInteger(message.offsetMinutes)) + return "offsetMinutes: integer expected"; + return null; + }; + + /** + * Creates a TimeZone message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.DateTime.TimeZone + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.DateTime.TimeZone} TimeZone + */ + TimeZone.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.DateTime.TimeZone) + return object; + var message = new $root.google.privacy.dlp.v2.DateTime.TimeZone(); + if (object.offsetMinutes != null) + message.offsetMinutes = object.offsetMinutes | 0; + return message; + }; + + /** + * Creates a plain object from a TimeZone message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.DateTime.TimeZone + * @static + * @param {google.privacy.dlp.v2.DateTime.TimeZone} message TimeZone + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TimeZone.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.offsetMinutes = 0; + if (message.offsetMinutes != null && message.hasOwnProperty("offsetMinutes")) + object.offsetMinutes = message.offsetMinutes; + return object; + }; + + /** + * Converts this TimeZone to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.DateTime.TimeZone + * @instance + * @returns {Object.} JSON object + */ + TimeZone.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TimeZone; + })(); + + return DateTime; + })(); + + v2.DeidentifyConfig = (function() { + + /** + * Properties of a DeidentifyConfig. + * @memberof google.privacy.dlp.v2 + * @interface IDeidentifyConfig + * @property {google.privacy.dlp.v2.IInfoTypeTransformations|null} [infoTypeTransformations] DeidentifyConfig infoTypeTransformations + * @property {google.privacy.dlp.v2.IRecordTransformations|null} [recordTransformations] DeidentifyConfig recordTransformations + * @property {google.privacy.dlp.v2.ITransformationErrorHandling|null} [transformationErrorHandling] DeidentifyConfig transformationErrorHandling + */ + + /** + * Constructs a new DeidentifyConfig. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents a DeidentifyConfig. + * @implements IDeidentifyConfig + * @constructor + * @param {google.privacy.dlp.v2.IDeidentifyConfig=} [properties] Properties to set + */ + function DeidentifyConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeidentifyConfig infoTypeTransformations. + * @member {google.privacy.dlp.v2.IInfoTypeTransformations|null|undefined} infoTypeTransformations + * @memberof google.privacy.dlp.v2.DeidentifyConfig + * @instance + */ + DeidentifyConfig.prototype.infoTypeTransformations = null; + + /** + * DeidentifyConfig recordTransformations. + * @member {google.privacy.dlp.v2.IRecordTransformations|null|undefined} recordTransformations + * @memberof google.privacy.dlp.v2.DeidentifyConfig + * @instance + */ + DeidentifyConfig.prototype.recordTransformations = null; + + /** + * DeidentifyConfig transformationErrorHandling. + * @member {google.privacy.dlp.v2.ITransformationErrorHandling|null|undefined} transformationErrorHandling + * @memberof google.privacy.dlp.v2.DeidentifyConfig + * @instance + */ + DeidentifyConfig.prototype.transformationErrorHandling = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DeidentifyConfig transformation. + * @member {"infoTypeTransformations"|"recordTransformations"|undefined} transformation + * @memberof google.privacy.dlp.v2.DeidentifyConfig + * @instance + */ + Object.defineProperty(DeidentifyConfig.prototype, "transformation", { + get: $util.oneOfGetter($oneOfFields = ["infoTypeTransformations", "recordTransformations"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DeidentifyConfig instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.DeidentifyConfig + * @static + * @param {google.privacy.dlp.v2.IDeidentifyConfig=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.DeidentifyConfig} DeidentifyConfig instance + */ + DeidentifyConfig.create = function create(properties) { + return new DeidentifyConfig(properties); + }; + + /** + * Encodes the specified DeidentifyConfig message. Does not implicitly {@link google.privacy.dlp.v2.DeidentifyConfig.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.DeidentifyConfig + * @static + * @param {google.privacy.dlp.v2.IDeidentifyConfig} message DeidentifyConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeidentifyConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.infoTypeTransformations != null && Object.hasOwnProperty.call(message, "infoTypeTransformations")) + $root.google.privacy.dlp.v2.InfoTypeTransformations.encode(message.infoTypeTransformations, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.recordTransformations != null && Object.hasOwnProperty.call(message, "recordTransformations")) + $root.google.privacy.dlp.v2.RecordTransformations.encode(message.recordTransformations, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.transformationErrorHandling != null && Object.hasOwnProperty.call(message, "transformationErrorHandling")) + $root.google.privacy.dlp.v2.TransformationErrorHandling.encode(message.transformationErrorHandling, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DeidentifyConfig message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.DeidentifyConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.DeidentifyConfig + * @static + * @param {google.privacy.dlp.v2.IDeidentifyConfig} message DeidentifyConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeidentifyConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeidentifyConfig message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.DeidentifyConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.DeidentifyConfig} DeidentifyConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeidentifyConfig.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.privacy.dlp.v2.DeidentifyConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.infoTypeTransformations = $root.google.privacy.dlp.v2.InfoTypeTransformations.decode(reader, reader.uint32()); + break; + case 2: + message.recordTransformations = $root.google.privacy.dlp.v2.RecordTransformations.decode(reader, reader.uint32()); + break; + case 3: + message.transformationErrorHandling = $root.google.privacy.dlp.v2.TransformationErrorHandling.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeidentifyConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.DeidentifyConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.DeidentifyConfig} DeidentifyConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeidentifyConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeidentifyConfig message. + * @function verify + * @memberof google.privacy.dlp.v2.DeidentifyConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeidentifyConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.infoTypeTransformations != null && message.hasOwnProperty("infoTypeTransformations")) { + properties.transformation = 1; + { + var error = $root.google.privacy.dlp.v2.InfoTypeTransformations.verify(message.infoTypeTransformations); + if (error) + return "infoTypeTransformations." + error; + } + } + if (message.recordTransformations != null && message.hasOwnProperty("recordTransformations")) { + if (properties.transformation === 1) + return "transformation: multiple values"; + properties.transformation = 1; + { + var error = $root.google.privacy.dlp.v2.RecordTransformations.verify(message.recordTransformations); + if (error) + return "recordTransformations." + error; + } + } + if (message.transformationErrorHandling != null && message.hasOwnProperty("transformationErrorHandling")) { + var error = $root.google.privacy.dlp.v2.TransformationErrorHandling.verify(message.transformationErrorHandling); + if (error) + return "transformationErrorHandling." + error; + } + return null; + }; + + /** + * Creates a DeidentifyConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.DeidentifyConfig + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.DeidentifyConfig} DeidentifyConfig + */ + DeidentifyConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.DeidentifyConfig) + return object; + var message = new $root.google.privacy.dlp.v2.DeidentifyConfig(); + if (object.infoTypeTransformations != null) { + if (typeof object.infoTypeTransformations !== "object") + throw TypeError(".google.privacy.dlp.v2.DeidentifyConfig.infoTypeTransformations: object expected"); + message.infoTypeTransformations = $root.google.privacy.dlp.v2.InfoTypeTransformations.fromObject(object.infoTypeTransformations); + } + if (object.recordTransformations != null) { + if (typeof object.recordTransformations !== "object") + throw TypeError(".google.privacy.dlp.v2.DeidentifyConfig.recordTransformations: object expected"); + message.recordTransformations = $root.google.privacy.dlp.v2.RecordTransformations.fromObject(object.recordTransformations); + } + if (object.transformationErrorHandling != null) { + if (typeof object.transformationErrorHandling !== "object") + throw TypeError(".google.privacy.dlp.v2.DeidentifyConfig.transformationErrorHandling: object expected"); + message.transformationErrorHandling = $root.google.privacy.dlp.v2.TransformationErrorHandling.fromObject(object.transformationErrorHandling); + } + return message; + }; + + /** + * Creates a plain object from a DeidentifyConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.DeidentifyConfig + * @static + * @param {google.privacy.dlp.v2.DeidentifyConfig} message DeidentifyConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeidentifyConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.transformationErrorHandling = null; + if (message.infoTypeTransformations != null && message.hasOwnProperty("infoTypeTransformations")) { + object.infoTypeTransformations = $root.google.privacy.dlp.v2.InfoTypeTransformations.toObject(message.infoTypeTransformations, options); + if (options.oneofs) + object.transformation = "infoTypeTransformations"; + } + if (message.recordTransformations != null && message.hasOwnProperty("recordTransformations")) { + object.recordTransformations = $root.google.privacy.dlp.v2.RecordTransformations.toObject(message.recordTransformations, options); + if (options.oneofs) + object.transformation = "recordTransformations"; + } + if (message.transformationErrorHandling != null && message.hasOwnProperty("transformationErrorHandling")) + object.transformationErrorHandling = $root.google.privacy.dlp.v2.TransformationErrorHandling.toObject(message.transformationErrorHandling, options); + return object; + }; + + /** + * Converts this DeidentifyConfig to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.DeidentifyConfig + * @instance + * @returns {Object.} JSON object + */ + DeidentifyConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeidentifyConfig; + })(); + + v2.TransformationErrorHandling = (function() { + + /** + * Properties of a TransformationErrorHandling. + * @memberof google.privacy.dlp.v2 + * @interface ITransformationErrorHandling + * @property {google.privacy.dlp.v2.TransformationErrorHandling.IThrowError|null} [throwError] TransformationErrorHandling throwError + * @property {google.privacy.dlp.v2.TransformationErrorHandling.ILeaveUntransformed|null} [leaveUntransformed] TransformationErrorHandling leaveUntransformed + */ + + /** + * Constructs a new TransformationErrorHandling. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents a TransformationErrorHandling. + * @implements ITransformationErrorHandling + * @constructor + * @param {google.privacy.dlp.v2.ITransformationErrorHandling=} [properties] Properties to set + */ + function TransformationErrorHandling(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TransformationErrorHandling throwError. + * @member {google.privacy.dlp.v2.TransformationErrorHandling.IThrowError|null|undefined} throwError + * @memberof google.privacy.dlp.v2.TransformationErrorHandling + * @instance + */ + TransformationErrorHandling.prototype.throwError = null; + + /** + * TransformationErrorHandling leaveUntransformed. + * @member {google.privacy.dlp.v2.TransformationErrorHandling.ILeaveUntransformed|null|undefined} leaveUntransformed + * @memberof google.privacy.dlp.v2.TransformationErrorHandling + * @instance + */ + TransformationErrorHandling.prototype.leaveUntransformed = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * TransformationErrorHandling mode. + * @member {"throwError"|"leaveUntransformed"|undefined} mode + * @memberof google.privacy.dlp.v2.TransformationErrorHandling + * @instance + */ + Object.defineProperty(TransformationErrorHandling.prototype, "mode", { + get: $util.oneOfGetter($oneOfFields = ["throwError", "leaveUntransformed"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TransformationErrorHandling instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.TransformationErrorHandling + * @static + * @param {google.privacy.dlp.v2.ITransformationErrorHandling=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.TransformationErrorHandling} TransformationErrorHandling instance + */ + TransformationErrorHandling.create = function create(properties) { + return new TransformationErrorHandling(properties); + }; + + /** + * Encodes the specified TransformationErrorHandling message. Does not implicitly {@link google.privacy.dlp.v2.TransformationErrorHandling.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.TransformationErrorHandling + * @static + * @param {google.privacy.dlp.v2.ITransformationErrorHandling} message TransformationErrorHandling message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransformationErrorHandling.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.throwError != null && Object.hasOwnProperty.call(message, "throwError")) + $root.google.privacy.dlp.v2.TransformationErrorHandling.ThrowError.encode(message.throwError, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.leaveUntransformed != null && Object.hasOwnProperty.call(message, "leaveUntransformed")) + $root.google.privacy.dlp.v2.TransformationErrorHandling.LeaveUntransformed.encode(message.leaveUntransformed, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TransformationErrorHandling message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.TransformationErrorHandling.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.TransformationErrorHandling + * @static + * @param {google.privacy.dlp.v2.ITransformationErrorHandling} message TransformationErrorHandling message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransformationErrorHandling.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TransformationErrorHandling message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.TransformationErrorHandling + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.TransformationErrorHandling} TransformationErrorHandling + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransformationErrorHandling.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.privacy.dlp.v2.TransformationErrorHandling(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.throwError = $root.google.privacy.dlp.v2.TransformationErrorHandling.ThrowError.decode(reader, reader.uint32()); + break; + case 2: + message.leaveUntransformed = $root.google.privacy.dlp.v2.TransformationErrorHandling.LeaveUntransformed.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TransformationErrorHandling message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.TransformationErrorHandling + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.TransformationErrorHandling} TransformationErrorHandling + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransformationErrorHandling.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TransformationErrorHandling message. + * @function verify + * @memberof google.privacy.dlp.v2.TransformationErrorHandling + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TransformationErrorHandling.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.throwError != null && message.hasOwnProperty("throwError")) { + properties.mode = 1; + { + var error = $root.google.privacy.dlp.v2.TransformationErrorHandling.ThrowError.verify(message.throwError); + if (error) + return "throwError." + error; + } + } + if (message.leaveUntransformed != null && message.hasOwnProperty("leaveUntransformed")) { + if (properties.mode === 1) + return "mode: multiple values"; + properties.mode = 1; + { + var error = $root.google.privacy.dlp.v2.TransformationErrorHandling.LeaveUntransformed.verify(message.leaveUntransformed); + if (error) + return "leaveUntransformed." + error; + } + } + return null; + }; + + /** + * Creates a TransformationErrorHandling message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.TransformationErrorHandling + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.TransformationErrorHandling} TransformationErrorHandling + */ + TransformationErrorHandling.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.TransformationErrorHandling) + return object; + var message = new $root.google.privacy.dlp.v2.TransformationErrorHandling(); + if (object.throwError != null) { + if (typeof object.throwError !== "object") + throw TypeError(".google.privacy.dlp.v2.TransformationErrorHandling.throwError: object expected"); + message.throwError = $root.google.privacy.dlp.v2.TransformationErrorHandling.ThrowError.fromObject(object.throwError); + } + if (object.leaveUntransformed != null) { + if (typeof object.leaveUntransformed !== "object") + throw TypeError(".google.privacy.dlp.v2.TransformationErrorHandling.leaveUntransformed: object expected"); + message.leaveUntransformed = $root.google.privacy.dlp.v2.TransformationErrorHandling.LeaveUntransformed.fromObject(object.leaveUntransformed); + } + return message; + }; + + /** + * Creates a plain object from a TransformationErrorHandling message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.TransformationErrorHandling + * @static + * @param {google.privacy.dlp.v2.TransformationErrorHandling} message TransformationErrorHandling + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TransformationErrorHandling.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.throwError != null && message.hasOwnProperty("throwError")) { + object.throwError = $root.google.privacy.dlp.v2.TransformationErrorHandling.ThrowError.toObject(message.throwError, options); + if (options.oneofs) + object.mode = "throwError"; + } + if (message.leaveUntransformed != null && message.hasOwnProperty("leaveUntransformed")) { + object.leaveUntransformed = $root.google.privacy.dlp.v2.TransformationErrorHandling.LeaveUntransformed.toObject(message.leaveUntransformed, options); + if (options.oneofs) + object.mode = "leaveUntransformed"; + } + return object; + }; + + /** + * Converts this TransformationErrorHandling to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.TransformationErrorHandling + * @instance + * @returns {Object.} JSON object + */ + TransformationErrorHandling.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + TransformationErrorHandling.ThrowError = (function() { + + /** + * Properties of a ThrowError. + * @memberof google.privacy.dlp.v2.TransformationErrorHandling + * @interface IThrowError + */ + + /** + * Constructs a new ThrowError. + * @memberof google.privacy.dlp.v2.TransformationErrorHandling + * @classdesc Represents a ThrowError. + * @implements IThrowError + * @constructor + * @param {google.privacy.dlp.v2.TransformationErrorHandling.IThrowError=} [properties] Properties to set + */ + function ThrowError(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new ThrowError instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.TransformationErrorHandling.ThrowError + * @static + * @param {google.privacy.dlp.v2.TransformationErrorHandling.IThrowError=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.TransformationErrorHandling.ThrowError} ThrowError instance + */ + ThrowError.create = function create(properties) { + return new ThrowError(properties); + }; + + /** + * Encodes the specified ThrowError message. Does not implicitly {@link google.privacy.dlp.v2.TransformationErrorHandling.ThrowError.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.TransformationErrorHandling.ThrowError + * @static + * @param {google.privacy.dlp.v2.TransformationErrorHandling.IThrowError} message ThrowError message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ThrowError.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified ThrowError message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.TransformationErrorHandling.ThrowError.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.TransformationErrorHandling.ThrowError + * @static + * @param {google.privacy.dlp.v2.TransformationErrorHandling.IThrowError} message ThrowError message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ThrowError.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ThrowError message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.TransformationErrorHandling.ThrowError + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.TransformationErrorHandling.ThrowError} ThrowError + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ThrowError.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.privacy.dlp.v2.TransformationErrorHandling.ThrowError(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ThrowError message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.TransformationErrorHandling.ThrowError + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.TransformationErrorHandling.ThrowError} ThrowError + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ThrowError.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ThrowError message. + * @function verify + * @memberof google.privacy.dlp.v2.TransformationErrorHandling.ThrowError + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ThrowError.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a ThrowError message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.TransformationErrorHandling.ThrowError + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.TransformationErrorHandling.ThrowError} ThrowError + */ + ThrowError.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.TransformationErrorHandling.ThrowError) + return object; + return new $root.google.privacy.dlp.v2.TransformationErrorHandling.ThrowError(); + }; + + /** + * Creates a plain object from a ThrowError message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.TransformationErrorHandling.ThrowError + * @static + * @param {google.privacy.dlp.v2.TransformationErrorHandling.ThrowError} message ThrowError + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ThrowError.toObject = function toObject() { + return {}; + }; + + /** + * Converts this ThrowError to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.TransformationErrorHandling.ThrowError + * @instance + * @returns {Object.} JSON object + */ + ThrowError.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ThrowError; + })(); + + TransformationErrorHandling.LeaveUntransformed = (function() { + + /** + * Properties of a LeaveUntransformed. + * @memberof google.privacy.dlp.v2.TransformationErrorHandling + * @interface ILeaveUntransformed + */ + + /** + * Constructs a new LeaveUntransformed. + * @memberof google.privacy.dlp.v2.TransformationErrorHandling + * @classdesc Represents a LeaveUntransformed. + * @implements ILeaveUntransformed + * @constructor + * @param {google.privacy.dlp.v2.TransformationErrorHandling.ILeaveUntransformed=} [properties] Properties to set + */ + function LeaveUntransformed(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new LeaveUntransformed instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.TransformationErrorHandling.LeaveUntransformed + * @static + * @param {google.privacy.dlp.v2.TransformationErrorHandling.ILeaveUntransformed=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.TransformationErrorHandling.LeaveUntransformed} LeaveUntransformed instance + */ + LeaveUntransformed.create = function create(properties) { + return new LeaveUntransformed(properties); + }; + + /** + * Encodes the specified LeaveUntransformed message. Does not implicitly {@link google.privacy.dlp.v2.TransformationErrorHandling.LeaveUntransformed.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.TransformationErrorHandling.LeaveUntransformed + * @static + * @param {google.privacy.dlp.v2.TransformationErrorHandling.ILeaveUntransformed} message LeaveUntransformed message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LeaveUntransformed.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified LeaveUntransformed message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.TransformationErrorHandling.LeaveUntransformed.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.TransformationErrorHandling.LeaveUntransformed + * @static + * @param {google.privacy.dlp.v2.TransformationErrorHandling.ILeaveUntransformed} message LeaveUntransformed message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LeaveUntransformed.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LeaveUntransformed message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.TransformationErrorHandling.LeaveUntransformed + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.TransformationErrorHandling.LeaveUntransformed} LeaveUntransformed + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LeaveUntransformed.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.privacy.dlp.v2.TransformationErrorHandling.LeaveUntransformed(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LeaveUntransformed message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.TransformationErrorHandling.LeaveUntransformed + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.TransformationErrorHandling.LeaveUntransformed} LeaveUntransformed + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LeaveUntransformed.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LeaveUntransformed message. + * @function verify + * @memberof google.privacy.dlp.v2.TransformationErrorHandling.LeaveUntransformed + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LeaveUntransformed.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a LeaveUntransformed message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.TransformationErrorHandling.LeaveUntransformed + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.TransformationErrorHandling.LeaveUntransformed} LeaveUntransformed + */ + LeaveUntransformed.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.TransformationErrorHandling.LeaveUntransformed) + return object; + return new $root.google.privacy.dlp.v2.TransformationErrorHandling.LeaveUntransformed(); + }; + + /** + * Creates a plain object from a LeaveUntransformed message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.TransformationErrorHandling.LeaveUntransformed + * @static + * @param {google.privacy.dlp.v2.TransformationErrorHandling.LeaveUntransformed} message LeaveUntransformed + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LeaveUntransformed.toObject = function toObject() { + return {}; + }; + + /** + * Converts this LeaveUntransformed to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.TransformationErrorHandling.LeaveUntransformed + * @instance + * @returns {Object.} JSON object + */ + LeaveUntransformed.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return LeaveUntransformed; + })(); + + return TransformationErrorHandling; + })(); + + v2.PrimitiveTransformation = (function() { + + /** + * Properties of a PrimitiveTransformation. + * @memberof google.privacy.dlp.v2 + * @interface IPrimitiveTransformation + * @property {google.privacy.dlp.v2.IReplaceValueConfig|null} [replaceConfig] PrimitiveTransformation replaceConfig + * @property {google.privacy.dlp.v2.IRedactConfig|null} [redactConfig] PrimitiveTransformation redactConfig + * @property {google.privacy.dlp.v2.ICharacterMaskConfig|null} [characterMaskConfig] PrimitiveTransformation characterMaskConfig + * @property {google.privacy.dlp.v2.ICryptoReplaceFfxFpeConfig|null} [cryptoReplaceFfxFpeConfig] PrimitiveTransformation cryptoReplaceFfxFpeConfig + * @property {google.privacy.dlp.v2.IFixedSizeBucketingConfig|null} [fixedSizeBucketingConfig] PrimitiveTransformation fixedSizeBucketingConfig + * @property {google.privacy.dlp.v2.IBucketingConfig|null} [bucketingConfig] PrimitiveTransformation bucketingConfig + * @property {google.privacy.dlp.v2.IReplaceWithInfoTypeConfig|null} [replaceWithInfoTypeConfig] PrimitiveTransformation replaceWithInfoTypeConfig + * @property {google.privacy.dlp.v2.ITimePartConfig|null} [timePartConfig] PrimitiveTransformation timePartConfig + * @property {google.privacy.dlp.v2.ICryptoHashConfig|null} [cryptoHashConfig] PrimitiveTransformation cryptoHashConfig + * @property {google.privacy.dlp.v2.IDateShiftConfig|null} [dateShiftConfig] PrimitiveTransformation dateShiftConfig + * @property {google.privacy.dlp.v2.ICryptoDeterministicConfig|null} [cryptoDeterministicConfig] PrimitiveTransformation cryptoDeterministicConfig + */ + + /** + * Constructs a new PrimitiveTransformation. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents a PrimitiveTransformation. + * @implements IPrimitiveTransformation + * @constructor + * @param {google.privacy.dlp.v2.IPrimitiveTransformation=} [properties] Properties to set + */ + function PrimitiveTransformation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PrimitiveTransformation replaceConfig. + * @member {google.privacy.dlp.v2.IReplaceValueConfig|null|undefined} replaceConfig + * @memberof google.privacy.dlp.v2.PrimitiveTransformation + * @instance + */ + PrimitiveTransformation.prototype.replaceConfig = null; + + /** + * PrimitiveTransformation redactConfig. + * @member {google.privacy.dlp.v2.IRedactConfig|null|undefined} redactConfig + * @memberof google.privacy.dlp.v2.PrimitiveTransformation + * @instance + */ + PrimitiveTransformation.prototype.redactConfig = null; + + /** + * PrimitiveTransformation characterMaskConfig. + * @member {google.privacy.dlp.v2.ICharacterMaskConfig|null|undefined} characterMaskConfig + * @memberof google.privacy.dlp.v2.PrimitiveTransformation + * @instance + */ + PrimitiveTransformation.prototype.characterMaskConfig = null; + + /** + * PrimitiveTransformation cryptoReplaceFfxFpeConfig. + * @member {google.privacy.dlp.v2.ICryptoReplaceFfxFpeConfig|null|undefined} cryptoReplaceFfxFpeConfig + * @memberof google.privacy.dlp.v2.PrimitiveTransformation + * @instance + */ + PrimitiveTransformation.prototype.cryptoReplaceFfxFpeConfig = null; + + /** + * PrimitiveTransformation fixedSizeBucketingConfig. + * @member {google.privacy.dlp.v2.IFixedSizeBucketingConfig|null|undefined} fixedSizeBucketingConfig + * @memberof google.privacy.dlp.v2.PrimitiveTransformation + * @instance + */ + PrimitiveTransformation.prototype.fixedSizeBucketingConfig = null; + + /** + * PrimitiveTransformation bucketingConfig. + * @member {google.privacy.dlp.v2.IBucketingConfig|null|undefined} bucketingConfig + * @memberof google.privacy.dlp.v2.PrimitiveTransformation + * @instance + */ + PrimitiveTransformation.prototype.bucketingConfig = null; + + /** + * PrimitiveTransformation replaceWithInfoTypeConfig. + * @member {google.privacy.dlp.v2.IReplaceWithInfoTypeConfig|null|undefined} replaceWithInfoTypeConfig + * @memberof google.privacy.dlp.v2.PrimitiveTransformation + * @instance + */ + PrimitiveTransformation.prototype.replaceWithInfoTypeConfig = null; + + /** + * PrimitiveTransformation timePartConfig. + * @member {google.privacy.dlp.v2.ITimePartConfig|null|undefined} timePartConfig + * @memberof google.privacy.dlp.v2.PrimitiveTransformation + * @instance + */ + PrimitiveTransformation.prototype.timePartConfig = null; + + /** + * PrimitiveTransformation cryptoHashConfig. + * @member {google.privacy.dlp.v2.ICryptoHashConfig|null|undefined} cryptoHashConfig + * @memberof google.privacy.dlp.v2.PrimitiveTransformation + * @instance + */ + PrimitiveTransformation.prototype.cryptoHashConfig = null; + + /** + * PrimitiveTransformation dateShiftConfig. + * @member {google.privacy.dlp.v2.IDateShiftConfig|null|undefined} dateShiftConfig + * @memberof google.privacy.dlp.v2.PrimitiveTransformation + * @instance + */ + PrimitiveTransformation.prototype.dateShiftConfig = null; + + /** + * PrimitiveTransformation cryptoDeterministicConfig. + * @member {google.privacy.dlp.v2.ICryptoDeterministicConfig|null|undefined} cryptoDeterministicConfig + * @memberof google.privacy.dlp.v2.PrimitiveTransformation + * @instance + */ + PrimitiveTransformation.prototype.cryptoDeterministicConfig = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * PrimitiveTransformation transformation. + * @member {"replaceConfig"|"redactConfig"|"characterMaskConfig"|"cryptoReplaceFfxFpeConfig"|"fixedSizeBucketingConfig"|"bucketingConfig"|"replaceWithInfoTypeConfig"|"timePartConfig"|"cryptoHashConfig"|"dateShiftConfig"|"cryptoDeterministicConfig"|undefined} transformation + * @memberof google.privacy.dlp.v2.PrimitiveTransformation + * @instance + */ + Object.defineProperty(PrimitiveTransformation.prototype, "transformation", { + get: $util.oneOfGetter($oneOfFields = ["replaceConfig", "redactConfig", "characterMaskConfig", "cryptoReplaceFfxFpeConfig", "fixedSizeBucketingConfig", "bucketingConfig", "replaceWithInfoTypeConfig", "timePartConfig", "cryptoHashConfig", "dateShiftConfig", "cryptoDeterministicConfig"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PrimitiveTransformation instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.PrimitiveTransformation + * @static + * @param {google.privacy.dlp.v2.IPrimitiveTransformation=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.PrimitiveTransformation} PrimitiveTransformation instance + */ + PrimitiveTransformation.create = function create(properties) { + return new PrimitiveTransformation(properties); + }; + + /** + * Encodes the specified PrimitiveTransformation message. Does not implicitly {@link google.privacy.dlp.v2.PrimitiveTransformation.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.PrimitiveTransformation + * @static + * @param {google.privacy.dlp.v2.IPrimitiveTransformation} message PrimitiveTransformation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PrimitiveTransformation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.replaceConfig != null && Object.hasOwnProperty.call(message, "replaceConfig")) + $root.google.privacy.dlp.v2.ReplaceValueConfig.encode(message.replaceConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.redactConfig != null && Object.hasOwnProperty.call(message, "redactConfig")) + $root.google.privacy.dlp.v2.RedactConfig.encode(message.redactConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.characterMaskConfig != null && Object.hasOwnProperty.call(message, "characterMaskConfig")) + $root.google.privacy.dlp.v2.CharacterMaskConfig.encode(message.characterMaskConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.cryptoReplaceFfxFpeConfig != null && Object.hasOwnProperty.call(message, "cryptoReplaceFfxFpeConfig")) + $root.google.privacy.dlp.v2.CryptoReplaceFfxFpeConfig.encode(message.cryptoReplaceFfxFpeConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.fixedSizeBucketingConfig != null && Object.hasOwnProperty.call(message, "fixedSizeBucketingConfig")) + $root.google.privacy.dlp.v2.FixedSizeBucketingConfig.encode(message.fixedSizeBucketingConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.bucketingConfig != null && Object.hasOwnProperty.call(message, "bucketingConfig")) + $root.google.privacy.dlp.v2.BucketingConfig.encode(message.bucketingConfig, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.replaceWithInfoTypeConfig != null && Object.hasOwnProperty.call(message, "replaceWithInfoTypeConfig")) + $root.google.privacy.dlp.v2.ReplaceWithInfoTypeConfig.encode(message.replaceWithInfoTypeConfig, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.timePartConfig != null && Object.hasOwnProperty.call(message, "timePartConfig")) + $root.google.privacy.dlp.v2.TimePartConfig.encode(message.timePartConfig, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.cryptoHashConfig != null && Object.hasOwnProperty.call(message, "cryptoHashConfig")) + $root.google.privacy.dlp.v2.CryptoHashConfig.encode(message.cryptoHashConfig, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.dateShiftConfig != null && Object.hasOwnProperty.call(message, "dateShiftConfig")) + $root.google.privacy.dlp.v2.DateShiftConfig.encode(message.dateShiftConfig, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.cryptoDeterministicConfig != null && Object.hasOwnProperty.call(message, "cryptoDeterministicConfig")) + $root.google.privacy.dlp.v2.CryptoDeterministicConfig.encode(message.cryptoDeterministicConfig, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PrimitiveTransformation message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.PrimitiveTransformation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.PrimitiveTransformation + * @static + * @param {google.privacy.dlp.v2.IPrimitiveTransformation} message PrimitiveTransformation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PrimitiveTransformation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PrimitiveTransformation message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.PrimitiveTransformation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.PrimitiveTransformation} PrimitiveTransformation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PrimitiveTransformation.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.privacy.dlp.v2.PrimitiveTransformation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.replaceConfig = $root.google.privacy.dlp.v2.ReplaceValueConfig.decode(reader, reader.uint32()); + break; + case 2: + message.redactConfig = $root.google.privacy.dlp.v2.RedactConfig.decode(reader, reader.uint32()); + break; + case 3: + message.characterMaskConfig = $root.google.privacy.dlp.v2.CharacterMaskConfig.decode(reader, reader.uint32()); + break; + case 4: + message.cryptoReplaceFfxFpeConfig = $root.google.privacy.dlp.v2.CryptoReplaceFfxFpeConfig.decode(reader, reader.uint32()); + break; + case 5: + message.fixedSizeBucketingConfig = $root.google.privacy.dlp.v2.FixedSizeBucketingConfig.decode(reader, reader.uint32()); + break; + case 6: + message.bucketingConfig = $root.google.privacy.dlp.v2.BucketingConfig.decode(reader, reader.uint32()); + break; + case 7: + message.replaceWithInfoTypeConfig = $root.google.privacy.dlp.v2.ReplaceWithInfoTypeConfig.decode(reader, reader.uint32()); + break; + case 8: + message.timePartConfig = $root.google.privacy.dlp.v2.TimePartConfig.decode(reader, reader.uint32()); + break; + case 9: + message.cryptoHashConfig = $root.google.privacy.dlp.v2.CryptoHashConfig.decode(reader, reader.uint32()); + break; + case 11: + message.dateShiftConfig = $root.google.privacy.dlp.v2.DateShiftConfig.decode(reader, reader.uint32()); + break; + case 12: + message.cryptoDeterministicConfig = $root.google.privacy.dlp.v2.CryptoDeterministicConfig.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PrimitiveTransformation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.PrimitiveTransformation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.PrimitiveTransformation} PrimitiveTransformation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PrimitiveTransformation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PrimitiveTransformation message. + * @function verify + * @memberof google.privacy.dlp.v2.PrimitiveTransformation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PrimitiveTransformation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.replaceConfig != null && message.hasOwnProperty("replaceConfig")) { + properties.transformation = 1; + { + var error = $root.google.privacy.dlp.v2.ReplaceValueConfig.verify(message.replaceConfig); + if (error) + return "replaceConfig." + error; + } + } + if (message.redactConfig != null && message.hasOwnProperty("redactConfig")) { + if (properties.transformation === 1) + return "transformation: multiple values"; + properties.transformation = 1; + { + var error = $root.google.privacy.dlp.v2.RedactConfig.verify(message.redactConfig); + if (error) + return "redactConfig." + error; + } + } + if (message.characterMaskConfig != null && message.hasOwnProperty("characterMaskConfig")) { + if (properties.transformation === 1) + return "transformation: multiple values"; + properties.transformation = 1; + { + var error = $root.google.privacy.dlp.v2.CharacterMaskConfig.verify(message.characterMaskConfig); + if (error) + return "characterMaskConfig." + error; + } + } + if (message.cryptoReplaceFfxFpeConfig != null && message.hasOwnProperty("cryptoReplaceFfxFpeConfig")) { + if (properties.transformation === 1) + return "transformation: multiple values"; + properties.transformation = 1; + { + var error = $root.google.privacy.dlp.v2.CryptoReplaceFfxFpeConfig.verify(message.cryptoReplaceFfxFpeConfig); + if (error) + return "cryptoReplaceFfxFpeConfig." + error; + } + } + if (message.fixedSizeBucketingConfig != null && message.hasOwnProperty("fixedSizeBucketingConfig")) { + if (properties.transformation === 1) + return "transformation: multiple values"; + properties.transformation = 1; + { + var error = $root.google.privacy.dlp.v2.FixedSizeBucketingConfig.verify(message.fixedSizeBucketingConfig); + if (error) + return "fixedSizeBucketingConfig." + error; + } + } + if (message.bucketingConfig != null && message.hasOwnProperty("bucketingConfig")) { + if (properties.transformation === 1) + return "transformation: multiple values"; + properties.transformation = 1; + { + var error = $root.google.privacy.dlp.v2.BucketingConfig.verify(message.bucketingConfig); + if (error) + return "bucketingConfig." + error; + } + } + if (message.replaceWithInfoTypeConfig != null && message.hasOwnProperty("replaceWithInfoTypeConfig")) { + if (properties.transformation === 1) + return "transformation: multiple values"; + properties.transformation = 1; + { + var error = $root.google.privacy.dlp.v2.ReplaceWithInfoTypeConfig.verify(message.replaceWithInfoTypeConfig); + if (error) + return "replaceWithInfoTypeConfig." + error; + } + } + if (message.timePartConfig != null && message.hasOwnProperty("timePartConfig")) { + if (properties.transformation === 1) + return "transformation: multiple values"; + properties.transformation = 1; + { + var error = $root.google.privacy.dlp.v2.TimePartConfig.verify(message.timePartConfig); + if (error) + return "timePartConfig." + error; + } + } + if (message.cryptoHashConfig != null && message.hasOwnProperty("cryptoHashConfig")) { + if (properties.transformation === 1) + return "transformation: multiple values"; + properties.transformation = 1; + { + var error = $root.google.privacy.dlp.v2.CryptoHashConfig.verify(message.cryptoHashConfig); + if (error) + return "cryptoHashConfig." + error; + } + } + if (message.dateShiftConfig != null && message.hasOwnProperty("dateShiftConfig")) { + if (properties.transformation === 1) + return "transformation: multiple values"; + properties.transformation = 1; + { + var error = $root.google.privacy.dlp.v2.DateShiftConfig.verify(message.dateShiftConfig); + if (error) + return "dateShiftConfig." + error; + } + } + if (message.cryptoDeterministicConfig != null && message.hasOwnProperty("cryptoDeterministicConfig")) { + if (properties.transformation === 1) + return "transformation: multiple values"; + properties.transformation = 1; + { + var error = $root.google.privacy.dlp.v2.CryptoDeterministicConfig.verify(message.cryptoDeterministicConfig); + if (error) + return "cryptoDeterministicConfig." + error; + } + } + return null; + }; + + /** + * Creates a PrimitiveTransformation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.PrimitiveTransformation + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.PrimitiveTransformation} PrimitiveTransformation + */ + PrimitiveTransformation.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.PrimitiveTransformation) + return object; + var message = new $root.google.privacy.dlp.v2.PrimitiveTransformation(); + if (object.replaceConfig != null) { + if (typeof object.replaceConfig !== "object") + throw TypeError(".google.privacy.dlp.v2.PrimitiveTransformation.replaceConfig: object expected"); + message.replaceConfig = $root.google.privacy.dlp.v2.ReplaceValueConfig.fromObject(object.replaceConfig); + } + if (object.redactConfig != null) { + if (typeof object.redactConfig !== "object") + throw TypeError(".google.privacy.dlp.v2.PrimitiveTransformation.redactConfig: object expected"); + message.redactConfig = $root.google.privacy.dlp.v2.RedactConfig.fromObject(object.redactConfig); + } + if (object.characterMaskConfig != null) { + if (typeof object.characterMaskConfig !== "object") + throw TypeError(".google.privacy.dlp.v2.PrimitiveTransformation.characterMaskConfig: object expected"); + message.characterMaskConfig = $root.google.privacy.dlp.v2.CharacterMaskConfig.fromObject(object.characterMaskConfig); + } + if (object.cryptoReplaceFfxFpeConfig != null) { + if (typeof object.cryptoReplaceFfxFpeConfig !== "object") + throw TypeError(".google.privacy.dlp.v2.PrimitiveTransformation.cryptoReplaceFfxFpeConfig: object expected"); + message.cryptoReplaceFfxFpeConfig = $root.google.privacy.dlp.v2.CryptoReplaceFfxFpeConfig.fromObject(object.cryptoReplaceFfxFpeConfig); + } + if (object.fixedSizeBucketingConfig != null) { + if (typeof object.fixedSizeBucketingConfig !== "object") + throw TypeError(".google.privacy.dlp.v2.PrimitiveTransformation.fixedSizeBucketingConfig: object expected"); + message.fixedSizeBucketingConfig = $root.google.privacy.dlp.v2.FixedSizeBucketingConfig.fromObject(object.fixedSizeBucketingConfig); + } + if (object.bucketingConfig != null) { + if (typeof object.bucketingConfig !== "object") + throw TypeError(".google.privacy.dlp.v2.PrimitiveTransformation.bucketingConfig: object expected"); + message.bucketingConfig = $root.google.privacy.dlp.v2.BucketingConfig.fromObject(object.bucketingConfig); + } + if (object.replaceWithInfoTypeConfig != null) { + if (typeof object.replaceWithInfoTypeConfig !== "object") + throw TypeError(".google.privacy.dlp.v2.PrimitiveTransformation.replaceWithInfoTypeConfig: object expected"); + message.replaceWithInfoTypeConfig = $root.google.privacy.dlp.v2.ReplaceWithInfoTypeConfig.fromObject(object.replaceWithInfoTypeConfig); + } + if (object.timePartConfig != null) { + if (typeof object.timePartConfig !== "object") + throw TypeError(".google.privacy.dlp.v2.PrimitiveTransformation.timePartConfig: object expected"); + message.timePartConfig = $root.google.privacy.dlp.v2.TimePartConfig.fromObject(object.timePartConfig); + } + if (object.cryptoHashConfig != null) { + if (typeof object.cryptoHashConfig !== "object") + throw TypeError(".google.privacy.dlp.v2.PrimitiveTransformation.cryptoHashConfig: object expected"); + message.cryptoHashConfig = $root.google.privacy.dlp.v2.CryptoHashConfig.fromObject(object.cryptoHashConfig); + } + if (object.dateShiftConfig != null) { + if (typeof object.dateShiftConfig !== "object") + throw TypeError(".google.privacy.dlp.v2.PrimitiveTransformation.dateShiftConfig: object expected"); + message.dateShiftConfig = $root.google.privacy.dlp.v2.DateShiftConfig.fromObject(object.dateShiftConfig); + } + if (object.cryptoDeterministicConfig != null) { + if (typeof object.cryptoDeterministicConfig !== "object") + throw TypeError(".google.privacy.dlp.v2.PrimitiveTransformation.cryptoDeterministicConfig: object expected"); + message.cryptoDeterministicConfig = $root.google.privacy.dlp.v2.CryptoDeterministicConfig.fromObject(object.cryptoDeterministicConfig); + } + return message; + }; + + /** + * Creates a plain object from a PrimitiveTransformation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.PrimitiveTransformation + * @static + * @param {google.privacy.dlp.v2.PrimitiveTransformation} message PrimitiveTransformation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PrimitiveTransformation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.replaceConfig != null && message.hasOwnProperty("replaceConfig")) { + object.replaceConfig = $root.google.privacy.dlp.v2.ReplaceValueConfig.toObject(message.replaceConfig, options); + if (options.oneofs) + object.transformation = "replaceConfig"; + } + if (message.redactConfig != null && message.hasOwnProperty("redactConfig")) { + object.redactConfig = $root.google.privacy.dlp.v2.RedactConfig.toObject(message.redactConfig, options); + if (options.oneofs) + object.transformation = "redactConfig"; + } + if (message.characterMaskConfig != null && message.hasOwnProperty("characterMaskConfig")) { + object.characterMaskConfig = $root.google.privacy.dlp.v2.CharacterMaskConfig.toObject(message.characterMaskConfig, options); + if (options.oneofs) + object.transformation = "characterMaskConfig"; + } + if (message.cryptoReplaceFfxFpeConfig != null && message.hasOwnProperty("cryptoReplaceFfxFpeConfig")) { + object.cryptoReplaceFfxFpeConfig = $root.google.privacy.dlp.v2.CryptoReplaceFfxFpeConfig.toObject(message.cryptoReplaceFfxFpeConfig, options); + if (options.oneofs) + object.transformation = "cryptoReplaceFfxFpeConfig"; + } + if (message.fixedSizeBucketingConfig != null && message.hasOwnProperty("fixedSizeBucketingConfig")) { + object.fixedSizeBucketingConfig = $root.google.privacy.dlp.v2.FixedSizeBucketingConfig.toObject(message.fixedSizeBucketingConfig, options); + if (options.oneofs) + object.transformation = "fixedSizeBucketingConfig"; + } + if (message.bucketingConfig != null && message.hasOwnProperty("bucketingConfig")) { + object.bucketingConfig = $root.google.privacy.dlp.v2.BucketingConfig.toObject(message.bucketingConfig, options); + if (options.oneofs) + object.transformation = "bucketingConfig"; + } + if (message.replaceWithInfoTypeConfig != null && message.hasOwnProperty("replaceWithInfoTypeConfig")) { + object.replaceWithInfoTypeConfig = $root.google.privacy.dlp.v2.ReplaceWithInfoTypeConfig.toObject(message.replaceWithInfoTypeConfig, options); + if (options.oneofs) + object.transformation = "replaceWithInfoTypeConfig"; + } + if (message.timePartConfig != null && message.hasOwnProperty("timePartConfig")) { + object.timePartConfig = $root.google.privacy.dlp.v2.TimePartConfig.toObject(message.timePartConfig, options); + if (options.oneofs) + object.transformation = "timePartConfig"; + } + if (message.cryptoHashConfig != null && message.hasOwnProperty("cryptoHashConfig")) { + object.cryptoHashConfig = $root.google.privacy.dlp.v2.CryptoHashConfig.toObject(message.cryptoHashConfig, options); + if (options.oneofs) + object.transformation = "cryptoHashConfig"; + } + if (message.dateShiftConfig != null && message.hasOwnProperty("dateShiftConfig")) { + object.dateShiftConfig = $root.google.privacy.dlp.v2.DateShiftConfig.toObject(message.dateShiftConfig, options); + if (options.oneofs) + object.transformation = "dateShiftConfig"; + } + if (message.cryptoDeterministicConfig != null && message.hasOwnProperty("cryptoDeterministicConfig")) { + object.cryptoDeterministicConfig = $root.google.privacy.dlp.v2.CryptoDeterministicConfig.toObject(message.cryptoDeterministicConfig, options); + if (options.oneofs) + object.transformation = "cryptoDeterministicConfig"; + } + return object; + }; + + /** + * Converts this PrimitiveTransformation to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.PrimitiveTransformation + * @instance + * @returns {Object.} JSON object + */ + PrimitiveTransformation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return PrimitiveTransformation; + })(); + + v2.TimePartConfig = (function() { + + /** + * Properties of a TimePartConfig. + * @memberof google.privacy.dlp.v2 + * @interface ITimePartConfig + * @property {google.privacy.dlp.v2.TimePartConfig.TimePart|null} [partToExtract] TimePartConfig partToExtract + */ + + /** + * Constructs a new TimePartConfig. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents a TimePartConfig. + * @implements ITimePartConfig + * @constructor + * @param {google.privacy.dlp.v2.ITimePartConfig=} [properties] Properties to set + */ + function TimePartConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TimePartConfig partToExtract. + * @member {google.privacy.dlp.v2.TimePartConfig.TimePart} partToExtract + * @memberof google.privacy.dlp.v2.TimePartConfig + * @instance + */ + TimePartConfig.prototype.partToExtract = 0; + + /** + * Creates a new TimePartConfig instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.TimePartConfig + * @static + * @param {google.privacy.dlp.v2.ITimePartConfig=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.TimePartConfig} TimePartConfig instance + */ + TimePartConfig.create = function create(properties) { + return new TimePartConfig(properties); + }; + + /** + * Encodes the specified TimePartConfig message. Does not implicitly {@link google.privacy.dlp.v2.TimePartConfig.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.TimePartConfig + * @static + * @param {google.privacy.dlp.v2.ITimePartConfig} message TimePartConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimePartConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.partToExtract != null && Object.hasOwnProperty.call(message, "partToExtract")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.partToExtract); + return writer; + }; + + /** + * Encodes the specified TimePartConfig message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.TimePartConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.TimePartConfig + * @static + * @param {google.privacy.dlp.v2.ITimePartConfig} message TimePartConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimePartConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TimePartConfig message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.TimePartConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.TimePartConfig} TimePartConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimePartConfig.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.privacy.dlp.v2.TimePartConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.partToExtract = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TimePartConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.TimePartConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.TimePartConfig} TimePartConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimePartConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TimePartConfig message. + * @function verify + * @memberof google.privacy.dlp.v2.TimePartConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TimePartConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.partToExtract != null && message.hasOwnProperty("partToExtract")) + switch (message.partToExtract) { + default: + return "partToExtract: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + return null; + }; + + /** + * Creates a TimePartConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.TimePartConfig + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.TimePartConfig} TimePartConfig + */ + TimePartConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.TimePartConfig) + return object; + var message = new $root.google.privacy.dlp.v2.TimePartConfig(); + switch (object.partToExtract) { + case "TIME_PART_UNSPECIFIED": + case 0: + message.partToExtract = 0; + break; + case "YEAR": + case 1: + message.partToExtract = 1; + break; + case "MONTH": + case 2: + message.partToExtract = 2; + break; + case "DAY_OF_MONTH": + case 3: + message.partToExtract = 3; + break; + case "DAY_OF_WEEK": + case 4: + message.partToExtract = 4; + break; + case "WEEK_OF_YEAR": + case 5: + message.partToExtract = 5; + break; + case "HOUR_OF_DAY": + case 6: + message.partToExtract = 6; + break; + } + return message; + }; + + /** + * Creates a plain object from a TimePartConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.TimePartConfig + * @static + * @param {google.privacy.dlp.v2.TimePartConfig} message TimePartConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TimePartConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.partToExtract = options.enums === String ? "TIME_PART_UNSPECIFIED" : 0; + if (message.partToExtract != null && message.hasOwnProperty("partToExtract")) + object.partToExtract = options.enums === String ? $root.google.privacy.dlp.v2.TimePartConfig.TimePart[message.partToExtract] : message.partToExtract; + return object; + }; + + /** + * Converts this TimePartConfig to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.TimePartConfig + * @instance + * @returns {Object.} JSON object + */ + TimePartConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * TimePart enum. + * @name google.privacy.dlp.v2.TimePartConfig.TimePart + * @enum {number} + * @property {number} TIME_PART_UNSPECIFIED=0 TIME_PART_UNSPECIFIED value + * @property {number} YEAR=1 YEAR value + * @property {number} MONTH=2 MONTH value + * @property {number} DAY_OF_MONTH=3 DAY_OF_MONTH value + * @property {number} DAY_OF_WEEK=4 DAY_OF_WEEK value + * @property {number} WEEK_OF_YEAR=5 WEEK_OF_YEAR value + * @property {number} HOUR_OF_DAY=6 HOUR_OF_DAY value + */ + TimePartConfig.TimePart = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TIME_PART_UNSPECIFIED"] = 0; + values[valuesById[1] = "YEAR"] = 1; + values[valuesById[2] = "MONTH"] = 2; + values[valuesById[3] = "DAY_OF_MONTH"] = 3; + values[valuesById[4] = "DAY_OF_WEEK"] = 4; + values[valuesById[5] = "WEEK_OF_YEAR"] = 5; + values[valuesById[6] = "HOUR_OF_DAY"] = 6; + return values; + })(); + + return TimePartConfig; + })(); + + v2.CryptoHashConfig = (function() { + + /** + * Properties of a CryptoHashConfig. + * @memberof google.privacy.dlp.v2 + * @interface ICryptoHashConfig + * @property {google.privacy.dlp.v2.ICryptoKey|null} [cryptoKey] CryptoHashConfig cryptoKey + */ + + /** + * Constructs a new CryptoHashConfig. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents a CryptoHashConfig. + * @implements ICryptoHashConfig + * @constructor + * @param {google.privacy.dlp.v2.ICryptoHashConfig=} [properties] Properties to set + */ + function CryptoHashConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CryptoHashConfig cryptoKey. + * @member {google.privacy.dlp.v2.ICryptoKey|null|undefined} cryptoKey + * @memberof google.privacy.dlp.v2.CryptoHashConfig + * @instance + */ + CryptoHashConfig.prototype.cryptoKey = null; + + /** + * Creates a new CryptoHashConfig instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.CryptoHashConfig + * @static + * @param {google.privacy.dlp.v2.ICryptoHashConfig=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.CryptoHashConfig} CryptoHashConfig instance + */ + CryptoHashConfig.create = function create(properties) { + return new CryptoHashConfig(properties); + }; + + /** + * Encodes the specified CryptoHashConfig message. Does not implicitly {@link google.privacy.dlp.v2.CryptoHashConfig.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.CryptoHashConfig + * @static + * @param {google.privacy.dlp.v2.ICryptoHashConfig} message CryptoHashConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CryptoHashConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.cryptoKey != null && Object.hasOwnProperty.call(message, "cryptoKey")) + $root.google.privacy.dlp.v2.CryptoKey.encode(message.cryptoKey, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CryptoHashConfig message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.CryptoHashConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.CryptoHashConfig + * @static + * @param {google.privacy.dlp.v2.ICryptoHashConfig} message CryptoHashConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CryptoHashConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CryptoHashConfig message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.CryptoHashConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.CryptoHashConfig} CryptoHashConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CryptoHashConfig.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.privacy.dlp.v2.CryptoHashConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.cryptoKey = $root.google.privacy.dlp.v2.CryptoKey.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CryptoHashConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.CryptoHashConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.CryptoHashConfig} CryptoHashConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CryptoHashConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CryptoHashConfig message. + * @function verify + * @memberof google.privacy.dlp.v2.CryptoHashConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CryptoHashConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.cryptoKey != null && message.hasOwnProperty("cryptoKey")) { + var error = $root.google.privacy.dlp.v2.CryptoKey.verify(message.cryptoKey); + if (error) + return "cryptoKey." + error; + } + return null; + }; + + /** + * Creates a CryptoHashConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.CryptoHashConfig + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.CryptoHashConfig} CryptoHashConfig + */ + CryptoHashConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.CryptoHashConfig) + return object; + var message = new $root.google.privacy.dlp.v2.CryptoHashConfig(); + if (object.cryptoKey != null) { + if (typeof object.cryptoKey !== "object") + throw TypeError(".google.privacy.dlp.v2.CryptoHashConfig.cryptoKey: object expected"); + message.cryptoKey = $root.google.privacy.dlp.v2.CryptoKey.fromObject(object.cryptoKey); + } + return message; + }; + + /** + * Creates a plain object from a CryptoHashConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.CryptoHashConfig + * @static + * @param {google.privacy.dlp.v2.CryptoHashConfig} message CryptoHashConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CryptoHashConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.cryptoKey = null; + if (message.cryptoKey != null && message.hasOwnProperty("cryptoKey")) + object.cryptoKey = $root.google.privacy.dlp.v2.CryptoKey.toObject(message.cryptoKey, options); + return object; + }; + + /** + * Converts this CryptoHashConfig to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.CryptoHashConfig + * @instance + * @returns {Object.} JSON object + */ + CryptoHashConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CryptoHashConfig; + })(); + + v2.CryptoDeterministicConfig = (function() { + + /** + * Properties of a CryptoDeterministicConfig. + * @memberof google.privacy.dlp.v2 + * @interface ICryptoDeterministicConfig + * @property {google.privacy.dlp.v2.ICryptoKey|null} [cryptoKey] CryptoDeterministicConfig cryptoKey + * @property {google.privacy.dlp.v2.IInfoType|null} [surrogateInfoType] CryptoDeterministicConfig surrogateInfoType + * @property {google.privacy.dlp.v2.IFieldId|null} [context] CryptoDeterministicConfig context + */ + + /** + * Constructs a new CryptoDeterministicConfig. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents a CryptoDeterministicConfig. + * @implements ICryptoDeterministicConfig + * @constructor + * @param {google.privacy.dlp.v2.ICryptoDeterministicConfig=} [properties] Properties to set + */ + function CryptoDeterministicConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CryptoDeterministicConfig cryptoKey. + * @member {google.privacy.dlp.v2.ICryptoKey|null|undefined} cryptoKey + * @memberof google.privacy.dlp.v2.CryptoDeterministicConfig + * @instance + */ + CryptoDeterministicConfig.prototype.cryptoKey = null; + + /** + * CryptoDeterministicConfig surrogateInfoType. + * @member {google.privacy.dlp.v2.IInfoType|null|undefined} surrogateInfoType + * @memberof google.privacy.dlp.v2.CryptoDeterministicConfig + * @instance + */ + CryptoDeterministicConfig.prototype.surrogateInfoType = null; + + /** + * CryptoDeterministicConfig context. + * @member {google.privacy.dlp.v2.IFieldId|null|undefined} context + * @memberof google.privacy.dlp.v2.CryptoDeterministicConfig + * @instance + */ + CryptoDeterministicConfig.prototype.context = null; + + /** + * Creates a new CryptoDeterministicConfig instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.CryptoDeterministicConfig + * @static + * @param {google.privacy.dlp.v2.ICryptoDeterministicConfig=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.CryptoDeterministicConfig} CryptoDeterministicConfig instance + */ + CryptoDeterministicConfig.create = function create(properties) { + return new CryptoDeterministicConfig(properties); + }; + + /** + * Encodes the specified CryptoDeterministicConfig message. Does not implicitly {@link google.privacy.dlp.v2.CryptoDeterministicConfig.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.CryptoDeterministicConfig + * @static + * @param {google.privacy.dlp.v2.ICryptoDeterministicConfig} message CryptoDeterministicConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CryptoDeterministicConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.cryptoKey != null && Object.hasOwnProperty.call(message, "cryptoKey")) + $root.google.privacy.dlp.v2.CryptoKey.encode(message.cryptoKey, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.surrogateInfoType != null && Object.hasOwnProperty.call(message, "surrogateInfoType")) + $root.google.privacy.dlp.v2.InfoType.encode(message.surrogateInfoType, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.context != null && Object.hasOwnProperty.call(message, "context")) + $root.google.privacy.dlp.v2.FieldId.encode(message.context, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CryptoDeterministicConfig message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.CryptoDeterministicConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.CryptoDeterministicConfig + * @static + * @param {google.privacy.dlp.v2.ICryptoDeterministicConfig} message CryptoDeterministicConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CryptoDeterministicConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CryptoDeterministicConfig message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.CryptoDeterministicConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.CryptoDeterministicConfig} CryptoDeterministicConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CryptoDeterministicConfig.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.privacy.dlp.v2.CryptoDeterministicConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.cryptoKey = $root.google.privacy.dlp.v2.CryptoKey.decode(reader, reader.uint32()); + break; + case 2: + message.surrogateInfoType = $root.google.privacy.dlp.v2.InfoType.decode(reader, reader.uint32()); + break; + case 3: + message.context = $root.google.privacy.dlp.v2.FieldId.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CryptoDeterministicConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.CryptoDeterministicConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.CryptoDeterministicConfig} CryptoDeterministicConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CryptoDeterministicConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CryptoDeterministicConfig message. + * @function verify + * @memberof google.privacy.dlp.v2.CryptoDeterministicConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CryptoDeterministicConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.cryptoKey != null && message.hasOwnProperty("cryptoKey")) { + var error = $root.google.privacy.dlp.v2.CryptoKey.verify(message.cryptoKey); + if (error) + return "cryptoKey." + error; + } + if (message.surrogateInfoType != null && message.hasOwnProperty("surrogateInfoType")) { + var error = $root.google.privacy.dlp.v2.InfoType.verify(message.surrogateInfoType); + if (error) + return "surrogateInfoType." + error; + } + if (message.context != null && message.hasOwnProperty("context")) { + var error = $root.google.privacy.dlp.v2.FieldId.verify(message.context); + if (error) + return "context." + error; + } + return null; + }; + + /** + * Creates a CryptoDeterministicConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.CryptoDeterministicConfig + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.CryptoDeterministicConfig} CryptoDeterministicConfig + */ + CryptoDeterministicConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.CryptoDeterministicConfig) + return object; + var message = new $root.google.privacy.dlp.v2.CryptoDeterministicConfig(); + if (object.cryptoKey != null) { + if (typeof object.cryptoKey !== "object") + throw TypeError(".google.privacy.dlp.v2.CryptoDeterministicConfig.cryptoKey: object expected"); + message.cryptoKey = $root.google.privacy.dlp.v2.CryptoKey.fromObject(object.cryptoKey); + } + if (object.surrogateInfoType != null) { + if (typeof object.surrogateInfoType !== "object") + throw TypeError(".google.privacy.dlp.v2.CryptoDeterministicConfig.surrogateInfoType: object expected"); + message.surrogateInfoType = $root.google.privacy.dlp.v2.InfoType.fromObject(object.surrogateInfoType); + } + if (object.context != null) { + if (typeof object.context !== "object") + throw TypeError(".google.privacy.dlp.v2.CryptoDeterministicConfig.context: object expected"); + message.context = $root.google.privacy.dlp.v2.FieldId.fromObject(object.context); + } + return message; + }; + + /** + * Creates a plain object from a CryptoDeterministicConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.CryptoDeterministicConfig + * @static + * @param {google.privacy.dlp.v2.CryptoDeterministicConfig} message CryptoDeterministicConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CryptoDeterministicConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.cryptoKey = null; + object.surrogateInfoType = null; + object.context = null; + } + if (message.cryptoKey != null && message.hasOwnProperty("cryptoKey")) + object.cryptoKey = $root.google.privacy.dlp.v2.CryptoKey.toObject(message.cryptoKey, options); + if (message.surrogateInfoType != null && message.hasOwnProperty("surrogateInfoType")) + object.surrogateInfoType = $root.google.privacy.dlp.v2.InfoType.toObject(message.surrogateInfoType, options); + if (message.context != null && message.hasOwnProperty("context")) + object.context = $root.google.privacy.dlp.v2.FieldId.toObject(message.context, options); + return object; + }; + + /** + * Converts this CryptoDeterministicConfig to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.CryptoDeterministicConfig + * @instance + * @returns {Object.} JSON object + */ + CryptoDeterministicConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CryptoDeterministicConfig; + })(); + + v2.ReplaceValueConfig = (function() { + + /** + * Properties of a ReplaceValueConfig. + * @memberof google.privacy.dlp.v2 + * @interface IReplaceValueConfig + * @property {google.privacy.dlp.v2.IValue|null} [newValue] ReplaceValueConfig newValue + */ + + /** + * Constructs a new ReplaceValueConfig. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents a ReplaceValueConfig. + * @implements IReplaceValueConfig + * @constructor + * @param {google.privacy.dlp.v2.IReplaceValueConfig=} [properties] Properties to set + */ + function ReplaceValueConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReplaceValueConfig newValue. + * @member {google.privacy.dlp.v2.IValue|null|undefined} newValue + * @memberof google.privacy.dlp.v2.ReplaceValueConfig + * @instance + */ + ReplaceValueConfig.prototype.newValue = null; + + /** + * Creates a new ReplaceValueConfig instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.ReplaceValueConfig + * @static + * @param {google.privacy.dlp.v2.IReplaceValueConfig=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.ReplaceValueConfig} ReplaceValueConfig instance + */ + ReplaceValueConfig.create = function create(properties) { + return new ReplaceValueConfig(properties); + }; + + /** + * Encodes the specified ReplaceValueConfig message. Does not implicitly {@link google.privacy.dlp.v2.ReplaceValueConfig.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.ReplaceValueConfig + * @static + * @param {google.privacy.dlp.v2.IReplaceValueConfig} message ReplaceValueConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReplaceValueConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.newValue != null && Object.hasOwnProperty.call(message, "newValue")) + $root.google.privacy.dlp.v2.Value.encode(message.newValue, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ReplaceValueConfig message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.ReplaceValueConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.ReplaceValueConfig + * @static + * @param {google.privacy.dlp.v2.IReplaceValueConfig} message ReplaceValueConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReplaceValueConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReplaceValueConfig message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.ReplaceValueConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.ReplaceValueConfig} ReplaceValueConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReplaceValueConfig.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.privacy.dlp.v2.ReplaceValueConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.newValue = $root.google.privacy.dlp.v2.Value.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReplaceValueConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.ReplaceValueConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.ReplaceValueConfig} ReplaceValueConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReplaceValueConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReplaceValueConfig message. + * @function verify + * @memberof google.privacy.dlp.v2.ReplaceValueConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReplaceValueConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.newValue != null && message.hasOwnProperty("newValue")) { + var error = $root.google.privacy.dlp.v2.Value.verify(message.newValue); + if (error) + return "newValue." + error; + } + return null; + }; + + /** + * Creates a ReplaceValueConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.ReplaceValueConfig + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.ReplaceValueConfig} ReplaceValueConfig + */ + ReplaceValueConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.ReplaceValueConfig) + return object; + var message = new $root.google.privacy.dlp.v2.ReplaceValueConfig(); + if (object.newValue != null) { + if (typeof object.newValue !== "object") + throw TypeError(".google.privacy.dlp.v2.ReplaceValueConfig.newValue: object expected"); + message.newValue = $root.google.privacy.dlp.v2.Value.fromObject(object.newValue); + } + return message; + }; + + /** + * Creates a plain object from a ReplaceValueConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.ReplaceValueConfig + * @static + * @param {google.privacy.dlp.v2.ReplaceValueConfig} message ReplaceValueConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReplaceValueConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.newValue = null; + if (message.newValue != null && message.hasOwnProperty("newValue")) + object.newValue = $root.google.privacy.dlp.v2.Value.toObject(message.newValue, options); + return object; + }; + + /** + * Converts this ReplaceValueConfig to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.ReplaceValueConfig + * @instance + * @returns {Object.} JSON object + */ + ReplaceValueConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ReplaceValueConfig; + })(); + + v2.ReplaceWithInfoTypeConfig = (function() { + + /** + * Properties of a ReplaceWithInfoTypeConfig. + * @memberof google.privacy.dlp.v2 + * @interface IReplaceWithInfoTypeConfig + */ + + /** + * Constructs a new ReplaceWithInfoTypeConfig. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents a ReplaceWithInfoTypeConfig. + * @implements IReplaceWithInfoTypeConfig + * @constructor + * @param {google.privacy.dlp.v2.IReplaceWithInfoTypeConfig=} [properties] Properties to set + */ + function ReplaceWithInfoTypeConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new ReplaceWithInfoTypeConfig instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.ReplaceWithInfoTypeConfig + * @static + * @param {google.privacy.dlp.v2.IReplaceWithInfoTypeConfig=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.ReplaceWithInfoTypeConfig} ReplaceWithInfoTypeConfig instance + */ + ReplaceWithInfoTypeConfig.create = function create(properties) { + return new ReplaceWithInfoTypeConfig(properties); + }; + + /** + * Encodes the specified ReplaceWithInfoTypeConfig message. Does not implicitly {@link google.privacy.dlp.v2.ReplaceWithInfoTypeConfig.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.ReplaceWithInfoTypeConfig + * @static + * @param {google.privacy.dlp.v2.IReplaceWithInfoTypeConfig} message ReplaceWithInfoTypeConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReplaceWithInfoTypeConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified ReplaceWithInfoTypeConfig message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.ReplaceWithInfoTypeConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.ReplaceWithInfoTypeConfig + * @static + * @param {google.privacy.dlp.v2.IReplaceWithInfoTypeConfig} message ReplaceWithInfoTypeConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReplaceWithInfoTypeConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReplaceWithInfoTypeConfig message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.ReplaceWithInfoTypeConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.ReplaceWithInfoTypeConfig} ReplaceWithInfoTypeConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReplaceWithInfoTypeConfig.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.privacy.dlp.v2.ReplaceWithInfoTypeConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReplaceWithInfoTypeConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.ReplaceWithInfoTypeConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.ReplaceWithInfoTypeConfig} ReplaceWithInfoTypeConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReplaceWithInfoTypeConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReplaceWithInfoTypeConfig message. + * @function verify + * @memberof google.privacy.dlp.v2.ReplaceWithInfoTypeConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReplaceWithInfoTypeConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a ReplaceWithInfoTypeConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.ReplaceWithInfoTypeConfig + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.ReplaceWithInfoTypeConfig} ReplaceWithInfoTypeConfig + */ + ReplaceWithInfoTypeConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.ReplaceWithInfoTypeConfig) + return object; + return new $root.google.privacy.dlp.v2.ReplaceWithInfoTypeConfig(); + }; + + /** + * Creates a plain object from a ReplaceWithInfoTypeConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.ReplaceWithInfoTypeConfig + * @static + * @param {google.privacy.dlp.v2.ReplaceWithInfoTypeConfig} message ReplaceWithInfoTypeConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReplaceWithInfoTypeConfig.toObject = function toObject() { + return {}; + }; + + /** + * Converts this ReplaceWithInfoTypeConfig to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.ReplaceWithInfoTypeConfig + * @instance + * @returns {Object.} JSON object + */ + ReplaceWithInfoTypeConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ReplaceWithInfoTypeConfig; + })(); + + v2.RedactConfig = (function() { + + /** + * Properties of a RedactConfig. + * @memberof google.privacy.dlp.v2 + * @interface IRedactConfig + */ + + /** + * Constructs a new RedactConfig. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents a RedactConfig. + * @implements IRedactConfig + * @constructor + * @param {google.privacy.dlp.v2.IRedactConfig=} [properties] Properties to set + */ + function RedactConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new RedactConfig instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.RedactConfig + * @static + * @param {google.privacy.dlp.v2.IRedactConfig=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.RedactConfig} RedactConfig instance + */ + RedactConfig.create = function create(properties) { + return new RedactConfig(properties); + }; + + /** + * Encodes the specified RedactConfig message. Does not implicitly {@link google.privacy.dlp.v2.RedactConfig.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.RedactConfig + * @static + * @param {google.privacy.dlp.v2.IRedactConfig} message RedactConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RedactConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified RedactConfig message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.RedactConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.RedactConfig + * @static + * @param {google.privacy.dlp.v2.IRedactConfig} message RedactConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RedactConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RedactConfig message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.RedactConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.RedactConfig} RedactConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RedactConfig.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.privacy.dlp.v2.RedactConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RedactConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.RedactConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.RedactConfig} RedactConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RedactConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RedactConfig message. + * @function verify + * @memberof google.privacy.dlp.v2.RedactConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RedactConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a RedactConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.RedactConfig + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.RedactConfig} RedactConfig + */ + RedactConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.RedactConfig) + return object; + return new $root.google.privacy.dlp.v2.RedactConfig(); + }; + + /** + * Creates a plain object from a RedactConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.RedactConfig + * @static + * @param {google.privacy.dlp.v2.RedactConfig} message RedactConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RedactConfig.toObject = function toObject() { + return {}; + }; + + /** + * Converts this RedactConfig to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.RedactConfig + * @instance + * @returns {Object.} JSON object + */ + RedactConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RedactConfig; + })(); + + v2.CharsToIgnore = (function() { + + /** + * Properties of a CharsToIgnore. + * @memberof google.privacy.dlp.v2 + * @interface ICharsToIgnore + * @property {string|null} [charactersToSkip] CharsToIgnore charactersToSkip + * @property {google.privacy.dlp.v2.CharsToIgnore.CommonCharsToIgnore|null} [commonCharactersToIgnore] CharsToIgnore commonCharactersToIgnore + */ + + /** + * Constructs a new CharsToIgnore. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents a CharsToIgnore. + * @implements ICharsToIgnore + * @constructor + * @param {google.privacy.dlp.v2.ICharsToIgnore=} [properties] Properties to set + */ + function CharsToIgnore(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CharsToIgnore charactersToSkip. + * @member {string} charactersToSkip + * @memberof google.privacy.dlp.v2.CharsToIgnore + * @instance + */ + CharsToIgnore.prototype.charactersToSkip = ""; + + /** + * CharsToIgnore commonCharactersToIgnore. + * @member {google.privacy.dlp.v2.CharsToIgnore.CommonCharsToIgnore} commonCharactersToIgnore + * @memberof google.privacy.dlp.v2.CharsToIgnore + * @instance + */ + CharsToIgnore.prototype.commonCharactersToIgnore = 0; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * CharsToIgnore characters. + * @member {"charactersToSkip"|"commonCharactersToIgnore"|undefined} characters + * @memberof google.privacy.dlp.v2.CharsToIgnore + * @instance + */ + Object.defineProperty(CharsToIgnore.prototype, "characters", { + get: $util.oneOfGetter($oneOfFields = ["charactersToSkip", "commonCharactersToIgnore"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CharsToIgnore instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.CharsToIgnore + * @static + * @param {google.privacy.dlp.v2.ICharsToIgnore=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.CharsToIgnore} CharsToIgnore instance + */ + CharsToIgnore.create = function create(properties) { + return new CharsToIgnore(properties); + }; + + /** + * Encodes the specified CharsToIgnore message. Does not implicitly {@link google.privacy.dlp.v2.CharsToIgnore.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.CharsToIgnore + * @static + * @param {google.privacy.dlp.v2.ICharsToIgnore} message CharsToIgnore message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CharsToIgnore.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.charactersToSkip != null && Object.hasOwnProperty.call(message, "charactersToSkip")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.charactersToSkip); + if (message.commonCharactersToIgnore != null && Object.hasOwnProperty.call(message, "commonCharactersToIgnore")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.commonCharactersToIgnore); + return writer; + }; + + /** + * Encodes the specified CharsToIgnore message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.CharsToIgnore.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.CharsToIgnore + * @static + * @param {google.privacy.dlp.v2.ICharsToIgnore} message CharsToIgnore message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CharsToIgnore.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CharsToIgnore message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.CharsToIgnore + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.CharsToIgnore} CharsToIgnore + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CharsToIgnore.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.privacy.dlp.v2.CharsToIgnore(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.charactersToSkip = reader.string(); + break; + case 2: + message.commonCharactersToIgnore = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CharsToIgnore message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.CharsToIgnore + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.CharsToIgnore} CharsToIgnore + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CharsToIgnore.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CharsToIgnore message. + * @function verify + * @memberof google.privacy.dlp.v2.CharsToIgnore + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CharsToIgnore.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.charactersToSkip != null && message.hasOwnProperty("charactersToSkip")) { + properties.characters = 1; + if (!$util.isString(message.charactersToSkip)) + return "charactersToSkip: string expected"; + } + if (message.commonCharactersToIgnore != null && message.hasOwnProperty("commonCharactersToIgnore")) { + if (properties.characters === 1) + return "characters: multiple values"; + properties.characters = 1; + switch (message.commonCharactersToIgnore) { + default: + return "commonCharactersToIgnore: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + } + return null; + }; + + /** + * Creates a CharsToIgnore message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.CharsToIgnore + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.CharsToIgnore} CharsToIgnore + */ + CharsToIgnore.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.CharsToIgnore) + return object; + var message = new $root.google.privacy.dlp.v2.CharsToIgnore(); + if (object.charactersToSkip != null) + message.charactersToSkip = String(object.charactersToSkip); + switch (object.commonCharactersToIgnore) { + case "COMMON_CHARS_TO_IGNORE_UNSPECIFIED": + case 0: + message.commonCharactersToIgnore = 0; + break; + case "NUMERIC": + case 1: + message.commonCharactersToIgnore = 1; + break; + case "ALPHA_UPPER_CASE": + case 2: + message.commonCharactersToIgnore = 2; + break; + case "ALPHA_LOWER_CASE": + case 3: + message.commonCharactersToIgnore = 3; + break; + case "PUNCTUATION": + case 4: + message.commonCharactersToIgnore = 4; + break; + case "WHITESPACE": + case 5: + message.commonCharactersToIgnore = 5; + break; + } + return message; + }; + + /** + * Creates a plain object from a CharsToIgnore message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.CharsToIgnore + * @static + * @param {google.privacy.dlp.v2.CharsToIgnore} message CharsToIgnore + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CharsToIgnore.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.charactersToSkip != null && message.hasOwnProperty("charactersToSkip")) { + object.charactersToSkip = message.charactersToSkip; + if (options.oneofs) + object.characters = "charactersToSkip"; + } + if (message.commonCharactersToIgnore != null && message.hasOwnProperty("commonCharactersToIgnore")) { + object.commonCharactersToIgnore = options.enums === String ? $root.google.privacy.dlp.v2.CharsToIgnore.CommonCharsToIgnore[message.commonCharactersToIgnore] : message.commonCharactersToIgnore; + if (options.oneofs) + object.characters = "commonCharactersToIgnore"; + } + return object; + }; + + /** + * Converts this CharsToIgnore to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.CharsToIgnore + * @instance + * @returns {Object.} JSON object + */ + CharsToIgnore.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * CommonCharsToIgnore enum. + * @name google.privacy.dlp.v2.CharsToIgnore.CommonCharsToIgnore + * @enum {number} + * @property {number} COMMON_CHARS_TO_IGNORE_UNSPECIFIED=0 COMMON_CHARS_TO_IGNORE_UNSPECIFIED value + * @property {number} NUMERIC=1 NUMERIC value + * @property {number} ALPHA_UPPER_CASE=2 ALPHA_UPPER_CASE value + * @property {number} ALPHA_LOWER_CASE=3 ALPHA_LOWER_CASE value + * @property {number} PUNCTUATION=4 PUNCTUATION value + * @property {number} WHITESPACE=5 WHITESPACE value + */ + CharsToIgnore.CommonCharsToIgnore = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "COMMON_CHARS_TO_IGNORE_UNSPECIFIED"] = 0; + values[valuesById[1] = "NUMERIC"] = 1; + values[valuesById[2] = "ALPHA_UPPER_CASE"] = 2; + values[valuesById[3] = "ALPHA_LOWER_CASE"] = 3; + values[valuesById[4] = "PUNCTUATION"] = 4; + values[valuesById[5] = "WHITESPACE"] = 5; + return values; + })(); + + return CharsToIgnore; + })(); + + v2.CharacterMaskConfig = (function() { + + /** + * Properties of a CharacterMaskConfig. + * @memberof google.privacy.dlp.v2 + * @interface ICharacterMaskConfig + * @property {string|null} [maskingCharacter] CharacterMaskConfig maskingCharacter + * @property {number|null} [numberToMask] CharacterMaskConfig numberToMask + * @property {boolean|null} [reverseOrder] CharacterMaskConfig reverseOrder + * @property {Array.|null} [charactersToIgnore] CharacterMaskConfig charactersToIgnore + */ + + /** + * Constructs a new CharacterMaskConfig. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents a CharacterMaskConfig. + * @implements ICharacterMaskConfig + * @constructor + * @param {google.privacy.dlp.v2.ICharacterMaskConfig=} [properties] Properties to set + */ + function CharacterMaskConfig(properties) { + this.charactersToIgnore = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CharacterMaskConfig maskingCharacter. + * @member {string} maskingCharacter + * @memberof google.privacy.dlp.v2.CharacterMaskConfig + * @instance + */ + CharacterMaskConfig.prototype.maskingCharacter = ""; + + /** + * CharacterMaskConfig numberToMask. + * @member {number} numberToMask + * @memberof google.privacy.dlp.v2.CharacterMaskConfig + * @instance + */ + CharacterMaskConfig.prototype.numberToMask = 0; + + /** + * CharacterMaskConfig reverseOrder. + * @member {boolean} reverseOrder + * @memberof google.privacy.dlp.v2.CharacterMaskConfig + * @instance + */ + CharacterMaskConfig.prototype.reverseOrder = false; + + /** + * CharacterMaskConfig charactersToIgnore. + * @member {Array.} charactersToIgnore + * @memberof google.privacy.dlp.v2.CharacterMaskConfig + * @instance + */ + CharacterMaskConfig.prototype.charactersToIgnore = $util.emptyArray; + + /** + * Creates a new CharacterMaskConfig instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.CharacterMaskConfig + * @static + * @param {google.privacy.dlp.v2.ICharacterMaskConfig=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.CharacterMaskConfig} CharacterMaskConfig instance + */ + CharacterMaskConfig.create = function create(properties) { + return new CharacterMaskConfig(properties); + }; + + /** + * Encodes the specified CharacterMaskConfig message. Does not implicitly {@link google.privacy.dlp.v2.CharacterMaskConfig.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.CharacterMaskConfig + * @static + * @param {google.privacy.dlp.v2.ICharacterMaskConfig} message CharacterMaskConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CharacterMaskConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.maskingCharacter != null && Object.hasOwnProperty.call(message, "maskingCharacter")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.maskingCharacter); + if (message.numberToMask != null && Object.hasOwnProperty.call(message, "numberToMask")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.numberToMask); + if (message.reverseOrder != null && Object.hasOwnProperty.call(message, "reverseOrder")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.reverseOrder); + if (message.charactersToIgnore != null && message.charactersToIgnore.length) + for (var i = 0; i < message.charactersToIgnore.length; ++i) + $root.google.privacy.dlp.v2.CharsToIgnore.encode(message.charactersToIgnore[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CharacterMaskConfig message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.CharacterMaskConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.CharacterMaskConfig + * @static + * @param {google.privacy.dlp.v2.ICharacterMaskConfig} message CharacterMaskConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CharacterMaskConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CharacterMaskConfig message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.CharacterMaskConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.CharacterMaskConfig} CharacterMaskConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CharacterMaskConfig.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.privacy.dlp.v2.CharacterMaskConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.maskingCharacter = reader.string(); + break; + case 2: + message.numberToMask = reader.int32(); + break; + case 3: + message.reverseOrder = reader.bool(); + break; + case 4: + if (!(message.charactersToIgnore && message.charactersToIgnore.length)) + message.charactersToIgnore = []; + message.charactersToIgnore.push($root.google.privacy.dlp.v2.CharsToIgnore.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CharacterMaskConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.CharacterMaskConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.CharacterMaskConfig} CharacterMaskConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CharacterMaskConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CharacterMaskConfig message. + * @function verify + * @memberof google.privacy.dlp.v2.CharacterMaskConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CharacterMaskConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.maskingCharacter != null && message.hasOwnProperty("maskingCharacter")) + if (!$util.isString(message.maskingCharacter)) + return "maskingCharacter: string expected"; + if (message.numberToMask != null && message.hasOwnProperty("numberToMask")) + if (!$util.isInteger(message.numberToMask)) + return "numberToMask: integer expected"; + if (message.reverseOrder != null && message.hasOwnProperty("reverseOrder")) + if (typeof message.reverseOrder !== "boolean") + return "reverseOrder: boolean expected"; + if (message.charactersToIgnore != null && message.hasOwnProperty("charactersToIgnore")) { + if (!Array.isArray(message.charactersToIgnore)) + return "charactersToIgnore: array expected"; + for (var i = 0; i < message.charactersToIgnore.length; ++i) { + var error = $root.google.privacy.dlp.v2.CharsToIgnore.verify(message.charactersToIgnore[i]); + if (error) + return "charactersToIgnore." + error; + } + } + return null; + }; + + /** + * Creates a CharacterMaskConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.CharacterMaskConfig + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.CharacterMaskConfig} CharacterMaskConfig + */ + CharacterMaskConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.CharacterMaskConfig) + return object; + var message = new $root.google.privacy.dlp.v2.CharacterMaskConfig(); + if (object.maskingCharacter != null) + message.maskingCharacter = String(object.maskingCharacter); + if (object.numberToMask != null) + message.numberToMask = object.numberToMask | 0; + if (object.reverseOrder != null) + message.reverseOrder = Boolean(object.reverseOrder); + if (object.charactersToIgnore) { + if (!Array.isArray(object.charactersToIgnore)) + throw TypeError(".google.privacy.dlp.v2.CharacterMaskConfig.charactersToIgnore: array expected"); + message.charactersToIgnore = []; + for (var i = 0; i < object.charactersToIgnore.length; ++i) { + if (typeof object.charactersToIgnore[i] !== "object") + throw TypeError(".google.privacy.dlp.v2.CharacterMaskConfig.charactersToIgnore: object expected"); + message.charactersToIgnore[i] = $root.google.privacy.dlp.v2.CharsToIgnore.fromObject(object.charactersToIgnore[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a CharacterMaskConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.CharacterMaskConfig + * @static + * @param {google.privacy.dlp.v2.CharacterMaskConfig} message CharacterMaskConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CharacterMaskConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.charactersToIgnore = []; + if (options.defaults) { + object.maskingCharacter = ""; + object.numberToMask = 0; + object.reverseOrder = false; + } + if (message.maskingCharacter != null && message.hasOwnProperty("maskingCharacter")) + object.maskingCharacter = message.maskingCharacter; + if (message.numberToMask != null && message.hasOwnProperty("numberToMask")) + object.numberToMask = message.numberToMask; + if (message.reverseOrder != null && message.hasOwnProperty("reverseOrder")) + object.reverseOrder = message.reverseOrder; + if (message.charactersToIgnore && message.charactersToIgnore.length) { + object.charactersToIgnore = []; + for (var j = 0; j < message.charactersToIgnore.length; ++j) + object.charactersToIgnore[j] = $root.google.privacy.dlp.v2.CharsToIgnore.toObject(message.charactersToIgnore[j], options); + } + return object; + }; + + /** + * Converts this CharacterMaskConfig to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.CharacterMaskConfig + * @instance + * @returns {Object.} JSON object + */ + CharacterMaskConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CharacterMaskConfig; + })(); + + v2.FixedSizeBucketingConfig = (function() { + + /** + * Properties of a FixedSizeBucketingConfig. + * @memberof google.privacy.dlp.v2 + * @interface IFixedSizeBucketingConfig + * @property {google.privacy.dlp.v2.IValue|null} [lowerBound] FixedSizeBucketingConfig lowerBound + * @property {google.privacy.dlp.v2.IValue|null} [upperBound] FixedSizeBucketingConfig upperBound + * @property {number|null} [bucketSize] FixedSizeBucketingConfig bucketSize + */ + + /** + * Constructs a new FixedSizeBucketingConfig. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents a FixedSizeBucketingConfig. + * @implements IFixedSizeBucketingConfig + * @constructor + * @param {google.privacy.dlp.v2.IFixedSizeBucketingConfig=} [properties] Properties to set + */ + function FixedSizeBucketingConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FixedSizeBucketingConfig lowerBound. + * @member {google.privacy.dlp.v2.IValue|null|undefined} lowerBound + * @memberof google.privacy.dlp.v2.FixedSizeBucketingConfig + * @instance + */ + FixedSizeBucketingConfig.prototype.lowerBound = null; + + /** + * FixedSizeBucketingConfig upperBound. + * @member {google.privacy.dlp.v2.IValue|null|undefined} upperBound + * @memberof google.privacy.dlp.v2.FixedSizeBucketingConfig + * @instance + */ + FixedSizeBucketingConfig.prototype.upperBound = null; + + /** + * FixedSizeBucketingConfig bucketSize. + * @member {number} bucketSize + * @memberof google.privacy.dlp.v2.FixedSizeBucketingConfig + * @instance + */ + FixedSizeBucketingConfig.prototype.bucketSize = 0; + + /** + * Creates a new FixedSizeBucketingConfig instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.FixedSizeBucketingConfig + * @static + * @param {google.privacy.dlp.v2.IFixedSizeBucketingConfig=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.FixedSizeBucketingConfig} FixedSizeBucketingConfig instance + */ + FixedSizeBucketingConfig.create = function create(properties) { + return new FixedSizeBucketingConfig(properties); + }; + + /** + * Encodes the specified FixedSizeBucketingConfig message. Does not implicitly {@link google.privacy.dlp.v2.FixedSizeBucketingConfig.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.FixedSizeBucketingConfig + * @static + * @param {google.privacy.dlp.v2.IFixedSizeBucketingConfig} message FixedSizeBucketingConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedSizeBucketingConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.lowerBound != null && Object.hasOwnProperty.call(message, "lowerBound")) + $root.google.privacy.dlp.v2.Value.encode(message.lowerBound, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.upperBound != null && Object.hasOwnProperty.call(message, "upperBound")) + $root.google.privacy.dlp.v2.Value.encode(message.upperBound, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.bucketSize != null && Object.hasOwnProperty.call(message, "bucketSize")) + writer.uint32(/* id 3, wireType 1 =*/25).double(message.bucketSize); + return writer; + }; + + /** + * Encodes the specified FixedSizeBucketingConfig message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.FixedSizeBucketingConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.FixedSizeBucketingConfig + * @static + * @param {google.privacy.dlp.v2.IFixedSizeBucketingConfig} message FixedSizeBucketingConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedSizeBucketingConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FixedSizeBucketingConfig message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.FixedSizeBucketingConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.FixedSizeBucketingConfig} FixedSizeBucketingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedSizeBucketingConfig.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.privacy.dlp.v2.FixedSizeBucketingConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.lowerBound = $root.google.privacy.dlp.v2.Value.decode(reader, reader.uint32()); + break; + case 2: + message.upperBound = $root.google.privacy.dlp.v2.Value.decode(reader, reader.uint32()); + break; + case 3: + message.bucketSize = reader.double(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FixedSizeBucketingConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.FixedSizeBucketingConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.FixedSizeBucketingConfig} FixedSizeBucketingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedSizeBucketingConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FixedSizeBucketingConfig message. + * @function verify + * @memberof google.privacy.dlp.v2.FixedSizeBucketingConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FixedSizeBucketingConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.lowerBound != null && message.hasOwnProperty("lowerBound")) { + var error = $root.google.privacy.dlp.v2.Value.verify(message.lowerBound); + if (error) + return "lowerBound." + error; + } + if (message.upperBound != null && message.hasOwnProperty("upperBound")) { + var error = $root.google.privacy.dlp.v2.Value.verify(message.upperBound); + if (error) + return "upperBound." + error; + } + if (message.bucketSize != null && message.hasOwnProperty("bucketSize")) + if (typeof message.bucketSize !== "number") + return "bucketSize: number expected"; + return null; + }; + + /** + * Creates a FixedSizeBucketingConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.FixedSizeBucketingConfig + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.FixedSizeBucketingConfig} FixedSizeBucketingConfig + */ + FixedSizeBucketingConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.FixedSizeBucketingConfig) + return object; + var message = new $root.google.privacy.dlp.v2.FixedSizeBucketingConfig(); + if (object.lowerBound != null) { + if (typeof object.lowerBound !== "object") + throw TypeError(".google.privacy.dlp.v2.FixedSizeBucketingConfig.lowerBound: object expected"); + message.lowerBound = $root.google.privacy.dlp.v2.Value.fromObject(object.lowerBound); + } + if (object.upperBound != null) { + if (typeof object.upperBound !== "object") + throw TypeError(".google.privacy.dlp.v2.FixedSizeBucketingConfig.upperBound: object expected"); + message.upperBound = $root.google.privacy.dlp.v2.Value.fromObject(object.upperBound); + } + if (object.bucketSize != null) + message.bucketSize = Number(object.bucketSize); + return message; + }; + + /** + * Creates a plain object from a FixedSizeBucketingConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.FixedSizeBucketingConfig + * @static + * @param {google.privacy.dlp.v2.FixedSizeBucketingConfig} message FixedSizeBucketingConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FixedSizeBucketingConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.lowerBound = null; + object.upperBound = null; + object.bucketSize = 0; + } + if (message.lowerBound != null && message.hasOwnProperty("lowerBound")) + object.lowerBound = $root.google.privacy.dlp.v2.Value.toObject(message.lowerBound, options); + if (message.upperBound != null && message.hasOwnProperty("upperBound")) + object.upperBound = $root.google.privacy.dlp.v2.Value.toObject(message.upperBound, options); + if (message.bucketSize != null && message.hasOwnProperty("bucketSize")) + object.bucketSize = options.json && !isFinite(message.bucketSize) ? String(message.bucketSize) : message.bucketSize; + return object; + }; + + /** + * Converts this FixedSizeBucketingConfig to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.FixedSizeBucketingConfig + * @instance + * @returns {Object.} JSON object + */ + FixedSizeBucketingConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return FixedSizeBucketingConfig; + })(); + + v2.BucketingConfig = (function() { + + /** + * Properties of a BucketingConfig. + * @memberof google.privacy.dlp.v2 + * @interface IBucketingConfig + * @property {Array.|null} [buckets] BucketingConfig buckets + */ + + /** + * Constructs a new BucketingConfig. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents a BucketingConfig. + * @implements IBucketingConfig + * @constructor + * @param {google.privacy.dlp.v2.IBucketingConfig=} [properties] Properties to set + */ + function BucketingConfig(properties) { + this.buckets = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BucketingConfig buckets. + * @member {Array.} buckets + * @memberof google.privacy.dlp.v2.BucketingConfig + * @instance + */ + BucketingConfig.prototype.buckets = $util.emptyArray; + + /** + * Creates a new BucketingConfig instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.BucketingConfig + * @static + * @param {google.privacy.dlp.v2.IBucketingConfig=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.BucketingConfig} BucketingConfig instance + */ + BucketingConfig.create = function create(properties) { + return new BucketingConfig(properties); + }; + + /** + * Encodes the specified BucketingConfig message. Does not implicitly {@link google.privacy.dlp.v2.BucketingConfig.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.BucketingConfig + * @static + * @param {google.privacy.dlp.v2.IBucketingConfig} message BucketingConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BucketingConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.buckets != null && message.buckets.length) + for (var i = 0; i < message.buckets.length; ++i) + $root.google.privacy.dlp.v2.BucketingConfig.Bucket.encode(message.buckets[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BucketingConfig message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.BucketingConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.BucketingConfig + * @static + * @param {google.privacy.dlp.v2.IBucketingConfig} message BucketingConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BucketingConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BucketingConfig message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.BucketingConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.BucketingConfig} BucketingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BucketingConfig.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.privacy.dlp.v2.BucketingConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.buckets && message.buckets.length)) + message.buckets = []; + message.buckets.push($root.google.privacy.dlp.v2.BucketingConfig.Bucket.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BucketingConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.BucketingConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.BucketingConfig} BucketingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BucketingConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BucketingConfig message. + * @function verify + * @memberof google.privacy.dlp.v2.BucketingConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BucketingConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.buckets != null && message.hasOwnProperty("buckets")) { + if (!Array.isArray(message.buckets)) + return "buckets: array expected"; + for (var i = 0; i < message.buckets.length; ++i) { + var error = $root.google.privacy.dlp.v2.BucketingConfig.Bucket.verify(message.buckets[i]); + if (error) + return "buckets." + error; + } + } + return null; + }; + + /** + * Creates a BucketingConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.BucketingConfig + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.BucketingConfig} BucketingConfig + */ + BucketingConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.BucketingConfig) + return object; + var message = new $root.google.privacy.dlp.v2.BucketingConfig(); + if (object.buckets) { + if (!Array.isArray(object.buckets)) + throw TypeError(".google.privacy.dlp.v2.BucketingConfig.buckets: array expected"); + message.buckets = []; + for (var i = 0; i < object.buckets.length; ++i) { + if (typeof object.buckets[i] !== "object") + throw TypeError(".google.privacy.dlp.v2.BucketingConfig.buckets: object expected"); + message.buckets[i] = $root.google.privacy.dlp.v2.BucketingConfig.Bucket.fromObject(object.buckets[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a BucketingConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.BucketingConfig + * @static + * @param {google.privacy.dlp.v2.BucketingConfig} message BucketingConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BucketingConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.buckets = []; + if (message.buckets && message.buckets.length) { + object.buckets = []; + for (var j = 0; j < message.buckets.length; ++j) + object.buckets[j] = $root.google.privacy.dlp.v2.BucketingConfig.Bucket.toObject(message.buckets[j], options); + } + return object; + }; + + /** + * Converts this BucketingConfig to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.BucketingConfig + * @instance + * @returns {Object.} JSON object + */ + BucketingConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + BucketingConfig.Bucket = (function() { + + /** + * Properties of a Bucket. + * @memberof google.privacy.dlp.v2.BucketingConfig + * @interface IBucket + * @property {google.privacy.dlp.v2.IValue|null} [min] Bucket min + * @property {google.privacy.dlp.v2.IValue|null} [max] Bucket max + * @property {google.privacy.dlp.v2.IValue|null} [replacementValue] Bucket replacementValue + */ + + /** + * Constructs a new Bucket. + * @memberof google.privacy.dlp.v2.BucketingConfig + * @classdesc Represents a Bucket. + * @implements IBucket + * @constructor + * @param {google.privacy.dlp.v2.BucketingConfig.IBucket=} [properties] Properties to set + */ + function Bucket(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Bucket min. + * @member {google.privacy.dlp.v2.IValue|null|undefined} min + * @memberof google.privacy.dlp.v2.BucketingConfig.Bucket + * @instance + */ + Bucket.prototype.min = null; + + /** + * Bucket max. + * @member {google.privacy.dlp.v2.IValue|null|undefined} max + * @memberof google.privacy.dlp.v2.BucketingConfig.Bucket + * @instance + */ + Bucket.prototype.max = null; + + /** + * Bucket replacementValue. + * @member {google.privacy.dlp.v2.IValue|null|undefined} replacementValue + * @memberof google.privacy.dlp.v2.BucketingConfig.Bucket + * @instance + */ + Bucket.prototype.replacementValue = null; + + /** + * Creates a new Bucket instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.BucketingConfig.Bucket + * @static + * @param {google.privacy.dlp.v2.BucketingConfig.IBucket=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.BucketingConfig.Bucket} Bucket instance + */ + Bucket.create = function create(properties) { + return new Bucket(properties); + }; + + /** + * Encodes the specified Bucket message. Does not implicitly {@link google.privacy.dlp.v2.BucketingConfig.Bucket.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.BucketingConfig.Bucket + * @static + * @param {google.privacy.dlp.v2.BucketingConfig.IBucket} message Bucket message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Bucket.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.min != null && Object.hasOwnProperty.call(message, "min")) + $root.google.privacy.dlp.v2.Value.encode(message.min, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.max != null && Object.hasOwnProperty.call(message, "max")) + $root.google.privacy.dlp.v2.Value.encode(message.max, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.replacementValue != null && Object.hasOwnProperty.call(message, "replacementValue")) + $root.google.privacy.dlp.v2.Value.encode(message.replacementValue, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Bucket message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.BucketingConfig.Bucket.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.BucketingConfig.Bucket + * @static + * @param {google.privacy.dlp.v2.BucketingConfig.IBucket} message Bucket message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Bucket.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Bucket message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.BucketingConfig.Bucket + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.BucketingConfig.Bucket} Bucket + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Bucket.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.privacy.dlp.v2.BucketingConfig.Bucket(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.min = $root.google.privacy.dlp.v2.Value.decode(reader, reader.uint32()); + break; + case 2: + message.max = $root.google.privacy.dlp.v2.Value.decode(reader, reader.uint32()); + break; + case 3: + message.replacementValue = $root.google.privacy.dlp.v2.Value.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Bucket message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.BucketingConfig.Bucket + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.BucketingConfig.Bucket} Bucket + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Bucket.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Bucket message. + * @function verify + * @memberof google.privacy.dlp.v2.BucketingConfig.Bucket + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Bucket.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.min != null && message.hasOwnProperty("min")) { + var error = $root.google.privacy.dlp.v2.Value.verify(message.min); + if (error) + return "min." + error; + } + if (message.max != null && message.hasOwnProperty("max")) { + var error = $root.google.privacy.dlp.v2.Value.verify(message.max); + if (error) + return "max." + error; + } + if (message.replacementValue != null && message.hasOwnProperty("replacementValue")) { + var error = $root.google.privacy.dlp.v2.Value.verify(message.replacementValue); + if (error) + return "replacementValue." + error; + } + return null; + }; + + /** + * Creates a Bucket message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.BucketingConfig.Bucket + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.BucketingConfig.Bucket} Bucket + */ + Bucket.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.BucketingConfig.Bucket) + return object; + var message = new $root.google.privacy.dlp.v2.BucketingConfig.Bucket(); + if (object.min != null) { + if (typeof object.min !== "object") + throw TypeError(".google.privacy.dlp.v2.BucketingConfig.Bucket.min: object expected"); + message.min = $root.google.privacy.dlp.v2.Value.fromObject(object.min); + } + if (object.max != null) { + if (typeof object.max !== "object") + throw TypeError(".google.privacy.dlp.v2.BucketingConfig.Bucket.max: object expected"); + message.max = $root.google.privacy.dlp.v2.Value.fromObject(object.max); + } + if (object.replacementValue != null) { + if (typeof object.replacementValue !== "object") + throw TypeError(".google.privacy.dlp.v2.BucketingConfig.Bucket.replacementValue: object expected"); + message.replacementValue = $root.google.privacy.dlp.v2.Value.fromObject(object.replacementValue); + } + return message; + }; + + /** + * Creates a plain object from a Bucket message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.BucketingConfig.Bucket + * @static + * @param {google.privacy.dlp.v2.BucketingConfig.Bucket} message Bucket + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Bucket.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.min = null; + object.max = null; + object.replacementValue = null; + } + if (message.min != null && message.hasOwnProperty("min")) + object.min = $root.google.privacy.dlp.v2.Value.toObject(message.min, options); + if (message.max != null && message.hasOwnProperty("max")) + object.max = $root.google.privacy.dlp.v2.Value.toObject(message.max, options); + if (message.replacementValue != null && message.hasOwnProperty("replacementValue")) + object.replacementValue = $root.google.privacy.dlp.v2.Value.toObject(message.replacementValue, options); + return object; + }; + + /** + * Converts this Bucket to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.BucketingConfig.Bucket + * @instance + * @returns {Object.} JSON object + */ + Bucket.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Bucket; + })(); + + return BucketingConfig; + })(); + + v2.CryptoReplaceFfxFpeConfig = (function() { + + /** + * Properties of a CryptoReplaceFfxFpeConfig. + * @memberof google.privacy.dlp.v2 + * @interface ICryptoReplaceFfxFpeConfig + * @property {google.privacy.dlp.v2.ICryptoKey|null} [cryptoKey] CryptoReplaceFfxFpeConfig cryptoKey + * @property {google.privacy.dlp.v2.IFieldId|null} [context] CryptoReplaceFfxFpeConfig context + * @property {google.privacy.dlp.v2.CryptoReplaceFfxFpeConfig.FfxCommonNativeAlphabet|null} [commonAlphabet] CryptoReplaceFfxFpeConfig commonAlphabet + * @property {string|null} [customAlphabet] CryptoReplaceFfxFpeConfig customAlphabet + * @property {number|null} [radix] CryptoReplaceFfxFpeConfig radix + * @property {google.privacy.dlp.v2.IInfoType|null} [surrogateInfoType] CryptoReplaceFfxFpeConfig surrogateInfoType + */ + + /** + * Constructs a new CryptoReplaceFfxFpeConfig. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents a CryptoReplaceFfxFpeConfig. + * @implements ICryptoReplaceFfxFpeConfig + * @constructor + * @param {google.privacy.dlp.v2.ICryptoReplaceFfxFpeConfig=} [properties] Properties to set + */ + function CryptoReplaceFfxFpeConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CryptoReplaceFfxFpeConfig cryptoKey. + * @member {google.privacy.dlp.v2.ICryptoKey|null|undefined} cryptoKey + * @memberof google.privacy.dlp.v2.CryptoReplaceFfxFpeConfig + * @instance + */ + CryptoReplaceFfxFpeConfig.prototype.cryptoKey = null; + + /** + * CryptoReplaceFfxFpeConfig context. + * @member {google.privacy.dlp.v2.IFieldId|null|undefined} context + * @memberof google.privacy.dlp.v2.CryptoReplaceFfxFpeConfig + * @instance + */ + CryptoReplaceFfxFpeConfig.prototype.context = null; + + /** + * CryptoReplaceFfxFpeConfig commonAlphabet. + * @member {google.privacy.dlp.v2.CryptoReplaceFfxFpeConfig.FfxCommonNativeAlphabet} commonAlphabet + * @memberof google.privacy.dlp.v2.CryptoReplaceFfxFpeConfig + * @instance + */ + CryptoReplaceFfxFpeConfig.prototype.commonAlphabet = 0; + + /** + * CryptoReplaceFfxFpeConfig customAlphabet. + * @member {string} customAlphabet + * @memberof google.privacy.dlp.v2.CryptoReplaceFfxFpeConfig + * @instance + */ + CryptoReplaceFfxFpeConfig.prototype.customAlphabet = ""; + + /** + * CryptoReplaceFfxFpeConfig radix. + * @member {number} radix + * @memberof google.privacy.dlp.v2.CryptoReplaceFfxFpeConfig + * @instance + */ + CryptoReplaceFfxFpeConfig.prototype.radix = 0; + + /** + * CryptoReplaceFfxFpeConfig surrogateInfoType. + * @member {google.privacy.dlp.v2.IInfoType|null|undefined} surrogateInfoType + * @memberof google.privacy.dlp.v2.CryptoReplaceFfxFpeConfig + * @instance + */ + CryptoReplaceFfxFpeConfig.prototype.surrogateInfoType = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * CryptoReplaceFfxFpeConfig alphabet. + * @member {"commonAlphabet"|"customAlphabet"|"radix"|undefined} alphabet + * @memberof google.privacy.dlp.v2.CryptoReplaceFfxFpeConfig + * @instance + */ + Object.defineProperty(CryptoReplaceFfxFpeConfig.prototype, "alphabet", { + get: $util.oneOfGetter($oneOfFields = ["commonAlphabet", "customAlphabet", "radix"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CryptoReplaceFfxFpeConfig instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.CryptoReplaceFfxFpeConfig + * @static + * @param {google.privacy.dlp.v2.ICryptoReplaceFfxFpeConfig=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.CryptoReplaceFfxFpeConfig} CryptoReplaceFfxFpeConfig instance + */ + CryptoReplaceFfxFpeConfig.create = function create(properties) { + return new CryptoReplaceFfxFpeConfig(properties); + }; + + /** + * Encodes the specified CryptoReplaceFfxFpeConfig message. Does not implicitly {@link google.privacy.dlp.v2.CryptoReplaceFfxFpeConfig.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.CryptoReplaceFfxFpeConfig + * @static + * @param {google.privacy.dlp.v2.ICryptoReplaceFfxFpeConfig} message CryptoReplaceFfxFpeConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CryptoReplaceFfxFpeConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.cryptoKey != null && Object.hasOwnProperty.call(message, "cryptoKey")) + $root.google.privacy.dlp.v2.CryptoKey.encode(message.cryptoKey, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.context != null && Object.hasOwnProperty.call(message, "context")) + $root.google.privacy.dlp.v2.FieldId.encode(message.context, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.commonAlphabet != null && Object.hasOwnProperty.call(message, "commonAlphabet")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.commonAlphabet); + if (message.customAlphabet != null && Object.hasOwnProperty.call(message, "customAlphabet")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.customAlphabet); + if (message.radix != null && Object.hasOwnProperty.call(message, "radix")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.radix); + if (message.surrogateInfoType != null && Object.hasOwnProperty.call(message, "surrogateInfoType")) + $root.google.privacy.dlp.v2.InfoType.encode(message.surrogateInfoType, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CryptoReplaceFfxFpeConfig message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.CryptoReplaceFfxFpeConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.CryptoReplaceFfxFpeConfig + * @static + * @param {google.privacy.dlp.v2.ICryptoReplaceFfxFpeConfig} message CryptoReplaceFfxFpeConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CryptoReplaceFfxFpeConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CryptoReplaceFfxFpeConfig message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.CryptoReplaceFfxFpeConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.CryptoReplaceFfxFpeConfig} CryptoReplaceFfxFpeConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CryptoReplaceFfxFpeConfig.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.privacy.dlp.v2.CryptoReplaceFfxFpeConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.cryptoKey = $root.google.privacy.dlp.v2.CryptoKey.decode(reader, reader.uint32()); + break; + case 2: + message.context = $root.google.privacy.dlp.v2.FieldId.decode(reader, reader.uint32()); + break; + case 4: + message.commonAlphabet = reader.int32(); + break; + case 5: + message.customAlphabet = reader.string(); + break; + case 6: + message.radix = reader.int32(); + break; + case 8: + message.surrogateInfoType = $root.google.privacy.dlp.v2.InfoType.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CryptoReplaceFfxFpeConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.CryptoReplaceFfxFpeConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.CryptoReplaceFfxFpeConfig} CryptoReplaceFfxFpeConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CryptoReplaceFfxFpeConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CryptoReplaceFfxFpeConfig message. + * @function verify + * @memberof google.privacy.dlp.v2.CryptoReplaceFfxFpeConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CryptoReplaceFfxFpeConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.cryptoKey != null && message.hasOwnProperty("cryptoKey")) { + var error = $root.google.privacy.dlp.v2.CryptoKey.verify(message.cryptoKey); + if (error) + return "cryptoKey." + error; + } + if (message.context != null && message.hasOwnProperty("context")) { + var error = $root.google.privacy.dlp.v2.FieldId.verify(message.context); + if (error) + return "context." + error; + } + if (message.commonAlphabet != null && message.hasOwnProperty("commonAlphabet")) { + properties.alphabet = 1; + switch (message.commonAlphabet) { + default: + return "commonAlphabet: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + } + if (message.customAlphabet != null && message.hasOwnProperty("customAlphabet")) { + if (properties.alphabet === 1) + return "alphabet: multiple values"; + properties.alphabet = 1; + if (!$util.isString(message.customAlphabet)) + return "customAlphabet: string expected"; + } + if (message.radix != null && message.hasOwnProperty("radix")) { + if (properties.alphabet === 1) + return "alphabet: multiple values"; + properties.alphabet = 1; + if (!$util.isInteger(message.radix)) + return "radix: integer expected"; + } + if (message.surrogateInfoType != null && message.hasOwnProperty("surrogateInfoType")) { + var error = $root.google.privacy.dlp.v2.InfoType.verify(message.surrogateInfoType); + if (error) + return "surrogateInfoType." + error; + } + return null; + }; + + /** + * Creates a CryptoReplaceFfxFpeConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.CryptoReplaceFfxFpeConfig + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.CryptoReplaceFfxFpeConfig} CryptoReplaceFfxFpeConfig + */ + CryptoReplaceFfxFpeConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.CryptoReplaceFfxFpeConfig) + return object; + var message = new $root.google.privacy.dlp.v2.CryptoReplaceFfxFpeConfig(); + if (object.cryptoKey != null) { + if (typeof object.cryptoKey !== "object") + throw TypeError(".google.privacy.dlp.v2.CryptoReplaceFfxFpeConfig.cryptoKey: object expected"); + message.cryptoKey = $root.google.privacy.dlp.v2.CryptoKey.fromObject(object.cryptoKey); + } + if (object.context != null) { + if (typeof object.context !== "object") + throw TypeError(".google.privacy.dlp.v2.CryptoReplaceFfxFpeConfig.context: object expected"); + message.context = $root.google.privacy.dlp.v2.FieldId.fromObject(object.context); + } + switch (object.commonAlphabet) { + case "FFX_COMMON_NATIVE_ALPHABET_UNSPECIFIED": + case 0: + message.commonAlphabet = 0; + break; + case "NUMERIC": + case 1: + message.commonAlphabet = 1; + break; + case "HEXADECIMAL": + case 2: + message.commonAlphabet = 2; + break; + case "UPPER_CASE_ALPHA_NUMERIC": + case 3: + message.commonAlphabet = 3; + break; + case "ALPHA_NUMERIC": + case 4: + message.commonAlphabet = 4; + break; + } + if (object.customAlphabet != null) + message.customAlphabet = String(object.customAlphabet); + if (object.radix != null) + message.radix = object.radix | 0; + if (object.surrogateInfoType != null) { + if (typeof object.surrogateInfoType !== "object") + throw TypeError(".google.privacy.dlp.v2.CryptoReplaceFfxFpeConfig.surrogateInfoType: object expected"); + message.surrogateInfoType = $root.google.privacy.dlp.v2.InfoType.fromObject(object.surrogateInfoType); + } + return message; + }; + + /** + * Creates a plain object from a CryptoReplaceFfxFpeConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.CryptoReplaceFfxFpeConfig + * @static + * @param {google.privacy.dlp.v2.CryptoReplaceFfxFpeConfig} message CryptoReplaceFfxFpeConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CryptoReplaceFfxFpeConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.cryptoKey = null; + object.context = null; + object.surrogateInfoType = null; + } + if (message.cryptoKey != null && message.hasOwnProperty("cryptoKey")) + object.cryptoKey = $root.google.privacy.dlp.v2.CryptoKey.toObject(message.cryptoKey, options); + if (message.context != null && message.hasOwnProperty("context")) + object.context = $root.google.privacy.dlp.v2.FieldId.toObject(message.context, options); + if (message.commonAlphabet != null && message.hasOwnProperty("commonAlphabet")) { + object.commonAlphabet = options.enums === String ? $root.google.privacy.dlp.v2.CryptoReplaceFfxFpeConfig.FfxCommonNativeAlphabet[message.commonAlphabet] : message.commonAlphabet; + if (options.oneofs) + object.alphabet = "commonAlphabet"; + } + if (message.customAlphabet != null && message.hasOwnProperty("customAlphabet")) { + object.customAlphabet = message.customAlphabet; + if (options.oneofs) + object.alphabet = "customAlphabet"; + } + if (message.radix != null && message.hasOwnProperty("radix")) { + object.radix = message.radix; + if (options.oneofs) + object.alphabet = "radix"; + } + if (message.surrogateInfoType != null && message.hasOwnProperty("surrogateInfoType")) + object.surrogateInfoType = $root.google.privacy.dlp.v2.InfoType.toObject(message.surrogateInfoType, options); + return object; + }; + + /** + * Converts this CryptoReplaceFfxFpeConfig to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.CryptoReplaceFfxFpeConfig + * @instance + * @returns {Object.} JSON object + */ + CryptoReplaceFfxFpeConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * FfxCommonNativeAlphabet enum. + * @name google.privacy.dlp.v2.CryptoReplaceFfxFpeConfig.FfxCommonNativeAlphabet + * @enum {number} + * @property {number} FFX_COMMON_NATIVE_ALPHABET_UNSPECIFIED=0 FFX_COMMON_NATIVE_ALPHABET_UNSPECIFIED value + * @property {number} NUMERIC=1 NUMERIC value + * @property {number} HEXADECIMAL=2 HEXADECIMAL value + * @property {number} UPPER_CASE_ALPHA_NUMERIC=3 UPPER_CASE_ALPHA_NUMERIC value + * @property {number} ALPHA_NUMERIC=4 ALPHA_NUMERIC value + */ + CryptoReplaceFfxFpeConfig.FfxCommonNativeAlphabet = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FFX_COMMON_NATIVE_ALPHABET_UNSPECIFIED"] = 0; + values[valuesById[1] = "NUMERIC"] = 1; + values[valuesById[2] = "HEXADECIMAL"] = 2; + values[valuesById[3] = "UPPER_CASE_ALPHA_NUMERIC"] = 3; + values[valuesById[4] = "ALPHA_NUMERIC"] = 4; + return values; + })(); + + return CryptoReplaceFfxFpeConfig; + })(); + + v2.CryptoKey = (function() { + + /** + * Properties of a CryptoKey. + * @memberof google.privacy.dlp.v2 + * @interface ICryptoKey + * @property {google.privacy.dlp.v2.ITransientCryptoKey|null} [transient] CryptoKey transient + * @property {google.privacy.dlp.v2.IUnwrappedCryptoKey|null} [unwrapped] CryptoKey unwrapped + * @property {google.privacy.dlp.v2.IKmsWrappedCryptoKey|null} [kmsWrapped] CryptoKey kmsWrapped + */ + + /** + * Constructs a new CryptoKey. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents a CryptoKey. + * @implements ICryptoKey + * @constructor + * @param {google.privacy.dlp.v2.ICryptoKey=} [properties] Properties to set + */ + function CryptoKey(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CryptoKey transient. + * @member {google.privacy.dlp.v2.ITransientCryptoKey|null|undefined} transient + * @memberof google.privacy.dlp.v2.CryptoKey + * @instance + */ + CryptoKey.prototype.transient = null; + + /** + * CryptoKey unwrapped. + * @member {google.privacy.dlp.v2.IUnwrappedCryptoKey|null|undefined} unwrapped + * @memberof google.privacy.dlp.v2.CryptoKey + * @instance + */ + CryptoKey.prototype.unwrapped = null; + + /** + * CryptoKey kmsWrapped. + * @member {google.privacy.dlp.v2.IKmsWrappedCryptoKey|null|undefined} kmsWrapped + * @memberof google.privacy.dlp.v2.CryptoKey + * @instance + */ + CryptoKey.prototype.kmsWrapped = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * CryptoKey source. + * @member {"transient"|"unwrapped"|"kmsWrapped"|undefined} source + * @memberof google.privacy.dlp.v2.CryptoKey + * @instance + */ + Object.defineProperty(CryptoKey.prototype, "source", { + get: $util.oneOfGetter($oneOfFields = ["transient", "unwrapped", "kmsWrapped"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CryptoKey instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.CryptoKey + * @static + * @param {google.privacy.dlp.v2.ICryptoKey=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.CryptoKey} CryptoKey instance + */ + CryptoKey.create = function create(properties) { + return new CryptoKey(properties); + }; + + /** + * Encodes the specified CryptoKey message. Does not implicitly {@link google.privacy.dlp.v2.CryptoKey.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.CryptoKey + * @static + * @param {google.privacy.dlp.v2.ICryptoKey} message CryptoKey message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CryptoKey.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.transient != null && Object.hasOwnProperty.call(message, "transient")) + $root.google.privacy.dlp.v2.TransientCryptoKey.encode(message.transient, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.unwrapped != null && Object.hasOwnProperty.call(message, "unwrapped")) + $root.google.privacy.dlp.v2.UnwrappedCryptoKey.encode(message.unwrapped, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.kmsWrapped != null && Object.hasOwnProperty.call(message, "kmsWrapped")) + $root.google.privacy.dlp.v2.KmsWrappedCryptoKey.encode(message.kmsWrapped, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CryptoKey message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.CryptoKey.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.CryptoKey + * @static + * @param {google.privacy.dlp.v2.ICryptoKey} message CryptoKey message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CryptoKey.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CryptoKey message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.CryptoKey + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.CryptoKey} CryptoKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CryptoKey.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.privacy.dlp.v2.CryptoKey(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.transient = $root.google.privacy.dlp.v2.TransientCryptoKey.decode(reader, reader.uint32()); + break; + case 2: + message.unwrapped = $root.google.privacy.dlp.v2.UnwrappedCryptoKey.decode(reader, reader.uint32()); + break; + case 3: + message.kmsWrapped = $root.google.privacy.dlp.v2.KmsWrappedCryptoKey.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CryptoKey message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.CryptoKey + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.CryptoKey} CryptoKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CryptoKey.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CryptoKey message. + * @function verify + * @memberof google.privacy.dlp.v2.CryptoKey + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CryptoKey.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.transient != null && message.hasOwnProperty("transient")) { + properties.source = 1; + { + var error = $root.google.privacy.dlp.v2.TransientCryptoKey.verify(message.transient); + if (error) + return "transient." + error; + } + } + if (message.unwrapped != null && message.hasOwnProperty("unwrapped")) { + if (properties.source === 1) + return "source: multiple values"; + properties.source = 1; + { + var error = $root.google.privacy.dlp.v2.UnwrappedCryptoKey.verify(message.unwrapped); + if (error) + return "unwrapped." + error; + } + } + if (message.kmsWrapped != null && message.hasOwnProperty("kmsWrapped")) { + if (properties.source === 1) + return "source: multiple values"; + properties.source = 1; + { + var error = $root.google.privacy.dlp.v2.KmsWrappedCryptoKey.verify(message.kmsWrapped); + if (error) + return "kmsWrapped." + error; + } + } + return null; + }; + + /** + * Creates a CryptoKey message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.CryptoKey + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.CryptoKey} CryptoKey + */ + CryptoKey.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.CryptoKey) + return object; + var message = new $root.google.privacy.dlp.v2.CryptoKey(); + if (object.transient != null) { + if (typeof object.transient !== "object") + throw TypeError(".google.privacy.dlp.v2.CryptoKey.transient: object expected"); + message.transient = $root.google.privacy.dlp.v2.TransientCryptoKey.fromObject(object.transient); + } + if (object.unwrapped != null) { + if (typeof object.unwrapped !== "object") + throw TypeError(".google.privacy.dlp.v2.CryptoKey.unwrapped: object expected"); + message.unwrapped = $root.google.privacy.dlp.v2.UnwrappedCryptoKey.fromObject(object.unwrapped); + } + if (object.kmsWrapped != null) { + if (typeof object.kmsWrapped !== "object") + throw TypeError(".google.privacy.dlp.v2.CryptoKey.kmsWrapped: object expected"); + message.kmsWrapped = $root.google.privacy.dlp.v2.KmsWrappedCryptoKey.fromObject(object.kmsWrapped); + } + return message; + }; + + /** + * Creates a plain object from a CryptoKey message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.CryptoKey + * @static + * @param {google.privacy.dlp.v2.CryptoKey} message CryptoKey + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CryptoKey.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.transient != null && message.hasOwnProperty("transient")) { + object.transient = $root.google.privacy.dlp.v2.TransientCryptoKey.toObject(message.transient, options); + if (options.oneofs) + object.source = "transient"; + } + if (message.unwrapped != null && message.hasOwnProperty("unwrapped")) { + object.unwrapped = $root.google.privacy.dlp.v2.UnwrappedCryptoKey.toObject(message.unwrapped, options); + if (options.oneofs) + object.source = "unwrapped"; + } + if (message.kmsWrapped != null && message.hasOwnProperty("kmsWrapped")) { + object.kmsWrapped = $root.google.privacy.dlp.v2.KmsWrappedCryptoKey.toObject(message.kmsWrapped, options); + if (options.oneofs) + object.source = "kmsWrapped"; + } + return object; + }; + + /** + * Converts this CryptoKey to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.CryptoKey + * @instance + * @returns {Object.} JSON object + */ + CryptoKey.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CryptoKey; + })(); + + v2.TransientCryptoKey = (function() { + + /** + * Properties of a TransientCryptoKey. + * @memberof google.privacy.dlp.v2 + * @interface ITransientCryptoKey + * @property {string|null} [name] TransientCryptoKey name + */ + + /** + * Constructs a new TransientCryptoKey. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents a TransientCryptoKey. + * @implements ITransientCryptoKey + * @constructor + * @param {google.privacy.dlp.v2.ITransientCryptoKey=} [properties] Properties to set + */ + function TransientCryptoKey(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TransientCryptoKey name. + * @member {string} name + * @memberof google.privacy.dlp.v2.TransientCryptoKey + * @instance + */ + TransientCryptoKey.prototype.name = ""; + + /** + * Creates a new TransientCryptoKey instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.TransientCryptoKey + * @static + * @param {google.privacy.dlp.v2.ITransientCryptoKey=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.TransientCryptoKey} TransientCryptoKey instance + */ + TransientCryptoKey.create = function create(properties) { + return new TransientCryptoKey(properties); + }; + + /** + * Encodes the specified TransientCryptoKey message. Does not implicitly {@link google.privacy.dlp.v2.TransientCryptoKey.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.TransientCryptoKey + * @static + * @param {google.privacy.dlp.v2.ITransientCryptoKey} message TransientCryptoKey message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransientCryptoKey.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified TransientCryptoKey message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.TransientCryptoKey.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.TransientCryptoKey + * @static + * @param {google.privacy.dlp.v2.ITransientCryptoKey} message TransientCryptoKey message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransientCryptoKey.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TransientCryptoKey message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.TransientCryptoKey + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.TransientCryptoKey} TransientCryptoKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransientCryptoKey.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.privacy.dlp.v2.TransientCryptoKey(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TransientCryptoKey message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.TransientCryptoKey + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.TransientCryptoKey} TransientCryptoKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransientCryptoKey.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TransientCryptoKey message. + * @function verify + * @memberof google.privacy.dlp.v2.TransientCryptoKey + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TransientCryptoKey.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a TransientCryptoKey message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.TransientCryptoKey + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.TransientCryptoKey} TransientCryptoKey + */ + TransientCryptoKey.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.TransientCryptoKey) + return object; + var message = new $root.google.privacy.dlp.v2.TransientCryptoKey(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a TransientCryptoKey message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.TransientCryptoKey + * @static + * @param {google.privacy.dlp.v2.TransientCryptoKey} message TransientCryptoKey + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TransientCryptoKey.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this TransientCryptoKey to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.TransientCryptoKey + * @instance + * @returns {Object.} JSON object + */ + TransientCryptoKey.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TransientCryptoKey; + })(); + + v2.UnwrappedCryptoKey = (function() { + + /** + * Properties of an UnwrappedCryptoKey. + * @memberof google.privacy.dlp.v2 + * @interface IUnwrappedCryptoKey + * @property {Uint8Array|null} [key] UnwrappedCryptoKey key + */ + + /** + * Constructs a new UnwrappedCryptoKey. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents an UnwrappedCryptoKey. + * @implements IUnwrappedCryptoKey + * @constructor + * @param {google.privacy.dlp.v2.IUnwrappedCryptoKey=} [properties] Properties to set + */ + function UnwrappedCryptoKey(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UnwrappedCryptoKey key. + * @member {Uint8Array} key + * @memberof google.privacy.dlp.v2.UnwrappedCryptoKey + * @instance + */ + UnwrappedCryptoKey.prototype.key = $util.newBuffer([]); + + /** + * Creates a new UnwrappedCryptoKey instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.UnwrappedCryptoKey + * @static + * @param {google.privacy.dlp.v2.IUnwrappedCryptoKey=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.UnwrappedCryptoKey} UnwrappedCryptoKey instance + */ + UnwrappedCryptoKey.create = function create(properties) { + return new UnwrappedCryptoKey(properties); + }; + + /** + * Encodes the specified UnwrappedCryptoKey message. Does not implicitly {@link google.privacy.dlp.v2.UnwrappedCryptoKey.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.UnwrappedCryptoKey + * @static + * @param {google.privacy.dlp.v2.IUnwrappedCryptoKey} message UnwrappedCryptoKey message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UnwrappedCryptoKey.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.key != null && Object.hasOwnProperty.call(message, "key")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.key); + return writer; + }; + + /** + * Encodes the specified UnwrappedCryptoKey message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.UnwrappedCryptoKey.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.UnwrappedCryptoKey + * @static + * @param {google.privacy.dlp.v2.IUnwrappedCryptoKey} message UnwrappedCryptoKey message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UnwrappedCryptoKey.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UnwrappedCryptoKey message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.UnwrappedCryptoKey + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.UnwrappedCryptoKey} UnwrappedCryptoKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UnwrappedCryptoKey.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.privacy.dlp.v2.UnwrappedCryptoKey(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UnwrappedCryptoKey message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.UnwrappedCryptoKey + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.UnwrappedCryptoKey} UnwrappedCryptoKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UnwrappedCryptoKey.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UnwrappedCryptoKey message. + * @function verify + * @memberof google.privacy.dlp.v2.UnwrappedCryptoKey + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UnwrappedCryptoKey.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.key != null && message.hasOwnProperty("key")) + if (!(message.key && typeof message.key.length === "number" || $util.isString(message.key))) + return "key: buffer expected"; + return null; + }; + + /** + * Creates an UnwrappedCryptoKey message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.UnwrappedCryptoKey + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.UnwrappedCryptoKey} UnwrappedCryptoKey + */ + UnwrappedCryptoKey.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.UnwrappedCryptoKey) + return object; + var message = new $root.google.privacy.dlp.v2.UnwrappedCryptoKey(); + if (object.key != null) + if (typeof object.key === "string") + $util.base64.decode(object.key, message.key = $util.newBuffer($util.base64.length(object.key)), 0); + else if (object.key.length) + message.key = object.key; + return message; + }; + + /** + * Creates a plain object from an UnwrappedCryptoKey message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.UnwrappedCryptoKey + * @static + * @param {google.privacy.dlp.v2.UnwrappedCryptoKey} message UnwrappedCryptoKey + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UnwrappedCryptoKey.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if (options.bytes === String) + object.key = ""; + else { + object.key = []; + if (options.bytes !== Array) + object.key = $util.newBuffer(object.key); + } + if (message.key != null && message.hasOwnProperty("key")) + object.key = options.bytes === String ? $util.base64.encode(message.key, 0, message.key.length) : options.bytes === Array ? Array.prototype.slice.call(message.key) : message.key; + return object; + }; + + /** + * Converts this UnwrappedCryptoKey to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.UnwrappedCryptoKey + * @instance + * @returns {Object.} JSON object + */ + UnwrappedCryptoKey.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UnwrappedCryptoKey; + })(); + + v2.KmsWrappedCryptoKey = (function() { + + /** + * Properties of a KmsWrappedCryptoKey. + * @memberof google.privacy.dlp.v2 + * @interface IKmsWrappedCryptoKey + * @property {Uint8Array|null} [wrappedKey] KmsWrappedCryptoKey wrappedKey + * @property {string|null} [cryptoKeyName] KmsWrappedCryptoKey cryptoKeyName + */ + + /** + * Constructs a new KmsWrappedCryptoKey. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents a KmsWrappedCryptoKey. + * @implements IKmsWrappedCryptoKey + * @constructor + * @param {google.privacy.dlp.v2.IKmsWrappedCryptoKey=} [properties] Properties to set + */ + function KmsWrappedCryptoKey(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * KmsWrappedCryptoKey wrappedKey. + * @member {Uint8Array} wrappedKey + * @memberof google.privacy.dlp.v2.KmsWrappedCryptoKey + * @instance + */ + KmsWrappedCryptoKey.prototype.wrappedKey = $util.newBuffer([]); + + /** + * KmsWrappedCryptoKey cryptoKeyName. + * @member {string} cryptoKeyName + * @memberof google.privacy.dlp.v2.KmsWrappedCryptoKey + * @instance + */ + KmsWrappedCryptoKey.prototype.cryptoKeyName = ""; + + /** + * Creates a new KmsWrappedCryptoKey instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.KmsWrappedCryptoKey + * @static + * @param {google.privacy.dlp.v2.IKmsWrappedCryptoKey=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.KmsWrappedCryptoKey} KmsWrappedCryptoKey instance + */ + KmsWrappedCryptoKey.create = function create(properties) { + return new KmsWrappedCryptoKey(properties); + }; + + /** + * Encodes the specified KmsWrappedCryptoKey message. Does not implicitly {@link google.privacy.dlp.v2.KmsWrappedCryptoKey.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.KmsWrappedCryptoKey + * @static + * @param {google.privacy.dlp.v2.IKmsWrappedCryptoKey} message KmsWrappedCryptoKey message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KmsWrappedCryptoKey.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.wrappedKey != null && Object.hasOwnProperty.call(message, "wrappedKey")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.wrappedKey); + if (message.cryptoKeyName != null && Object.hasOwnProperty.call(message, "cryptoKeyName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.cryptoKeyName); + return writer; + }; + + /** + * Encodes the specified KmsWrappedCryptoKey message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.KmsWrappedCryptoKey.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.KmsWrappedCryptoKey + * @static + * @param {google.privacy.dlp.v2.IKmsWrappedCryptoKey} message KmsWrappedCryptoKey message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KmsWrappedCryptoKey.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a KmsWrappedCryptoKey message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.KmsWrappedCryptoKey + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.KmsWrappedCryptoKey} KmsWrappedCryptoKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KmsWrappedCryptoKey.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.privacy.dlp.v2.KmsWrappedCryptoKey(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.wrappedKey = reader.bytes(); + break; + case 2: + message.cryptoKeyName = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a KmsWrappedCryptoKey message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.KmsWrappedCryptoKey + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.KmsWrappedCryptoKey} KmsWrappedCryptoKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KmsWrappedCryptoKey.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a KmsWrappedCryptoKey message. + * @function verify + * @memberof google.privacy.dlp.v2.KmsWrappedCryptoKey + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + KmsWrappedCryptoKey.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.wrappedKey != null && message.hasOwnProperty("wrappedKey")) + if (!(message.wrappedKey && typeof message.wrappedKey.length === "number" || $util.isString(message.wrappedKey))) + return "wrappedKey: buffer expected"; + if (message.cryptoKeyName != null && message.hasOwnProperty("cryptoKeyName")) + if (!$util.isString(message.cryptoKeyName)) + return "cryptoKeyName: string expected"; + return null; + }; + + /** + * Creates a KmsWrappedCryptoKey message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.KmsWrappedCryptoKey + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.KmsWrappedCryptoKey} KmsWrappedCryptoKey + */ + KmsWrappedCryptoKey.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.KmsWrappedCryptoKey) + return object; + var message = new $root.google.privacy.dlp.v2.KmsWrappedCryptoKey(); + if (object.wrappedKey != null) + if (typeof object.wrappedKey === "string") + $util.base64.decode(object.wrappedKey, message.wrappedKey = $util.newBuffer($util.base64.length(object.wrappedKey)), 0); + else if (object.wrappedKey.length) + message.wrappedKey = object.wrappedKey; + if (object.cryptoKeyName != null) + message.cryptoKeyName = String(object.cryptoKeyName); + return message; + }; + + /** + * Creates a plain object from a KmsWrappedCryptoKey message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.KmsWrappedCryptoKey + * @static + * @param {google.privacy.dlp.v2.KmsWrappedCryptoKey} message KmsWrappedCryptoKey + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + KmsWrappedCryptoKey.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.wrappedKey = ""; + else { + object.wrappedKey = []; + if (options.bytes !== Array) + object.wrappedKey = $util.newBuffer(object.wrappedKey); + } + object.cryptoKeyName = ""; + } + if (message.wrappedKey != null && message.hasOwnProperty("wrappedKey")) + object.wrappedKey = options.bytes === String ? $util.base64.encode(message.wrappedKey, 0, message.wrappedKey.length) : options.bytes === Array ? Array.prototype.slice.call(message.wrappedKey) : message.wrappedKey; + if (message.cryptoKeyName != null && message.hasOwnProperty("cryptoKeyName")) + object.cryptoKeyName = message.cryptoKeyName; + return object; + }; + + /** + * Converts this KmsWrappedCryptoKey to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.KmsWrappedCryptoKey + * @instance + * @returns {Object.} JSON object + */ + KmsWrappedCryptoKey.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return KmsWrappedCryptoKey; + })(); + + v2.DateShiftConfig = (function() { + + /** + * Properties of a DateShiftConfig. + * @memberof google.privacy.dlp.v2 + * @interface IDateShiftConfig + * @property {number|null} [upperBoundDays] DateShiftConfig upperBoundDays + * @property {number|null} [lowerBoundDays] DateShiftConfig lowerBoundDays + * @property {google.privacy.dlp.v2.IFieldId|null} [context] DateShiftConfig context + * @property {google.privacy.dlp.v2.ICryptoKey|null} [cryptoKey] DateShiftConfig cryptoKey + */ + + /** + * Constructs a new DateShiftConfig. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents a DateShiftConfig. + * @implements IDateShiftConfig + * @constructor + * @param {google.privacy.dlp.v2.IDateShiftConfig=} [properties] Properties to set + */ + function DateShiftConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DateShiftConfig upperBoundDays. + * @member {number} upperBoundDays + * @memberof google.privacy.dlp.v2.DateShiftConfig + * @instance + */ + DateShiftConfig.prototype.upperBoundDays = 0; + + /** + * DateShiftConfig lowerBoundDays. + * @member {number} lowerBoundDays + * @memberof google.privacy.dlp.v2.DateShiftConfig + * @instance + */ + DateShiftConfig.prototype.lowerBoundDays = 0; + + /** + * DateShiftConfig context. + * @member {google.privacy.dlp.v2.IFieldId|null|undefined} context + * @memberof google.privacy.dlp.v2.DateShiftConfig + * @instance + */ + DateShiftConfig.prototype.context = null; + + /** + * DateShiftConfig cryptoKey. + * @member {google.privacy.dlp.v2.ICryptoKey|null|undefined} cryptoKey + * @memberof google.privacy.dlp.v2.DateShiftConfig + * @instance + */ + DateShiftConfig.prototype.cryptoKey = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DateShiftConfig method. + * @member {"cryptoKey"|undefined} method + * @memberof google.privacy.dlp.v2.DateShiftConfig + * @instance + */ + Object.defineProperty(DateShiftConfig.prototype, "method", { + get: $util.oneOfGetter($oneOfFields = ["cryptoKey"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DateShiftConfig instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.DateShiftConfig + * @static + * @param {google.privacy.dlp.v2.IDateShiftConfig=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.DateShiftConfig} DateShiftConfig instance + */ + DateShiftConfig.create = function create(properties) { + return new DateShiftConfig(properties); + }; + + /** + * Encodes the specified DateShiftConfig message. Does not implicitly {@link google.privacy.dlp.v2.DateShiftConfig.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.DateShiftConfig + * @static + * @param {google.privacy.dlp.v2.IDateShiftConfig} message DateShiftConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DateShiftConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.upperBoundDays != null && Object.hasOwnProperty.call(message, "upperBoundDays")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.upperBoundDays); + if (message.lowerBoundDays != null && Object.hasOwnProperty.call(message, "lowerBoundDays")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.lowerBoundDays); + if (message.context != null && Object.hasOwnProperty.call(message, "context")) + $root.google.privacy.dlp.v2.FieldId.encode(message.context, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.cryptoKey != null && Object.hasOwnProperty.call(message, "cryptoKey")) + $root.google.privacy.dlp.v2.CryptoKey.encode(message.cryptoKey, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DateShiftConfig message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.DateShiftConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.DateShiftConfig + * @static + * @param {google.privacy.dlp.v2.IDateShiftConfig} message DateShiftConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DateShiftConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DateShiftConfig message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.DateShiftConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.DateShiftConfig} DateShiftConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DateShiftConfig.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.privacy.dlp.v2.DateShiftConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.upperBoundDays = reader.int32(); + break; + case 2: + message.lowerBoundDays = reader.int32(); + break; + case 3: + message.context = $root.google.privacy.dlp.v2.FieldId.decode(reader, reader.uint32()); + break; + case 4: + message.cryptoKey = $root.google.privacy.dlp.v2.CryptoKey.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DateShiftConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.DateShiftConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.DateShiftConfig} DateShiftConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DateShiftConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DateShiftConfig message. + * @function verify + * @memberof google.privacy.dlp.v2.DateShiftConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DateShiftConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.upperBoundDays != null && message.hasOwnProperty("upperBoundDays")) + if (!$util.isInteger(message.upperBoundDays)) + return "upperBoundDays: integer expected"; + if (message.lowerBoundDays != null && message.hasOwnProperty("lowerBoundDays")) + if (!$util.isInteger(message.lowerBoundDays)) + return "lowerBoundDays: integer expected"; + if (message.context != null && message.hasOwnProperty("context")) { + var error = $root.google.privacy.dlp.v2.FieldId.verify(message.context); + if (error) + return "context." + error; + } + if (message.cryptoKey != null && message.hasOwnProperty("cryptoKey")) { + properties.method = 1; + { + var error = $root.google.privacy.dlp.v2.CryptoKey.verify(message.cryptoKey); + if (error) + return "cryptoKey." + error; + } + } + return null; + }; + + /** + * Creates a DateShiftConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.DateShiftConfig + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.DateShiftConfig} DateShiftConfig + */ + DateShiftConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.DateShiftConfig) + return object; + var message = new $root.google.privacy.dlp.v2.DateShiftConfig(); + if (object.upperBoundDays != null) + message.upperBoundDays = object.upperBoundDays | 0; + if (object.lowerBoundDays != null) + message.lowerBoundDays = object.lowerBoundDays | 0; + if (object.context != null) { + if (typeof object.context !== "object") + throw TypeError(".google.privacy.dlp.v2.DateShiftConfig.context: object expected"); + message.context = $root.google.privacy.dlp.v2.FieldId.fromObject(object.context); + } + if (object.cryptoKey != null) { + if (typeof object.cryptoKey !== "object") + throw TypeError(".google.privacy.dlp.v2.DateShiftConfig.cryptoKey: object expected"); + message.cryptoKey = $root.google.privacy.dlp.v2.CryptoKey.fromObject(object.cryptoKey); + } + return message; + }; + + /** + * Creates a plain object from a DateShiftConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.DateShiftConfig + * @static + * @param {google.privacy.dlp.v2.DateShiftConfig} message DateShiftConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DateShiftConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.upperBoundDays = 0; + object.lowerBoundDays = 0; + object.context = null; + } + if (message.upperBoundDays != null && message.hasOwnProperty("upperBoundDays")) + object.upperBoundDays = message.upperBoundDays; + if (message.lowerBoundDays != null && message.hasOwnProperty("lowerBoundDays")) + object.lowerBoundDays = message.lowerBoundDays; + if (message.context != null && message.hasOwnProperty("context")) + object.context = $root.google.privacy.dlp.v2.FieldId.toObject(message.context, options); + if (message.cryptoKey != null && message.hasOwnProperty("cryptoKey")) { + object.cryptoKey = $root.google.privacy.dlp.v2.CryptoKey.toObject(message.cryptoKey, options); + if (options.oneofs) + object.method = "cryptoKey"; + } + return object; + }; + + /** + * Converts this DateShiftConfig to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.DateShiftConfig + * @instance + * @returns {Object.} JSON object + */ + DateShiftConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DateShiftConfig; + })(); + + v2.InfoTypeTransformations = (function() { + + /** + * Properties of an InfoTypeTransformations. + * @memberof google.privacy.dlp.v2 + * @interface IInfoTypeTransformations + * @property {Array.|null} [transformations] InfoTypeTransformations transformations + */ + + /** + * Constructs a new InfoTypeTransformations. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents an InfoTypeTransformations. + * @implements IInfoTypeTransformations + * @constructor + * @param {google.privacy.dlp.v2.IInfoTypeTransformations=} [properties] Properties to set + */ + function InfoTypeTransformations(properties) { + this.transformations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InfoTypeTransformations transformations. + * @member {Array.} transformations + * @memberof google.privacy.dlp.v2.InfoTypeTransformations + * @instance + */ + InfoTypeTransformations.prototype.transformations = $util.emptyArray; + + /** + * Creates a new InfoTypeTransformations instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.InfoTypeTransformations + * @static + * @param {google.privacy.dlp.v2.IInfoTypeTransformations=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.InfoTypeTransformations} InfoTypeTransformations instance + */ + InfoTypeTransformations.create = function create(properties) { + return new InfoTypeTransformations(properties); + }; + + /** + * Encodes the specified InfoTypeTransformations message. Does not implicitly {@link google.privacy.dlp.v2.InfoTypeTransformations.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.InfoTypeTransformations + * @static + * @param {google.privacy.dlp.v2.IInfoTypeTransformations} message InfoTypeTransformations message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InfoTypeTransformations.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.transformations != null && message.transformations.length) + for (var i = 0; i < message.transformations.length; ++i) + $root.google.privacy.dlp.v2.InfoTypeTransformations.InfoTypeTransformation.encode(message.transformations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified InfoTypeTransformations message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.InfoTypeTransformations.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.InfoTypeTransformations + * @static + * @param {google.privacy.dlp.v2.IInfoTypeTransformations} message InfoTypeTransformations message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InfoTypeTransformations.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InfoTypeTransformations message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.InfoTypeTransformations + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.InfoTypeTransformations} InfoTypeTransformations + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InfoTypeTransformations.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.privacy.dlp.v2.InfoTypeTransformations(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.transformations && message.transformations.length)) + message.transformations = []; + message.transformations.push($root.google.privacy.dlp.v2.InfoTypeTransformations.InfoTypeTransformation.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InfoTypeTransformations message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.InfoTypeTransformations + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.InfoTypeTransformations} InfoTypeTransformations + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InfoTypeTransformations.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InfoTypeTransformations message. + * @function verify + * @memberof google.privacy.dlp.v2.InfoTypeTransformations + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InfoTypeTransformations.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.transformations != null && message.hasOwnProperty("transformations")) { + if (!Array.isArray(message.transformations)) + return "transformations: array expected"; + for (var i = 0; i < message.transformations.length; ++i) { + var error = $root.google.privacy.dlp.v2.InfoTypeTransformations.InfoTypeTransformation.verify(message.transformations[i]); + if (error) + return "transformations." + error; + } + } + return null; + }; + + /** + * Creates an InfoTypeTransformations message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.InfoTypeTransformations + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.InfoTypeTransformations} InfoTypeTransformations + */ + InfoTypeTransformations.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.InfoTypeTransformations) + return object; + var message = new $root.google.privacy.dlp.v2.InfoTypeTransformations(); + if (object.transformations) { + if (!Array.isArray(object.transformations)) + throw TypeError(".google.privacy.dlp.v2.InfoTypeTransformations.transformations: array expected"); + message.transformations = []; + for (var i = 0; i < object.transformations.length; ++i) { + if (typeof object.transformations[i] !== "object") + throw TypeError(".google.privacy.dlp.v2.InfoTypeTransformations.transformations: object expected"); + message.transformations[i] = $root.google.privacy.dlp.v2.InfoTypeTransformations.InfoTypeTransformation.fromObject(object.transformations[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an InfoTypeTransformations message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.InfoTypeTransformations + * @static + * @param {google.privacy.dlp.v2.InfoTypeTransformations} message InfoTypeTransformations + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InfoTypeTransformations.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.transformations = []; + if (message.transformations && message.transformations.length) { + object.transformations = []; + for (var j = 0; j < message.transformations.length; ++j) + object.transformations[j] = $root.google.privacy.dlp.v2.InfoTypeTransformations.InfoTypeTransformation.toObject(message.transformations[j], options); + } + return object; + }; + + /** + * Converts this InfoTypeTransformations to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.InfoTypeTransformations + * @instance + * @returns {Object.} JSON object + */ + InfoTypeTransformations.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + InfoTypeTransformations.InfoTypeTransformation = (function() { + + /** + * Properties of an InfoTypeTransformation. + * @memberof google.privacy.dlp.v2.InfoTypeTransformations + * @interface IInfoTypeTransformation + * @property {Array.|null} [infoTypes] InfoTypeTransformation infoTypes + * @property {google.privacy.dlp.v2.IPrimitiveTransformation|null} [primitiveTransformation] InfoTypeTransformation primitiveTransformation + */ + + /** + * Constructs a new InfoTypeTransformation. + * @memberof google.privacy.dlp.v2.InfoTypeTransformations + * @classdesc Represents an InfoTypeTransformation. + * @implements IInfoTypeTransformation + * @constructor + * @param {google.privacy.dlp.v2.InfoTypeTransformations.IInfoTypeTransformation=} [properties] Properties to set + */ + function InfoTypeTransformation(properties) { + this.infoTypes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InfoTypeTransformation infoTypes. + * @member {Array.} infoTypes + * @memberof google.privacy.dlp.v2.InfoTypeTransformations.InfoTypeTransformation + * @instance + */ + InfoTypeTransformation.prototype.infoTypes = $util.emptyArray; + + /** + * InfoTypeTransformation primitiveTransformation. + * @member {google.privacy.dlp.v2.IPrimitiveTransformation|null|undefined} primitiveTransformation + * @memberof google.privacy.dlp.v2.InfoTypeTransformations.InfoTypeTransformation + * @instance + */ + InfoTypeTransformation.prototype.primitiveTransformation = null; + + /** + * Creates a new InfoTypeTransformation instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.InfoTypeTransformations.InfoTypeTransformation + * @static + * @param {google.privacy.dlp.v2.InfoTypeTransformations.IInfoTypeTransformation=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.InfoTypeTransformations.InfoTypeTransformation} InfoTypeTransformation instance + */ + InfoTypeTransformation.create = function create(properties) { + return new InfoTypeTransformation(properties); + }; + + /** + * Encodes the specified InfoTypeTransformation message. Does not implicitly {@link google.privacy.dlp.v2.InfoTypeTransformations.InfoTypeTransformation.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.InfoTypeTransformations.InfoTypeTransformation + * @static + * @param {google.privacy.dlp.v2.InfoTypeTransformations.IInfoTypeTransformation} message InfoTypeTransformation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InfoTypeTransformation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.infoTypes != null && message.infoTypes.length) + for (var i = 0; i < message.infoTypes.length; ++i) + $root.google.privacy.dlp.v2.InfoType.encode(message.infoTypes[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.primitiveTransformation != null && Object.hasOwnProperty.call(message, "primitiveTransformation")) + $root.google.privacy.dlp.v2.PrimitiveTransformation.encode(message.primitiveTransformation, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified InfoTypeTransformation message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.InfoTypeTransformations.InfoTypeTransformation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.InfoTypeTransformations.InfoTypeTransformation + * @static + * @param {google.privacy.dlp.v2.InfoTypeTransformations.IInfoTypeTransformation} message InfoTypeTransformation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InfoTypeTransformation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InfoTypeTransformation message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.InfoTypeTransformations.InfoTypeTransformation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.InfoTypeTransformations.InfoTypeTransformation} InfoTypeTransformation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InfoTypeTransformation.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.privacy.dlp.v2.InfoTypeTransformations.InfoTypeTransformation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.infoTypes && message.infoTypes.length)) + message.infoTypes = []; + message.infoTypes.push($root.google.privacy.dlp.v2.InfoType.decode(reader, reader.uint32())); + break; + case 2: + message.primitiveTransformation = $root.google.privacy.dlp.v2.PrimitiveTransformation.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InfoTypeTransformation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.InfoTypeTransformations.InfoTypeTransformation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.InfoTypeTransformations.InfoTypeTransformation} InfoTypeTransformation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InfoTypeTransformation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InfoTypeTransformation message. + * @function verify + * @memberof google.privacy.dlp.v2.InfoTypeTransformations.InfoTypeTransformation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InfoTypeTransformation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.infoTypes != null && message.hasOwnProperty("infoTypes")) { + if (!Array.isArray(message.infoTypes)) + return "infoTypes: array expected"; + for (var i = 0; i < message.infoTypes.length; ++i) { + var error = $root.google.privacy.dlp.v2.InfoType.verify(message.infoTypes[i]); + if (error) + return "infoTypes." + error; + } + } + if (message.primitiveTransformation != null && message.hasOwnProperty("primitiveTransformation")) { + var error = $root.google.privacy.dlp.v2.PrimitiveTransformation.verify(message.primitiveTransformation); + if (error) + return "primitiveTransformation." + error; + } + return null; + }; + + /** + * Creates an InfoTypeTransformation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.InfoTypeTransformations.InfoTypeTransformation + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.InfoTypeTransformations.InfoTypeTransformation} InfoTypeTransformation + */ + InfoTypeTransformation.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.InfoTypeTransformations.InfoTypeTransformation) + return object; + var message = new $root.google.privacy.dlp.v2.InfoTypeTransformations.InfoTypeTransformation(); + if (object.infoTypes) { + if (!Array.isArray(object.infoTypes)) + throw TypeError(".google.privacy.dlp.v2.InfoTypeTransformations.InfoTypeTransformation.infoTypes: array expected"); + message.infoTypes = []; + for (var i = 0; i < object.infoTypes.length; ++i) { + if (typeof object.infoTypes[i] !== "object") + throw TypeError(".google.privacy.dlp.v2.InfoTypeTransformations.InfoTypeTransformation.infoTypes: object expected"); + message.infoTypes[i] = $root.google.privacy.dlp.v2.InfoType.fromObject(object.infoTypes[i]); + } + } + if (object.primitiveTransformation != null) { + if (typeof object.primitiveTransformation !== "object") + throw TypeError(".google.privacy.dlp.v2.InfoTypeTransformations.InfoTypeTransformation.primitiveTransformation: object expected"); + message.primitiveTransformation = $root.google.privacy.dlp.v2.PrimitiveTransformation.fromObject(object.primitiveTransformation); + } + return message; + }; + + /** + * Creates a plain object from an InfoTypeTransformation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.InfoTypeTransformations.InfoTypeTransformation + * @static + * @param {google.privacy.dlp.v2.InfoTypeTransformations.InfoTypeTransformation} message InfoTypeTransformation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InfoTypeTransformation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.infoTypes = []; + if (options.defaults) + object.primitiveTransformation = null; + if (message.infoTypes && message.infoTypes.length) { + object.infoTypes = []; + for (var j = 0; j < message.infoTypes.length; ++j) + object.infoTypes[j] = $root.google.privacy.dlp.v2.InfoType.toObject(message.infoTypes[j], options); + } + if (message.primitiveTransformation != null && message.hasOwnProperty("primitiveTransformation")) + object.primitiveTransformation = $root.google.privacy.dlp.v2.PrimitiveTransformation.toObject(message.primitiveTransformation, options); + return object; + }; + + /** + * Converts this InfoTypeTransformation to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.InfoTypeTransformations.InfoTypeTransformation + * @instance + * @returns {Object.} JSON object + */ + InfoTypeTransformation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InfoTypeTransformation; + })(); + + return InfoTypeTransformations; + })(); + + v2.FieldTransformation = (function() { + + /** + * Properties of a FieldTransformation. + * @memberof google.privacy.dlp.v2 + * @interface IFieldTransformation + * @property {Array.|null} [fields] FieldTransformation fields + * @property {google.privacy.dlp.v2.IRecordCondition|null} [condition] FieldTransformation condition + * @property {google.privacy.dlp.v2.IPrimitiveTransformation|null} [primitiveTransformation] FieldTransformation primitiveTransformation + * @property {google.privacy.dlp.v2.IInfoTypeTransformations|null} [infoTypeTransformations] FieldTransformation infoTypeTransformations + */ + + /** + * Constructs a new FieldTransformation. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents a FieldTransformation. + * @implements IFieldTransformation + * @constructor + * @param {google.privacy.dlp.v2.IFieldTransformation=} [properties] Properties to set + */ + function FieldTransformation(properties) { + this.fields = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldTransformation fields. + * @member {Array.} fields + * @memberof google.privacy.dlp.v2.FieldTransformation + * @instance + */ + FieldTransformation.prototype.fields = $util.emptyArray; + + /** + * FieldTransformation condition. + * @member {google.privacy.dlp.v2.IRecordCondition|null|undefined} condition + * @memberof google.privacy.dlp.v2.FieldTransformation + * @instance + */ + FieldTransformation.prototype.condition = null; + + /** + * FieldTransformation primitiveTransformation. + * @member {google.privacy.dlp.v2.IPrimitiveTransformation|null|undefined} primitiveTransformation + * @memberof google.privacy.dlp.v2.FieldTransformation + * @instance + */ + FieldTransformation.prototype.primitiveTransformation = null; + + /** + * FieldTransformation infoTypeTransformations. + * @member {google.privacy.dlp.v2.IInfoTypeTransformations|null|undefined} infoTypeTransformations + * @memberof google.privacy.dlp.v2.FieldTransformation + * @instance + */ + FieldTransformation.prototype.infoTypeTransformations = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * FieldTransformation transformation. + * @member {"primitiveTransformation"|"infoTypeTransformations"|undefined} transformation + * @memberof google.privacy.dlp.v2.FieldTransformation + * @instance + */ + Object.defineProperty(FieldTransformation.prototype, "transformation", { + get: $util.oneOfGetter($oneOfFields = ["primitiveTransformation", "infoTypeTransformations"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new FieldTransformation instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.FieldTransformation + * @static + * @param {google.privacy.dlp.v2.IFieldTransformation=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.FieldTransformation} FieldTransformation instance + */ + FieldTransformation.create = function create(properties) { + return new FieldTransformation(properties); + }; + + /** + * Encodes the specified FieldTransformation message. Does not implicitly {@link google.privacy.dlp.v2.FieldTransformation.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.FieldTransformation + * @static + * @param {google.privacy.dlp.v2.IFieldTransformation} message FieldTransformation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldTransformation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fields != null && message.fields.length) + for (var i = 0; i < message.fields.length; ++i) + $root.google.privacy.dlp.v2.FieldId.encode(message.fields[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) + $root.google.privacy.dlp.v2.RecordCondition.encode(message.condition, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.primitiveTransformation != null && Object.hasOwnProperty.call(message, "primitiveTransformation")) + $root.google.privacy.dlp.v2.PrimitiveTransformation.encode(message.primitiveTransformation, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.infoTypeTransformations != null && Object.hasOwnProperty.call(message, "infoTypeTransformations")) + $root.google.privacy.dlp.v2.InfoTypeTransformations.encode(message.infoTypeTransformations, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FieldTransformation message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.FieldTransformation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.FieldTransformation + * @static + * @param {google.privacy.dlp.v2.IFieldTransformation} message FieldTransformation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldTransformation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldTransformation message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.FieldTransformation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.FieldTransformation} FieldTransformation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldTransformation.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.privacy.dlp.v2.FieldTransformation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.fields && message.fields.length)) + message.fields = []; + message.fields.push($root.google.privacy.dlp.v2.FieldId.decode(reader, reader.uint32())); + break; + case 3: + message.condition = $root.google.privacy.dlp.v2.RecordCondition.decode(reader, reader.uint32()); + break; + case 4: + message.primitiveTransformation = $root.google.privacy.dlp.v2.PrimitiveTransformation.decode(reader, reader.uint32()); + break; + case 5: + message.infoTypeTransformations = $root.google.privacy.dlp.v2.InfoTypeTransformations.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldTransformation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.FieldTransformation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.FieldTransformation} FieldTransformation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldTransformation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldTransformation message. + * @function verify + * @memberof google.privacy.dlp.v2.FieldTransformation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldTransformation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.fields != null && message.hasOwnProperty("fields")) { + if (!Array.isArray(message.fields)) + return "fields: array expected"; + for (var i = 0; i < message.fields.length; ++i) { + var error = $root.google.privacy.dlp.v2.FieldId.verify(message.fields[i]); + if (error) + return "fields." + error; + } + } + if (message.condition != null && message.hasOwnProperty("condition")) { + var error = $root.google.privacy.dlp.v2.RecordCondition.verify(message.condition); + if (error) + return "condition." + error; + } + if (message.primitiveTransformation != null && message.hasOwnProperty("primitiveTransformation")) { + properties.transformation = 1; + { + var error = $root.google.privacy.dlp.v2.PrimitiveTransformation.verify(message.primitiveTransformation); + if (error) + return "primitiveTransformation." + error; + } + } + if (message.infoTypeTransformations != null && message.hasOwnProperty("infoTypeTransformations")) { + if (properties.transformation === 1) + return "transformation: multiple values"; + properties.transformation = 1; + { + var error = $root.google.privacy.dlp.v2.InfoTypeTransformations.verify(message.infoTypeTransformations); + if (error) + return "infoTypeTransformations." + error; + } + } + return null; + }; + + /** + * Creates a FieldTransformation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.FieldTransformation + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.FieldTransformation} FieldTransformation + */ + FieldTransformation.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.FieldTransformation) + return object; + var message = new $root.google.privacy.dlp.v2.FieldTransformation(); + if (object.fields) { + if (!Array.isArray(object.fields)) + throw TypeError(".google.privacy.dlp.v2.FieldTransformation.fields: array expected"); + message.fields = []; + for (var i = 0; i < object.fields.length; ++i) { + if (typeof object.fields[i] !== "object") + throw TypeError(".google.privacy.dlp.v2.FieldTransformation.fields: object expected"); + message.fields[i] = $root.google.privacy.dlp.v2.FieldId.fromObject(object.fields[i]); + } + } + if (object.condition != null) { + if (typeof object.condition !== "object") + throw TypeError(".google.privacy.dlp.v2.FieldTransformation.condition: object expected"); + message.condition = $root.google.privacy.dlp.v2.RecordCondition.fromObject(object.condition); + } + if (object.primitiveTransformation != null) { + if (typeof object.primitiveTransformation !== "object") + throw TypeError(".google.privacy.dlp.v2.FieldTransformation.primitiveTransformation: object expected"); + message.primitiveTransformation = $root.google.privacy.dlp.v2.PrimitiveTransformation.fromObject(object.primitiveTransformation); + } + if (object.infoTypeTransformations != null) { + if (typeof object.infoTypeTransformations !== "object") + throw TypeError(".google.privacy.dlp.v2.FieldTransformation.infoTypeTransformations: object expected"); + message.infoTypeTransformations = $root.google.privacy.dlp.v2.InfoTypeTransformations.fromObject(object.infoTypeTransformations); + } + return message; + }; + + /** + * Creates a plain object from a FieldTransformation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.FieldTransformation + * @static + * @param {google.privacy.dlp.v2.FieldTransformation} message FieldTransformation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldTransformation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.fields = []; + if (options.defaults) + object.condition = null; + if (message.fields && message.fields.length) { + object.fields = []; + for (var j = 0; j < message.fields.length; ++j) + object.fields[j] = $root.google.privacy.dlp.v2.FieldId.toObject(message.fields[j], options); + } + if (message.condition != null && message.hasOwnProperty("condition")) + object.condition = $root.google.privacy.dlp.v2.RecordCondition.toObject(message.condition, options); + if (message.primitiveTransformation != null && message.hasOwnProperty("primitiveTransformation")) { + object.primitiveTransformation = $root.google.privacy.dlp.v2.PrimitiveTransformation.toObject(message.primitiveTransformation, options); + if (options.oneofs) + object.transformation = "primitiveTransformation"; + } + if (message.infoTypeTransformations != null && message.hasOwnProperty("infoTypeTransformations")) { + object.infoTypeTransformations = $root.google.privacy.dlp.v2.InfoTypeTransformations.toObject(message.infoTypeTransformations, options); + if (options.oneofs) + object.transformation = "infoTypeTransformations"; + } + return object; + }; + + /** + * Converts this FieldTransformation to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.FieldTransformation + * @instance + * @returns {Object.} JSON object + */ + FieldTransformation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return FieldTransformation; + })(); + + v2.RecordTransformations = (function() { + + /** + * Properties of a RecordTransformations. + * @memberof google.privacy.dlp.v2 + * @interface IRecordTransformations + * @property {Array.|null} [fieldTransformations] RecordTransformations fieldTransformations + * @property {Array.|null} [recordSuppressions] RecordTransformations recordSuppressions + */ + + /** + * Constructs a new RecordTransformations. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents a RecordTransformations. + * @implements IRecordTransformations + * @constructor + * @param {google.privacy.dlp.v2.IRecordTransformations=} [properties] Properties to set + */ + function RecordTransformations(properties) { + this.fieldTransformations = []; + this.recordSuppressions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RecordTransformations fieldTransformations. + * @member {Array.} fieldTransformations + * @memberof google.privacy.dlp.v2.RecordTransformations + * @instance + */ + RecordTransformations.prototype.fieldTransformations = $util.emptyArray; + + /** + * RecordTransformations recordSuppressions. + * @member {Array.} recordSuppressions + * @memberof google.privacy.dlp.v2.RecordTransformations + * @instance + */ + RecordTransformations.prototype.recordSuppressions = $util.emptyArray; + + /** + * Creates a new RecordTransformations instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.RecordTransformations + * @static + * @param {google.privacy.dlp.v2.IRecordTransformations=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.RecordTransformations} RecordTransformations instance + */ + RecordTransformations.create = function create(properties) { + return new RecordTransformations(properties); + }; + + /** + * Encodes the specified RecordTransformations message. Does not implicitly {@link google.privacy.dlp.v2.RecordTransformations.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.RecordTransformations + * @static + * @param {google.privacy.dlp.v2.IRecordTransformations} message RecordTransformations message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RecordTransformations.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fieldTransformations != null && message.fieldTransformations.length) + for (var i = 0; i < message.fieldTransformations.length; ++i) + $root.google.privacy.dlp.v2.FieldTransformation.encode(message.fieldTransformations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.recordSuppressions != null && message.recordSuppressions.length) + for (var i = 0; i < message.recordSuppressions.length; ++i) + $root.google.privacy.dlp.v2.RecordSuppression.encode(message.recordSuppressions[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RecordTransformations message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.RecordTransformations.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.RecordTransformations + * @static + * @param {google.privacy.dlp.v2.IRecordTransformations} message RecordTransformations message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RecordTransformations.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RecordTransformations message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.RecordTransformations + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.RecordTransformations} RecordTransformations + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RecordTransformations.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.privacy.dlp.v2.RecordTransformations(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.fieldTransformations && message.fieldTransformations.length)) + message.fieldTransformations = []; + message.fieldTransformations.push($root.google.privacy.dlp.v2.FieldTransformation.decode(reader, reader.uint32())); + break; + case 2: + if (!(message.recordSuppressions && message.recordSuppressions.length)) + message.recordSuppressions = []; + message.recordSuppressions.push($root.google.privacy.dlp.v2.RecordSuppression.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RecordTransformations message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.RecordTransformations + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.RecordTransformations} RecordTransformations + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RecordTransformations.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RecordTransformations message. + * @function verify + * @memberof google.privacy.dlp.v2.RecordTransformations + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RecordTransformations.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.fieldTransformations != null && message.hasOwnProperty("fieldTransformations")) { + if (!Array.isArray(message.fieldTransformations)) + return "fieldTransformations: array expected"; + for (var i = 0; i < message.fieldTransformations.length; ++i) { + var error = $root.google.privacy.dlp.v2.FieldTransformation.verify(message.fieldTransformations[i]); + if (error) + return "fieldTransformations." + error; + } + } + if (message.recordSuppressions != null && message.hasOwnProperty("recordSuppressions")) { + if (!Array.isArray(message.recordSuppressions)) + return "recordSuppressions: array expected"; + for (var i = 0; i < message.recordSuppressions.length; ++i) { + var error = $root.google.privacy.dlp.v2.RecordSuppression.verify(message.recordSuppressions[i]); + if (error) + return "recordSuppressions." + error; + } + } + return null; + }; + + /** + * Creates a RecordTransformations message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.RecordTransformations + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.RecordTransformations} RecordTransformations + */ + RecordTransformations.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.RecordTransformations) + return object; + var message = new $root.google.privacy.dlp.v2.RecordTransformations(); + if (object.fieldTransformations) { + if (!Array.isArray(object.fieldTransformations)) + throw TypeError(".google.privacy.dlp.v2.RecordTransformations.fieldTransformations: array expected"); + message.fieldTransformations = []; + for (var i = 0; i < object.fieldTransformations.length; ++i) { + if (typeof object.fieldTransformations[i] !== "object") + throw TypeError(".google.privacy.dlp.v2.RecordTransformations.fieldTransformations: object expected"); + message.fieldTransformations[i] = $root.google.privacy.dlp.v2.FieldTransformation.fromObject(object.fieldTransformations[i]); + } + } + if (object.recordSuppressions) { + if (!Array.isArray(object.recordSuppressions)) + throw TypeError(".google.privacy.dlp.v2.RecordTransformations.recordSuppressions: array expected"); + message.recordSuppressions = []; + for (var i = 0; i < object.recordSuppressions.length; ++i) { + if (typeof object.recordSuppressions[i] !== "object") + throw TypeError(".google.privacy.dlp.v2.RecordTransformations.recordSuppressions: object expected"); + message.recordSuppressions[i] = $root.google.privacy.dlp.v2.RecordSuppression.fromObject(object.recordSuppressions[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a RecordTransformations message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.RecordTransformations + * @static + * @param {google.privacy.dlp.v2.RecordTransformations} message RecordTransformations + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RecordTransformations.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.fieldTransformations = []; + object.recordSuppressions = []; + } + if (message.fieldTransformations && message.fieldTransformations.length) { + object.fieldTransformations = []; + for (var j = 0; j < message.fieldTransformations.length; ++j) + object.fieldTransformations[j] = $root.google.privacy.dlp.v2.FieldTransformation.toObject(message.fieldTransformations[j], options); + } + if (message.recordSuppressions && message.recordSuppressions.length) { + object.recordSuppressions = []; + for (var j = 0; j < message.recordSuppressions.length; ++j) + object.recordSuppressions[j] = $root.google.privacy.dlp.v2.RecordSuppression.toObject(message.recordSuppressions[j], options); + } + return object; + }; + + /** + * Converts this RecordTransformations to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.RecordTransformations + * @instance + * @returns {Object.} JSON object + */ + RecordTransformations.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RecordTransformations; + })(); + + v2.RecordSuppression = (function() { + + /** + * Properties of a RecordSuppression. + * @memberof google.privacy.dlp.v2 + * @interface IRecordSuppression + * @property {google.privacy.dlp.v2.IRecordCondition|null} [condition] RecordSuppression condition + */ + + /** + * Constructs a new RecordSuppression. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents a RecordSuppression. + * @implements IRecordSuppression + * @constructor + * @param {google.privacy.dlp.v2.IRecordSuppression=} [properties] Properties to set + */ + function RecordSuppression(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RecordSuppression condition. + * @member {google.privacy.dlp.v2.IRecordCondition|null|undefined} condition + * @memberof google.privacy.dlp.v2.RecordSuppression + * @instance + */ + RecordSuppression.prototype.condition = null; + + /** + * Creates a new RecordSuppression instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.RecordSuppression + * @static + * @param {google.privacy.dlp.v2.IRecordSuppression=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.RecordSuppression} RecordSuppression instance + */ + RecordSuppression.create = function create(properties) { + return new RecordSuppression(properties); + }; + + /** + * Encodes the specified RecordSuppression message. Does not implicitly {@link google.privacy.dlp.v2.RecordSuppression.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.RecordSuppression + * @static + * @param {google.privacy.dlp.v2.IRecordSuppression} message RecordSuppression message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RecordSuppression.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) + $root.google.privacy.dlp.v2.RecordCondition.encode(message.condition, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RecordSuppression message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.RecordSuppression.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.RecordSuppression + * @static + * @param {google.privacy.dlp.v2.IRecordSuppression} message RecordSuppression message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RecordSuppression.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RecordSuppression message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.RecordSuppression + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.RecordSuppression} RecordSuppression + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RecordSuppression.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.privacy.dlp.v2.RecordSuppression(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.condition = $root.google.privacy.dlp.v2.RecordCondition.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RecordSuppression message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.RecordSuppression + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.RecordSuppression} RecordSuppression + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RecordSuppression.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RecordSuppression message. + * @function verify + * @memberof google.privacy.dlp.v2.RecordSuppression + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RecordSuppression.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.condition != null && message.hasOwnProperty("condition")) { + var error = $root.google.privacy.dlp.v2.RecordCondition.verify(message.condition); + if (error) + return "condition." + error; + } + return null; + }; + + /** + * Creates a RecordSuppression message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.RecordSuppression + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.RecordSuppression} RecordSuppression + */ + RecordSuppression.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.RecordSuppression) + return object; + var message = new $root.google.privacy.dlp.v2.RecordSuppression(); + if (object.condition != null) { + if (typeof object.condition !== "object") + throw TypeError(".google.privacy.dlp.v2.RecordSuppression.condition: object expected"); + message.condition = $root.google.privacy.dlp.v2.RecordCondition.fromObject(object.condition); + } + return message; + }; + + /** + * Creates a plain object from a RecordSuppression message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.RecordSuppression + * @static + * @param {google.privacy.dlp.v2.RecordSuppression} message RecordSuppression + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RecordSuppression.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.condition = null; + if (message.condition != null && message.hasOwnProperty("condition")) + object.condition = $root.google.privacy.dlp.v2.RecordCondition.toObject(message.condition, options); + return object; + }; + + /** + * Converts this RecordSuppression to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.RecordSuppression + * @instance + * @returns {Object.} JSON object + */ + RecordSuppression.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RecordSuppression; + })(); + + v2.RecordCondition = (function() { + + /** + * Properties of a RecordCondition. + * @memberof google.privacy.dlp.v2 + * @interface IRecordCondition + * @property {google.privacy.dlp.v2.RecordCondition.IExpressions|null} [expressions] RecordCondition expressions + */ + + /** + * Constructs a new RecordCondition. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents a RecordCondition. + * @implements IRecordCondition + * @constructor + * @param {google.privacy.dlp.v2.IRecordCondition=} [properties] Properties to set + */ + function RecordCondition(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RecordCondition expressions. + * @member {google.privacy.dlp.v2.RecordCondition.IExpressions|null|undefined} expressions + * @memberof google.privacy.dlp.v2.RecordCondition + * @instance + */ + RecordCondition.prototype.expressions = null; + + /** + * Creates a new RecordCondition instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.RecordCondition + * @static + * @param {google.privacy.dlp.v2.IRecordCondition=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.RecordCondition} RecordCondition instance + */ + RecordCondition.create = function create(properties) { + return new RecordCondition(properties); + }; + + /** + * Encodes the specified RecordCondition message. Does not implicitly {@link google.privacy.dlp.v2.RecordCondition.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.RecordCondition + * @static + * @param {google.privacy.dlp.v2.IRecordCondition} message RecordCondition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RecordCondition.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.expressions != null && Object.hasOwnProperty.call(message, "expressions")) + $root.google.privacy.dlp.v2.RecordCondition.Expressions.encode(message.expressions, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RecordCondition message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.RecordCondition.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.RecordCondition + * @static + * @param {google.privacy.dlp.v2.IRecordCondition} message RecordCondition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RecordCondition.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RecordCondition message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.RecordCondition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.RecordCondition} RecordCondition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RecordCondition.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.privacy.dlp.v2.RecordCondition(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: + message.expressions = $root.google.privacy.dlp.v2.RecordCondition.Expressions.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RecordCondition message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.RecordCondition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.RecordCondition} RecordCondition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RecordCondition.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RecordCondition message. + * @function verify + * @memberof google.privacy.dlp.v2.RecordCondition + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RecordCondition.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.expressions != null && message.hasOwnProperty("expressions")) { + var error = $root.google.privacy.dlp.v2.RecordCondition.Expressions.verify(message.expressions); + if (error) + return "expressions." + error; + } + return null; + }; + + /** + * Creates a RecordCondition message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.RecordCondition + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.RecordCondition} RecordCondition + */ + RecordCondition.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.RecordCondition) + return object; + var message = new $root.google.privacy.dlp.v2.RecordCondition(); + if (object.expressions != null) { + if (typeof object.expressions !== "object") + throw TypeError(".google.privacy.dlp.v2.RecordCondition.expressions: object expected"); + message.expressions = $root.google.privacy.dlp.v2.RecordCondition.Expressions.fromObject(object.expressions); + } + return message; + }; + + /** + * Creates a plain object from a RecordCondition message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.RecordCondition + * @static + * @param {google.privacy.dlp.v2.RecordCondition} message RecordCondition + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RecordCondition.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.expressions = null; + if (message.expressions != null && message.hasOwnProperty("expressions")) + object.expressions = $root.google.privacy.dlp.v2.RecordCondition.Expressions.toObject(message.expressions, options); + return object; + }; + + /** + * Converts this RecordCondition to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.RecordCondition + * @instance + * @returns {Object.} JSON object + */ + RecordCondition.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + RecordCondition.Condition = (function() { + + /** + * Properties of a Condition. + * @memberof google.privacy.dlp.v2.RecordCondition + * @interface ICondition + * @property {google.privacy.dlp.v2.IFieldId|null} [field] Condition field + * @property {google.privacy.dlp.v2.RelationalOperator|null} [operator] Condition operator + * @property {google.privacy.dlp.v2.IValue|null} [value] Condition value + */ + + /** + * Constructs a new Condition. + * @memberof google.privacy.dlp.v2.RecordCondition + * @classdesc Represents a Condition. + * @implements ICondition + * @constructor + * @param {google.privacy.dlp.v2.RecordCondition.ICondition=} [properties] Properties to set + */ + function Condition(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Condition field. + * @member {google.privacy.dlp.v2.IFieldId|null|undefined} field + * @memberof google.privacy.dlp.v2.RecordCondition.Condition + * @instance + */ + Condition.prototype.field = null; + + /** + * Condition operator. + * @member {google.privacy.dlp.v2.RelationalOperator} operator + * @memberof google.privacy.dlp.v2.RecordCondition.Condition + * @instance + */ + Condition.prototype.operator = 0; + + /** + * Condition value. + * @member {google.privacy.dlp.v2.IValue|null|undefined} value + * @memberof google.privacy.dlp.v2.RecordCondition.Condition + * @instance + */ + Condition.prototype.value = null; + + /** + * Creates a new Condition instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.RecordCondition.Condition + * @static + * @param {google.privacy.dlp.v2.RecordCondition.ICondition=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.RecordCondition.Condition} Condition instance + */ + Condition.create = function create(properties) { + return new Condition(properties); + }; + + /** + * Encodes the specified Condition message. Does not implicitly {@link google.privacy.dlp.v2.RecordCondition.Condition.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.RecordCondition.Condition + * @static + * @param {google.privacy.dlp.v2.RecordCondition.ICondition} message Condition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Condition.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.field != null && Object.hasOwnProperty.call(message, "field")) + $root.google.privacy.dlp.v2.FieldId.encode(message.field, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.operator != null && Object.hasOwnProperty.call(message, "operator")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.operator); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + $root.google.privacy.dlp.v2.Value.encode(message.value, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Condition message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.RecordCondition.Condition.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.RecordCondition.Condition + * @static + * @param {google.privacy.dlp.v2.RecordCondition.ICondition} message Condition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Condition.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Condition message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.RecordCondition.Condition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.RecordCondition.Condition} Condition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Condition.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.privacy.dlp.v2.RecordCondition.Condition(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.field = $root.google.privacy.dlp.v2.FieldId.decode(reader, reader.uint32()); + break; + case 3: + message.operator = reader.int32(); + break; + case 4: + message.value = $root.google.privacy.dlp.v2.Value.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Condition message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.RecordCondition.Condition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.RecordCondition.Condition} Condition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Condition.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Condition message. + * @function verify + * @memberof google.privacy.dlp.v2.RecordCondition.Condition + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Condition.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.field != null && message.hasOwnProperty("field")) { + var error = $root.google.privacy.dlp.v2.FieldId.verify(message.field); + if (error) + return "field." + error; + } + if (message.operator != null && message.hasOwnProperty("operator")) + switch (message.operator) { + default: + return "operator: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + break; + } + if (message.value != null && message.hasOwnProperty("value")) { + var error = $root.google.privacy.dlp.v2.Value.verify(message.value); + if (error) + return "value." + error; + } + return null; + }; + + /** + * Creates a Condition message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.RecordCondition.Condition + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.RecordCondition.Condition} Condition + */ + Condition.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.RecordCondition.Condition) + return object; + var message = new $root.google.privacy.dlp.v2.RecordCondition.Condition(); + if (object.field != null) { + if (typeof object.field !== "object") + throw TypeError(".google.privacy.dlp.v2.RecordCondition.Condition.field: object expected"); + message.field = $root.google.privacy.dlp.v2.FieldId.fromObject(object.field); + } + switch (object.operator) { + case "RELATIONAL_OPERATOR_UNSPECIFIED": + case 0: + message.operator = 0; + break; + case "EQUAL_TO": + case 1: + message.operator = 1; + break; + case "NOT_EQUAL_TO": + case 2: + message.operator = 2; + break; + case "GREATER_THAN": + case 3: + message.operator = 3; + break; + case "LESS_THAN": + case 4: + message.operator = 4; + break; + case "GREATER_THAN_OR_EQUALS": + case 5: + message.operator = 5; + break; + case "LESS_THAN_OR_EQUALS": + case 6: + message.operator = 6; + break; + case "EXISTS": + case 7: + message.operator = 7; + break; + } + if (object.value != null) { + if (typeof object.value !== "object") + throw TypeError(".google.privacy.dlp.v2.RecordCondition.Condition.value: object expected"); + message.value = $root.google.privacy.dlp.v2.Value.fromObject(object.value); + } + return message; + }; + + /** + * Creates a plain object from a Condition message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.RecordCondition.Condition + * @static + * @param {google.privacy.dlp.v2.RecordCondition.Condition} message Condition + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Condition.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.field = null; + object.operator = options.enums === String ? "RELATIONAL_OPERATOR_UNSPECIFIED" : 0; + object.value = null; + } + if (message.field != null && message.hasOwnProperty("field")) + object.field = $root.google.privacy.dlp.v2.FieldId.toObject(message.field, options); + if (message.operator != null && message.hasOwnProperty("operator")) + object.operator = options.enums === String ? $root.google.privacy.dlp.v2.RelationalOperator[message.operator] : message.operator; + if (message.value != null && message.hasOwnProperty("value")) + object.value = $root.google.privacy.dlp.v2.Value.toObject(message.value, options); + return object; + }; + + /** + * Converts this Condition to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.RecordCondition.Condition + * @instance + * @returns {Object.} JSON object + */ + Condition.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Condition; + })(); + + RecordCondition.Conditions = (function() { + + /** + * Properties of a Conditions. + * @memberof google.privacy.dlp.v2.RecordCondition + * @interface IConditions + * @property {Array.|null} [conditions] Conditions conditions + */ + + /** + * Constructs a new Conditions. + * @memberof google.privacy.dlp.v2.RecordCondition + * @classdesc Represents a Conditions. + * @implements IConditions + * @constructor + * @param {google.privacy.dlp.v2.RecordCondition.IConditions=} [properties] Properties to set + */ + function Conditions(properties) { + this.conditions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Conditions conditions. + * @member {Array.} conditions + * @memberof google.privacy.dlp.v2.RecordCondition.Conditions + * @instance + */ + Conditions.prototype.conditions = $util.emptyArray; + + /** + * Creates a new Conditions instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.RecordCondition.Conditions + * @static + * @param {google.privacy.dlp.v2.RecordCondition.IConditions=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.RecordCondition.Conditions} Conditions instance + */ + Conditions.create = function create(properties) { + return new Conditions(properties); + }; + + /** + * Encodes the specified Conditions message. Does not implicitly {@link google.privacy.dlp.v2.RecordCondition.Conditions.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.RecordCondition.Conditions + * @static + * @param {google.privacy.dlp.v2.RecordCondition.IConditions} message Conditions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Conditions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.conditions != null && message.conditions.length) + for (var i = 0; i < message.conditions.length; ++i) + $root.google.privacy.dlp.v2.RecordCondition.Condition.encode(message.conditions[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Conditions message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.RecordCondition.Conditions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.RecordCondition.Conditions + * @static + * @param {google.privacy.dlp.v2.RecordCondition.IConditions} message Conditions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Conditions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Conditions message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.RecordCondition.Conditions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.RecordCondition.Conditions} Conditions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Conditions.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.privacy.dlp.v2.RecordCondition.Conditions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.conditions && message.conditions.length)) + message.conditions = []; + message.conditions.push($root.google.privacy.dlp.v2.RecordCondition.Condition.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Conditions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.RecordCondition.Conditions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.RecordCondition.Conditions} Conditions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Conditions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Conditions message. + * @function verify + * @memberof google.privacy.dlp.v2.RecordCondition.Conditions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Conditions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.conditions != null && message.hasOwnProperty("conditions")) { + if (!Array.isArray(message.conditions)) + return "conditions: array expected"; + for (var i = 0; i < message.conditions.length; ++i) { + var error = $root.google.privacy.dlp.v2.RecordCondition.Condition.verify(message.conditions[i]); + if (error) + return "conditions." + error; + } + } + return null; + }; + + /** + * Creates a Conditions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.RecordCondition.Conditions + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.RecordCondition.Conditions} Conditions + */ + Conditions.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.RecordCondition.Conditions) + return object; + var message = new $root.google.privacy.dlp.v2.RecordCondition.Conditions(); + if (object.conditions) { + if (!Array.isArray(object.conditions)) + throw TypeError(".google.privacy.dlp.v2.RecordCondition.Conditions.conditions: array expected"); + message.conditions = []; + for (var i = 0; i < object.conditions.length; ++i) { + if (typeof object.conditions[i] !== "object") + throw TypeError(".google.privacy.dlp.v2.RecordCondition.Conditions.conditions: object expected"); + message.conditions[i] = $root.google.privacy.dlp.v2.RecordCondition.Condition.fromObject(object.conditions[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Conditions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.RecordCondition.Conditions + * @static + * @param {google.privacy.dlp.v2.RecordCondition.Conditions} message Conditions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Conditions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.conditions = []; + if (message.conditions && message.conditions.length) { + object.conditions = []; + for (var j = 0; j < message.conditions.length; ++j) + object.conditions[j] = $root.google.privacy.dlp.v2.RecordCondition.Condition.toObject(message.conditions[j], options); + } + return object; + }; + + /** + * Converts this Conditions to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.RecordCondition.Conditions + * @instance + * @returns {Object.} JSON object + */ + Conditions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Conditions; + })(); + + RecordCondition.Expressions = (function() { + + /** + * Properties of an Expressions. + * @memberof google.privacy.dlp.v2.RecordCondition + * @interface IExpressions + * @property {google.privacy.dlp.v2.RecordCondition.Expressions.LogicalOperator|null} [logicalOperator] Expressions logicalOperator + * @property {google.privacy.dlp.v2.RecordCondition.IConditions|null} [conditions] Expressions conditions + */ + + /** + * Constructs a new Expressions. + * @memberof google.privacy.dlp.v2.RecordCondition + * @classdesc Represents an Expressions. + * @implements IExpressions + * @constructor + * @param {google.privacy.dlp.v2.RecordCondition.IExpressions=} [properties] Properties to set + */ + function Expressions(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Expressions logicalOperator. + * @member {google.privacy.dlp.v2.RecordCondition.Expressions.LogicalOperator} logicalOperator + * @memberof google.privacy.dlp.v2.RecordCondition.Expressions + * @instance + */ + Expressions.prototype.logicalOperator = 0; + + /** + * Expressions conditions. + * @member {google.privacy.dlp.v2.RecordCondition.IConditions|null|undefined} conditions + * @memberof google.privacy.dlp.v2.RecordCondition.Expressions + * @instance + */ + Expressions.prototype.conditions = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Expressions type. + * @member {"conditions"|undefined} type + * @memberof google.privacy.dlp.v2.RecordCondition.Expressions + * @instance + */ + Object.defineProperty(Expressions.prototype, "type", { + get: $util.oneOfGetter($oneOfFields = ["conditions"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Expressions instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.RecordCondition.Expressions + * @static + * @param {google.privacy.dlp.v2.RecordCondition.IExpressions=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.RecordCondition.Expressions} Expressions instance + */ + Expressions.create = function create(properties) { + return new Expressions(properties); + }; + + /** + * Encodes the specified Expressions message. Does not implicitly {@link google.privacy.dlp.v2.RecordCondition.Expressions.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.RecordCondition.Expressions + * @static + * @param {google.privacy.dlp.v2.RecordCondition.IExpressions} message Expressions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Expressions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.logicalOperator != null && Object.hasOwnProperty.call(message, "logicalOperator")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.logicalOperator); + if (message.conditions != null && Object.hasOwnProperty.call(message, "conditions")) + $root.google.privacy.dlp.v2.RecordCondition.Conditions.encode(message.conditions, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Expressions message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.RecordCondition.Expressions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.RecordCondition.Expressions + * @static + * @param {google.privacy.dlp.v2.RecordCondition.IExpressions} message Expressions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Expressions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Expressions message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.RecordCondition.Expressions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.RecordCondition.Expressions} Expressions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Expressions.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.privacy.dlp.v2.RecordCondition.Expressions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.logicalOperator = reader.int32(); + break; + case 3: + message.conditions = $root.google.privacy.dlp.v2.RecordCondition.Conditions.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Expressions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.RecordCondition.Expressions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.RecordCondition.Expressions} Expressions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Expressions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Expressions message. + * @function verify + * @memberof google.privacy.dlp.v2.RecordCondition.Expressions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Expressions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.logicalOperator != null && message.hasOwnProperty("logicalOperator")) + switch (message.logicalOperator) { + default: + return "logicalOperator: enum value expected"; + case 0: + case 1: + break; + } + if (message.conditions != null && message.hasOwnProperty("conditions")) { + properties.type = 1; + { + var error = $root.google.privacy.dlp.v2.RecordCondition.Conditions.verify(message.conditions); + if (error) + return "conditions." + error; + } + } + return null; + }; + + /** + * Creates an Expressions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.RecordCondition.Expressions + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.RecordCondition.Expressions} Expressions + */ + Expressions.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.RecordCondition.Expressions) + return object; + var message = new $root.google.privacy.dlp.v2.RecordCondition.Expressions(); + switch (object.logicalOperator) { + case "LOGICAL_OPERATOR_UNSPECIFIED": + case 0: + message.logicalOperator = 0; + break; + case "AND": + case 1: + message.logicalOperator = 1; + break; + } + if (object.conditions != null) { + if (typeof object.conditions !== "object") + throw TypeError(".google.privacy.dlp.v2.RecordCondition.Expressions.conditions: object expected"); + message.conditions = $root.google.privacy.dlp.v2.RecordCondition.Conditions.fromObject(object.conditions); + } + return message; + }; + + /** + * Creates a plain object from an Expressions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.RecordCondition.Expressions + * @static + * @param {google.privacy.dlp.v2.RecordCondition.Expressions} message Expressions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Expressions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.logicalOperator = options.enums === String ? "LOGICAL_OPERATOR_UNSPECIFIED" : 0; + if (message.logicalOperator != null && message.hasOwnProperty("logicalOperator")) + object.logicalOperator = options.enums === String ? $root.google.privacy.dlp.v2.RecordCondition.Expressions.LogicalOperator[message.logicalOperator] : message.logicalOperator; + if (message.conditions != null && message.hasOwnProperty("conditions")) { + object.conditions = $root.google.privacy.dlp.v2.RecordCondition.Conditions.toObject(message.conditions, options); + if (options.oneofs) + object.type = "conditions"; + } + return object; + }; + + /** + * Converts this Expressions to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.RecordCondition.Expressions + * @instance + * @returns {Object.} JSON object + */ + Expressions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * LogicalOperator enum. + * @name google.privacy.dlp.v2.RecordCondition.Expressions.LogicalOperator + * @enum {number} + * @property {number} LOGICAL_OPERATOR_UNSPECIFIED=0 LOGICAL_OPERATOR_UNSPECIFIED value + * @property {number} AND=1 AND value + */ + Expressions.LogicalOperator = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "LOGICAL_OPERATOR_UNSPECIFIED"] = 0; + values[valuesById[1] = "AND"] = 1; + return values; + })(); + + return Expressions; + })(); + + return RecordCondition; + })(); + + v2.TransformationOverview = (function() { + + /** + * Properties of a TransformationOverview. + * @memberof google.privacy.dlp.v2 + * @interface ITransformationOverview + * @property {number|Long|null} [transformedBytes] TransformationOverview transformedBytes + * @property {Array.|null} [transformationSummaries] TransformationOverview transformationSummaries + */ + + /** + * Constructs a new TransformationOverview. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents a TransformationOverview. + * @implements ITransformationOverview + * @constructor + * @param {google.privacy.dlp.v2.ITransformationOverview=} [properties] Properties to set + */ + function TransformationOverview(properties) { + this.transformationSummaries = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TransformationOverview transformedBytes. + * @member {number|Long} transformedBytes + * @memberof google.privacy.dlp.v2.TransformationOverview + * @instance + */ + TransformationOverview.prototype.transformedBytes = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * TransformationOverview transformationSummaries. + * @member {Array.} transformationSummaries + * @memberof google.privacy.dlp.v2.TransformationOverview + * @instance + */ + TransformationOverview.prototype.transformationSummaries = $util.emptyArray; + + /** + * Creates a new TransformationOverview instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.TransformationOverview + * @static + * @param {google.privacy.dlp.v2.ITransformationOverview=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.TransformationOverview} TransformationOverview instance + */ + TransformationOverview.create = function create(properties) { + return new TransformationOverview(properties); + }; + + /** + * Encodes the specified TransformationOverview message. Does not implicitly {@link google.privacy.dlp.v2.TransformationOverview.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.TransformationOverview + * @static + * @param {google.privacy.dlp.v2.ITransformationOverview} message TransformationOverview message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransformationOverview.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.transformedBytes != null && Object.hasOwnProperty.call(message, "transformedBytes")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.transformedBytes); + if (message.transformationSummaries != null && message.transformationSummaries.length) + for (var i = 0; i < message.transformationSummaries.length; ++i) + $root.google.privacy.dlp.v2.TransformationSummary.encode(message.transformationSummaries[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TransformationOverview message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.TransformationOverview.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.TransformationOverview + * @static + * @param {google.privacy.dlp.v2.ITransformationOverview} message TransformationOverview message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransformationOverview.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TransformationOverview message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.TransformationOverview + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.TransformationOverview} TransformationOverview + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransformationOverview.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.privacy.dlp.v2.TransformationOverview(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + message.transformedBytes = reader.int64(); + break; + case 3: + if (!(message.transformationSummaries && message.transformationSummaries.length)) + message.transformationSummaries = []; + message.transformationSummaries.push($root.google.privacy.dlp.v2.TransformationSummary.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TransformationOverview message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.TransformationOverview + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.TransformationOverview} TransformationOverview + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransformationOverview.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TransformationOverview message. + * @function verify + * @memberof google.privacy.dlp.v2.TransformationOverview + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TransformationOverview.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.transformedBytes != null && message.hasOwnProperty("transformedBytes")) + if (!$util.isInteger(message.transformedBytes) && !(message.transformedBytes && $util.isInteger(message.transformedBytes.low) && $util.isInteger(message.transformedBytes.high))) + return "transformedBytes: integer|Long expected"; + if (message.transformationSummaries != null && message.hasOwnProperty("transformationSummaries")) { + if (!Array.isArray(message.transformationSummaries)) + return "transformationSummaries: array expected"; + for (var i = 0; i < message.transformationSummaries.length; ++i) { + var error = $root.google.privacy.dlp.v2.TransformationSummary.verify(message.transformationSummaries[i]); + if (error) + return "transformationSummaries." + error; + } + } + return null; + }; + + /** + * Creates a TransformationOverview message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.TransformationOverview + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.TransformationOverview} TransformationOverview + */ + TransformationOverview.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.TransformationOverview) + return object; + var message = new $root.google.privacy.dlp.v2.TransformationOverview(); + if (object.transformedBytes != null) + if ($util.Long) + (message.transformedBytes = $util.Long.fromValue(object.transformedBytes)).unsigned = false; + else if (typeof object.transformedBytes === "string") + message.transformedBytes = parseInt(object.transformedBytes, 10); + else if (typeof object.transformedBytes === "number") + message.transformedBytes = object.transformedBytes; + else if (typeof object.transformedBytes === "object") + message.transformedBytes = new $util.LongBits(object.transformedBytes.low >>> 0, object.transformedBytes.high >>> 0).toNumber(); + if (object.transformationSummaries) { + if (!Array.isArray(object.transformationSummaries)) + throw TypeError(".google.privacy.dlp.v2.TransformationOverview.transformationSummaries: array expected"); + message.transformationSummaries = []; + for (var i = 0; i < object.transformationSummaries.length; ++i) { + if (typeof object.transformationSummaries[i] !== "object") + throw TypeError(".google.privacy.dlp.v2.TransformationOverview.transformationSummaries: object expected"); + message.transformationSummaries[i] = $root.google.privacy.dlp.v2.TransformationSummary.fromObject(object.transformationSummaries[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a TransformationOverview message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.TransformationOverview + * @static + * @param {google.privacy.dlp.v2.TransformationOverview} message TransformationOverview + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TransformationOverview.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.transformationSummaries = []; + if (options.defaults) + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.transformedBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.transformedBytes = options.longs === String ? "0" : 0; + if (message.transformedBytes != null && message.hasOwnProperty("transformedBytes")) + if (typeof message.transformedBytes === "number") + object.transformedBytes = options.longs === String ? String(message.transformedBytes) : message.transformedBytes; + else + object.transformedBytes = options.longs === String ? $util.Long.prototype.toString.call(message.transformedBytes) : options.longs === Number ? new $util.LongBits(message.transformedBytes.low >>> 0, message.transformedBytes.high >>> 0).toNumber() : message.transformedBytes; + if (message.transformationSummaries && message.transformationSummaries.length) { + object.transformationSummaries = []; + for (var j = 0; j < message.transformationSummaries.length; ++j) + object.transformationSummaries[j] = $root.google.privacy.dlp.v2.TransformationSummary.toObject(message.transformationSummaries[j], options); + } + return object; + }; + + /** + * Converts this TransformationOverview to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.TransformationOverview + * @instance + * @returns {Object.} JSON object + */ + TransformationOverview.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TransformationOverview; + })(); + + v2.TransformationSummary = (function() { + + /** + * Properties of a TransformationSummary. + * @memberof google.privacy.dlp.v2 + * @interface ITransformationSummary + * @property {google.privacy.dlp.v2.IInfoType|null} [infoType] TransformationSummary infoType + * @property {google.privacy.dlp.v2.IFieldId|null} [field] TransformationSummary field + * @property {google.privacy.dlp.v2.IPrimitiveTransformation|null} [transformation] TransformationSummary transformation + * @property {Array.|null} [fieldTransformations] TransformationSummary fieldTransformations + * @property {google.privacy.dlp.v2.IRecordSuppression|null} [recordSuppress] TransformationSummary recordSuppress + * @property {Array.|null} [results] TransformationSummary results + * @property {number|Long|null} [transformedBytes] TransformationSummary transformedBytes + */ + + /** + * Constructs a new TransformationSummary. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents a TransformationSummary. + * @implements ITransformationSummary + * @constructor + * @param {google.privacy.dlp.v2.ITransformationSummary=} [properties] Properties to set + */ + function TransformationSummary(properties) { + this.fieldTransformations = []; + this.results = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TransformationSummary infoType. + * @member {google.privacy.dlp.v2.IInfoType|null|undefined} infoType + * @memberof google.privacy.dlp.v2.TransformationSummary + * @instance + */ + TransformationSummary.prototype.infoType = null; + + /** + * TransformationSummary field. + * @member {google.privacy.dlp.v2.IFieldId|null|undefined} field + * @memberof google.privacy.dlp.v2.TransformationSummary + * @instance + */ + TransformationSummary.prototype.field = null; + + /** + * TransformationSummary transformation. + * @member {google.privacy.dlp.v2.IPrimitiveTransformation|null|undefined} transformation + * @memberof google.privacy.dlp.v2.TransformationSummary + * @instance + */ + TransformationSummary.prototype.transformation = null; + + /** + * TransformationSummary fieldTransformations. + * @member {Array.} fieldTransformations + * @memberof google.privacy.dlp.v2.TransformationSummary + * @instance + */ + TransformationSummary.prototype.fieldTransformations = $util.emptyArray; + + /** + * TransformationSummary recordSuppress. + * @member {google.privacy.dlp.v2.IRecordSuppression|null|undefined} recordSuppress + * @memberof google.privacy.dlp.v2.TransformationSummary + * @instance + */ + TransformationSummary.prototype.recordSuppress = null; + + /** + * TransformationSummary results. + * @member {Array.} results + * @memberof google.privacy.dlp.v2.TransformationSummary + * @instance + */ + TransformationSummary.prototype.results = $util.emptyArray; + + /** + * TransformationSummary transformedBytes. + * @member {number|Long} transformedBytes + * @memberof google.privacy.dlp.v2.TransformationSummary + * @instance + */ + TransformationSummary.prototype.transformedBytes = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TransformationSummary instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.TransformationSummary + * @static + * @param {google.privacy.dlp.v2.ITransformationSummary=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.TransformationSummary} TransformationSummary instance + */ + TransformationSummary.create = function create(properties) { + return new TransformationSummary(properties); + }; + + /** + * Encodes the specified TransformationSummary message. Does not implicitly {@link google.privacy.dlp.v2.TransformationSummary.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.TransformationSummary + * @static + * @param {google.privacy.dlp.v2.ITransformationSummary} message TransformationSummary message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransformationSummary.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.infoType != null && Object.hasOwnProperty.call(message, "infoType")) + $root.google.privacy.dlp.v2.InfoType.encode(message.infoType, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.field != null && Object.hasOwnProperty.call(message, "field")) + $root.google.privacy.dlp.v2.FieldId.encode(message.field, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.transformation != null && Object.hasOwnProperty.call(message, "transformation")) + $root.google.privacy.dlp.v2.PrimitiveTransformation.encode(message.transformation, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.results != null && message.results.length) + for (var i = 0; i < message.results.length; ++i) + $root.google.privacy.dlp.v2.TransformationSummary.SummaryResult.encode(message.results[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.fieldTransformations != null && message.fieldTransformations.length) + for (var i = 0; i < message.fieldTransformations.length; ++i) + $root.google.privacy.dlp.v2.FieldTransformation.encode(message.fieldTransformations[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.recordSuppress != null && Object.hasOwnProperty.call(message, "recordSuppress")) + $root.google.privacy.dlp.v2.RecordSuppression.encode(message.recordSuppress, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.transformedBytes != null && Object.hasOwnProperty.call(message, "transformedBytes")) + writer.uint32(/* id 7, wireType 0 =*/56).int64(message.transformedBytes); + return writer; + }; + + /** + * Encodes the specified TransformationSummary message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.TransformationSummary.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.TransformationSummary + * @static + * @param {google.privacy.dlp.v2.ITransformationSummary} message TransformationSummary message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransformationSummary.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TransformationSummary message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.TransformationSummary + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.TransformationSummary} TransformationSummary + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransformationSummary.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.privacy.dlp.v2.TransformationSummary(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.infoType = $root.google.privacy.dlp.v2.InfoType.decode(reader, reader.uint32()); + break; + case 2: + message.field = $root.google.privacy.dlp.v2.FieldId.decode(reader, reader.uint32()); + break; + case 3: + message.transformation = $root.google.privacy.dlp.v2.PrimitiveTransformation.decode(reader, reader.uint32()); + break; + case 5: + if (!(message.fieldTransformations && message.fieldTransformations.length)) + message.fieldTransformations = []; + message.fieldTransformations.push($root.google.privacy.dlp.v2.FieldTransformation.decode(reader, reader.uint32())); + break; + case 6: + message.recordSuppress = $root.google.privacy.dlp.v2.RecordSuppression.decode(reader, reader.uint32()); + break; + case 4: + if (!(message.results && message.results.length)) + message.results = []; + message.results.push($root.google.privacy.dlp.v2.TransformationSummary.SummaryResult.decode(reader, reader.uint32())); + break; + case 7: + message.transformedBytes = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TransformationSummary message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.TransformationSummary + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.TransformationSummary} TransformationSummary + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransformationSummary.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TransformationSummary message. + * @function verify + * @memberof google.privacy.dlp.v2.TransformationSummary + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TransformationSummary.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.infoType != null && message.hasOwnProperty("infoType")) { + var error = $root.google.privacy.dlp.v2.InfoType.verify(message.infoType); + if (error) + return "infoType." + error; + } + if (message.field != null && message.hasOwnProperty("field")) { + var error = $root.google.privacy.dlp.v2.FieldId.verify(message.field); + if (error) + return "field." + error; + } + if (message.transformation != null && message.hasOwnProperty("transformation")) { + var error = $root.google.privacy.dlp.v2.PrimitiveTransformation.verify(message.transformation); + if (error) + return "transformation." + error; + } + if (message.fieldTransformations != null && message.hasOwnProperty("fieldTransformations")) { + if (!Array.isArray(message.fieldTransformations)) + return "fieldTransformations: array expected"; + for (var i = 0; i < message.fieldTransformations.length; ++i) { + var error = $root.google.privacy.dlp.v2.FieldTransformation.verify(message.fieldTransformations[i]); + if (error) + return "fieldTransformations." + error; + } + } + if (message.recordSuppress != null && message.hasOwnProperty("recordSuppress")) { + var error = $root.google.privacy.dlp.v2.RecordSuppression.verify(message.recordSuppress); + if (error) + return "recordSuppress." + error; + } + if (message.results != null && message.hasOwnProperty("results")) { + if (!Array.isArray(message.results)) + return "results: array expected"; + for (var i = 0; i < message.results.length; ++i) { + var error = $root.google.privacy.dlp.v2.TransformationSummary.SummaryResult.verify(message.results[i]); + if (error) + return "results." + error; + } + } + if (message.transformedBytes != null && message.hasOwnProperty("transformedBytes")) + if (!$util.isInteger(message.transformedBytes) && !(message.transformedBytes && $util.isInteger(message.transformedBytes.low) && $util.isInteger(message.transformedBytes.high))) + return "transformedBytes: integer|Long expected"; + return null; + }; + + /** + * Creates a TransformationSummary message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.TransformationSummary + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.TransformationSummary} TransformationSummary + */ + TransformationSummary.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.TransformationSummary) + return object; + var message = new $root.google.privacy.dlp.v2.TransformationSummary(); + if (object.infoType != null) { + if (typeof object.infoType !== "object") + throw TypeError(".google.privacy.dlp.v2.TransformationSummary.infoType: object expected"); + message.infoType = $root.google.privacy.dlp.v2.InfoType.fromObject(object.infoType); + } + if (object.field != null) { + if (typeof object.field !== "object") + throw TypeError(".google.privacy.dlp.v2.TransformationSummary.field: object expected"); + message.field = $root.google.privacy.dlp.v2.FieldId.fromObject(object.field); + } + if (object.transformation != null) { + if (typeof object.transformation !== "object") + throw TypeError(".google.privacy.dlp.v2.TransformationSummary.transformation: object expected"); + message.transformation = $root.google.privacy.dlp.v2.PrimitiveTransformation.fromObject(object.transformation); + } + if (object.fieldTransformations) { + if (!Array.isArray(object.fieldTransformations)) + throw TypeError(".google.privacy.dlp.v2.TransformationSummary.fieldTransformations: array expected"); + message.fieldTransformations = []; + for (var i = 0; i < object.fieldTransformations.length; ++i) { + if (typeof object.fieldTransformations[i] !== "object") + throw TypeError(".google.privacy.dlp.v2.TransformationSummary.fieldTransformations: object expected"); + message.fieldTransformations[i] = $root.google.privacy.dlp.v2.FieldTransformation.fromObject(object.fieldTransformations[i]); + } + } + if (object.recordSuppress != null) { + if (typeof object.recordSuppress !== "object") + throw TypeError(".google.privacy.dlp.v2.TransformationSummary.recordSuppress: object expected"); + message.recordSuppress = $root.google.privacy.dlp.v2.RecordSuppression.fromObject(object.recordSuppress); + } + if (object.results) { + if (!Array.isArray(object.results)) + throw TypeError(".google.privacy.dlp.v2.TransformationSummary.results: array expected"); + message.results = []; + for (var i = 0; i < object.results.length; ++i) { + if (typeof object.results[i] !== "object") + throw TypeError(".google.privacy.dlp.v2.TransformationSummary.results: object expected"); + message.results[i] = $root.google.privacy.dlp.v2.TransformationSummary.SummaryResult.fromObject(object.results[i]); + } + } + if (object.transformedBytes != null) + if ($util.Long) + (message.transformedBytes = $util.Long.fromValue(object.transformedBytes)).unsigned = false; + else if (typeof object.transformedBytes === "string") + message.transformedBytes = parseInt(object.transformedBytes, 10); + else if (typeof object.transformedBytes === "number") + message.transformedBytes = object.transformedBytes; + else if (typeof object.transformedBytes === "object") + message.transformedBytes = new $util.LongBits(object.transformedBytes.low >>> 0, object.transformedBytes.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a TransformationSummary message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.TransformationSummary + * @static + * @param {google.privacy.dlp.v2.TransformationSummary} message TransformationSummary + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TransformationSummary.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.results = []; + object.fieldTransformations = []; + } + if (options.defaults) { + object.infoType = null; + object.field = null; + object.transformation = null; + object.recordSuppress = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.transformedBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.transformedBytes = options.longs === String ? "0" : 0; + } + if (message.infoType != null && message.hasOwnProperty("infoType")) + object.infoType = $root.google.privacy.dlp.v2.InfoType.toObject(message.infoType, options); + if (message.field != null && message.hasOwnProperty("field")) + object.field = $root.google.privacy.dlp.v2.FieldId.toObject(message.field, options); + if (message.transformation != null && message.hasOwnProperty("transformation")) + object.transformation = $root.google.privacy.dlp.v2.PrimitiveTransformation.toObject(message.transformation, options); + if (message.results && message.results.length) { + object.results = []; + for (var j = 0; j < message.results.length; ++j) + object.results[j] = $root.google.privacy.dlp.v2.TransformationSummary.SummaryResult.toObject(message.results[j], options); + } + if (message.fieldTransformations && message.fieldTransformations.length) { + object.fieldTransformations = []; + for (var j = 0; j < message.fieldTransformations.length; ++j) + object.fieldTransformations[j] = $root.google.privacy.dlp.v2.FieldTransformation.toObject(message.fieldTransformations[j], options); + } + if (message.recordSuppress != null && message.hasOwnProperty("recordSuppress")) + object.recordSuppress = $root.google.privacy.dlp.v2.RecordSuppression.toObject(message.recordSuppress, options); + if (message.transformedBytes != null && message.hasOwnProperty("transformedBytes")) + if (typeof message.transformedBytes === "number") + object.transformedBytes = options.longs === String ? String(message.transformedBytes) : message.transformedBytes; + else + object.transformedBytes = options.longs === String ? $util.Long.prototype.toString.call(message.transformedBytes) : options.longs === Number ? new $util.LongBits(message.transformedBytes.low >>> 0, message.transformedBytes.high >>> 0).toNumber() : message.transformedBytes; + return object; + }; + + /** + * Converts this TransformationSummary to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.TransformationSummary + * @instance + * @returns {Object.} JSON object + */ + TransformationSummary.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + TransformationSummary.SummaryResult = (function() { + + /** + * Properties of a SummaryResult. + * @memberof google.privacy.dlp.v2.TransformationSummary + * @interface ISummaryResult + * @property {number|Long|null} [count] SummaryResult count + * @property {google.privacy.dlp.v2.TransformationSummary.TransformationResultCode|null} [code] SummaryResult code + * @property {string|null} [details] SummaryResult details + */ + + /** + * Constructs a new SummaryResult. + * @memberof google.privacy.dlp.v2.TransformationSummary + * @classdesc Represents a SummaryResult. + * @implements ISummaryResult + * @constructor + * @param {google.privacy.dlp.v2.TransformationSummary.ISummaryResult=} [properties] Properties to set + */ + function SummaryResult(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SummaryResult count. + * @member {number|Long} count + * @memberof google.privacy.dlp.v2.TransformationSummary.SummaryResult + * @instance + */ + SummaryResult.prototype.count = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * SummaryResult code. + * @member {google.privacy.dlp.v2.TransformationSummary.TransformationResultCode} code + * @memberof google.privacy.dlp.v2.TransformationSummary.SummaryResult + * @instance + */ + SummaryResult.prototype.code = 0; + + /** + * SummaryResult details. + * @member {string} details + * @memberof google.privacy.dlp.v2.TransformationSummary.SummaryResult + * @instance + */ + SummaryResult.prototype.details = ""; + + /** + * Creates a new SummaryResult instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.TransformationSummary.SummaryResult + * @static + * @param {google.privacy.dlp.v2.TransformationSummary.ISummaryResult=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.TransformationSummary.SummaryResult} SummaryResult instance + */ + SummaryResult.create = function create(properties) { + return new SummaryResult(properties); + }; + + /** + * Encodes the specified SummaryResult message. Does not implicitly {@link google.privacy.dlp.v2.TransformationSummary.SummaryResult.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.TransformationSummary.SummaryResult + * @static + * @param {google.privacy.dlp.v2.TransformationSummary.ISummaryResult} message SummaryResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SummaryResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.count != null && Object.hasOwnProperty.call(message, "count")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.count); + if (message.code != null && Object.hasOwnProperty.call(message, "code")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.code); + if (message.details != null && Object.hasOwnProperty.call(message, "details")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.details); + return writer; + }; + + /** + * Encodes the specified SummaryResult message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.TransformationSummary.SummaryResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.TransformationSummary.SummaryResult + * @static + * @param {google.privacy.dlp.v2.TransformationSummary.ISummaryResult} message SummaryResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SummaryResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SummaryResult message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.TransformationSummary.SummaryResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.TransformationSummary.SummaryResult} SummaryResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SummaryResult.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.privacy.dlp.v2.TransformationSummary.SummaryResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.count = reader.int64(); + break; + case 2: + message.code = reader.int32(); + break; + case 3: + message.details = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SummaryResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.TransformationSummary.SummaryResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.TransformationSummary.SummaryResult} SummaryResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SummaryResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SummaryResult message. + * @function verify + * @memberof google.privacy.dlp.v2.TransformationSummary.SummaryResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SummaryResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.count != null && message.hasOwnProperty("count")) + if (!$util.isInteger(message.count) && !(message.count && $util.isInteger(message.count.low) && $util.isInteger(message.count.high))) + return "count: integer|Long expected"; + if (message.code != null && message.hasOwnProperty("code")) + switch (message.code) { + default: + return "code: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.details != null && message.hasOwnProperty("details")) + if (!$util.isString(message.details)) + return "details: string expected"; + return null; + }; + + /** + * Creates a SummaryResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.TransformationSummary.SummaryResult + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.TransformationSummary.SummaryResult} SummaryResult + */ + SummaryResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.TransformationSummary.SummaryResult) + return object; + var message = new $root.google.privacy.dlp.v2.TransformationSummary.SummaryResult(); + if (object.count != null) + if ($util.Long) + (message.count = $util.Long.fromValue(object.count)).unsigned = false; + else if (typeof object.count === "string") + message.count = parseInt(object.count, 10); + else if (typeof object.count === "number") + message.count = object.count; + else if (typeof object.count === "object") + message.count = new $util.LongBits(object.count.low >>> 0, object.count.high >>> 0).toNumber(); + switch (object.code) { + case "TRANSFORMATION_RESULT_CODE_UNSPECIFIED": + case 0: + message.code = 0; + break; + case "SUCCESS": + case 1: + message.code = 1; + break; + case "ERROR": + case 2: + message.code = 2; + break; + } + if (object.details != null) + message.details = String(object.details); + return message; + }; + + /** + * Creates a plain object from a SummaryResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.TransformationSummary.SummaryResult + * @static + * @param {google.privacy.dlp.v2.TransformationSummary.SummaryResult} message SummaryResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SummaryResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.count = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.count = options.longs === String ? "0" : 0; + object.code = options.enums === String ? "TRANSFORMATION_RESULT_CODE_UNSPECIFIED" : 0; + object.details = ""; + } + if (message.count != null && message.hasOwnProperty("count")) + if (typeof message.count === "number") + object.count = options.longs === String ? String(message.count) : message.count; + else + object.count = options.longs === String ? $util.Long.prototype.toString.call(message.count) : options.longs === Number ? new $util.LongBits(message.count.low >>> 0, message.count.high >>> 0).toNumber() : message.count; + if (message.code != null && message.hasOwnProperty("code")) + object.code = options.enums === String ? $root.google.privacy.dlp.v2.TransformationSummary.TransformationResultCode[message.code] : message.code; + if (message.details != null && message.hasOwnProperty("details")) + object.details = message.details; + return object; + }; + + /** + * Converts this SummaryResult to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.TransformationSummary.SummaryResult + * @instance + * @returns {Object.} JSON object + */ + SummaryResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + 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; + })(); + + v2.Schedule = (function() { + + /** + * Properties of a Schedule. + * @memberof google.privacy.dlp.v2 + * @interface ISchedule + * @property {google.protobuf.IDuration|null} [recurrencePeriodDuration] Schedule recurrencePeriodDuration + */ + + /** + * Constructs a new Schedule. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents a Schedule. + * @implements ISchedule + * @constructor + * @param {google.privacy.dlp.v2.ISchedule=} [properties] Properties to set + */ + function Schedule(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Schedule recurrencePeriodDuration. + * @member {google.protobuf.IDuration|null|undefined} recurrencePeriodDuration + * @memberof google.privacy.dlp.v2.Schedule + * @instance + */ + Schedule.prototype.recurrencePeriodDuration = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Schedule option. + * @member {"recurrencePeriodDuration"|undefined} option + * @memberof google.privacy.dlp.v2.Schedule + * @instance + */ + Object.defineProperty(Schedule.prototype, "option", { + get: $util.oneOfGetter($oneOfFields = ["recurrencePeriodDuration"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Schedule instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.Schedule + * @static + * @param {google.privacy.dlp.v2.ISchedule=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.Schedule} Schedule instance + */ + Schedule.create = function create(properties) { + return new Schedule(properties); + }; + + /** + * Encodes the specified Schedule message. Does not implicitly {@link google.privacy.dlp.v2.Schedule.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.Schedule + * @static + * @param {google.privacy.dlp.v2.ISchedule} message Schedule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Schedule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.recurrencePeriodDuration != null && Object.hasOwnProperty.call(message, "recurrencePeriodDuration")) + $root.google.protobuf.Duration.encode(message.recurrencePeriodDuration, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Schedule message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.Schedule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.Schedule + * @static + * @param {google.privacy.dlp.v2.ISchedule} message Schedule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Schedule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Schedule message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.Schedule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.Schedule} Schedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Schedule.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.privacy.dlp.v2.Schedule(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.recurrencePeriodDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Schedule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.Schedule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.Schedule} Schedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Schedule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Schedule message. + * @function verify + * @memberof google.privacy.dlp.v2.Schedule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Schedule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.recurrencePeriodDuration != null && message.hasOwnProperty("recurrencePeriodDuration")) { + properties.option = 1; + { + var error = $root.google.protobuf.Duration.verify(message.recurrencePeriodDuration); + if (error) + return "recurrencePeriodDuration." + error; + } + } + return null; + }; + + /** + * Creates a Schedule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.Schedule + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.Schedule} Schedule + */ + Schedule.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.Schedule) + return object; + var message = new $root.google.privacy.dlp.v2.Schedule(); + if (object.recurrencePeriodDuration != null) { + if (typeof object.recurrencePeriodDuration !== "object") + throw TypeError(".google.privacy.dlp.v2.Schedule.recurrencePeriodDuration: object expected"); + message.recurrencePeriodDuration = $root.google.protobuf.Duration.fromObject(object.recurrencePeriodDuration); + } + return message; + }; + + /** + * Creates a plain object from a Schedule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.Schedule + * @static + * @param {google.privacy.dlp.v2.Schedule} message Schedule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Schedule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.recurrencePeriodDuration != null && message.hasOwnProperty("recurrencePeriodDuration")) { + object.recurrencePeriodDuration = $root.google.protobuf.Duration.toObject(message.recurrencePeriodDuration, options); + if (options.oneofs) + object.option = "recurrencePeriodDuration"; + } + return object; + }; + + /** + * Converts this Schedule to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.Schedule + * @instance + * @returns {Object.} JSON object + */ + Schedule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Schedule; + })(); + + v2.Manual = (function() { + + /** + * Properties of a Manual. + * @memberof google.privacy.dlp.v2 + * @interface IManual + */ + + /** + * Constructs a new Manual. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents a Manual. + * @implements IManual + * @constructor + * @param {google.privacy.dlp.v2.IManual=} [properties] Properties to set + */ + function Manual(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new Manual instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.Manual + * @static + * @param {google.privacy.dlp.v2.IManual=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.Manual} Manual instance + */ + Manual.create = function create(properties) { + return new Manual(properties); + }; + + /** + * Encodes the specified Manual message. Does not implicitly {@link google.privacy.dlp.v2.Manual.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.Manual + * @static + * @param {google.privacy.dlp.v2.IManual} message Manual message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Manual.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified Manual message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.Manual.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.Manual + * @static + * @param {google.privacy.dlp.v2.IManual} message Manual message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Manual.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Manual message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.Manual + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.Manual} Manual + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Manual.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.privacy.dlp.v2.Manual(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Manual message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.Manual + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.Manual} Manual + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Manual.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Manual message. + * @function verify + * @memberof google.privacy.dlp.v2.Manual + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Manual.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a Manual message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.Manual + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.Manual} Manual + */ + Manual.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.Manual) + return object; + return new $root.google.privacy.dlp.v2.Manual(); + }; + + /** + * Creates a plain object from a Manual message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.Manual + * @static + * @param {google.privacy.dlp.v2.Manual} message Manual + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Manual.toObject = function toObject() { + return {}; + }; + + /** + * Converts this Manual to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.Manual + * @instance + * @returns {Object.} JSON object + */ + Manual.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Manual; + })(); + + v2.InspectTemplate = (function() { + + /** + * Properties of an InspectTemplate. + * @memberof google.privacy.dlp.v2 + * @interface IInspectTemplate + * @property {string|null} [name] InspectTemplate name + * @property {string|null} [displayName] InspectTemplate displayName + * @property {string|null} [description] InspectTemplate description + * @property {google.protobuf.ITimestamp|null} [createTime] InspectTemplate createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] InspectTemplate updateTime + * @property {google.privacy.dlp.v2.IInspectConfig|null} [inspectConfig] InspectTemplate inspectConfig + */ + + /** + * Constructs a new InspectTemplate. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents an InspectTemplate. + * @implements IInspectTemplate + * @constructor + * @param {google.privacy.dlp.v2.IInspectTemplate=} [properties] Properties to set + */ + function InspectTemplate(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InspectTemplate name. + * @member {string} name + * @memberof google.privacy.dlp.v2.InspectTemplate + * @instance + */ + InspectTemplate.prototype.name = ""; + + /** + * InspectTemplate displayName. + * @member {string} displayName + * @memberof google.privacy.dlp.v2.InspectTemplate + * @instance + */ + InspectTemplate.prototype.displayName = ""; + + /** + * InspectTemplate description. + * @member {string} description + * @memberof google.privacy.dlp.v2.InspectTemplate + * @instance + */ + InspectTemplate.prototype.description = ""; + + /** + * InspectTemplate createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.privacy.dlp.v2.InspectTemplate + * @instance + */ + InspectTemplate.prototype.createTime = null; + + /** + * InspectTemplate updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.privacy.dlp.v2.InspectTemplate + * @instance + */ + InspectTemplate.prototype.updateTime = null; + + /** + * InspectTemplate inspectConfig. + * @member {google.privacy.dlp.v2.IInspectConfig|null|undefined} inspectConfig + * @memberof google.privacy.dlp.v2.InspectTemplate + * @instance + */ + InspectTemplate.prototype.inspectConfig = null; + + /** + * Creates a new InspectTemplate instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.InspectTemplate + * @static + * @param {google.privacy.dlp.v2.IInspectTemplate=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.InspectTemplate} InspectTemplate instance + */ + InspectTemplate.create = function create(properties) { + return new InspectTemplate(properties); + }; + + /** + * Encodes the specified InspectTemplate message. Does not implicitly {@link google.privacy.dlp.v2.InspectTemplate.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.InspectTemplate + * @static + * @param {google.privacy.dlp.v2.IInspectTemplate} message InspectTemplate message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InspectTemplate.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.inspectConfig != null && Object.hasOwnProperty.call(message, "inspectConfig")) + $root.google.privacy.dlp.v2.InspectConfig.encode(message.inspectConfig, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified InspectTemplate message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.InspectTemplate.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.InspectTemplate + * @static + * @param {google.privacy.dlp.v2.IInspectTemplate} message InspectTemplate message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InspectTemplate.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InspectTemplate message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.InspectTemplate + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.InspectTemplate} InspectTemplate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InspectTemplate.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.privacy.dlp.v2.InspectTemplate(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.displayName = reader.string(); + break; + case 3: + message.description = reader.string(); + break; + case 4: + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 5: + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 6: + message.inspectConfig = $root.google.privacy.dlp.v2.InspectConfig.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InspectTemplate message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.InspectTemplate + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.InspectTemplate} InspectTemplate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InspectTemplate.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InspectTemplate message. + * @function verify + * @memberof google.privacy.dlp.v2.InspectTemplate + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InspectTemplate.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.inspectConfig != null && message.hasOwnProperty("inspectConfig")) { + var error = $root.google.privacy.dlp.v2.InspectConfig.verify(message.inspectConfig); + if (error) + return "inspectConfig." + error; + } + return null; + }; + + /** + * Creates an InspectTemplate message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.InspectTemplate + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.InspectTemplate} InspectTemplate + */ + InspectTemplate.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.InspectTemplate) + return object; + var message = new $root.google.privacy.dlp.v2.InspectTemplate(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.description != null) + message.description = String(object.description); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.privacy.dlp.v2.InspectTemplate.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.privacy.dlp.v2.InspectTemplate.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.inspectConfig != null) { + if (typeof object.inspectConfig !== "object") + throw TypeError(".google.privacy.dlp.v2.InspectTemplate.inspectConfig: object expected"); + message.inspectConfig = $root.google.privacy.dlp.v2.InspectConfig.fromObject(object.inspectConfig); + } + return message; + }; + + /** + * Creates a plain object from an InspectTemplate message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.InspectTemplate + * @static + * @param {google.privacy.dlp.v2.InspectTemplate} message InspectTemplate + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InspectTemplate.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.description = ""; + object.createTime = null; + object.updateTime = null; + object.inspectConfig = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.inspectConfig != null && message.hasOwnProperty("inspectConfig")) + object.inspectConfig = $root.google.privacy.dlp.v2.InspectConfig.toObject(message.inspectConfig, options); + return object; + }; + + /** + * Converts this InspectTemplate to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.InspectTemplate + * @instance + * @returns {Object.} JSON object + */ + InspectTemplate.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InspectTemplate; + })(); + + v2.DeidentifyTemplate = (function() { + + /** + * Properties of a DeidentifyTemplate. + * @memberof google.privacy.dlp.v2 + * @interface IDeidentifyTemplate + * @property {string|null} [name] DeidentifyTemplate name + * @property {string|null} [displayName] DeidentifyTemplate displayName + * @property {string|null} [description] DeidentifyTemplate description + * @property {google.protobuf.ITimestamp|null} [createTime] DeidentifyTemplate createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] DeidentifyTemplate updateTime + * @property {google.privacy.dlp.v2.IDeidentifyConfig|null} [deidentifyConfig] DeidentifyTemplate deidentifyConfig + */ + + /** + * Constructs a new DeidentifyTemplate. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents a DeidentifyTemplate. + * @implements IDeidentifyTemplate + * @constructor + * @param {google.privacy.dlp.v2.IDeidentifyTemplate=} [properties] Properties to set + */ + function DeidentifyTemplate(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeidentifyTemplate name. + * @member {string} name + * @memberof google.privacy.dlp.v2.DeidentifyTemplate + * @instance + */ + DeidentifyTemplate.prototype.name = ""; + + /** + * DeidentifyTemplate displayName. + * @member {string} displayName + * @memberof google.privacy.dlp.v2.DeidentifyTemplate + * @instance + */ + DeidentifyTemplate.prototype.displayName = ""; + + /** + * DeidentifyTemplate description. + * @member {string} description + * @memberof google.privacy.dlp.v2.DeidentifyTemplate + * @instance + */ + DeidentifyTemplate.prototype.description = ""; + + /** + * DeidentifyTemplate createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.privacy.dlp.v2.DeidentifyTemplate + * @instance + */ + DeidentifyTemplate.prototype.createTime = null; + + /** + * DeidentifyTemplate updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.privacy.dlp.v2.DeidentifyTemplate + * @instance + */ + DeidentifyTemplate.prototype.updateTime = null; + + /** + * DeidentifyTemplate deidentifyConfig. + * @member {google.privacy.dlp.v2.IDeidentifyConfig|null|undefined} deidentifyConfig + * @memberof google.privacy.dlp.v2.DeidentifyTemplate + * @instance + */ + DeidentifyTemplate.prototype.deidentifyConfig = null; + + /** + * Creates a new DeidentifyTemplate instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.DeidentifyTemplate + * @static + * @param {google.privacy.dlp.v2.IDeidentifyTemplate=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.DeidentifyTemplate} DeidentifyTemplate instance + */ + DeidentifyTemplate.create = function create(properties) { + return new DeidentifyTemplate(properties); + }; + + /** + * Encodes the specified DeidentifyTemplate message. Does not implicitly {@link google.privacy.dlp.v2.DeidentifyTemplate.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.DeidentifyTemplate + * @static + * @param {google.privacy.dlp.v2.IDeidentifyTemplate} message DeidentifyTemplate message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeidentifyTemplate.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.deidentifyConfig != null && Object.hasOwnProperty.call(message, "deidentifyConfig")) + $root.google.privacy.dlp.v2.DeidentifyConfig.encode(message.deidentifyConfig, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DeidentifyTemplate message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.DeidentifyTemplate.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.DeidentifyTemplate + * @static + * @param {google.privacy.dlp.v2.IDeidentifyTemplate} message DeidentifyTemplate message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeidentifyTemplate.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeidentifyTemplate message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.DeidentifyTemplate + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.DeidentifyTemplate} DeidentifyTemplate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeidentifyTemplate.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.privacy.dlp.v2.DeidentifyTemplate(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.displayName = reader.string(); + break; + case 3: + message.description = reader.string(); + break; + case 4: + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 5: + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 6: + message.deidentifyConfig = $root.google.privacy.dlp.v2.DeidentifyConfig.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeidentifyTemplate message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.DeidentifyTemplate + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.DeidentifyTemplate} DeidentifyTemplate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeidentifyTemplate.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeidentifyTemplate message. + * @function verify + * @memberof google.privacy.dlp.v2.DeidentifyTemplate + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeidentifyTemplate.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.deidentifyConfig != null && message.hasOwnProperty("deidentifyConfig")) { + var error = $root.google.privacy.dlp.v2.DeidentifyConfig.verify(message.deidentifyConfig); + if (error) + return "deidentifyConfig." + error; + } + return null; + }; + + /** + * Creates a DeidentifyTemplate message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.DeidentifyTemplate + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.DeidentifyTemplate} DeidentifyTemplate + */ + DeidentifyTemplate.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.DeidentifyTemplate) + return object; + var message = new $root.google.privacy.dlp.v2.DeidentifyTemplate(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.description != null) + message.description = String(object.description); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.privacy.dlp.v2.DeidentifyTemplate.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.privacy.dlp.v2.DeidentifyTemplate.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.deidentifyConfig != null) { + if (typeof object.deidentifyConfig !== "object") + throw TypeError(".google.privacy.dlp.v2.DeidentifyTemplate.deidentifyConfig: object expected"); + message.deidentifyConfig = $root.google.privacy.dlp.v2.DeidentifyConfig.fromObject(object.deidentifyConfig); + } + return message; + }; + + /** + * Creates a plain object from a DeidentifyTemplate message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.DeidentifyTemplate + * @static + * @param {google.privacy.dlp.v2.DeidentifyTemplate} message DeidentifyTemplate + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeidentifyTemplate.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.description = ""; + object.createTime = null; + object.updateTime = null; + object.deidentifyConfig = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.deidentifyConfig != null && message.hasOwnProperty("deidentifyConfig")) + object.deidentifyConfig = $root.google.privacy.dlp.v2.DeidentifyConfig.toObject(message.deidentifyConfig, options); + return object; + }; + + /** + * Converts this DeidentifyTemplate to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.DeidentifyTemplate + * @instance + * @returns {Object.} JSON object + */ + DeidentifyTemplate.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeidentifyTemplate; + })(); + + v2.Error = (function() { + + /** + * Properties of an Error. + * @memberof google.privacy.dlp.v2 + * @interface IError + * @property {google.rpc.IStatus|null} [details] Error details + * @property {Array.|null} [timestamps] Error timestamps + */ + + /** + * Constructs a new Error. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents an Error. + * @implements IError + * @constructor + * @param {google.privacy.dlp.v2.IError=} [properties] Properties to set + */ + function Error(properties) { + this.timestamps = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Error details. + * @member {google.rpc.IStatus|null|undefined} details + * @memberof google.privacy.dlp.v2.Error + * @instance + */ + Error.prototype.details = null; + + /** + * Error timestamps. + * @member {Array.} timestamps + * @memberof google.privacy.dlp.v2.Error + * @instance + */ + Error.prototype.timestamps = $util.emptyArray; + + /** + * Creates a new Error instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.Error + * @static + * @param {google.privacy.dlp.v2.IError=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.Error} Error instance + */ + Error.create = function create(properties) { + return new Error(properties); + }; + + /** + * Encodes the specified Error message. Does not implicitly {@link google.privacy.dlp.v2.Error.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.Error + * @static + * @param {google.privacy.dlp.v2.IError} message Error message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Error.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.details != null && Object.hasOwnProperty.call(message, "details")) + $root.google.rpc.Status.encode(message.details, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.timestamps != null && message.timestamps.length) + for (var i = 0; i < message.timestamps.length; ++i) + $root.google.protobuf.Timestamp.encode(message.timestamps[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Error message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.Error.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.Error + * @static + * @param {google.privacy.dlp.v2.IError} message Error message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Error.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Error message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.Error + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.Error} Error + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Error.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.privacy.dlp.v2.Error(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.details = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + case 2: + if (!(message.timestamps && message.timestamps.length)) + message.timestamps = []; + message.timestamps.push($root.google.protobuf.Timestamp.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Error message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.Error + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.Error} Error + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Error.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Error message. + * @function verify + * @memberof google.privacy.dlp.v2.Error + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Error.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.details != null && message.hasOwnProperty("details")) { + var error = $root.google.rpc.Status.verify(message.details); + if (error) + return "details." + error; + } + if (message.timestamps != null && message.hasOwnProperty("timestamps")) { + if (!Array.isArray(message.timestamps)) + return "timestamps: array expected"; + for (var i = 0; i < message.timestamps.length; ++i) { + var error = $root.google.protobuf.Timestamp.verify(message.timestamps[i]); + if (error) + return "timestamps." + error; + } + } + return null; + }; + + /** + * Creates an Error message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.Error + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.Error} Error + */ + Error.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.Error) + return object; + var message = new $root.google.privacy.dlp.v2.Error(); + if (object.details != null) { + if (typeof object.details !== "object") + throw TypeError(".google.privacy.dlp.v2.Error.details: object expected"); + message.details = $root.google.rpc.Status.fromObject(object.details); + } + if (object.timestamps) { + if (!Array.isArray(object.timestamps)) + throw TypeError(".google.privacy.dlp.v2.Error.timestamps: array expected"); + message.timestamps = []; + for (var i = 0; i < object.timestamps.length; ++i) { + if (typeof object.timestamps[i] !== "object") + throw TypeError(".google.privacy.dlp.v2.Error.timestamps: object expected"); + message.timestamps[i] = $root.google.protobuf.Timestamp.fromObject(object.timestamps[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an Error message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.Error + * @static + * @param {google.privacy.dlp.v2.Error} message Error + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Error.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.timestamps = []; + if (options.defaults) + object.details = null; + if (message.details != null && message.hasOwnProperty("details")) + object.details = $root.google.rpc.Status.toObject(message.details, options); + if (message.timestamps && message.timestamps.length) { + object.timestamps = []; + for (var j = 0; j < message.timestamps.length; ++j) + object.timestamps[j] = $root.google.protobuf.Timestamp.toObject(message.timestamps[j], options); + } + return object; + }; + + /** + * Converts this Error to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.Error + * @instance + * @returns {Object.} JSON object + */ + Error.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Error; + })(); + + v2.JobTrigger = (function() { + + /** + * Properties of a JobTrigger. + * @memberof google.privacy.dlp.v2 + * @interface IJobTrigger + * @property {string|null} [name] JobTrigger name + * @property {string|null} [displayName] JobTrigger displayName + * @property {string|null} [description] JobTrigger description + * @property {google.privacy.dlp.v2.IInspectJobConfig|null} [inspectJob] JobTrigger inspectJob + * @property {Array.|null} [triggers] JobTrigger triggers + * @property {Array.|null} [errors] JobTrigger errors + * @property {google.protobuf.ITimestamp|null} [createTime] JobTrigger createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] JobTrigger updateTime + * @property {google.protobuf.ITimestamp|null} [lastRunTime] JobTrigger lastRunTime + * @property {google.privacy.dlp.v2.JobTrigger.Status|null} [status] JobTrigger status + */ + + /** + * Constructs a new JobTrigger. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents a JobTrigger. + * @implements IJobTrigger + * @constructor + * @param {google.privacy.dlp.v2.IJobTrigger=} [properties] Properties to set + */ + function JobTrigger(properties) { + this.triggers = []; + this.errors = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * JobTrigger name. + * @member {string} name + * @memberof google.privacy.dlp.v2.JobTrigger + * @instance + */ + JobTrigger.prototype.name = ""; + + /** + * JobTrigger displayName. + * @member {string} displayName + * @memberof google.privacy.dlp.v2.JobTrigger + * @instance + */ + JobTrigger.prototype.displayName = ""; + + /** + * JobTrigger description. + * @member {string} description + * @memberof google.privacy.dlp.v2.JobTrigger + * @instance + */ + JobTrigger.prototype.description = ""; + + /** + * JobTrigger inspectJob. + * @member {google.privacy.dlp.v2.IInspectJobConfig|null|undefined} inspectJob + * @memberof google.privacy.dlp.v2.JobTrigger + * @instance + */ + JobTrigger.prototype.inspectJob = null; + + /** + * JobTrigger triggers. + * @member {Array.} triggers + * @memberof google.privacy.dlp.v2.JobTrigger + * @instance + */ + JobTrigger.prototype.triggers = $util.emptyArray; + + /** + * JobTrigger errors. + * @member {Array.} errors + * @memberof google.privacy.dlp.v2.JobTrigger + * @instance + */ + JobTrigger.prototype.errors = $util.emptyArray; + + /** + * JobTrigger createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.privacy.dlp.v2.JobTrigger + * @instance + */ + JobTrigger.prototype.createTime = null; + + /** + * JobTrigger updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.privacy.dlp.v2.JobTrigger + * @instance + */ + JobTrigger.prototype.updateTime = null; + + /** + * JobTrigger lastRunTime. + * @member {google.protobuf.ITimestamp|null|undefined} lastRunTime + * @memberof google.privacy.dlp.v2.JobTrigger + * @instance + */ + JobTrigger.prototype.lastRunTime = null; + + /** + * JobTrigger status. + * @member {google.privacy.dlp.v2.JobTrigger.Status} status + * @memberof google.privacy.dlp.v2.JobTrigger + * @instance + */ + JobTrigger.prototype.status = 0; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * JobTrigger job. + * @member {"inspectJob"|undefined} job + * @memberof google.privacy.dlp.v2.JobTrigger + * @instance + */ + Object.defineProperty(JobTrigger.prototype, "job", { + get: $util.oneOfGetter($oneOfFields = ["inspectJob"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new JobTrigger instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.JobTrigger + * @static + * @param {google.privacy.dlp.v2.IJobTrigger=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.JobTrigger} JobTrigger instance + */ + JobTrigger.create = function create(properties) { + return new JobTrigger(properties); + }; + + /** + * Encodes the specified JobTrigger message. Does not implicitly {@link google.privacy.dlp.v2.JobTrigger.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.JobTrigger + * @static + * @param {google.privacy.dlp.v2.IJobTrigger} message JobTrigger message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JobTrigger.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.inspectJob != null && Object.hasOwnProperty.call(message, "inspectJob")) + $root.google.privacy.dlp.v2.InspectJobConfig.encode(message.inspectJob, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.triggers != null && message.triggers.length) + for (var i = 0; i < message.triggers.length; ++i) + $root.google.privacy.dlp.v2.JobTrigger.Trigger.encode(message.triggers[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.errors != null && message.errors.length) + for (var i = 0; i < message.errors.length; ++i) + $root.google.privacy.dlp.v2.Error.encode(message.errors[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.lastRunTime != null && Object.hasOwnProperty.call(message, "lastRunTime")) + $root.google.protobuf.Timestamp.encode(message.lastRunTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.status); + return writer; + }; + + /** + * Encodes the specified JobTrigger message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.JobTrigger.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.JobTrigger + * @static + * @param {google.privacy.dlp.v2.IJobTrigger} message JobTrigger message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JobTrigger.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a JobTrigger message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.JobTrigger + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.JobTrigger} JobTrigger + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JobTrigger.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.privacy.dlp.v2.JobTrigger(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.displayName = reader.string(); + break; + case 3: + message.description = reader.string(); + break; + case 4: + message.inspectJob = $root.google.privacy.dlp.v2.InspectJobConfig.decode(reader, reader.uint32()); + break; + case 5: + if (!(message.triggers && message.triggers.length)) + message.triggers = []; + message.triggers.push($root.google.privacy.dlp.v2.JobTrigger.Trigger.decode(reader, reader.uint32())); + break; + case 6: + if (!(message.errors && message.errors.length)) + message.errors = []; + message.errors.push($root.google.privacy.dlp.v2.Error.decode(reader, reader.uint32())); + break; + case 7: + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 8: + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 9: + message.lastRunTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 10: + message.status = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a JobTrigger message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.JobTrigger + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.JobTrigger} JobTrigger + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JobTrigger.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a JobTrigger message. + * @function verify + * @memberof google.privacy.dlp.v2.JobTrigger + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + JobTrigger.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.inspectJob != null && message.hasOwnProperty("inspectJob")) { + properties.job = 1; + { + var error = $root.google.privacy.dlp.v2.InspectJobConfig.verify(message.inspectJob); + if (error) + return "inspectJob." + error; + } + } + if (message.triggers != null && message.hasOwnProperty("triggers")) { + if (!Array.isArray(message.triggers)) + return "triggers: array expected"; + for (var i = 0; i < message.triggers.length; ++i) { + var error = $root.google.privacy.dlp.v2.JobTrigger.Trigger.verify(message.triggers[i]); + if (error) + return "triggers." + error; + } + } + if (message.errors != null && message.hasOwnProperty("errors")) { + if (!Array.isArray(message.errors)) + return "errors: array expected"; + for (var i = 0; i < message.errors.length; ++i) { + var error = $root.google.privacy.dlp.v2.Error.verify(message.errors[i]); + if (error) + return "errors." + error; + } + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.lastRunTime != null && message.hasOwnProperty("lastRunTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.lastRunTime); + if (error) + return "lastRunTime." + error; + } + if (message.status != null && message.hasOwnProperty("status")) + switch (message.status) { + default: + return "status: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + return null; + }; + + /** + * Creates a JobTrigger message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.JobTrigger + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.JobTrigger} JobTrigger + */ + JobTrigger.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.JobTrigger) + return object; + var message = new $root.google.privacy.dlp.v2.JobTrigger(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.description != null) + message.description = String(object.description); + if (object.inspectJob != null) { + if (typeof object.inspectJob !== "object") + throw TypeError(".google.privacy.dlp.v2.JobTrigger.inspectJob: object expected"); + message.inspectJob = $root.google.privacy.dlp.v2.InspectJobConfig.fromObject(object.inspectJob); + } + if (object.triggers) { + if (!Array.isArray(object.triggers)) + throw TypeError(".google.privacy.dlp.v2.JobTrigger.triggers: array expected"); + message.triggers = []; + for (var i = 0; i < object.triggers.length; ++i) { + if (typeof object.triggers[i] !== "object") + throw TypeError(".google.privacy.dlp.v2.JobTrigger.triggers: object expected"); + message.triggers[i] = $root.google.privacy.dlp.v2.JobTrigger.Trigger.fromObject(object.triggers[i]); + } + } + if (object.errors) { + if (!Array.isArray(object.errors)) + throw TypeError(".google.privacy.dlp.v2.JobTrigger.errors: array expected"); + message.errors = []; + for (var i = 0; i < object.errors.length; ++i) { + if (typeof object.errors[i] !== "object") + throw TypeError(".google.privacy.dlp.v2.JobTrigger.errors: object expected"); + message.errors[i] = $root.google.privacy.dlp.v2.Error.fromObject(object.errors[i]); + } + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.privacy.dlp.v2.JobTrigger.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.privacy.dlp.v2.JobTrigger.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.lastRunTime != null) { + if (typeof object.lastRunTime !== "object") + throw TypeError(".google.privacy.dlp.v2.JobTrigger.lastRunTime: object expected"); + message.lastRunTime = $root.google.protobuf.Timestamp.fromObject(object.lastRunTime); + } + switch (object.status) { + case "STATUS_UNSPECIFIED": + case 0: + message.status = 0; + break; + case "HEALTHY": + case 1: + message.status = 1; + break; + case "PAUSED": + case 2: + message.status = 2; + break; + case "CANCELLED": + case 3: + message.status = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from a JobTrigger message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.JobTrigger + * @static + * @param {google.privacy.dlp.v2.JobTrigger} message JobTrigger + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + JobTrigger.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.triggers = []; + object.errors = []; + } + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.description = ""; + object.createTime = null; + object.updateTime = null; + object.lastRunTime = null; + object.status = options.enums === String ? "STATUS_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.inspectJob != null && message.hasOwnProperty("inspectJob")) { + object.inspectJob = $root.google.privacy.dlp.v2.InspectJobConfig.toObject(message.inspectJob, options); + if (options.oneofs) + object.job = "inspectJob"; + } + if (message.triggers && message.triggers.length) { + object.triggers = []; + for (var j = 0; j < message.triggers.length; ++j) + object.triggers[j] = $root.google.privacy.dlp.v2.JobTrigger.Trigger.toObject(message.triggers[j], options); + } + if (message.errors && message.errors.length) { + object.errors = []; + for (var j = 0; j < message.errors.length; ++j) + object.errors[j] = $root.google.privacy.dlp.v2.Error.toObject(message.errors[j], options); + } + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.lastRunTime != null && message.hasOwnProperty("lastRunTime")) + object.lastRunTime = $root.google.protobuf.Timestamp.toObject(message.lastRunTime, options); + if (message.status != null && message.hasOwnProperty("status")) + object.status = options.enums === String ? $root.google.privacy.dlp.v2.JobTrigger.Status[message.status] : message.status; + return object; + }; + + /** + * Converts this JobTrigger to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.JobTrigger + * @instance + * @returns {Object.} JSON object + */ + JobTrigger.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + JobTrigger.Trigger = (function() { + + /** + * Properties of a Trigger. + * @memberof google.privacy.dlp.v2.JobTrigger + * @interface ITrigger + * @property {google.privacy.dlp.v2.ISchedule|null} [schedule] Trigger schedule + * @property {google.privacy.dlp.v2.IManual|null} [manual] Trigger manual + */ + + /** + * Constructs a new Trigger. + * @memberof google.privacy.dlp.v2.JobTrigger + * @classdesc Represents a Trigger. + * @implements ITrigger + * @constructor + * @param {google.privacy.dlp.v2.JobTrigger.ITrigger=} [properties] Properties to set + */ + function Trigger(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Trigger schedule. + * @member {google.privacy.dlp.v2.ISchedule|null|undefined} schedule + * @memberof google.privacy.dlp.v2.JobTrigger.Trigger + * @instance + */ + Trigger.prototype.schedule = null; + + /** + * Trigger manual. + * @member {google.privacy.dlp.v2.IManual|null|undefined} manual + * @memberof google.privacy.dlp.v2.JobTrigger.Trigger + * @instance + */ + Trigger.prototype.manual = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Trigger trigger. + * @member {"schedule"|"manual"|undefined} trigger + * @memberof google.privacy.dlp.v2.JobTrigger.Trigger + * @instance + */ + Object.defineProperty(Trigger.prototype, "trigger", { + get: $util.oneOfGetter($oneOfFields = ["schedule", "manual"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Trigger instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.JobTrigger.Trigger + * @static + * @param {google.privacy.dlp.v2.JobTrigger.ITrigger=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.JobTrigger.Trigger} Trigger instance + */ + Trigger.create = function create(properties) { + return new Trigger(properties); + }; + + /** + * Encodes the specified Trigger message. Does not implicitly {@link google.privacy.dlp.v2.JobTrigger.Trigger.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.JobTrigger.Trigger + * @static + * @param {google.privacy.dlp.v2.JobTrigger.ITrigger} message Trigger message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Trigger.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.schedule != null && Object.hasOwnProperty.call(message, "schedule")) + $root.google.privacy.dlp.v2.Schedule.encode(message.schedule, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.manual != null && Object.hasOwnProperty.call(message, "manual")) + $root.google.privacy.dlp.v2.Manual.encode(message.manual, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Trigger message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.JobTrigger.Trigger.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.JobTrigger.Trigger + * @static + * @param {google.privacy.dlp.v2.JobTrigger.ITrigger} message Trigger message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Trigger.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Trigger message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.JobTrigger.Trigger + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.JobTrigger.Trigger} Trigger + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Trigger.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.privacy.dlp.v2.JobTrigger.Trigger(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.schedule = $root.google.privacy.dlp.v2.Schedule.decode(reader, reader.uint32()); + break; + case 2: + message.manual = $root.google.privacy.dlp.v2.Manual.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Trigger message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.JobTrigger.Trigger + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.JobTrigger.Trigger} Trigger + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Trigger.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Trigger message. + * @function verify + * @memberof google.privacy.dlp.v2.JobTrigger.Trigger + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Trigger.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.schedule != null && message.hasOwnProperty("schedule")) { + properties.trigger = 1; + { + var error = $root.google.privacy.dlp.v2.Schedule.verify(message.schedule); + if (error) + return "schedule." + error; + } + } + if (message.manual != null && message.hasOwnProperty("manual")) { + if (properties.trigger === 1) + return "trigger: multiple values"; + properties.trigger = 1; + { + var error = $root.google.privacy.dlp.v2.Manual.verify(message.manual); + if (error) + return "manual." + error; + } + } + return null; + }; + + /** + * Creates a Trigger message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.JobTrigger.Trigger + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.JobTrigger.Trigger} Trigger + */ + Trigger.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.JobTrigger.Trigger) + return object; + var message = new $root.google.privacy.dlp.v2.JobTrigger.Trigger(); + if (object.schedule != null) { + if (typeof object.schedule !== "object") + throw TypeError(".google.privacy.dlp.v2.JobTrigger.Trigger.schedule: object expected"); + message.schedule = $root.google.privacy.dlp.v2.Schedule.fromObject(object.schedule); + } + if (object.manual != null) { + if (typeof object.manual !== "object") + throw TypeError(".google.privacy.dlp.v2.JobTrigger.Trigger.manual: object expected"); + message.manual = $root.google.privacy.dlp.v2.Manual.fromObject(object.manual); + } + return message; + }; + + /** + * Creates a plain object from a Trigger message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.JobTrigger.Trigger + * @static + * @param {google.privacy.dlp.v2.JobTrigger.Trigger} message Trigger + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Trigger.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.schedule != null && message.hasOwnProperty("schedule")) { + object.schedule = $root.google.privacy.dlp.v2.Schedule.toObject(message.schedule, options); + if (options.oneofs) + object.trigger = "schedule"; + } + if (message.manual != null && message.hasOwnProperty("manual")) { + object.manual = $root.google.privacy.dlp.v2.Manual.toObject(message.manual, options); + if (options.oneofs) + object.trigger = "manual"; + } + return object; + }; + + /** + * Converts this Trigger to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.JobTrigger.Trigger + * @instance + * @returns {Object.} JSON object + */ + Trigger.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Trigger; + })(); + + /** + * Status enum. + * @name google.privacy.dlp.v2.JobTrigger.Status + * @enum {number} + * @property {number} STATUS_UNSPECIFIED=0 STATUS_UNSPECIFIED value + * @property {number} HEALTHY=1 HEALTHY value + * @property {number} PAUSED=2 PAUSED value + * @property {number} CANCELLED=3 CANCELLED value + */ + JobTrigger.Status = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATUS_UNSPECIFIED"] = 0; + values[valuesById[1] = "HEALTHY"] = 1; + values[valuesById[2] = "PAUSED"] = 2; + values[valuesById[3] = "CANCELLED"] = 3; + return values; + })(); + + return JobTrigger; + })(); + + v2.Action = (function() { + + /** + * Properties of an Action. + * @memberof google.privacy.dlp.v2 + * @interface IAction + * @property {google.privacy.dlp.v2.Action.ISaveFindings|null} [saveFindings] Action saveFindings + * @property {google.privacy.dlp.v2.Action.IPublishToPubSub|null} [pubSub] Action pubSub + * @property {google.privacy.dlp.v2.Action.IPublishSummaryToCscc|null} [publishSummaryToCscc] Action publishSummaryToCscc + * @property {google.privacy.dlp.v2.Action.IPublishFindingsToCloudDataCatalog|null} [publishFindingsToCloudDataCatalog] Action publishFindingsToCloudDataCatalog + * @property {google.privacy.dlp.v2.Action.IJobNotificationEmails|null} [jobNotificationEmails] Action jobNotificationEmails + * @property {google.privacy.dlp.v2.Action.IPublishToStackdriver|null} [publishToStackdriver] Action publishToStackdriver + */ + + /** + * Constructs a new Action. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents an Action. + * @implements IAction + * @constructor + * @param {google.privacy.dlp.v2.IAction=} [properties] Properties to set + */ + function Action(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Action saveFindings. + * @member {google.privacy.dlp.v2.Action.ISaveFindings|null|undefined} saveFindings + * @memberof google.privacy.dlp.v2.Action + * @instance + */ + Action.prototype.saveFindings = null; + + /** + * Action pubSub. + * @member {google.privacy.dlp.v2.Action.IPublishToPubSub|null|undefined} pubSub + * @memberof google.privacy.dlp.v2.Action + * @instance + */ + Action.prototype.pubSub = null; + + /** + * Action publishSummaryToCscc. + * @member {google.privacy.dlp.v2.Action.IPublishSummaryToCscc|null|undefined} publishSummaryToCscc + * @memberof google.privacy.dlp.v2.Action + * @instance + */ + Action.prototype.publishSummaryToCscc = null; + + /** + * Action publishFindingsToCloudDataCatalog. + * @member {google.privacy.dlp.v2.Action.IPublishFindingsToCloudDataCatalog|null|undefined} publishFindingsToCloudDataCatalog + * @memberof google.privacy.dlp.v2.Action + * @instance + */ + Action.prototype.publishFindingsToCloudDataCatalog = null; + + /** + * Action jobNotificationEmails. + * @member {google.privacy.dlp.v2.Action.IJobNotificationEmails|null|undefined} jobNotificationEmails + * @memberof google.privacy.dlp.v2.Action + * @instance + */ + Action.prototype.jobNotificationEmails = null; + + /** + * Action publishToStackdriver. + * @member {google.privacy.dlp.v2.Action.IPublishToStackdriver|null|undefined} publishToStackdriver + * @memberof google.privacy.dlp.v2.Action + * @instance + */ + Action.prototype.publishToStackdriver = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Action action. + * @member {"saveFindings"|"pubSub"|"publishSummaryToCscc"|"publishFindingsToCloudDataCatalog"|"jobNotificationEmails"|"publishToStackdriver"|undefined} action + * @memberof google.privacy.dlp.v2.Action + * @instance + */ + Object.defineProperty(Action.prototype, "action", { + get: $util.oneOfGetter($oneOfFields = ["saveFindings", "pubSub", "publishSummaryToCscc", "publishFindingsToCloudDataCatalog", "jobNotificationEmails", "publishToStackdriver"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Action instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.Action + * @static + * @param {google.privacy.dlp.v2.IAction=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.Action} Action instance + */ + Action.create = function create(properties) { + return new Action(properties); + }; + + /** + * Encodes the specified Action message. Does not implicitly {@link google.privacy.dlp.v2.Action.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.Action + * @static + * @param {google.privacy.dlp.v2.IAction} message Action message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Action.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.saveFindings != null && Object.hasOwnProperty.call(message, "saveFindings")) + $root.google.privacy.dlp.v2.Action.SaveFindings.encode(message.saveFindings, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.pubSub != null && Object.hasOwnProperty.call(message, "pubSub")) + $root.google.privacy.dlp.v2.Action.PublishToPubSub.encode(message.pubSub, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.publishSummaryToCscc != null && Object.hasOwnProperty.call(message, "publishSummaryToCscc")) + $root.google.privacy.dlp.v2.Action.PublishSummaryToCscc.encode(message.publishSummaryToCscc, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.publishFindingsToCloudDataCatalog != null && Object.hasOwnProperty.call(message, "publishFindingsToCloudDataCatalog")) + $root.google.privacy.dlp.v2.Action.PublishFindingsToCloudDataCatalog.encode(message.publishFindingsToCloudDataCatalog, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.jobNotificationEmails != null && Object.hasOwnProperty.call(message, "jobNotificationEmails")) + $root.google.privacy.dlp.v2.Action.JobNotificationEmails.encode(message.jobNotificationEmails, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.publishToStackdriver != null && Object.hasOwnProperty.call(message, "publishToStackdriver")) + $root.google.privacy.dlp.v2.Action.PublishToStackdriver.encode(message.publishToStackdriver, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Action message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.Action.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.Action + * @static + * @param {google.privacy.dlp.v2.IAction} message Action message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Action.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Action message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.Action + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.Action} Action + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Action.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.privacy.dlp.v2.Action(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.saveFindings = $root.google.privacy.dlp.v2.Action.SaveFindings.decode(reader, reader.uint32()); + break; + case 2: + message.pubSub = $root.google.privacy.dlp.v2.Action.PublishToPubSub.decode(reader, reader.uint32()); + break; + case 3: + message.publishSummaryToCscc = $root.google.privacy.dlp.v2.Action.PublishSummaryToCscc.decode(reader, reader.uint32()); + break; + case 5: + message.publishFindingsToCloudDataCatalog = $root.google.privacy.dlp.v2.Action.PublishFindingsToCloudDataCatalog.decode(reader, reader.uint32()); + break; + case 8: + message.jobNotificationEmails = $root.google.privacy.dlp.v2.Action.JobNotificationEmails.decode(reader, reader.uint32()); + break; + case 9: + message.publishToStackdriver = $root.google.privacy.dlp.v2.Action.PublishToStackdriver.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Action message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.Action + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.Action} Action + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Action.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Action message. + * @function verify + * @memberof google.privacy.dlp.v2.Action + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Action.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.saveFindings != null && message.hasOwnProperty("saveFindings")) { + properties.action = 1; + { + var error = $root.google.privacy.dlp.v2.Action.SaveFindings.verify(message.saveFindings); + if (error) + return "saveFindings." + error; + } + } + if (message.pubSub != null && message.hasOwnProperty("pubSub")) { + if (properties.action === 1) + return "action: multiple values"; + properties.action = 1; + { + var error = $root.google.privacy.dlp.v2.Action.PublishToPubSub.verify(message.pubSub); + if (error) + return "pubSub." + error; + } + } + if (message.publishSummaryToCscc != null && message.hasOwnProperty("publishSummaryToCscc")) { + if (properties.action === 1) + return "action: multiple values"; + properties.action = 1; + { + var error = $root.google.privacy.dlp.v2.Action.PublishSummaryToCscc.verify(message.publishSummaryToCscc); + if (error) + return "publishSummaryToCscc." + error; + } + } + if (message.publishFindingsToCloudDataCatalog != null && message.hasOwnProperty("publishFindingsToCloudDataCatalog")) { + if (properties.action === 1) + return "action: multiple values"; + properties.action = 1; + { + var error = $root.google.privacy.dlp.v2.Action.PublishFindingsToCloudDataCatalog.verify(message.publishFindingsToCloudDataCatalog); + if (error) + return "publishFindingsToCloudDataCatalog." + error; + } + } + if (message.jobNotificationEmails != null && message.hasOwnProperty("jobNotificationEmails")) { + if (properties.action === 1) + return "action: multiple values"; + properties.action = 1; + { + var error = $root.google.privacy.dlp.v2.Action.JobNotificationEmails.verify(message.jobNotificationEmails); + if (error) + return "jobNotificationEmails." + error; + } + } + if (message.publishToStackdriver != null && message.hasOwnProperty("publishToStackdriver")) { + if (properties.action === 1) + return "action: multiple values"; + properties.action = 1; + { + var error = $root.google.privacy.dlp.v2.Action.PublishToStackdriver.verify(message.publishToStackdriver); + if (error) + return "publishToStackdriver." + error; + } + } + return null; + }; + + /** + * Creates an Action message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.Action + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.Action} Action + */ + Action.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.Action) + return object; + var message = new $root.google.privacy.dlp.v2.Action(); + if (object.saveFindings != null) { + if (typeof object.saveFindings !== "object") + throw TypeError(".google.privacy.dlp.v2.Action.saveFindings: object expected"); + message.saveFindings = $root.google.privacy.dlp.v2.Action.SaveFindings.fromObject(object.saveFindings); + } + if (object.pubSub != null) { + if (typeof object.pubSub !== "object") + throw TypeError(".google.privacy.dlp.v2.Action.pubSub: object expected"); + message.pubSub = $root.google.privacy.dlp.v2.Action.PublishToPubSub.fromObject(object.pubSub); + } + if (object.publishSummaryToCscc != null) { + if (typeof object.publishSummaryToCscc !== "object") + throw TypeError(".google.privacy.dlp.v2.Action.publishSummaryToCscc: object expected"); + message.publishSummaryToCscc = $root.google.privacy.dlp.v2.Action.PublishSummaryToCscc.fromObject(object.publishSummaryToCscc); + } + if (object.publishFindingsToCloudDataCatalog != null) { + if (typeof object.publishFindingsToCloudDataCatalog !== "object") + throw TypeError(".google.privacy.dlp.v2.Action.publishFindingsToCloudDataCatalog: object expected"); + message.publishFindingsToCloudDataCatalog = $root.google.privacy.dlp.v2.Action.PublishFindingsToCloudDataCatalog.fromObject(object.publishFindingsToCloudDataCatalog); + } + if (object.jobNotificationEmails != null) { + if (typeof object.jobNotificationEmails !== "object") + throw TypeError(".google.privacy.dlp.v2.Action.jobNotificationEmails: object expected"); + message.jobNotificationEmails = $root.google.privacy.dlp.v2.Action.JobNotificationEmails.fromObject(object.jobNotificationEmails); + } + if (object.publishToStackdriver != null) { + if (typeof object.publishToStackdriver !== "object") + throw TypeError(".google.privacy.dlp.v2.Action.publishToStackdriver: object expected"); + message.publishToStackdriver = $root.google.privacy.dlp.v2.Action.PublishToStackdriver.fromObject(object.publishToStackdriver); + } + return message; + }; + + /** + * Creates a plain object from an Action message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.Action + * @static + * @param {google.privacy.dlp.v2.Action} message Action + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Action.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.saveFindings != null && message.hasOwnProperty("saveFindings")) { + object.saveFindings = $root.google.privacy.dlp.v2.Action.SaveFindings.toObject(message.saveFindings, options); + if (options.oneofs) + object.action = "saveFindings"; + } + if (message.pubSub != null && message.hasOwnProperty("pubSub")) { + object.pubSub = $root.google.privacy.dlp.v2.Action.PublishToPubSub.toObject(message.pubSub, options); + if (options.oneofs) + object.action = "pubSub"; + } + if (message.publishSummaryToCscc != null && message.hasOwnProperty("publishSummaryToCscc")) { + object.publishSummaryToCscc = $root.google.privacy.dlp.v2.Action.PublishSummaryToCscc.toObject(message.publishSummaryToCscc, options); + if (options.oneofs) + object.action = "publishSummaryToCscc"; + } + if (message.publishFindingsToCloudDataCatalog != null && message.hasOwnProperty("publishFindingsToCloudDataCatalog")) { + object.publishFindingsToCloudDataCatalog = $root.google.privacy.dlp.v2.Action.PublishFindingsToCloudDataCatalog.toObject(message.publishFindingsToCloudDataCatalog, options); + if (options.oneofs) + object.action = "publishFindingsToCloudDataCatalog"; + } + if (message.jobNotificationEmails != null && message.hasOwnProperty("jobNotificationEmails")) { + object.jobNotificationEmails = $root.google.privacy.dlp.v2.Action.JobNotificationEmails.toObject(message.jobNotificationEmails, options); + if (options.oneofs) + object.action = "jobNotificationEmails"; + } + if (message.publishToStackdriver != null && message.hasOwnProperty("publishToStackdriver")) { + object.publishToStackdriver = $root.google.privacy.dlp.v2.Action.PublishToStackdriver.toObject(message.publishToStackdriver, options); + if (options.oneofs) + object.action = "publishToStackdriver"; + } + return object; + }; + + /** + * Converts this Action to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.Action + * @instance + * @returns {Object.} JSON object + */ + Action.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + Action.SaveFindings = (function() { + + /** + * Properties of a SaveFindings. + * @memberof google.privacy.dlp.v2.Action + * @interface ISaveFindings + * @property {google.privacy.dlp.v2.IOutputStorageConfig|null} [outputConfig] SaveFindings outputConfig + */ + + /** + * Constructs a new SaveFindings. + * @memberof google.privacy.dlp.v2.Action + * @classdesc Represents a SaveFindings. + * @implements ISaveFindings + * @constructor + * @param {google.privacy.dlp.v2.Action.ISaveFindings=} [properties] Properties to set + */ + function SaveFindings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SaveFindings outputConfig. + * @member {google.privacy.dlp.v2.IOutputStorageConfig|null|undefined} outputConfig + * @memberof google.privacy.dlp.v2.Action.SaveFindings + * @instance + */ + SaveFindings.prototype.outputConfig = null; + + /** + * Creates a new SaveFindings instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.Action.SaveFindings + * @static + * @param {google.privacy.dlp.v2.Action.ISaveFindings=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.Action.SaveFindings} SaveFindings instance + */ + SaveFindings.create = function create(properties) { + return new SaveFindings(properties); + }; + + /** + * Encodes the specified SaveFindings message. Does not implicitly {@link google.privacy.dlp.v2.Action.SaveFindings.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.Action.SaveFindings + * @static + * @param {google.privacy.dlp.v2.Action.ISaveFindings} message SaveFindings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SaveFindings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.outputConfig != null && Object.hasOwnProperty.call(message, "outputConfig")) + $root.google.privacy.dlp.v2.OutputStorageConfig.encode(message.outputConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SaveFindings message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.Action.SaveFindings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.Action.SaveFindings + * @static + * @param {google.privacy.dlp.v2.Action.ISaveFindings} message SaveFindings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SaveFindings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SaveFindings message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.Action.SaveFindings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.Action.SaveFindings} SaveFindings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SaveFindings.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.privacy.dlp.v2.Action.SaveFindings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.outputConfig = $root.google.privacy.dlp.v2.OutputStorageConfig.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SaveFindings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.Action.SaveFindings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.Action.SaveFindings} SaveFindings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SaveFindings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SaveFindings message. + * @function verify + * @memberof google.privacy.dlp.v2.Action.SaveFindings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SaveFindings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) { + var error = $root.google.privacy.dlp.v2.OutputStorageConfig.verify(message.outputConfig); + if (error) + return "outputConfig." + error; + } + return null; + }; + + /** + * Creates a SaveFindings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.Action.SaveFindings + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.Action.SaveFindings} SaveFindings + */ + SaveFindings.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.Action.SaveFindings) + return object; + var message = new $root.google.privacy.dlp.v2.Action.SaveFindings(); + if (object.outputConfig != null) { + if (typeof object.outputConfig !== "object") + throw TypeError(".google.privacy.dlp.v2.Action.SaveFindings.outputConfig: object expected"); + message.outputConfig = $root.google.privacy.dlp.v2.OutputStorageConfig.fromObject(object.outputConfig); + } + return message; + }; + + /** + * Creates a plain object from a SaveFindings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.Action.SaveFindings + * @static + * @param {google.privacy.dlp.v2.Action.SaveFindings} message SaveFindings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SaveFindings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.outputConfig = null; + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) + object.outputConfig = $root.google.privacy.dlp.v2.OutputStorageConfig.toObject(message.outputConfig, options); + return object; + }; + + /** + * Converts this SaveFindings to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.Action.SaveFindings + * @instance + * @returns {Object.} JSON object + */ + SaveFindings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SaveFindings; + })(); + + Action.PublishToPubSub = (function() { + + /** + * Properties of a PublishToPubSub. + * @memberof google.privacy.dlp.v2.Action + * @interface IPublishToPubSub + * @property {string|null} [topic] PublishToPubSub topic + */ + + /** + * Constructs a new PublishToPubSub. + * @memberof google.privacy.dlp.v2.Action + * @classdesc Represents a PublishToPubSub. + * @implements IPublishToPubSub + * @constructor + * @param {google.privacy.dlp.v2.Action.IPublishToPubSub=} [properties] Properties to set + */ + function PublishToPubSub(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PublishToPubSub topic. + * @member {string} topic + * @memberof google.privacy.dlp.v2.Action.PublishToPubSub + * @instance + */ + PublishToPubSub.prototype.topic = ""; + + /** + * Creates a new PublishToPubSub instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.Action.PublishToPubSub + * @static + * @param {google.privacy.dlp.v2.Action.IPublishToPubSub=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.Action.PublishToPubSub} PublishToPubSub instance + */ + PublishToPubSub.create = function create(properties) { + return new PublishToPubSub(properties); + }; + + /** + * Encodes the specified PublishToPubSub message. Does not implicitly {@link google.privacy.dlp.v2.Action.PublishToPubSub.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.Action.PublishToPubSub + * @static + * @param {google.privacy.dlp.v2.Action.IPublishToPubSub} message PublishToPubSub message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PublishToPubSub.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.topic != null && Object.hasOwnProperty.call(message, "topic")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.topic); + return writer; + }; + + /** + * Encodes the specified PublishToPubSub message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.Action.PublishToPubSub.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.Action.PublishToPubSub + * @static + * @param {google.privacy.dlp.v2.Action.IPublishToPubSub} message PublishToPubSub message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PublishToPubSub.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PublishToPubSub message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.Action.PublishToPubSub + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.Action.PublishToPubSub} PublishToPubSub + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PublishToPubSub.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.privacy.dlp.v2.Action.PublishToPubSub(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.topic = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PublishToPubSub message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.Action.PublishToPubSub + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.Action.PublishToPubSub} PublishToPubSub + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PublishToPubSub.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PublishToPubSub message. + * @function verify + * @memberof google.privacy.dlp.v2.Action.PublishToPubSub + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PublishToPubSub.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.topic != null && message.hasOwnProperty("topic")) + if (!$util.isString(message.topic)) + return "topic: string expected"; + return null; + }; + + /** + * Creates a PublishToPubSub message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.Action.PublishToPubSub + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.Action.PublishToPubSub} PublishToPubSub + */ + PublishToPubSub.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.Action.PublishToPubSub) + return object; + var message = new $root.google.privacy.dlp.v2.Action.PublishToPubSub(); + if (object.topic != null) + message.topic = String(object.topic); + return message; + }; + + /** + * Creates a plain object from a PublishToPubSub message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.Action.PublishToPubSub + * @static + * @param {google.privacy.dlp.v2.Action.PublishToPubSub} message PublishToPubSub + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PublishToPubSub.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.topic = ""; + if (message.topic != null && message.hasOwnProperty("topic")) + object.topic = message.topic; + return object; + }; + + /** + * Converts this PublishToPubSub to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.Action.PublishToPubSub + * @instance + * @returns {Object.} JSON object + */ + PublishToPubSub.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return PublishToPubSub; + })(); + + Action.PublishSummaryToCscc = (function() { + + /** + * Properties of a PublishSummaryToCscc. + * @memberof google.privacy.dlp.v2.Action + * @interface IPublishSummaryToCscc + */ + + /** + * Constructs a new PublishSummaryToCscc. + * @memberof google.privacy.dlp.v2.Action + * @classdesc Represents a PublishSummaryToCscc. + * @implements IPublishSummaryToCscc + * @constructor + * @param {google.privacy.dlp.v2.Action.IPublishSummaryToCscc=} [properties] Properties to set + */ + function PublishSummaryToCscc(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new PublishSummaryToCscc instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.Action.PublishSummaryToCscc + * @static + * @param {google.privacy.dlp.v2.Action.IPublishSummaryToCscc=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.Action.PublishSummaryToCscc} PublishSummaryToCscc instance + */ + PublishSummaryToCscc.create = function create(properties) { + return new PublishSummaryToCscc(properties); + }; + + /** + * Encodes the specified PublishSummaryToCscc message. Does not implicitly {@link google.privacy.dlp.v2.Action.PublishSummaryToCscc.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.Action.PublishSummaryToCscc + * @static + * @param {google.privacy.dlp.v2.Action.IPublishSummaryToCscc} message PublishSummaryToCscc message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PublishSummaryToCscc.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified PublishSummaryToCscc message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.Action.PublishSummaryToCscc.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.Action.PublishSummaryToCscc + * @static + * @param {google.privacy.dlp.v2.Action.IPublishSummaryToCscc} message PublishSummaryToCscc message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PublishSummaryToCscc.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PublishSummaryToCscc message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.Action.PublishSummaryToCscc + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.Action.PublishSummaryToCscc} PublishSummaryToCscc + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PublishSummaryToCscc.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.privacy.dlp.v2.Action.PublishSummaryToCscc(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PublishSummaryToCscc message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.Action.PublishSummaryToCscc + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.Action.PublishSummaryToCscc} PublishSummaryToCscc + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PublishSummaryToCscc.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PublishSummaryToCscc message. + * @function verify + * @memberof google.privacy.dlp.v2.Action.PublishSummaryToCscc + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PublishSummaryToCscc.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a PublishSummaryToCscc message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.Action.PublishSummaryToCscc + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.Action.PublishSummaryToCscc} PublishSummaryToCscc + */ + PublishSummaryToCscc.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.Action.PublishSummaryToCscc) + return object; + return new $root.google.privacy.dlp.v2.Action.PublishSummaryToCscc(); + }; + + /** + * Creates a plain object from a PublishSummaryToCscc message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.Action.PublishSummaryToCscc + * @static + * @param {google.privacy.dlp.v2.Action.PublishSummaryToCscc} message PublishSummaryToCscc + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PublishSummaryToCscc.toObject = function toObject() { + return {}; + }; + + /** + * Converts this PublishSummaryToCscc to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.Action.PublishSummaryToCscc + * @instance + * @returns {Object.} JSON object + */ + PublishSummaryToCscc.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return PublishSummaryToCscc; + })(); + + Action.PublishFindingsToCloudDataCatalog = (function() { + + /** + * Properties of a PublishFindingsToCloudDataCatalog. + * @memberof google.privacy.dlp.v2.Action + * @interface IPublishFindingsToCloudDataCatalog + */ + + /** + * Constructs a new PublishFindingsToCloudDataCatalog. + * @memberof google.privacy.dlp.v2.Action + * @classdesc Represents a PublishFindingsToCloudDataCatalog. + * @implements IPublishFindingsToCloudDataCatalog + * @constructor + * @param {google.privacy.dlp.v2.Action.IPublishFindingsToCloudDataCatalog=} [properties] Properties to set + */ + function PublishFindingsToCloudDataCatalog(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new PublishFindingsToCloudDataCatalog instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.Action.PublishFindingsToCloudDataCatalog + * @static + * @param {google.privacy.dlp.v2.Action.IPublishFindingsToCloudDataCatalog=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.Action.PublishFindingsToCloudDataCatalog} PublishFindingsToCloudDataCatalog instance + */ + PublishFindingsToCloudDataCatalog.create = function create(properties) { + return new PublishFindingsToCloudDataCatalog(properties); + }; + + /** + * Encodes the specified PublishFindingsToCloudDataCatalog message. Does not implicitly {@link google.privacy.dlp.v2.Action.PublishFindingsToCloudDataCatalog.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.Action.PublishFindingsToCloudDataCatalog + * @static + * @param {google.privacy.dlp.v2.Action.IPublishFindingsToCloudDataCatalog} message PublishFindingsToCloudDataCatalog message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PublishFindingsToCloudDataCatalog.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified PublishFindingsToCloudDataCatalog message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.Action.PublishFindingsToCloudDataCatalog.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.Action.PublishFindingsToCloudDataCatalog + * @static + * @param {google.privacy.dlp.v2.Action.IPublishFindingsToCloudDataCatalog} message PublishFindingsToCloudDataCatalog message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PublishFindingsToCloudDataCatalog.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PublishFindingsToCloudDataCatalog message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.Action.PublishFindingsToCloudDataCatalog + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.Action.PublishFindingsToCloudDataCatalog} PublishFindingsToCloudDataCatalog + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PublishFindingsToCloudDataCatalog.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.privacy.dlp.v2.Action.PublishFindingsToCloudDataCatalog(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PublishFindingsToCloudDataCatalog message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.Action.PublishFindingsToCloudDataCatalog + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.Action.PublishFindingsToCloudDataCatalog} PublishFindingsToCloudDataCatalog + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PublishFindingsToCloudDataCatalog.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PublishFindingsToCloudDataCatalog message. + * @function verify + * @memberof google.privacy.dlp.v2.Action.PublishFindingsToCloudDataCatalog + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PublishFindingsToCloudDataCatalog.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a PublishFindingsToCloudDataCatalog message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.Action.PublishFindingsToCloudDataCatalog + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.Action.PublishFindingsToCloudDataCatalog} PublishFindingsToCloudDataCatalog + */ + PublishFindingsToCloudDataCatalog.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.Action.PublishFindingsToCloudDataCatalog) + return object; + return new $root.google.privacy.dlp.v2.Action.PublishFindingsToCloudDataCatalog(); + }; + + /** + * Creates a plain object from a PublishFindingsToCloudDataCatalog message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.Action.PublishFindingsToCloudDataCatalog + * @static + * @param {google.privacy.dlp.v2.Action.PublishFindingsToCloudDataCatalog} message PublishFindingsToCloudDataCatalog + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PublishFindingsToCloudDataCatalog.toObject = function toObject() { + return {}; + }; + + /** + * Converts this PublishFindingsToCloudDataCatalog to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.Action.PublishFindingsToCloudDataCatalog + * @instance + * @returns {Object.} JSON object + */ + PublishFindingsToCloudDataCatalog.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return PublishFindingsToCloudDataCatalog; + })(); + + Action.JobNotificationEmails = (function() { + + /** + * Properties of a JobNotificationEmails. + * @memberof google.privacy.dlp.v2.Action + * @interface IJobNotificationEmails + */ + + /** + * Constructs a new JobNotificationEmails. + * @memberof google.privacy.dlp.v2.Action + * @classdesc Represents a JobNotificationEmails. + * @implements IJobNotificationEmails + * @constructor + * @param {google.privacy.dlp.v2.Action.IJobNotificationEmails=} [properties] Properties to set + */ + function JobNotificationEmails(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new JobNotificationEmails instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.Action.JobNotificationEmails + * @static + * @param {google.privacy.dlp.v2.Action.IJobNotificationEmails=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.Action.JobNotificationEmails} JobNotificationEmails instance + */ + JobNotificationEmails.create = function create(properties) { + return new JobNotificationEmails(properties); + }; + + /** + * Encodes the specified JobNotificationEmails message. Does not implicitly {@link google.privacy.dlp.v2.Action.JobNotificationEmails.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.Action.JobNotificationEmails + * @static + * @param {google.privacy.dlp.v2.Action.IJobNotificationEmails} message JobNotificationEmails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JobNotificationEmails.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified JobNotificationEmails message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.Action.JobNotificationEmails.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.Action.JobNotificationEmails + * @static + * @param {google.privacy.dlp.v2.Action.IJobNotificationEmails} message JobNotificationEmails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JobNotificationEmails.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a JobNotificationEmails message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.Action.JobNotificationEmails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.Action.JobNotificationEmails} JobNotificationEmails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JobNotificationEmails.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.privacy.dlp.v2.Action.JobNotificationEmails(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a JobNotificationEmails message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.Action.JobNotificationEmails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.Action.JobNotificationEmails} JobNotificationEmails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JobNotificationEmails.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a JobNotificationEmails message. + * @function verify + * @memberof google.privacy.dlp.v2.Action.JobNotificationEmails + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + JobNotificationEmails.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a JobNotificationEmails message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.Action.JobNotificationEmails + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.Action.JobNotificationEmails} JobNotificationEmails + */ + JobNotificationEmails.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.Action.JobNotificationEmails) + return object; + return new $root.google.privacy.dlp.v2.Action.JobNotificationEmails(); + }; + + /** + * Creates a plain object from a JobNotificationEmails message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.Action.JobNotificationEmails + * @static + * @param {google.privacy.dlp.v2.Action.JobNotificationEmails} message JobNotificationEmails + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + JobNotificationEmails.toObject = function toObject() { + return {}; + }; + + /** + * Converts this JobNotificationEmails to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.Action.JobNotificationEmails + * @instance + * @returns {Object.} JSON object + */ + JobNotificationEmails.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return JobNotificationEmails; + })(); + + Action.PublishToStackdriver = (function() { + + /** + * Properties of a PublishToStackdriver. + * @memberof google.privacy.dlp.v2.Action + * @interface IPublishToStackdriver + */ + + /** + * Constructs a new PublishToStackdriver. + * @memberof google.privacy.dlp.v2.Action + * @classdesc Represents a PublishToStackdriver. + * @implements IPublishToStackdriver + * @constructor + * @param {google.privacy.dlp.v2.Action.IPublishToStackdriver=} [properties] Properties to set + */ + function PublishToStackdriver(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new PublishToStackdriver instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.Action.PublishToStackdriver + * @static + * @param {google.privacy.dlp.v2.Action.IPublishToStackdriver=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.Action.PublishToStackdriver} PublishToStackdriver instance + */ + PublishToStackdriver.create = function create(properties) { + return new PublishToStackdriver(properties); + }; + + /** + * Encodes the specified PublishToStackdriver message. Does not implicitly {@link google.privacy.dlp.v2.Action.PublishToStackdriver.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.Action.PublishToStackdriver + * @static + * @param {google.privacy.dlp.v2.Action.IPublishToStackdriver} message PublishToStackdriver message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PublishToStackdriver.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified PublishToStackdriver message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.Action.PublishToStackdriver.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.Action.PublishToStackdriver + * @static + * @param {google.privacy.dlp.v2.Action.IPublishToStackdriver} message PublishToStackdriver message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PublishToStackdriver.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PublishToStackdriver message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.Action.PublishToStackdriver + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.Action.PublishToStackdriver} PublishToStackdriver + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PublishToStackdriver.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.privacy.dlp.v2.Action.PublishToStackdriver(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PublishToStackdriver message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.Action.PublishToStackdriver + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.Action.PublishToStackdriver} PublishToStackdriver + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PublishToStackdriver.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PublishToStackdriver message. + * @function verify + * @memberof google.privacy.dlp.v2.Action.PublishToStackdriver + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PublishToStackdriver.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a PublishToStackdriver message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.Action.PublishToStackdriver + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.Action.PublishToStackdriver} PublishToStackdriver + */ + PublishToStackdriver.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.Action.PublishToStackdriver) + return object; + return new $root.google.privacy.dlp.v2.Action.PublishToStackdriver(); + }; + + /** + * Creates a plain object from a PublishToStackdriver message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.Action.PublishToStackdriver + * @static + * @param {google.privacy.dlp.v2.Action.PublishToStackdriver} message PublishToStackdriver + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PublishToStackdriver.toObject = function toObject() { + return {}; + }; + + /** + * Converts this PublishToStackdriver to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.Action.PublishToStackdriver + * @instance + * @returns {Object.} JSON object + */ + PublishToStackdriver.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return PublishToStackdriver; + })(); + + return Action; + })(); + + v2.CreateInspectTemplateRequest = (function() { + + /** + * Properties of a CreateInspectTemplateRequest. + * @memberof google.privacy.dlp.v2 + * @interface ICreateInspectTemplateRequest + * @property {string|null} [parent] CreateInspectTemplateRequest parent + * @property {google.privacy.dlp.v2.IInspectTemplate|null} [inspectTemplate] CreateInspectTemplateRequest inspectTemplate + * @property {string|null} [templateId] CreateInspectTemplateRequest templateId + * @property {string|null} [locationId] CreateInspectTemplateRequest locationId + */ + + /** + * Constructs a new CreateInspectTemplateRequest. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents a CreateInspectTemplateRequest. + * @implements ICreateInspectTemplateRequest + * @constructor + * @param {google.privacy.dlp.v2.ICreateInspectTemplateRequest=} [properties] Properties to set + */ + function CreateInspectTemplateRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateInspectTemplateRequest parent. + * @member {string} parent + * @memberof google.privacy.dlp.v2.CreateInspectTemplateRequest + * @instance + */ + CreateInspectTemplateRequest.prototype.parent = ""; + + /** + * CreateInspectTemplateRequest inspectTemplate. + * @member {google.privacy.dlp.v2.IInspectTemplate|null|undefined} inspectTemplate + * @memberof google.privacy.dlp.v2.CreateInspectTemplateRequest + * @instance + */ + CreateInspectTemplateRequest.prototype.inspectTemplate = null; + + /** + * CreateInspectTemplateRequest templateId. + * @member {string} templateId + * @memberof google.privacy.dlp.v2.CreateInspectTemplateRequest + * @instance + */ + CreateInspectTemplateRequest.prototype.templateId = ""; + + /** + * CreateInspectTemplateRequest locationId. + * @member {string} locationId + * @memberof google.privacy.dlp.v2.CreateInspectTemplateRequest + * @instance + */ + CreateInspectTemplateRequest.prototype.locationId = ""; + + /** + * Creates a new CreateInspectTemplateRequest instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.CreateInspectTemplateRequest + * @static + * @param {google.privacy.dlp.v2.ICreateInspectTemplateRequest=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.CreateInspectTemplateRequest} CreateInspectTemplateRequest instance + */ + CreateInspectTemplateRequest.create = function create(properties) { + return new CreateInspectTemplateRequest(properties); + }; + + /** + * Encodes the specified CreateInspectTemplateRequest message. Does not implicitly {@link google.privacy.dlp.v2.CreateInspectTemplateRequest.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.CreateInspectTemplateRequest + * @static + * @param {google.privacy.dlp.v2.ICreateInspectTemplateRequest} message CreateInspectTemplateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateInspectTemplateRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.inspectTemplate != null && Object.hasOwnProperty.call(message, "inspectTemplate")) + $root.google.privacy.dlp.v2.InspectTemplate.encode(message.inspectTemplate, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.templateId != null && Object.hasOwnProperty.call(message, "templateId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.templateId); + if (message.locationId != null && Object.hasOwnProperty.call(message, "locationId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.locationId); + return writer; + }; + + /** + * Encodes the specified CreateInspectTemplateRequest message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.CreateInspectTemplateRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.CreateInspectTemplateRequest + * @static + * @param {google.privacy.dlp.v2.ICreateInspectTemplateRequest} message CreateInspectTemplateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateInspectTemplateRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateInspectTemplateRequest message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.CreateInspectTemplateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.CreateInspectTemplateRequest} CreateInspectTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateInspectTemplateRequest.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.privacy.dlp.v2.CreateInspectTemplateRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.inspectTemplate = $root.google.privacy.dlp.v2.InspectTemplate.decode(reader, reader.uint32()); + break; + case 3: + message.templateId = reader.string(); + break; + case 4: + message.locationId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateInspectTemplateRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.CreateInspectTemplateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.CreateInspectTemplateRequest} CreateInspectTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateInspectTemplateRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateInspectTemplateRequest message. + * @function verify + * @memberof google.privacy.dlp.v2.CreateInspectTemplateRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateInspectTemplateRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.inspectTemplate != null && message.hasOwnProperty("inspectTemplate")) { + var error = $root.google.privacy.dlp.v2.InspectTemplate.verify(message.inspectTemplate); + if (error) + return "inspectTemplate." + error; + } + if (message.templateId != null && message.hasOwnProperty("templateId")) + if (!$util.isString(message.templateId)) + return "templateId: string expected"; + if (message.locationId != null && message.hasOwnProperty("locationId")) + if (!$util.isString(message.locationId)) + return "locationId: string expected"; + return null; + }; + + /** + * Creates a CreateInspectTemplateRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.CreateInspectTemplateRequest + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.CreateInspectTemplateRequest} CreateInspectTemplateRequest + */ + CreateInspectTemplateRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.CreateInspectTemplateRequest) + return object; + var message = new $root.google.privacy.dlp.v2.CreateInspectTemplateRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.inspectTemplate != null) { + if (typeof object.inspectTemplate !== "object") + throw TypeError(".google.privacy.dlp.v2.CreateInspectTemplateRequest.inspectTemplate: object expected"); + message.inspectTemplate = $root.google.privacy.dlp.v2.InspectTemplate.fromObject(object.inspectTemplate); + } + if (object.templateId != null) + message.templateId = String(object.templateId); + if (object.locationId != null) + message.locationId = String(object.locationId); + return message; + }; + + /** + * Creates a plain object from a CreateInspectTemplateRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.CreateInspectTemplateRequest + * @static + * @param {google.privacy.dlp.v2.CreateInspectTemplateRequest} message CreateInspectTemplateRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateInspectTemplateRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.inspectTemplate = null; + object.templateId = ""; + object.locationId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.inspectTemplate != null && message.hasOwnProperty("inspectTemplate")) + object.inspectTemplate = $root.google.privacy.dlp.v2.InspectTemplate.toObject(message.inspectTemplate, options); + if (message.templateId != null && message.hasOwnProperty("templateId")) + object.templateId = message.templateId; + if (message.locationId != null && message.hasOwnProperty("locationId")) + object.locationId = message.locationId; + return object; + }; + + /** + * Converts this CreateInspectTemplateRequest to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.CreateInspectTemplateRequest + * @instance + * @returns {Object.} JSON object + */ + CreateInspectTemplateRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CreateInspectTemplateRequest; + })(); + + v2.UpdateInspectTemplateRequest = (function() { + + /** + * Properties of an UpdateInspectTemplateRequest. + * @memberof google.privacy.dlp.v2 + * @interface IUpdateInspectTemplateRequest + * @property {string|null} [name] UpdateInspectTemplateRequest name + * @property {google.privacy.dlp.v2.IInspectTemplate|null} [inspectTemplate] UpdateInspectTemplateRequest inspectTemplate + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateInspectTemplateRequest updateMask + */ + + /** + * Constructs a new UpdateInspectTemplateRequest. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents an UpdateInspectTemplateRequest. + * @implements IUpdateInspectTemplateRequest + * @constructor + * @param {google.privacy.dlp.v2.IUpdateInspectTemplateRequest=} [properties] Properties to set + */ + function UpdateInspectTemplateRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateInspectTemplateRequest name. + * @member {string} name + * @memberof google.privacy.dlp.v2.UpdateInspectTemplateRequest + * @instance + */ + UpdateInspectTemplateRequest.prototype.name = ""; + + /** + * UpdateInspectTemplateRequest inspectTemplate. + * @member {google.privacy.dlp.v2.IInspectTemplate|null|undefined} inspectTemplate + * @memberof google.privacy.dlp.v2.UpdateInspectTemplateRequest + * @instance + */ + UpdateInspectTemplateRequest.prototype.inspectTemplate = null; + + /** + * UpdateInspectTemplateRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.privacy.dlp.v2.UpdateInspectTemplateRequest + * @instance + */ + UpdateInspectTemplateRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateInspectTemplateRequest instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.UpdateInspectTemplateRequest + * @static + * @param {google.privacy.dlp.v2.IUpdateInspectTemplateRequest=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.UpdateInspectTemplateRequest} UpdateInspectTemplateRequest instance + */ + UpdateInspectTemplateRequest.create = function create(properties) { + return new UpdateInspectTemplateRequest(properties); + }; + + /** + * Encodes the specified UpdateInspectTemplateRequest message. Does not implicitly {@link google.privacy.dlp.v2.UpdateInspectTemplateRequest.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.UpdateInspectTemplateRequest + * @static + * @param {google.privacy.dlp.v2.IUpdateInspectTemplateRequest} message UpdateInspectTemplateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateInspectTemplateRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.inspectTemplate != null && Object.hasOwnProperty.call(message, "inspectTemplate")) + $root.google.privacy.dlp.v2.InspectTemplate.encode(message.inspectTemplate, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateInspectTemplateRequest message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.UpdateInspectTemplateRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.UpdateInspectTemplateRequest + * @static + * @param {google.privacy.dlp.v2.IUpdateInspectTemplateRequest} message UpdateInspectTemplateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateInspectTemplateRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateInspectTemplateRequest message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.UpdateInspectTemplateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.UpdateInspectTemplateRequest} UpdateInspectTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateInspectTemplateRequest.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.privacy.dlp.v2.UpdateInspectTemplateRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.inspectTemplate = $root.google.privacy.dlp.v2.InspectTemplate.decode(reader, reader.uint32()); + break; + case 3: + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateInspectTemplateRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.UpdateInspectTemplateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.UpdateInspectTemplateRequest} UpdateInspectTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateInspectTemplateRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateInspectTemplateRequest message. + * @function verify + * @memberof google.privacy.dlp.v2.UpdateInspectTemplateRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateInspectTemplateRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.inspectTemplate != null && message.hasOwnProperty("inspectTemplate")) { + var error = $root.google.privacy.dlp.v2.InspectTemplate.verify(message.inspectTemplate); + if (error) + return "inspectTemplate." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateInspectTemplateRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.UpdateInspectTemplateRequest + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.UpdateInspectTemplateRequest} UpdateInspectTemplateRequest + */ + UpdateInspectTemplateRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.UpdateInspectTemplateRequest) + return object; + var message = new $root.google.privacy.dlp.v2.UpdateInspectTemplateRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.inspectTemplate != null) { + if (typeof object.inspectTemplate !== "object") + throw TypeError(".google.privacy.dlp.v2.UpdateInspectTemplateRequest.inspectTemplate: object expected"); + message.inspectTemplate = $root.google.privacy.dlp.v2.InspectTemplate.fromObject(object.inspectTemplate); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.privacy.dlp.v2.UpdateInspectTemplateRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateInspectTemplateRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.UpdateInspectTemplateRequest + * @static + * @param {google.privacy.dlp.v2.UpdateInspectTemplateRequest} message UpdateInspectTemplateRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateInspectTemplateRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.inspectTemplate = null; + object.updateMask = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.inspectTemplate != null && message.hasOwnProperty("inspectTemplate")) + object.inspectTemplate = $root.google.privacy.dlp.v2.InspectTemplate.toObject(message.inspectTemplate, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateInspectTemplateRequest to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.UpdateInspectTemplateRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateInspectTemplateRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UpdateInspectTemplateRequest; + })(); + + v2.GetInspectTemplateRequest = (function() { + + /** + * Properties of a GetInspectTemplateRequest. + * @memberof google.privacy.dlp.v2 + * @interface IGetInspectTemplateRequest + * @property {string|null} [name] GetInspectTemplateRequest name + */ + + /** + * Constructs a new GetInspectTemplateRequest. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents a GetInspectTemplateRequest. + * @implements IGetInspectTemplateRequest + * @constructor + * @param {google.privacy.dlp.v2.IGetInspectTemplateRequest=} [properties] Properties to set + */ + function GetInspectTemplateRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetInspectTemplateRequest name. + * @member {string} name + * @memberof google.privacy.dlp.v2.GetInspectTemplateRequest + * @instance + */ + GetInspectTemplateRequest.prototype.name = ""; + + /** + * Creates a new GetInspectTemplateRequest instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.GetInspectTemplateRequest + * @static + * @param {google.privacy.dlp.v2.IGetInspectTemplateRequest=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.GetInspectTemplateRequest} GetInspectTemplateRequest instance + */ + GetInspectTemplateRequest.create = function create(properties) { + return new GetInspectTemplateRequest(properties); + }; + + /** + * Encodes the specified GetInspectTemplateRequest message. Does not implicitly {@link google.privacy.dlp.v2.GetInspectTemplateRequest.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.GetInspectTemplateRequest + * @static + * @param {google.privacy.dlp.v2.IGetInspectTemplateRequest} message GetInspectTemplateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetInspectTemplateRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetInspectTemplateRequest message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.GetInspectTemplateRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.GetInspectTemplateRequest + * @static + * @param {google.privacy.dlp.v2.IGetInspectTemplateRequest} message GetInspectTemplateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetInspectTemplateRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetInspectTemplateRequest message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.GetInspectTemplateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.GetInspectTemplateRequest} GetInspectTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetInspectTemplateRequest.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.privacy.dlp.v2.GetInspectTemplateRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetInspectTemplateRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.GetInspectTemplateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.GetInspectTemplateRequest} GetInspectTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetInspectTemplateRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetInspectTemplateRequest message. + * @function verify + * @memberof google.privacy.dlp.v2.GetInspectTemplateRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetInspectTemplateRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetInspectTemplateRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.GetInspectTemplateRequest + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.GetInspectTemplateRequest} GetInspectTemplateRequest + */ + GetInspectTemplateRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.GetInspectTemplateRequest) + return object; + var message = new $root.google.privacy.dlp.v2.GetInspectTemplateRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetInspectTemplateRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.GetInspectTemplateRequest + * @static + * @param {google.privacy.dlp.v2.GetInspectTemplateRequest} message GetInspectTemplateRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetInspectTemplateRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetInspectTemplateRequest to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.GetInspectTemplateRequest + * @instance + * @returns {Object.} JSON object + */ + GetInspectTemplateRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetInspectTemplateRequest; + })(); + + v2.ListInspectTemplatesRequest = (function() { + + /** + * Properties of a ListInspectTemplatesRequest. + * @memberof google.privacy.dlp.v2 + * @interface IListInspectTemplatesRequest + * @property {string|null} [parent] ListInspectTemplatesRequest parent + * @property {string|null} [pageToken] ListInspectTemplatesRequest pageToken + * @property {number|null} [pageSize] ListInspectTemplatesRequest pageSize + * @property {string|null} [orderBy] ListInspectTemplatesRequest orderBy + * @property {string|null} [locationId] ListInspectTemplatesRequest locationId + */ + + /** + * Constructs a new ListInspectTemplatesRequest. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents a ListInspectTemplatesRequest. + * @implements IListInspectTemplatesRequest + * @constructor + * @param {google.privacy.dlp.v2.IListInspectTemplatesRequest=} [properties] Properties to set + */ + function ListInspectTemplatesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListInspectTemplatesRequest parent. + * @member {string} parent + * @memberof google.privacy.dlp.v2.ListInspectTemplatesRequest + * @instance + */ + ListInspectTemplatesRequest.prototype.parent = ""; + + /** + * ListInspectTemplatesRequest pageToken. + * @member {string} pageToken + * @memberof google.privacy.dlp.v2.ListInspectTemplatesRequest + * @instance + */ + ListInspectTemplatesRequest.prototype.pageToken = ""; + + /** + * ListInspectTemplatesRequest pageSize. + * @member {number} pageSize + * @memberof google.privacy.dlp.v2.ListInspectTemplatesRequest + * @instance + */ + ListInspectTemplatesRequest.prototype.pageSize = 0; + + /** + * ListInspectTemplatesRequest orderBy. + * @member {string} orderBy + * @memberof google.privacy.dlp.v2.ListInspectTemplatesRequest + * @instance + */ + ListInspectTemplatesRequest.prototype.orderBy = ""; + + /** + * ListInspectTemplatesRequest locationId. + * @member {string} locationId + * @memberof google.privacy.dlp.v2.ListInspectTemplatesRequest + * @instance + */ + ListInspectTemplatesRequest.prototype.locationId = ""; + + /** + * Creates a new ListInspectTemplatesRequest instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.ListInspectTemplatesRequest + * @static + * @param {google.privacy.dlp.v2.IListInspectTemplatesRequest=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.ListInspectTemplatesRequest} ListInspectTemplatesRequest instance + */ + ListInspectTemplatesRequest.create = function create(properties) { + return new ListInspectTemplatesRequest(properties); + }; + + /** + * Encodes the specified ListInspectTemplatesRequest message. Does not implicitly {@link google.privacy.dlp.v2.ListInspectTemplatesRequest.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.ListInspectTemplatesRequest + * @static + * @param {google.privacy.dlp.v2.IListInspectTemplatesRequest} message ListInspectTemplatesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInspectTemplatesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pageToken); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.orderBy); + if (message.locationId != null && Object.hasOwnProperty.call(message, "locationId")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.locationId); + return writer; + }; + + /** + * Encodes the specified ListInspectTemplatesRequest message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.ListInspectTemplatesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.ListInspectTemplatesRequest + * @static + * @param {google.privacy.dlp.v2.IListInspectTemplatesRequest} message ListInspectTemplatesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInspectTemplatesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListInspectTemplatesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.ListInspectTemplatesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.ListInspectTemplatesRequest} ListInspectTemplatesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInspectTemplatesRequest.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.privacy.dlp.v2.ListInspectTemplatesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.pageToken = reader.string(); + break; + case 3: + message.pageSize = reader.int32(); + break; + case 4: + message.orderBy = reader.string(); + break; + case 5: + message.locationId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListInspectTemplatesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.ListInspectTemplatesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.ListInspectTemplatesRequest} ListInspectTemplatesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInspectTemplatesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListInspectTemplatesRequest message. + * @function verify + * @memberof google.privacy.dlp.v2.ListInspectTemplatesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListInspectTemplatesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + if (message.locationId != null && message.hasOwnProperty("locationId")) + if (!$util.isString(message.locationId)) + return "locationId: string expected"; + return null; + }; + + /** + * Creates a ListInspectTemplatesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.ListInspectTemplatesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.ListInspectTemplatesRequest} ListInspectTemplatesRequest + */ + ListInspectTemplatesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.ListInspectTemplatesRequest) + return object; + var message = new $root.google.privacy.dlp.v2.ListInspectTemplatesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.locationId != null) + message.locationId = String(object.locationId); + return message; + }; + + /** + * Creates a plain object from a ListInspectTemplatesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.ListInspectTemplatesRequest + * @static + * @param {google.privacy.dlp.v2.ListInspectTemplatesRequest} message ListInspectTemplatesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListInspectTemplatesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageToken = ""; + object.pageSize = 0; + object.orderBy = ""; + object.locationId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + if (message.locationId != null && message.hasOwnProperty("locationId")) + object.locationId = message.locationId; + return object; + }; + + /** + * Converts this ListInspectTemplatesRequest to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.ListInspectTemplatesRequest + * @instance + * @returns {Object.} JSON object + */ + ListInspectTemplatesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListInspectTemplatesRequest; + })(); + + v2.ListInspectTemplatesResponse = (function() { + + /** + * Properties of a ListInspectTemplatesResponse. + * @memberof google.privacy.dlp.v2 + * @interface IListInspectTemplatesResponse + * @property {Array.|null} [inspectTemplates] ListInspectTemplatesResponse inspectTemplates + * @property {string|null} [nextPageToken] ListInspectTemplatesResponse nextPageToken + */ + + /** + * Constructs a new ListInspectTemplatesResponse. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents a ListInspectTemplatesResponse. + * @implements IListInspectTemplatesResponse + * @constructor + * @param {google.privacy.dlp.v2.IListInspectTemplatesResponse=} [properties] Properties to set + */ + function ListInspectTemplatesResponse(properties) { + this.inspectTemplates = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListInspectTemplatesResponse inspectTemplates. + * @member {Array.} inspectTemplates + * @memberof google.privacy.dlp.v2.ListInspectTemplatesResponse + * @instance + */ + ListInspectTemplatesResponse.prototype.inspectTemplates = $util.emptyArray; + + /** + * ListInspectTemplatesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.privacy.dlp.v2.ListInspectTemplatesResponse + * @instance + */ + ListInspectTemplatesResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListInspectTemplatesResponse instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.ListInspectTemplatesResponse + * @static + * @param {google.privacy.dlp.v2.IListInspectTemplatesResponse=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.ListInspectTemplatesResponse} ListInspectTemplatesResponse instance + */ + ListInspectTemplatesResponse.create = function create(properties) { + return new ListInspectTemplatesResponse(properties); + }; + + /** + * Encodes the specified ListInspectTemplatesResponse message. Does not implicitly {@link google.privacy.dlp.v2.ListInspectTemplatesResponse.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.ListInspectTemplatesResponse + * @static + * @param {google.privacy.dlp.v2.IListInspectTemplatesResponse} message ListInspectTemplatesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInspectTemplatesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.inspectTemplates != null && message.inspectTemplates.length) + for (var i = 0; i < message.inspectTemplates.length; ++i) + $root.google.privacy.dlp.v2.InspectTemplate.encode(message.inspectTemplates[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListInspectTemplatesResponse message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.ListInspectTemplatesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.ListInspectTemplatesResponse + * @static + * @param {google.privacy.dlp.v2.IListInspectTemplatesResponse} message ListInspectTemplatesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInspectTemplatesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListInspectTemplatesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.ListInspectTemplatesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.ListInspectTemplatesResponse} ListInspectTemplatesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInspectTemplatesResponse.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.privacy.dlp.v2.ListInspectTemplatesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.inspectTemplates && message.inspectTemplates.length)) + message.inspectTemplates = []; + message.inspectTemplates.push($root.google.privacy.dlp.v2.InspectTemplate.decode(reader, reader.uint32())); + break; + case 2: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListInspectTemplatesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.ListInspectTemplatesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.ListInspectTemplatesResponse} ListInspectTemplatesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInspectTemplatesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListInspectTemplatesResponse message. + * @function verify + * @memberof google.privacy.dlp.v2.ListInspectTemplatesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListInspectTemplatesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.inspectTemplates != null && message.hasOwnProperty("inspectTemplates")) { + if (!Array.isArray(message.inspectTemplates)) + return "inspectTemplates: array expected"; + for (var i = 0; i < message.inspectTemplates.length; ++i) { + var error = $root.google.privacy.dlp.v2.InspectTemplate.verify(message.inspectTemplates[i]); + if (error) + return "inspectTemplates." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListInspectTemplatesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.ListInspectTemplatesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.ListInspectTemplatesResponse} ListInspectTemplatesResponse + */ + ListInspectTemplatesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.ListInspectTemplatesResponse) + return object; + var message = new $root.google.privacy.dlp.v2.ListInspectTemplatesResponse(); + if (object.inspectTemplates) { + if (!Array.isArray(object.inspectTemplates)) + throw TypeError(".google.privacy.dlp.v2.ListInspectTemplatesResponse.inspectTemplates: array expected"); + message.inspectTemplates = []; + for (var i = 0; i < object.inspectTemplates.length; ++i) { + if (typeof object.inspectTemplates[i] !== "object") + throw TypeError(".google.privacy.dlp.v2.ListInspectTemplatesResponse.inspectTemplates: object expected"); + message.inspectTemplates[i] = $root.google.privacy.dlp.v2.InspectTemplate.fromObject(object.inspectTemplates[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListInspectTemplatesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.ListInspectTemplatesResponse + * @static + * @param {google.privacy.dlp.v2.ListInspectTemplatesResponse} message ListInspectTemplatesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListInspectTemplatesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.inspectTemplates = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.inspectTemplates && message.inspectTemplates.length) { + object.inspectTemplates = []; + for (var j = 0; j < message.inspectTemplates.length; ++j) + object.inspectTemplates[j] = $root.google.privacy.dlp.v2.InspectTemplate.toObject(message.inspectTemplates[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListInspectTemplatesResponse to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.ListInspectTemplatesResponse + * @instance + * @returns {Object.} JSON object + */ + ListInspectTemplatesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListInspectTemplatesResponse; + })(); + + v2.DeleteInspectTemplateRequest = (function() { + + /** + * Properties of a DeleteInspectTemplateRequest. + * @memberof google.privacy.dlp.v2 + * @interface IDeleteInspectTemplateRequest + * @property {string|null} [name] DeleteInspectTemplateRequest name + */ + + /** + * Constructs a new DeleteInspectTemplateRequest. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents a DeleteInspectTemplateRequest. + * @implements IDeleteInspectTemplateRequest + * @constructor + * @param {google.privacy.dlp.v2.IDeleteInspectTemplateRequest=} [properties] Properties to set + */ + function DeleteInspectTemplateRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteInspectTemplateRequest name. + * @member {string} name + * @memberof google.privacy.dlp.v2.DeleteInspectTemplateRequest + * @instance + */ + DeleteInspectTemplateRequest.prototype.name = ""; + + /** + * Creates a new DeleteInspectTemplateRequest instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.DeleteInspectTemplateRequest + * @static + * @param {google.privacy.dlp.v2.IDeleteInspectTemplateRequest=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.DeleteInspectTemplateRequest} DeleteInspectTemplateRequest instance + */ + DeleteInspectTemplateRequest.create = function create(properties) { + return new DeleteInspectTemplateRequest(properties); + }; + + /** + * Encodes the specified DeleteInspectTemplateRequest message. Does not implicitly {@link google.privacy.dlp.v2.DeleteInspectTemplateRequest.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.DeleteInspectTemplateRequest + * @static + * @param {google.privacy.dlp.v2.IDeleteInspectTemplateRequest} message DeleteInspectTemplateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteInspectTemplateRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified DeleteInspectTemplateRequest message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.DeleteInspectTemplateRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.DeleteInspectTemplateRequest + * @static + * @param {google.privacy.dlp.v2.IDeleteInspectTemplateRequest} message DeleteInspectTemplateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteInspectTemplateRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteInspectTemplateRequest message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.DeleteInspectTemplateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.DeleteInspectTemplateRequest} DeleteInspectTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteInspectTemplateRequest.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.privacy.dlp.v2.DeleteInspectTemplateRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteInspectTemplateRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.DeleteInspectTemplateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.DeleteInspectTemplateRequest} DeleteInspectTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteInspectTemplateRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteInspectTemplateRequest message. + * @function verify + * @memberof google.privacy.dlp.v2.DeleteInspectTemplateRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteInspectTemplateRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a DeleteInspectTemplateRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.DeleteInspectTemplateRequest + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.DeleteInspectTemplateRequest} DeleteInspectTemplateRequest + */ + DeleteInspectTemplateRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.DeleteInspectTemplateRequest) + return object; + var message = new $root.google.privacy.dlp.v2.DeleteInspectTemplateRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteInspectTemplateRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.DeleteInspectTemplateRequest + * @static + * @param {google.privacy.dlp.v2.DeleteInspectTemplateRequest} message DeleteInspectTemplateRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteInspectTemplateRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this DeleteInspectTemplateRequest to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.DeleteInspectTemplateRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteInspectTemplateRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeleteInspectTemplateRequest; + })(); + + v2.CreateJobTriggerRequest = (function() { + + /** + * Properties of a CreateJobTriggerRequest. + * @memberof google.privacy.dlp.v2 + * @interface ICreateJobTriggerRequest + * @property {string|null} [parent] CreateJobTriggerRequest parent + * @property {google.privacy.dlp.v2.IJobTrigger|null} [jobTrigger] CreateJobTriggerRequest jobTrigger + * @property {string|null} [triggerId] CreateJobTriggerRequest triggerId + * @property {string|null} [locationId] CreateJobTriggerRequest locationId + */ + + /** + * Constructs a new CreateJobTriggerRequest. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents a CreateJobTriggerRequest. + * @implements ICreateJobTriggerRequest + * @constructor + * @param {google.privacy.dlp.v2.ICreateJobTriggerRequest=} [properties] Properties to set + */ + function CreateJobTriggerRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateJobTriggerRequest parent. + * @member {string} parent + * @memberof google.privacy.dlp.v2.CreateJobTriggerRequest + * @instance + */ + CreateJobTriggerRequest.prototype.parent = ""; + + /** + * CreateJobTriggerRequest jobTrigger. + * @member {google.privacy.dlp.v2.IJobTrigger|null|undefined} jobTrigger + * @memberof google.privacy.dlp.v2.CreateJobTriggerRequest + * @instance + */ + CreateJobTriggerRequest.prototype.jobTrigger = null; + + /** + * CreateJobTriggerRequest triggerId. + * @member {string} triggerId + * @memberof google.privacy.dlp.v2.CreateJobTriggerRequest + * @instance + */ + CreateJobTriggerRequest.prototype.triggerId = ""; + + /** + * CreateJobTriggerRequest locationId. + * @member {string} locationId + * @memberof google.privacy.dlp.v2.CreateJobTriggerRequest + * @instance + */ + CreateJobTriggerRequest.prototype.locationId = ""; + + /** + * Creates a new CreateJobTriggerRequest instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.CreateJobTriggerRequest + * @static + * @param {google.privacy.dlp.v2.ICreateJobTriggerRequest=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.CreateJobTriggerRequest} CreateJobTriggerRequest instance + */ + CreateJobTriggerRequest.create = function create(properties) { + return new CreateJobTriggerRequest(properties); + }; + + /** + * Encodes the specified CreateJobTriggerRequest message. Does not implicitly {@link google.privacy.dlp.v2.CreateJobTriggerRequest.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.CreateJobTriggerRequest + * @static + * @param {google.privacy.dlp.v2.ICreateJobTriggerRequest} message CreateJobTriggerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateJobTriggerRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.jobTrigger != null && Object.hasOwnProperty.call(message, "jobTrigger")) + $root.google.privacy.dlp.v2.JobTrigger.encode(message.jobTrigger, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.triggerId != null && Object.hasOwnProperty.call(message, "triggerId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.triggerId); + if (message.locationId != null && Object.hasOwnProperty.call(message, "locationId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.locationId); + return writer; + }; + + /** + * Encodes the specified CreateJobTriggerRequest message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.CreateJobTriggerRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.CreateJobTriggerRequest + * @static + * @param {google.privacy.dlp.v2.ICreateJobTriggerRequest} message CreateJobTriggerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateJobTriggerRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateJobTriggerRequest message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.CreateJobTriggerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.CreateJobTriggerRequest} CreateJobTriggerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateJobTriggerRequest.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.privacy.dlp.v2.CreateJobTriggerRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.jobTrigger = $root.google.privacy.dlp.v2.JobTrigger.decode(reader, reader.uint32()); + break; + case 3: + message.triggerId = reader.string(); + break; + case 4: + message.locationId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateJobTriggerRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.CreateJobTriggerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.CreateJobTriggerRequest} CreateJobTriggerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateJobTriggerRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateJobTriggerRequest message. + * @function verify + * @memberof google.privacy.dlp.v2.CreateJobTriggerRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateJobTriggerRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.jobTrigger != null && message.hasOwnProperty("jobTrigger")) { + var error = $root.google.privacy.dlp.v2.JobTrigger.verify(message.jobTrigger); + if (error) + return "jobTrigger." + error; + } + if (message.triggerId != null && message.hasOwnProperty("triggerId")) + if (!$util.isString(message.triggerId)) + return "triggerId: string expected"; + if (message.locationId != null && message.hasOwnProperty("locationId")) + if (!$util.isString(message.locationId)) + return "locationId: string expected"; + return null; + }; + + /** + * Creates a CreateJobTriggerRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.CreateJobTriggerRequest + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.CreateJobTriggerRequest} CreateJobTriggerRequest + */ + CreateJobTriggerRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.CreateJobTriggerRequest) + return object; + var message = new $root.google.privacy.dlp.v2.CreateJobTriggerRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.jobTrigger != null) { + if (typeof object.jobTrigger !== "object") + throw TypeError(".google.privacy.dlp.v2.CreateJobTriggerRequest.jobTrigger: object expected"); + message.jobTrigger = $root.google.privacy.dlp.v2.JobTrigger.fromObject(object.jobTrigger); + } + if (object.triggerId != null) + message.triggerId = String(object.triggerId); + if (object.locationId != null) + message.locationId = String(object.locationId); + return message; + }; + + /** + * Creates a plain object from a CreateJobTriggerRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.CreateJobTriggerRequest + * @static + * @param {google.privacy.dlp.v2.CreateJobTriggerRequest} message CreateJobTriggerRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateJobTriggerRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.jobTrigger = null; + object.triggerId = ""; + object.locationId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.jobTrigger != null && message.hasOwnProperty("jobTrigger")) + object.jobTrigger = $root.google.privacy.dlp.v2.JobTrigger.toObject(message.jobTrigger, options); + if (message.triggerId != null && message.hasOwnProperty("triggerId")) + object.triggerId = message.triggerId; + if (message.locationId != null && message.hasOwnProperty("locationId")) + object.locationId = message.locationId; + return object; + }; + + /** + * Converts this CreateJobTriggerRequest to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.CreateJobTriggerRequest + * @instance + * @returns {Object.} JSON object + */ + CreateJobTriggerRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CreateJobTriggerRequest; + })(); + + v2.ActivateJobTriggerRequest = (function() { + + /** + * Properties of an ActivateJobTriggerRequest. + * @memberof google.privacy.dlp.v2 + * @interface IActivateJobTriggerRequest + * @property {string|null} [name] ActivateJobTriggerRequest name + */ + + /** + * Constructs a new ActivateJobTriggerRequest. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents an ActivateJobTriggerRequest. + * @implements IActivateJobTriggerRequest + * @constructor + * @param {google.privacy.dlp.v2.IActivateJobTriggerRequest=} [properties] Properties to set + */ + function ActivateJobTriggerRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ActivateJobTriggerRequest name. + * @member {string} name + * @memberof google.privacy.dlp.v2.ActivateJobTriggerRequest + * @instance + */ + ActivateJobTriggerRequest.prototype.name = ""; + + /** + * Creates a new ActivateJobTriggerRequest instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.ActivateJobTriggerRequest + * @static + * @param {google.privacy.dlp.v2.IActivateJobTriggerRequest=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.ActivateJobTriggerRequest} ActivateJobTriggerRequest instance + */ + ActivateJobTriggerRequest.create = function create(properties) { + return new ActivateJobTriggerRequest(properties); + }; + + /** + * Encodes the specified ActivateJobTriggerRequest message. Does not implicitly {@link google.privacy.dlp.v2.ActivateJobTriggerRequest.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.ActivateJobTriggerRequest + * @static + * @param {google.privacy.dlp.v2.IActivateJobTriggerRequest} message ActivateJobTriggerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ActivateJobTriggerRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified ActivateJobTriggerRequest message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.ActivateJobTriggerRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.ActivateJobTriggerRequest + * @static + * @param {google.privacy.dlp.v2.IActivateJobTriggerRequest} message ActivateJobTriggerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ActivateJobTriggerRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ActivateJobTriggerRequest message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.ActivateJobTriggerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.ActivateJobTriggerRequest} ActivateJobTriggerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ActivateJobTriggerRequest.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.privacy.dlp.v2.ActivateJobTriggerRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ActivateJobTriggerRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.ActivateJobTriggerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.ActivateJobTriggerRequest} ActivateJobTriggerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ActivateJobTriggerRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ActivateJobTriggerRequest message. + * @function verify + * @memberof google.privacy.dlp.v2.ActivateJobTriggerRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ActivateJobTriggerRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates an ActivateJobTriggerRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.ActivateJobTriggerRequest + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.ActivateJobTriggerRequest} ActivateJobTriggerRequest + */ + ActivateJobTriggerRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.ActivateJobTriggerRequest) + return object; + var message = new $root.google.privacy.dlp.v2.ActivateJobTriggerRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from an ActivateJobTriggerRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.ActivateJobTriggerRequest + * @static + * @param {google.privacy.dlp.v2.ActivateJobTriggerRequest} message ActivateJobTriggerRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ActivateJobTriggerRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this ActivateJobTriggerRequest to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.ActivateJobTriggerRequest + * @instance + * @returns {Object.} JSON object + */ + ActivateJobTriggerRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ActivateJobTriggerRequest; + })(); + + v2.UpdateJobTriggerRequest = (function() { + + /** + * Properties of an UpdateJobTriggerRequest. + * @memberof google.privacy.dlp.v2 + * @interface IUpdateJobTriggerRequest + * @property {string|null} [name] UpdateJobTriggerRequest name + * @property {google.privacy.dlp.v2.IJobTrigger|null} [jobTrigger] UpdateJobTriggerRequest jobTrigger + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateJobTriggerRequest updateMask + */ + + /** + * Constructs a new UpdateJobTriggerRequest. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents an UpdateJobTriggerRequest. + * @implements IUpdateJobTriggerRequest + * @constructor + * @param {google.privacy.dlp.v2.IUpdateJobTriggerRequest=} [properties] Properties to set + */ + function UpdateJobTriggerRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateJobTriggerRequest name. + * @member {string} name + * @memberof google.privacy.dlp.v2.UpdateJobTriggerRequest + * @instance + */ + UpdateJobTriggerRequest.prototype.name = ""; + + /** + * UpdateJobTriggerRequest jobTrigger. + * @member {google.privacy.dlp.v2.IJobTrigger|null|undefined} jobTrigger + * @memberof google.privacy.dlp.v2.UpdateJobTriggerRequest + * @instance + */ + UpdateJobTriggerRequest.prototype.jobTrigger = null; + + /** + * UpdateJobTriggerRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.privacy.dlp.v2.UpdateJobTriggerRequest + * @instance + */ + UpdateJobTriggerRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateJobTriggerRequest instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.UpdateJobTriggerRequest + * @static + * @param {google.privacy.dlp.v2.IUpdateJobTriggerRequest=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.UpdateJobTriggerRequest} UpdateJobTriggerRequest instance + */ + UpdateJobTriggerRequest.create = function create(properties) { + return new UpdateJobTriggerRequest(properties); + }; + + /** + * Encodes the specified UpdateJobTriggerRequest message. Does not implicitly {@link google.privacy.dlp.v2.UpdateJobTriggerRequest.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.UpdateJobTriggerRequest + * @static + * @param {google.privacy.dlp.v2.IUpdateJobTriggerRequest} message UpdateJobTriggerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateJobTriggerRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.jobTrigger != null && Object.hasOwnProperty.call(message, "jobTrigger")) + $root.google.privacy.dlp.v2.JobTrigger.encode(message.jobTrigger, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateJobTriggerRequest message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.UpdateJobTriggerRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.UpdateJobTriggerRequest + * @static + * @param {google.privacy.dlp.v2.IUpdateJobTriggerRequest} message UpdateJobTriggerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateJobTriggerRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateJobTriggerRequest message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.UpdateJobTriggerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.UpdateJobTriggerRequest} UpdateJobTriggerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateJobTriggerRequest.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.privacy.dlp.v2.UpdateJobTriggerRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.jobTrigger = $root.google.privacy.dlp.v2.JobTrigger.decode(reader, reader.uint32()); + break; + case 3: + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateJobTriggerRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.UpdateJobTriggerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.UpdateJobTriggerRequest} UpdateJobTriggerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateJobTriggerRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateJobTriggerRequest message. + * @function verify + * @memberof google.privacy.dlp.v2.UpdateJobTriggerRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateJobTriggerRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.jobTrigger != null && message.hasOwnProperty("jobTrigger")) { + var error = $root.google.privacy.dlp.v2.JobTrigger.verify(message.jobTrigger); + if (error) + return "jobTrigger." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateJobTriggerRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.UpdateJobTriggerRequest + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.UpdateJobTriggerRequest} UpdateJobTriggerRequest + */ + UpdateJobTriggerRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.UpdateJobTriggerRequest) + return object; + var message = new $root.google.privacy.dlp.v2.UpdateJobTriggerRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.jobTrigger != null) { + if (typeof object.jobTrigger !== "object") + throw TypeError(".google.privacy.dlp.v2.UpdateJobTriggerRequest.jobTrigger: object expected"); + message.jobTrigger = $root.google.privacy.dlp.v2.JobTrigger.fromObject(object.jobTrigger); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.privacy.dlp.v2.UpdateJobTriggerRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateJobTriggerRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.UpdateJobTriggerRequest + * @static + * @param {google.privacy.dlp.v2.UpdateJobTriggerRequest} message UpdateJobTriggerRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateJobTriggerRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.jobTrigger = null; + object.updateMask = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.jobTrigger != null && message.hasOwnProperty("jobTrigger")) + object.jobTrigger = $root.google.privacy.dlp.v2.JobTrigger.toObject(message.jobTrigger, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateJobTriggerRequest to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.UpdateJobTriggerRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateJobTriggerRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UpdateJobTriggerRequest; + })(); + + v2.GetJobTriggerRequest = (function() { + + /** + * Properties of a GetJobTriggerRequest. + * @memberof google.privacy.dlp.v2 + * @interface IGetJobTriggerRequest + * @property {string|null} [name] GetJobTriggerRequest name + */ + + /** + * Constructs a new GetJobTriggerRequest. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents a GetJobTriggerRequest. + * @implements IGetJobTriggerRequest + * @constructor + * @param {google.privacy.dlp.v2.IGetJobTriggerRequest=} [properties] Properties to set + */ + function GetJobTriggerRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetJobTriggerRequest name. + * @member {string} name + * @memberof google.privacy.dlp.v2.GetJobTriggerRequest + * @instance + */ + GetJobTriggerRequest.prototype.name = ""; + + /** + * Creates a new GetJobTriggerRequest instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.GetJobTriggerRequest + * @static + * @param {google.privacy.dlp.v2.IGetJobTriggerRequest=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.GetJobTriggerRequest} GetJobTriggerRequest instance + */ + GetJobTriggerRequest.create = function create(properties) { + return new GetJobTriggerRequest(properties); + }; + + /** + * Encodes the specified GetJobTriggerRequest message. Does not implicitly {@link google.privacy.dlp.v2.GetJobTriggerRequest.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.GetJobTriggerRequest + * @static + * @param {google.privacy.dlp.v2.IGetJobTriggerRequest} message GetJobTriggerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetJobTriggerRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetJobTriggerRequest message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.GetJobTriggerRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.GetJobTriggerRequest + * @static + * @param {google.privacy.dlp.v2.IGetJobTriggerRequest} message GetJobTriggerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetJobTriggerRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetJobTriggerRequest message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.GetJobTriggerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.GetJobTriggerRequest} GetJobTriggerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetJobTriggerRequest.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.privacy.dlp.v2.GetJobTriggerRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetJobTriggerRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.GetJobTriggerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.GetJobTriggerRequest} GetJobTriggerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetJobTriggerRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetJobTriggerRequest message. + * @function verify + * @memberof google.privacy.dlp.v2.GetJobTriggerRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetJobTriggerRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetJobTriggerRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.GetJobTriggerRequest + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.GetJobTriggerRequest} GetJobTriggerRequest + */ + GetJobTriggerRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.GetJobTriggerRequest) + return object; + var message = new $root.google.privacy.dlp.v2.GetJobTriggerRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetJobTriggerRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.GetJobTriggerRequest + * @static + * @param {google.privacy.dlp.v2.GetJobTriggerRequest} message GetJobTriggerRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetJobTriggerRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetJobTriggerRequest to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.GetJobTriggerRequest + * @instance + * @returns {Object.} JSON object + */ + GetJobTriggerRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetJobTriggerRequest; + })(); + + v2.CreateDlpJobRequest = (function() { + + /** + * Properties of a CreateDlpJobRequest. + * @memberof google.privacy.dlp.v2 + * @interface ICreateDlpJobRequest + * @property {string|null} [parent] CreateDlpJobRequest parent + * @property {google.privacy.dlp.v2.IInspectJobConfig|null} [inspectJob] CreateDlpJobRequest inspectJob + * @property {google.privacy.dlp.v2.IRiskAnalysisJobConfig|null} [riskJob] CreateDlpJobRequest riskJob + * @property {string|null} [jobId] CreateDlpJobRequest jobId + * @property {string|null} [locationId] CreateDlpJobRequest locationId + */ + + /** + * Constructs a new CreateDlpJobRequest. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents a CreateDlpJobRequest. + * @implements ICreateDlpJobRequest + * @constructor + * @param {google.privacy.dlp.v2.ICreateDlpJobRequest=} [properties] Properties to set + */ + function CreateDlpJobRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateDlpJobRequest parent. + * @member {string} parent + * @memberof google.privacy.dlp.v2.CreateDlpJobRequest + * @instance + */ + CreateDlpJobRequest.prototype.parent = ""; + + /** + * CreateDlpJobRequest inspectJob. + * @member {google.privacy.dlp.v2.IInspectJobConfig|null|undefined} inspectJob + * @memberof google.privacy.dlp.v2.CreateDlpJobRequest + * @instance + */ + CreateDlpJobRequest.prototype.inspectJob = null; + + /** + * CreateDlpJobRequest riskJob. + * @member {google.privacy.dlp.v2.IRiskAnalysisJobConfig|null|undefined} riskJob + * @memberof google.privacy.dlp.v2.CreateDlpJobRequest + * @instance + */ + CreateDlpJobRequest.prototype.riskJob = null; + + /** + * CreateDlpJobRequest jobId. + * @member {string} jobId + * @memberof google.privacy.dlp.v2.CreateDlpJobRequest + * @instance + */ + CreateDlpJobRequest.prototype.jobId = ""; + + /** + * CreateDlpJobRequest locationId. + * @member {string} locationId + * @memberof google.privacy.dlp.v2.CreateDlpJobRequest + * @instance + */ + CreateDlpJobRequest.prototype.locationId = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * CreateDlpJobRequest job. + * @member {"inspectJob"|"riskJob"|undefined} job + * @memberof google.privacy.dlp.v2.CreateDlpJobRequest + * @instance + */ + Object.defineProperty(CreateDlpJobRequest.prototype, "job", { + get: $util.oneOfGetter($oneOfFields = ["inspectJob", "riskJob"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CreateDlpJobRequest instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.CreateDlpJobRequest + * @static + * @param {google.privacy.dlp.v2.ICreateDlpJobRequest=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.CreateDlpJobRequest} CreateDlpJobRequest instance + */ + CreateDlpJobRequest.create = function create(properties) { + return new CreateDlpJobRequest(properties); + }; + + /** + * Encodes the specified CreateDlpJobRequest message. Does not implicitly {@link google.privacy.dlp.v2.CreateDlpJobRequest.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.CreateDlpJobRequest + * @static + * @param {google.privacy.dlp.v2.ICreateDlpJobRequest} message CreateDlpJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateDlpJobRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.inspectJob != null && Object.hasOwnProperty.call(message, "inspectJob")) + $root.google.privacy.dlp.v2.InspectJobConfig.encode(message.inspectJob, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.riskJob != null && Object.hasOwnProperty.call(message, "riskJob")) + $root.google.privacy.dlp.v2.RiskAnalysisJobConfig.encode(message.riskJob, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.jobId != null && Object.hasOwnProperty.call(message, "jobId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.jobId); + if (message.locationId != null && Object.hasOwnProperty.call(message, "locationId")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.locationId); + return writer; + }; + + /** + * Encodes the specified CreateDlpJobRequest message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.CreateDlpJobRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.CreateDlpJobRequest + * @static + * @param {google.privacy.dlp.v2.ICreateDlpJobRequest} message CreateDlpJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateDlpJobRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateDlpJobRequest message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.CreateDlpJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.CreateDlpJobRequest} CreateDlpJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateDlpJobRequest.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.privacy.dlp.v2.CreateDlpJobRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.inspectJob = $root.google.privacy.dlp.v2.InspectJobConfig.decode(reader, reader.uint32()); + break; + case 3: + message.riskJob = $root.google.privacy.dlp.v2.RiskAnalysisJobConfig.decode(reader, reader.uint32()); + break; + case 4: + message.jobId = reader.string(); + break; + case 5: + message.locationId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateDlpJobRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.CreateDlpJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.CreateDlpJobRequest} CreateDlpJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateDlpJobRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateDlpJobRequest message. + * @function verify + * @memberof google.privacy.dlp.v2.CreateDlpJobRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateDlpJobRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.inspectJob != null && message.hasOwnProperty("inspectJob")) { + properties.job = 1; + { + var error = $root.google.privacy.dlp.v2.InspectJobConfig.verify(message.inspectJob); + if (error) + return "inspectJob." + error; + } + } + if (message.riskJob != null && message.hasOwnProperty("riskJob")) { + if (properties.job === 1) + return "job: multiple values"; + properties.job = 1; + { + var error = $root.google.privacy.dlp.v2.RiskAnalysisJobConfig.verify(message.riskJob); + if (error) + return "riskJob." + error; + } + } + if (message.jobId != null && message.hasOwnProperty("jobId")) + if (!$util.isString(message.jobId)) + return "jobId: string expected"; + if (message.locationId != null && message.hasOwnProperty("locationId")) + if (!$util.isString(message.locationId)) + return "locationId: string expected"; + return null; + }; + + /** + * Creates a CreateDlpJobRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.CreateDlpJobRequest + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.CreateDlpJobRequest} CreateDlpJobRequest + */ + CreateDlpJobRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.CreateDlpJobRequest) + return object; + var message = new $root.google.privacy.dlp.v2.CreateDlpJobRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.inspectJob != null) { + if (typeof object.inspectJob !== "object") + throw TypeError(".google.privacy.dlp.v2.CreateDlpJobRequest.inspectJob: object expected"); + message.inspectJob = $root.google.privacy.dlp.v2.InspectJobConfig.fromObject(object.inspectJob); + } + if (object.riskJob != null) { + if (typeof object.riskJob !== "object") + throw TypeError(".google.privacy.dlp.v2.CreateDlpJobRequest.riskJob: object expected"); + message.riskJob = $root.google.privacy.dlp.v2.RiskAnalysisJobConfig.fromObject(object.riskJob); + } + if (object.jobId != null) + message.jobId = String(object.jobId); + if (object.locationId != null) + message.locationId = String(object.locationId); + return message; + }; + + /** + * Creates a plain object from a CreateDlpJobRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.CreateDlpJobRequest + * @static + * @param {google.privacy.dlp.v2.CreateDlpJobRequest} message CreateDlpJobRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateDlpJobRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.jobId = ""; + object.locationId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.inspectJob != null && message.hasOwnProperty("inspectJob")) { + object.inspectJob = $root.google.privacy.dlp.v2.InspectJobConfig.toObject(message.inspectJob, options); + if (options.oneofs) + object.job = "inspectJob"; + } + if (message.riskJob != null && message.hasOwnProperty("riskJob")) { + object.riskJob = $root.google.privacy.dlp.v2.RiskAnalysisJobConfig.toObject(message.riskJob, options); + if (options.oneofs) + object.job = "riskJob"; + } + if (message.jobId != null && message.hasOwnProperty("jobId")) + object.jobId = message.jobId; + if (message.locationId != null && message.hasOwnProperty("locationId")) + object.locationId = message.locationId; + return object; + }; + + /** + * Converts this CreateDlpJobRequest to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.CreateDlpJobRequest + * @instance + * @returns {Object.} JSON object + */ + CreateDlpJobRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CreateDlpJobRequest; + })(); + + v2.ListJobTriggersRequest = (function() { + + /** + * Properties of a ListJobTriggersRequest. + * @memberof google.privacy.dlp.v2 + * @interface IListJobTriggersRequest + * @property {string|null} [parent] ListJobTriggersRequest parent + * @property {string|null} [pageToken] ListJobTriggersRequest pageToken + * @property {number|null} [pageSize] ListJobTriggersRequest pageSize + * @property {string|null} [orderBy] ListJobTriggersRequest orderBy + * @property {string|null} [filter] ListJobTriggersRequest filter + * @property {string|null} [locationId] ListJobTriggersRequest locationId + */ + + /** + * Constructs a new ListJobTriggersRequest. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents a ListJobTriggersRequest. + * @implements IListJobTriggersRequest + * @constructor + * @param {google.privacy.dlp.v2.IListJobTriggersRequest=} [properties] Properties to set + */ + function ListJobTriggersRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListJobTriggersRequest parent. + * @member {string} parent + * @memberof google.privacy.dlp.v2.ListJobTriggersRequest + * @instance + */ + ListJobTriggersRequest.prototype.parent = ""; + + /** + * ListJobTriggersRequest pageToken. + * @member {string} pageToken + * @memberof google.privacy.dlp.v2.ListJobTriggersRequest + * @instance + */ + ListJobTriggersRequest.prototype.pageToken = ""; + + /** + * ListJobTriggersRequest pageSize. + * @member {number} pageSize + * @memberof google.privacy.dlp.v2.ListJobTriggersRequest + * @instance + */ + ListJobTriggersRequest.prototype.pageSize = 0; + + /** + * ListJobTriggersRequest orderBy. + * @member {string} orderBy + * @memberof google.privacy.dlp.v2.ListJobTriggersRequest + * @instance + */ + ListJobTriggersRequest.prototype.orderBy = ""; + + /** + * ListJobTriggersRequest filter. + * @member {string} filter + * @memberof google.privacy.dlp.v2.ListJobTriggersRequest + * @instance + */ + ListJobTriggersRequest.prototype.filter = ""; + + /** + * ListJobTriggersRequest locationId. + * @member {string} locationId + * @memberof google.privacy.dlp.v2.ListJobTriggersRequest + * @instance + */ + ListJobTriggersRequest.prototype.locationId = ""; + + /** + * Creates a new ListJobTriggersRequest instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.ListJobTriggersRequest + * @static + * @param {google.privacy.dlp.v2.IListJobTriggersRequest=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.ListJobTriggersRequest} ListJobTriggersRequest instance + */ + ListJobTriggersRequest.create = function create(properties) { + return new ListJobTriggersRequest(properties); + }; + + /** + * Encodes the specified ListJobTriggersRequest message. Does not implicitly {@link google.privacy.dlp.v2.ListJobTriggersRequest.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.ListJobTriggersRequest + * @static + * @param {google.privacy.dlp.v2.IListJobTriggersRequest} message ListJobTriggersRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListJobTriggersRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pageToken); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.orderBy); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.filter); + if (message.locationId != null && Object.hasOwnProperty.call(message, "locationId")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.locationId); + return writer; + }; + + /** + * Encodes the specified ListJobTriggersRequest message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.ListJobTriggersRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.ListJobTriggersRequest + * @static + * @param {google.privacy.dlp.v2.IListJobTriggersRequest} message ListJobTriggersRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListJobTriggersRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListJobTriggersRequest message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.ListJobTriggersRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.ListJobTriggersRequest} ListJobTriggersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListJobTriggersRequest.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.privacy.dlp.v2.ListJobTriggersRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.pageToken = reader.string(); + break; + case 3: + message.pageSize = reader.int32(); + break; + case 4: + message.orderBy = reader.string(); + break; + case 5: + message.filter = reader.string(); + break; + case 7: + message.locationId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListJobTriggersRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.ListJobTriggersRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.ListJobTriggersRequest} ListJobTriggersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListJobTriggersRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListJobTriggersRequest message. + * @function verify + * @memberof google.privacy.dlp.v2.ListJobTriggersRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListJobTriggersRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.locationId != null && message.hasOwnProperty("locationId")) + if (!$util.isString(message.locationId)) + return "locationId: string expected"; + return null; + }; + + /** + * Creates a ListJobTriggersRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.ListJobTriggersRequest + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.ListJobTriggersRequest} ListJobTriggersRequest + */ + ListJobTriggersRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.ListJobTriggersRequest) + return object; + var message = new $root.google.privacy.dlp.v2.ListJobTriggersRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.filter != null) + message.filter = String(object.filter); + if (object.locationId != null) + message.locationId = String(object.locationId); + return message; + }; + + /** + * Creates a plain object from a ListJobTriggersRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.ListJobTriggersRequest + * @static + * @param {google.privacy.dlp.v2.ListJobTriggersRequest} message ListJobTriggersRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListJobTriggersRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageToken = ""; + object.pageSize = 0; + object.orderBy = ""; + object.filter = ""; + object.locationId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.locationId != null && message.hasOwnProperty("locationId")) + object.locationId = message.locationId; + return object; + }; + + /** + * Converts this ListJobTriggersRequest to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.ListJobTriggersRequest + * @instance + * @returns {Object.} JSON object + */ + ListJobTriggersRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListJobTriggersRequest; + })(); + + v2.ListJobTriggersResponse = (function() { + + /** + * Properties of a ListJobTriggersResponse. + * @memberof google.privacy.dlp.v2 + * @interface IListJobTriggersResponse + * @property {Array.|null} [jobTriggers] ListJobTriggersResponse jobTriggers + * @property {string|null} [nextPageToken] ListJobTriggersResponse nextPageToken + */ + + /** + * Constructs a new ListJobTriggersResponse. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents a ListJobTriggersResponse. + * @implements IListJobTriggersResponse + * @constructor + * @param {google.privacy.dlp.v2.IListJobTriggersResponse=} [properties] Properties to set + */ + function ListJobTriggersResponse(properties) { + this.jobTriggers = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListJobTriggersResponse jobTriggers. + * @member {Array.} jobTriggers + * @memberof google.privacy.dlp.v2.ListJobTriggersResponse + * @instance + */ + ListJobTriggersResponse.prototype.jobTriggers = $util.emptyArray; + + /** + * ListJobTriggersResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.privacy.dlp.v2.ListJobTriggersResponse + * @instance + */ + ListJobTriggersResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListJobTriggersResponse instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.ListJobTriggersResponse + * @static + * @param {google.privacy.dlp.v2.IListJobTriggersResponse=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.ListJobTriggersResponse} ListJobTriggersResponse instance + */ + ListJobTriggersResponse.create = function create(properties) { + return new ListJobTriggersResponse(properties); + }; + + /** + * Encodes the specified ListJobTriggersResponse message. Does not implicitly {@link google.privacy.dlp.v2.ListJobTriggersResponse.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.ListJobTriggersResponse + * @static + * @param {google.privacy.dlp.v2.IListJobTriggersResponse} message ListJobTriggersResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListJobTriggersResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.jobTriggers != null && message.jobTriggers.length) + for (var i = 0; i < message.jobTriggers.length; ++i) + $root.google.privacy.dlp.v2.JobTrigger.encode(message.jobTriggers[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListJobTriggersResponse message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.ListJobTriggersResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.ListJobTriggersResponse + * @static + * @param {google.privacy.dlp.v2.IListJobTriggersResponse} message ListJobTriggersResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListJobTriggersResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListJobTriggersResponse message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.ListJobTriggersResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.ListJobTriggersResponse} ListJobTriggersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListJobTriggersResponse.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.privacy.dlp.v2.ListJobTriggersResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.jobTriggers && message.jobTriggers.length)) + message.jobTriggers = []; + message.jobTriggers.push($root.google.privacy.dlp.v2.JobTrigger.decode(reader, reader.uint32())); + break; + case 2: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListJobTriggersResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.ListJobTriggersResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.ListJobTriggersResponse} ListJobTriggersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListJobTriggersResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListJobTriggersResponse message. + * @function verify + * @memberof google.privacy.dlp.v2.ListJobTriggersResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListJobTriggersResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.jobTriggers != null && message.hasOwnProperty("jobTriggers")) { + if (!Array.isArray(message.jobTriggers)) + return "jobTriggers: array expected"; + for (var i = 0; i < message.jobTriggers.length; ++i) { + var error = $root.google.privacy.dlp.v2.JobTrigger.verify(message.jobTriggers[i]); + if (error) + return "jobTriggers." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListJobTriggersResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.ListJobTriggersResponse + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.ListJobTriggersResponse} ListJobTriggersResponse + */ + ListJobTriggersResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.ListJobTriggersResponse) + return object; + var message = new $root.google.privacy.dlp.v2.ListJobTriggersResponse(); + if (object.jobTriggers) { + if (!Array.isArray(object.jobTriggers)) + throw TypeError(".google.privacy.dlp.v2.ListJobTriggersResponse.jobTriggers: array expected"); + message.jobTriggers = []; + for (var i = 0; i < object.jobTriggers.length; ++i) { + if (typeof object.jobTriggers[i] !== "object") + throw TypeError(".google.privacy.dlp.v2.ListJobTriggersResponse.jobTriggers: object expected"); + message.jobTriggers[i] = $root.google.privacy.dlp.v2.JobTrigger.fromObject(object.jobTriggers[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListJobTriggersResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.ListJobTriggersResponse + * @static + * @param {google.privacy.dlp.v2.ListJobTriggersResponse} message ListJobTriggersResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListJobTriggersResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.jobTriggers = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.jobTriggers && message.jobTriggers.length) { + object.jobTriggers = []; + for (var j = 0; j < message.jobTriggers.length; ++j) + object.jobTriggers[j] = $root.google.privacy.dlp.v2.JobTrigger.toObject(message.jobTriggers[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListJobTriggersResponse to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.ListJobTriggersResponse + * @instance + * @returns {Object.} JSON object + */ + ListJobTriggersResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListJobTriggersResponse; + })(); + + v2.DeleteJobTriggerRequest = (function() { + + /** + * Properties of a DeleteJobTriggerRequest. + * @memberof google.privacy.dlp.v2 + * @interface IDeleteJobTriggerRequest + * @property {string|null} [name] DeleteJobTriggerRequest name + */ + + /** + * Constructs a new DeleteJobTriggerRequest. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents a DeleteJobTriggerRequest. + * @implements IDeleteJobTriggerRequest + * @constructor + * @param {google.privacy.dlp.v2.IDeleteJobTriggerRequest=} [properties] Properties to set + */ + function DeleteJobTriggerRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteJobTriggerRequest name. + * @member {string} name + * @memberof google.privacy.dlp.v2.DeleteJobTriggerRequest + * @instance + */ + DeleteJobTriggerRequest.prototype.name = ""; + + /** + * Creates a new DeleteJobTriggerRequest instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.DeleteJobTriggerRequest + * @static + * @param {google.privacy.dlp.v2.IDeleteJobTriggerRequest=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.DeleteJobTriggerRequest} DeleteJobTriggerRequest instance + */ + DeleteJobTriggerRequest.create = function create(properties) { + return new DeleteJobTriggerRequest(properties); + }; + + /** + * Encodes the specified DeleteJobTriggerRequest message. Does not implicitly {@link google.privacy.dlp.v2.DeleteJobTriggerRequest.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.DeleteJobTriggerRequest + * @static + * @param {google.privacy.dlp.v2.IDeleteJobTriggerRequest} message DeleteJobTriggerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteJobTriggerRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified DeleteJobTriggerRequest message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.DeleteJobTriggerRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.DeleteJobTriggerRequest + * @static + * @param {google.privacy.dlp.v2.IDeleteJobTriggerRequest} message DeleteJobTriggerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteJobTriggerRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteJobTriggerRequest message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.DeleteJobTriggerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.DeleteJobTriggerRequest} DeleteJobTriggerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteJobTriggerRequest.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.privacy.dlp.v2.DeleteJobTriggerRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteJobTriggerRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.DeleteJobTriggerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.DeleteJobTriggerRequest} DeleteJobTriggerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteJobTriggerRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteJobTriggerRequest message. + * @function verify + * @memberof google.privacy.dlp.v2.DeleteJobTriggerRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteJobTriggerRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a DeleteJobTriggerRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.DeleteJobTriggerRequest + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.DeleteJobTriggerRequest} DeleteJobTriggerRequest + */ + DeleteJobTriggerRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.DeleteJobTriggerRequest) + return object; + var message = new $root.google.privacy.dlp.v2.DeleteJobTriggerRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteJobTriggerRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.DeleteJobTriggerRequest + * @static + * @param {google.privacy.dlp.v2.DeleteJobTriggerRequest} message DeleteJobTriggerRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteJobTriggerRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this DeleteJobTriggerRequest to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.DeleteJobTriggerRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteJobTriggerRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeleteJobTriggerRequest; + })(); + + v2.InspectJobConfig = (function() { + + /** + * Properties of an InspectJobConfig. + * @memberof google.privacy.dlp.v2 + * @interface IInspectJobConfig + * @property {google.privacy.dlp.v2.IStorageConfig|null} [storageConfig] InspectJobConfig storageConfig + * @property {google.privacy.dlp.v2.IInspectConfig|null} [inspectConfig] InspectJobConfig inspectConfig + * @property {string|null} [inspectTemplateName] InspectJobConfig inspectTemplateName + * @property {Array.|null} [actions] InspectJobConfig actions + */ + + /** + * Constructs a new InspectJobConfig. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents an InspectJobConfig. + * @implements IInspectJobConfig + * @constructor + * @param {google.privacy.dlp.v2.IInspectJobConfig=} [properties] Properties to set + */ + function InspectJobConfig(properties) { + this.actions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InspectJobConfig storageConfig. + * @member {google.privacy.dlp.v2.IStorageConfig|null|undefined} storageConfig + * @memberof google.privacy.dlp.v2.InspectJobConfig + * @instance + */ + InspectJobConfig.prototype.storageConfig = null; + + /** + * InspectJobConfig inspectConfig. + * @member {google.privacy.dlp.v2.IInspectConfig|null|undefined} inspectConfig + * @memberof google.privacy.dlp.v2.InspectJobConfig + * @instance + */ + InspectJobConfig.prototype.inspectConfig = null; + + /** + * InspectJobConfig inspectTemplateName. + * @member {string} inspectTemplateName + * @memberof google.privacy.dlp.v2.InspectJobConfig + * @instance + */ + InspectJobConfig.prototype.inspectTemplateName = ""; + + /** + * InspectJobConfig actions. + * @member {Array.} actions + * @memberof google.privacy.dlp.v2.InspectJobConfig + * @instance + */ + InspectJobConfig.prototype.actions = $util.emptyArray; + + /** + * Creates a new InspectJobConfig instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.InspectJobConfig + * @static + * @param {google.privacy.dlp.v2.IInspectJobConfig=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.InspectJobConfig} InspectJobConfig instance + */ + InspectJobConfig.create = function create(properties) { + return new InspectJobConfig(properties); + }; + + /** + * Encodes the specified InspectJobConfig message. Does not implicitly {@link google.privacy.dlp.v2.InspectJobConfig.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.InspectJobConfig + * @static + * @param {google.privacy.dlp.v2.IInspectJobConfig} message InspectJobConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InspectJobConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.storageConfig != null && Object.hasOwnProperty.call(message, "storageConfig")) + $root.google.privacy.dlp.v2.StorageConfig.encode(message.storageConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.inspectConfig != null && Object.hasOwnProperty.call(message, "inspectConfig")) + $root.google.privacy.dlp.v2.InspectConfig.encode(message.inspectConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.inspectTemplateName != null && Object.hasOwnProperty.call(message, "inspectTemplateName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.inspectTemplateName); + if (message.actions != null && message.actions.length) + for (var i = 0; i < message.actions.length; ++i) + $root.google.privacy.dlp.v2.Action.encode(message.actions[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified InspectJobConfig message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.InspectJobConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.InspectJobConfig + * @static + * @param {google.privacy.dlp.v2.IInspectJobConfig} message InspectJobConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InspectJobConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InspectJobConfig message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.InspectJobConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.InspectJobConfig} InspectJobConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InspectJobConfig.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.privacy.dlp.v2.InspectJobConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.storageConfig = $root.google.privacy.dlp.v2.StorageConfig.decode(reader, reader.uint32()); + break; + case 2: + message.inspectConfig = $root.google.privacy.dlp.v2.InspectConfig.decode(reader, reader.uint32()); + break; + case 3: + message.inspectTemplateName = reader.string(); + break; + case 4: + if (!(message.actions && message.actions.length)) + message.actions = []; + message.actions.push($root.google.privacy.dlp.v2.Action.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InspectJobConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.InspectJobConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.InspectJobConfig} InspectJobConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InspectJobConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InspectJobConfig message. + * @function verify + * @memberof google.privacy.dlp.v2.InspectJobConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InspectJobConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.storageConfig != null && message.hasOwnProperty("storageConfig")) { + var error = $root.google.privacy.dlp.v2.StorageConfig.verify(message.storageConfig); + if (error) + return "storageConfig." + error; + } + if (message.inspectConfig != null && message.hasOwnProperty("inspectConfig")) { + var error = $root.google.privacy.dlp.v2.InspectConfig.verify(message.inspectConfig); + if (error) + return "inspectConfig." + error; + } + if (message.inspectTemplateName != null && message.hasOwnProperty("inspectTemplateName")) + if (!$util.isString(message.inspectTemplateName)) + return "inspectTemplateName: string expected"; + if (message.actions != null && message.hasOwnProperty("actions")) { + if (!Array.isArray(message.actions)) + return "actions: array expected"; + for (var i = 0; i < message.actions.length; ++i) { + var error = $root.google.privacy.dlp.v2.Action.verify(message.actions[i]); + if (error) + return "actions." + error; + } + } + return null; + }; + + /** + * Creates an InspectJobConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.InspectJobConfig + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.InspectJobConfig} InspectJobConfig + */ + InspectJobConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.InspectJobConfig) + return object; + var message = new $root.google.privacy.dlp.v2.InspectJobConfig(); + if (object.storageConfig != null) { + if (typeof object.storageConfig !== "object") + throw TypeError(".google.privacy.dlp.v2.InspectJobConfig.storageConfig: object expected"); + message.storageConfig = $root.google.privacy.dlp.v2.StorageConfig.fromObject(object.storageConfig); + } + if (object.inspectConfig != null) { + if (typeof object.inspectConfig !== "object") + throw TypeError(".google.privacy.dlp.v2.InspectJobConfig.inspectConfig: object expected"); + message.inspectConfig = $root.google.privacy.dlp.v2.InspectConfig.fromObject(object.inspectConfig); + } + if (object.inspectTemplateName != null) + message.inspectTemplateName = String(object.inspectTemplateName); + if (object.actions) { + if (!Array.isArray(object.actions)) + throw TypeError(".google.privacy.dlp.v2.InspectJobConfig.actions: array expected"); + message.actions = []; + for (var i = 0; i < object.actions.length; ++i) { + if (typeof object.actions[i] !== "object") + throw TypeError(".google.privacy.dlp.v2.InspectJobConfig.actions: object expected"); + message.actions[i] = $root.google.privacy.dlp.v2.Action.fromObject(object.actions[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an InspectJobConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.InspectJobConfig + * @static + * @param {google.privacy.dlp.v2.InspectJobConfig} message InspectJobConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InspectJobConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.actions = []; + if (options.defaults) { + object.storageConfig = null; + object.inspectConfig = null; + object.inspectTemplateName = ""; + } + if (message.storageConfig != null && message.hasOwnProperty("storageConfig")) + object.storageConfig = $root.google.privacy.dlp.v2.StorageConfig.toObject(message.storageConfig, options); + if (message.inspectConfig != null && message.hasOwnProperty("inspectConfig")) + object.inspectConfig = $root.google.privacy.dlp.v2.InspectConfig.toObject(message.inspectConfig, options); + if (message.inspectTemplateName != null && message.hasOwnProperty("inspectTemplateName")) + object.inspectTemplateName = message.inspectTemplateName; + if (message.actions && message.actions.length) { + object.actions = []; + for (var j = 0; j < message.actions.length; ++j) + object.actions[j] = $root.google.privacy.dlp.v2.Action.toObject(message.actions[j], options); + } + return object; + }; + + /** + * Converts this InspectJobConfig to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.InspectJobConfig + * @instance + * @returns {Object.} JSON object + */ + InspectJobConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InspectJobConfig; + })(); + + v2.DlpJob = (function() { + + /** + * Properties of a DlpJob. + * @memberof google.privacy.dlp.v2 + * @interface IDlpJob + * @property {string|null} [name] DlpJob name + * @property {google.privacy.dlp.v2.DlpJobType|null} [type] DlpJob type + * @property {google.privacy.dlp.v2.DlpJob.JobState|null} [state] DlpJob state + * @property {google.privacy.dlp.v2.IAnalyzeDataSourceRiskDetails|null} [riskDetails] DlpJob riskDetails + * @property {google.privacy.dlp.v2.IInspectDataSourceDetails|null} [inspectDetails] DlpJob inspectDetails + * @property {google.protobuf.ITimestamp|null} [createTime] DlpJob createTime + * @property {google.protobuf.ITimestamp|null} [startTime] DlpJob startTime + * @property {google.protobuf.ITimestamp|null} [endTime] DlpJob endTime + * @property {string|null} [jobTriggerName] DlpJob jobTriggerName + * @property {Array.|null} [errors] DlpJob errors + */ + + /** + * Constructs a new DlpJob. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents a DlpJob. + * @implements IDlpJob + * @constructor + * @param {google.privacy.dlp.v2.IDlpJob=} [properties] Properties to set + */ + function DlpJob(properties) { + this.errors = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DlpJob name. + * @member {string} name + * @memberof google.privacy.dlp.v2.DlpJob + * @instance + */ + DlpJob.prototype.name = ""; + + /** + * DlpJob type. + * @member {google.privacy.dlp.v2.DlpJobType} type + * @memberof google.privacy.dlp.v2.DlpJob + * @instance + */ + DlpJob.prototype.type = 0; + + /** + * DlpJob state. + * @member {google.privacy.dlp.v2.DlpJob.JobState} state + * @memberof google.privacy.dlp.v2.DlpJob + * @instance + */ + DlpJob.prototype.state = 0; + + /** + * DlpJob riskDetails. + * @member {google.privacy.dlp.v2.IAnalyzeDataSourceRiskDetails|null|undefined} riskDetails + * @memberof google.privacy.dlp.v2.DlpJob + * @instance + */ + DlpJob.prototype.riskDetails = null; + + /** + * DlpJob inspectDetails. + * @member {google.privacy.dlp.v2.IInspectDataSourceDetails|null|undefined} inspectDetails + * @memberof google.privacy.dlp.v2.DlpJob + * @instance + */ + DlpJob.prototype.inspectDetails = null; + + /** + * DlpJob createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.privacy.dlp.v2.DlpJob + * @instance + */ + DlpJob.prototype.createTime = null; + + /** + * DlpJob startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.privacy.dlp.v2.DlpJob + * @instance + */ + DlpJob.prototype.startTime = null; + + /** + * DlpJob endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.privacy.dlp.v2.DlpJob + * @instance + */ + DlpJob.prototype.endTime = null; + + /** + * DlpJob jobTriggerName. + * @member {string} jobTriggerName + * @memberof google.privacy.dlp.v2.DlpJob + * @instance + */ + DlpJob.prototype.jobTriggerName = ""; + + /** + * DlpJob errors. + * @member {Array.} errors + * @memberof google.privacy.dlp.v2.DlpJob + * @instance + */ + DlpJob.prototype.errors = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DlpJob details. + * @member {"riskDetails"|"inspectDetails"|undefined} details + * @memberof google.privacy.dlp.v2.DlpJob + * @instance + */ + Object.defineProperty(DlpJob.prototype, "details", { + get: $util.oneOfGetter($oneOfFields = ["riskDetails", "inspectDetails"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DlpJob instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.DlpJob + * @static + * @param {google.privacy.dlp.v2.IDlpJob=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.DlpJob} DlpJob instance + */ + DlpJob.create = function create(properties) { + return new DlpJob(properties); + }; + + /** + * Encodes the specified DlpJob message. Does not implicitly {@link google.privacy.dlp.v2.DlpJob.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.DlpJob + * @static + * @param {google.privacy.dlp.v2.IDlpJob} message DlpJob message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DlpJob.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.type); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.state); + if (message.riskDetails != null && Object.hasOwnProperty.call(message, "riskDetails")) + $root.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.encode(message.riskDetails, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.inspectDetails != null && Object.hasOwnProperty.call(message, "inspectDetails")) + $root.google.privacy.dlp.v2.InspectDataSourceDetails.encode(message.inspectDetails, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.jobTriggerName != null && Object.hasOwnProperty.call(message, "jobTriggerName")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.jobTriggerName); + if (message.errors != null && message.errors.length) + for (var i = 0; i < message.errors.length; ++i) + $root.google.privacy.dlp.v2.Error.encode(message.errors[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DlpJob message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.DlpJob.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.DlpJob + * @static + * @param {google.privacy.dlp.v2.IDlpJob} message DlpJob message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DlpJob.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DlpJob message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.DlpJob + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.DlpJob} DlpJob + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DlpJob.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.privacy.dlp.v2.DlpJob(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.type = reader.int32(); + break; + case 3: + message.state = reader.int32(); + break; + case 4: + message.riskDetails = $root.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.decode(reader, reader.uint32()); + break; + case 5: + message.inspectDetails = $root.google.privacy.dlp.v2.InspectDataSourceDetails.decode(reader, reader.uint32()); + break; + case 6: + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 7: + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 8: + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 10: + message.jobTriggerName = reader.string(); + break; + case 11: + if (!(message.errors && message.errors.length)) + message.errors = []; + message.errors.push($root.google.privacy.dlp.v2.Error.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DlpJob message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.DlpJob + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.DlpJob} DlpJob + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DlpJob.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DlpJob message. + * @function verify + * @memberof google.privacy.dlp.v2.DlpJob + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DlpJob.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + if (message.riskDetails != null && message.hasOwnProperty("riskDetails")) { + properties.details = 1; + { + var error = $root.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.verify(message.riskDetails); + if (error) + return "riskDetails." + error; + } + } + if (message.inspectDetails != null && message.hasOwnProperty("inspectDetails")) { + if (properties.details === 1) + return "details: multiple values"; + properties.details = 1; + { + var error = $root.google.privacy.dlp.v2.InspectDataSourceDetails.verify(message.inspectDetails); + if (error) + return "inspectDetails." + error; + } + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + if (message.jobTriggerName != null && message.hasOwnProperty("jobTriggerName")) + if (!$util.isString(message.jobTriggerName)) + return "jobTriggerName: string expected"; + if (message.errors != null && message.hasOwnProperty("errors")) { + if (!Array.isArray(message.errors)) + return "errors: array expected"; + for (var i = 0; i < message.errors.length; ++i) { + var error = $root.google.privacy.dlp.v2.Error.verify(message.errors[i]); + if (error) + return "errors." + error; + } + } + return null; + }; + + /** + * Creates a DlpJob message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.DlpJob + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.DlpJob} DlpJob + */ + DlpJob.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.DlpJob) + return object; + var message = new $root.google.privacy.dlp.v2.DlpJob(); + if (object.name != null) + message.name = String(object.name); + switch (object.type) { + case "DLP_JOB_TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "INSPECT_JOB": + case 1: + message.type = 1; + break; + case "RISK_ANALYSIS_JOB": + case 2: + message.type = 2; + break; + } + switch (object.state) { + case "JOB_STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "PENDING": + case 1: + message.state = 1; + break; + case "RUNNING": + case 2: + message.state = 2; + break; + case "DONE": + case 3: + message.state = 3; + break; + case "CANCELED": + case 4: + message.state = 4; + break; + case "FAILED": + case 5: + message.state = 5; + break; + case "ACTIVE": + case 6: + message.state = 6; + break; + } + if (object.riskDetails != null) { + if (typeof object.riskDetails !== "object") + throw TypeError(".google.privacy.dlp.v2.DlpJob.riskDetails: object expected"); + message.riskDetails = $root.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.fromObject(object.riskDetails); + } + if (object.inspectDetails != null) { + if (typeof object.inspectDetails !== "object") + throw TypeError(".google.privacy.dlp.v2.DlpJob.inspectDetails: object expected"); + message.inspectDetails = $root.google.privacy.dlp.v2.InspectDataSourceDetails.fromObject(object.inspectDetails); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.privacy.dlp.v2.DlpJob.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.privacy.dlp.v2.DlpJob.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.privacy.dlp.v2.DlpJob.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + if (object.jobTriggerName != null) + message.jobTriggerName = String(object.jobTriggerName); + if (object.errors) { + if (!Array.isArray(object.errors)) + throw TypeError(".google.privacy.dlp.v2.DlpJob.errors: array expected"); + message.errors = []; + for (var i = 0; i < object.errors.length; ++i) { + if (typeof object.errors[i] !== "object") + throw TypeError(".google.privacy.dlp.v2.DlpJob.errors: object expected"); + message.errors[i] = $root.google.privacy.dlp.v2.Error.fromObject(object.errors[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a DlpJob message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.DlpJob + * @static + * @param {google.privacy.dlp.v2.DlpJob} message DlpJob + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DlpJob.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.errors = []; + if (options.defaults) { + object.name = ""; + object.type = options.enums === String ? "DLP_JOB_TYPE_UNSPECIFIED" : 0; + object.state = options.enums === String ? "JOB_STATE_UNSPECIFIED" : 0; + object.createTime = null; + object.startTime = null; + object.endTime = null; + object.jobTriggerName = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.privacy.dlp.v2.DlpJobType[message.type] : message.type; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.privacy.dlp.v2.DlpJob.JobState[message.state] : message.state; + if (message.riskDetails != null && message.hasOwnProperty("riskDetails")) { + object.riskDetails = $root.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.toObject(message.riskDetails, options); + if (options.oneofs) + object.details = "riskDetails"; + } + if (message.inspectDetails != null && message.hasOwnProperty("inspectDetails")) { + object.inspectDetails = $root.google.privacy.dlp.v2.InspectDataSourceDetails.toObject(message.inspectDetails, options); + if (options.oneofs) + object.details = "inspectDetails"; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + if (message.jobTriggerName != null && message.hasOwnProperty("jobTriggerName")) + object.jobTriggerName = message.jobTriggerName; + if (message.errors && message.errors.length) { + object.errors = []; + for (var j = 0; j < message.errors.length; ++j) + object.errors[j] = $root.google.privacy.dlp.v2.Error.toObject(message.errors[j], options); + } + return object; + }; + + /** + * Converts this DlpJob to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.DlpJob + * @instance + * @returns {Object.} JSON object + */ + DlpJob.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * JobState enum. + * @name google.privacy.dlp.v2.DlpJob.JobState + * @enum {number} + * @property {number} JOB_STATE_UNSPECIFIED=0 JOB_STATE_UNSPECIFIED value + * @property {number} PENDING=1 PENDING value + * @property {number} RUNNING=2 RUNNING value + * @property {number} DONE=3 DONE value + * @property {number} CANCELED=4 CANCELED value + * @property {number} FAILED=5 FAILED value + * @property {number} ACTIVE=6 ACTIVE value + */ + DlpJob.JobState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "JOB_STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "PENDING"] = 1; + values[valuesById[2] = "RUNNING"] = 2; + values[valuesById[3] = "DONE"] = 3; + values[valuesById[4] = "CANCELED"] = 4; + values[valuesById[5] = "FAILED"] = 5; + values[valuesById[6] = "ACTIVE"] = 6; + return values; + })(); + + return DlpJob; + })(); + + v2.GetDlpJobRequest = (function() { + + /** + * Properties of a GetDlpJobRequest. + * @memberof google.privacy.dlp.v2 + * @interface IGetDlpJobRequest + * @property {string|null} [name] GetDlpJobRequest name + */ + + /** + * Constructs a new GetDlpJobRequest. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents a GetDlpJobRequest. + * @implements IGetDlpJobRequest + * @constructor + * @param {google.privacy.dlp.v2.IGetDlpJobRequest=} [properties] Properties to set + */ + function GetDlpJobRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetDlpJobRequest name. + * @member {string} name + * @memberof google.privacy.dlp.v2.GetDlpJobRequest + * @instance + */ + GetDlpJobRequest.prototype.name = ""; + + /** + * Creates a new GetDlpJobRequest instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.GetDlpJobRequest + * @static + * @param {google.privacy.dlp.v2.IGetDlpJobRequest=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.GetDlpJobRequest} GetDlpJobRequest instance + */ + GetDlpJobRequest.create = function create(properties) { + return new GetDlpJobRequest(properties); + }; + + /** + * Encodes the specified GetDlpJobRequest message. Does not implicitly {@link google.privacy.dlp.v2.GetDlpJobRequest.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.GetDlpJobRequest + * @static + * @param {google.privacy.dlp.v2.IGetDlpJobRequest} message GetDlpJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDlpJobRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetDlpJobRequest message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.GetDlpJobRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.GetDlpJobRequest + * @static + * @param {google.privacy.dlp.v2.IGetDlpJobRequest} message GetDlpJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDlpJobRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetDlpJobRequest message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.GetDlpJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.GetDlpJobRequest} GetDlpJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDlpJobRequest.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.privacy.dlp.v2.GetDlpJobRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetDlpJobRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.GetDlpJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.GetDlpJobRequest} GetDlpJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDlpJobRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetDlpJobRequest message. + * @function verify + * @memberof google.privacy.dlp.v2.GetDlpJobRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetDlpJobRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetDlpJobRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.GetDlpJobRequest + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.GetDlpJobRequest} GetDlpJobRequest + */ + GetDlpJobRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.GetDlpJobRequest) + return object; + var message = new $root.google.privacy.dlp.v2.GetDlpJobRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetDlpJobRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.GetDlpJobRequest + * @static + * @param {google.privacy.dlp.v2.GetDlpJobRequest} message GetDlpJobRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetDlpJobRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetDlpJobRequest to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.GetDlpJobRequest + * @instance + * @returns {Object.} JSON object + */ + GetDlpJobRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetDlpJobRequest; + })(); + + v2.ListDlpJobsRequest = (function() { + + /** + * Properties of a ListDlpJobsRequest. + * @memberof google.privacy.dlp.v2 + * @interface IListDlpJobsRequest + * @property {string|null} [parent] ListDlpJobsRequest parent + * @property {string|null} [filter] ListDlpJobsRequest filter + * @property {number|null} [pageSize] ListDlpJobsRequest pageSize + * @property {string|null} [pageToken] ListDlpJobsRequest pageToken + * @property {google.privacy.dlp.v2.DlpJobType|null} [type] ListDlpJobsRequest type + * @property {string|null} [orderBy] ListDlpJobsRequest orderBy + * @property {string|null} [locationId] ListDlpJobsRequest locationId + */ + + /** + * Constructs a new ListDlpJobsRequest. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents a ListDlpJobsRequest. + * @implements IListDlpJobsRequest + * @constructor + * @param {google.privacy.dlp.v2.IListDlpJobsRequest=} [properties] Properties to set + */ + function ListDlpJobsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListDlpJobsRequest parent. + * @member {string} parent + * @memberof google.privacy.dlp.v2.ListDlpJobsRequest + * @instance + */ + ListDlpJobsRequest.prototype.parent = ""; + + /** + * ListDlpJobsRequest filter. + * @member {string} filter + * @memberof google.privacy.dlp.v2.ListDlpJobsRequest + * @instance + */ + ListDlpJobsRequest.prototype.filter = ""; + + /** + * ListDlpJobsRequest pageSize. + * @member {number} pageSize + * @memberof google.privacy.dlp.v2.ListDlpJobsRequest + * @instance + */ + ListDlpJobsRequest.prototype.pageSize = 0; + + /** + * ListDlpJobsRequest pageToken. + * @member {string} pageToken + * @memberof google.privacy.dlp.v2.ListDlpJobsRequest + * @instance + */ + ListDlpJobsRequest.prototype.pageToken = ""; + + /** + * ListDlpJobsRequest type. + * @member {google.privacy.dlp.v2.DlpJobType} type + * @memberof google.privacy.dlp.v2.ListDlpJobsRequest + * @instance + */ + ListDlpJobsRequest.prototype.type = 0; + + /** + * ListDlpJobsRequest orderBy. + * @member {string} orderBy + * @memberof google.privacy.dlp.v2.ListDlpJobsRequest + * @instance + */ + ListDlpJobsRequest.prototype.orderBy = ""; + + /** + * ListDlpJobsRequest locationId. + * @member {string} locationId + * @memberof google.privacy.dlp.v2.ListDlpJobsRequest + * @instance + */ + ListDlpJobsRequest.prototype.locationId = ""; + + /** + * Creates a new ListDlpJobsRequest instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.ListDlpJobsRequest + * @static + * @param {google.privacy.dlp.v2.IListDlpJobsRequest=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.ListDlpJobsRequest} ListDlpJobsRequest instance + */ + ListDlpJobsRequest.create = function create(properties) { + return new ListDlpJobsRequest(properties); + }; + + /** + * Encodes the specified ListDlpJobsRequest message. Does not implicitly {@link google.privacy.dlp.v2.ListDlpJobsRequest.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.ListDlpJobsRequest + * @static + * @param {google.privacy.dlp.v2.IListDlpJobsRequest} message ListDlpJobsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDlpJobsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.filter); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.parent); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.orderBy); + if (message.locationId != null && Object.hasOwnProperty.call(message, "locationId")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.locationId); + return writer; + }; + + /** + * Encodes the specified ListDlpJobsRequest message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.ListDlpJobsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.ListDlpJobsRequest + * @static + * @param {google.privacy.dlp.v2.IListDlpJobsRequest} message ListDlpJobsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDlpJobsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListDlpJobsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.ListDlpJobsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.ListDlpJobsRequest} ListDlpJobsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDlpJobsRequest.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.privacy.dlp.v2.ListDlpJobsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 4: + message.parent = reader.string(); + break; + case 1: + message.filter = reader.string(); + break; + case 2: + message.pageSize = reader.int32(); + break; + case 3: + message.pageToken = reader.string(); + break; + case 5: + message.type = reader.int32(); + break; + case 6: + message.orderBy = reader.string(); + break; + case 7: + message.locationId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListDlpJobsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.ListDlpJobsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.ListDlpJobsRequest} ListDlpJobsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDlpJobsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListDlpJobsRequest message. + * @function verify + * @memberof google.privacy.dlp.v2.ListDlpJobsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListDlpJobsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + if (message.locationId != null && message.hasOwnProperty("locationId")) + if (!$util.isString(message.locationId)) + return "locationId: string expected"; + return null; + }; + + /** + * Creates a ListDlpJobsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.ListDlpJobsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.ListDlpJobsRequest} ListDlpJobsRequest + */ + ListDlpJobsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.ListDlpJobsRequest) + return object; + var message = new $root.google.privacy.dlp.v2.ListDlpJobsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.filter != null) + message.filter = String(object.filter); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + switch (object.type) { + case "DLP_JOB_TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "INSPECT_JOB": + case 1: + message.type = 1; + break; + case "RISK_ANALYSIS_JOB": + case 2: + message.type = 2; + break; + } + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.locationId != null) + message.locationId = String(object.locationId); + return message; + }; + + /** + * Creates a plain object from a ListDlpJobsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.ListDlpJobsRequest + * @static + * @param {google.privacy.dlp.v2.ListDlpJobsRequest} message ListDlpJobsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListDlpJobsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.filter = ""; + object.pageSize = 0; + object.pageToken = ""; + object.parent = ""; + object.type = options.enums === String ? "DLP_JOB_TYPE_UNSPECIFIED" : 0; + object.orderBy = ""; + object.locationId = ""; + } + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.privacy.dlp.v2.DlpJobType[message.type] : message.type; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + if (message.locationId != null && message.hasOwnProperty("locationId")) + object.locationId = message.locationId; + return object; + }; + + /** + * Converts this ListDlpJobsRequest to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.ListDlpJobsRequest + * @instance + * @returns {Object.} JSON object + */ + ListDlpJobsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListDlpJobsRequest; + })(); + + v2.ListDlpJobsResponse = (function() { + + /** + * Properties of a ListDlpJobsResponse. + * @memberof google.privacy.dlp.v2 + * @interface IListDlpJobsResponse + * @property {Array.|null} [jobs] ListDlpJobsResponse jobs + * @property {string|null} [nextPageToken] ListDlpJobsResponse nextPageToken + */ + + /** + * Constructs a new ListDlpJobsResponse. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents a ListDlpJobsResponse. + * @implements IListDlpJobsResponse + * @constructor + * @param {google.privacy.dlp.v2.IListDlpJobsResponse=} [properties] Properties to set + */ + function ListDlpJobsResponse(properties) { + this.jobs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListDlpJobsResponse jobs. + * @member {Array.} jobs + * @memberof google.privacy.dlp.v2.ListDlpJobsResponse + * @instance + */ + ListDlpJobsResponse.prototype.jobs = $util.emptyArray; + + /** + * ListDlpJobsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.privacy.dlp.v2.ListDlpJobsResponse + * @instance + */ + ListDlpJobsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListDlpJobsResponse instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.ListDlpJobsResponse + * @static + * @param {google.privacy.dlp.v2.IListDlpJobsResponse=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.ListDlpJobsResponse} ListDlpJobsResponse instance + */ + ListDlpJobsResponse.create = function create(properties) { + return new ListDlpJobsResponse(properties); + }; + + /** + * Encodes the specified ListDlpJobsResponse message. Does not implicitly {@link google.privacy.dlp.v2.ListDlpJobsResponse.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.ListDlpJobsResponse + * @static + * @param {google.privacy.dlp.v2.IListDlpJobsResponse} message ListDlpJobsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDlpJobsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.jobs != null && message.jobs.length) + for (var i = 0; i < message.jobs.length; ++i) + $root.google.privacy.dlp.v2.DlpJob.encode(message.jobs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListDlpJobsResponse message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.ListDlpJobsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.ListDlpJobsResponse + * @static + * @param {google.privacy.dlp.v2.IListDlpJobsResponse} message ListDlpJobsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDlpJobsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListDlpJobsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.ListDlpJobsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.ListDlpJobsResponse} ListDlpJobsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDlpJobsResponse.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.privacy.dlp.v2.ListDlpJobsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.jobs && message.jobs.length)) + message.jobs = []; + message.jobs.push($root.google.privacy.dlp.v2.DlpJob.decode(reader, reader.uint32())); + break; + case 2: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListDlpJobsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.ListDlpJobsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.ListDlpJobsResponse} ListDlpJobsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDlpJobsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListDlpJobsResponse message. + * @function verify + * @memberof google.privacy.dlp.v2.ListDlpJobsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListDlpJobsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.jobs != null && message.hasOwnProperty("jobs")) { + if (!Array.isArray(message.jobs)) + return "jobs: array expected"; + for (var i = 0; i < message.jobs.length; ++i) { + var error = $root.google.privacy.dlp.v2.DlpJob.verify(message.jobs[i]); + if (error) + return "jobs." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListDlpJobsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.ListDlpJobsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.ListDlpJobsResponse} ListDlpJobsResponse + */ + ListDlpJobsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.ListDlpJobsResponse) + return object; + var message = new $root.google.privacy.dlp.v2.ListDlpJobsResponse(); + if (object.jobs) { + if (!Array.isArray(object.jobs)) + throw TypeError(".google.privacy.dlp.v2.ListDlpJobsResponse.jobs: array expected"); + message.jobs = []; + for (var i = 0; i < object.jobs.length; ++i) { + if (typeof object.jobs[i] !== "object") + throw TypeError(".google.privacy.dlp.v2.ListDlpJobsResponse.jobs: object expected"); + message.jobs[i] = $root.google.privacy.dlp.v2.DlpJob.fromObject(object.jobs[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListDlpJobsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.ListDlpJobsResponse + * @static + * @param {google.privacy.dlp.v2.ListDlpJobsResponse} message ListDlpJobsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListDlpJobsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.jobs = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.jobs && message.jobs.length) { + object.jobs = []; + for (var j = 0; j < message.jobs.length; ++j) + object.jobs[j] = $root.google.privacy.dlp.v2.DlpJob.toObject(message.jobs[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListDlpJobsResponse to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.ListDlpJobsResponse + * @instance + * @returns {Object.} JSON object + */ + ListDlpJobsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListDlpJobsResponse; + })(); + + v2.CancelDlpJobRequest = (function() { + + /** + * Properties of a CancelDlpJobRequest. + * @memberof google.privacy.dlp.v2 + * @interface ICancelDlpJobRequest + * @property {string|null} [name] CancelDlpJobRequest name + */ + + /** + * Constructs a new CancelDlpJobRequest. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents a CancelDlpJobRequest. + * @implements ICancelDlpJobRequest + * @constructor + * @param {google.privacy.dlp.v2.ICancelDlpJobRequest=} [properties] Properties to set + */ + function CancelDlpJobRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CancelDlpJobRequest name. + * @member {string} name + * @memberof google.privacy.dlp.v2.CancelDlpJobRequest + * @instance + */ + CancelDlpJobRequest.prototype.name = ""; + + /** + * Creates a new CancelDlpJobRequest instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.CancelDlpJobRequest + * @static + * @param {google.privacy.dlp.v2.ICancelDlpJobRequest=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.CancelDlpJobRequest} CancelDlpJobRequest instance + */ + CancelDlpJobRequest.create = function create(properties) { + return new CancelDlpJobRequest(properties); + }; + + /** + * Encodes the specified CancelDlpJobRequest message. Does not implicitly {@link google.privacy.dlp.v2.CancelDlpJobRequest.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.CancelDlpJobRequest + * @static + * @param {google.privacy.dlp.v2.ICancelDlpJobRequest} message CancelDlpJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelDlpJobRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified CancelDlpJobRequest message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.CancelDlpJobRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.CancelDlpJobRequest + * @static + * @param {google.privacy.dlp.v2.ICancelDlpJobRequest} message CancelDlpJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelDlpJobRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CancelDlpJobRequest message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.CancelDlpJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.CancelDlpJobRequest} CancelDlpJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelDlpJobRequest.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.privacy.dlp.v2.CancelDlpJobRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CancelDlpJobRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.CancelDlpJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.CancelDlpJobRequest} CancelDlpJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelDlpJobRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CancelDlpJobRequest message. + * @function verify + * @memberof google.privacy.dlp.v2.CancelDlpJobRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CancelDlpJobRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a CancelDlpJobRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.CancelDlpJobRequest + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.CancelDlpJobRequest} CancelDlpJobRequest + */ + CancelDlpJobRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.CancelDlpJobRequest) + return object; + var message = new $root.google.privacy.dlp.v2.CancelDlpJobRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a CancelDlpJobRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.CancelDlpJobRequest + * @static + * @param {google.privacy.dlp.v2.CancelDlpJobRequest} message CancelDlpJobRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CancelDlpJobRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this CancelDlpJobRequest to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.CancelDlpJobRequest + * @instance + * @returns {Object.} JSON object + */ + CancelDlpJobRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CancelDlpJobRequest; + })(); + + v2.FinishDlpJobRequest = (function() { + + /** + * Properties of a FinishDlpJobRequest. + * @memberof google.privacy.dlp.v2 + * @interface IFinishDlpJobRequest + * @property {string|null} [name] FinishDlpJobRequest name + */ + + /** + * Constructs a new FinishDlpJobRequest. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents a FinishDlpJobRequest. + * @implements IFinishDlpJobRequest + * @constructor + * @param {google.privacy.dlp.v2.IFinishDlpJobRequest=} [properties] Properties to set + */ + function FinishDlpJobRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FinishDlpJobRequest name. + * @member {string} name + * @memberof google.privacy.dlp.v2.FinishDlpJobRequest + * @instance + */ + FinishDlpJobRequest.prototype.name = ""; + + /** + * Creates a new FinishDlpJobRequest instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.FinishDlpJobRequest + * @static + * @param {google.privacy.dlp.v2.IFinishDlpJobRequest=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.FinishDlpJobRequest} FinishDlpJobRequest instance + */ + FinishDlpJobRequest.create = function create(properties) { + return new FinishDlpJobRequest(properties); + }; + + /** + * Encodes the specified FinishDlpJobRequest message. Does not implicitly {@link google.privacy.dlp.v2.FinishDlpJobRequest.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.FinishDlpJobRequest + * @static + * @param {google.privacy.dlp.v2.IFinishDlpJobRequest} message FinishDlpJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FinishDlpJobRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified FinishDlpJobRequest message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.FinishDlpJobRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.FinishDlpJobRequest + * @static + * @param {google.privacy.dlp.v2.IFinishDlpJobRequest} message FinishDlpJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FinishDlpJobRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FinishDlpJobRequest message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.FinishDlpJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.FinishDlpJobRequest} FinishDlpJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FinishDlpJobRequest.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.privacy.dlp.v2.FinishDlpJobRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FinishDlpJobRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.FinishDlpJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.FinishDlpJobRequest} FinishDlpJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FinishDlpJobRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FinishDlpJobRequest message. + * @function verify + * @memberof google.privacy.dlp.v2.FinishDlpJobRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FinishDlpJobRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a FinishDlpJobRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.FinishDlpJobRequest + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.FinishDlpJobRequest} FinishDlpJobRequest + */ + FinishDlpJobRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.FinishDlpJobRequest) + return object; + var message = new $root.google.privacy.dlp.v2.FinishDlpJobRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a FinishDlpJobRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.FinishDlpJobRequest + * @static + * @param {google.privacy.dlp.v2.FinishDlpJobRequest} message FinishDlpJobRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FinishDlpJobRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this FinishDlpJobRequest to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.FinishDlpJobRequest + * @instance + * @returns {Object.} JSON object + */ + FinishDlpJobRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return FinishDlpJobRequest; + })(); + + v2.DeleteDlpJobRequest = (function() { + + /** + * Properties of a DeleteDlpJobRequest. + * @memberof google.privacy.dlp.v2 + * @interface IDeleteDlpJobRequest + * @property {string|null} [name] DeleteDlpJobRequest name + */ + + /** + * Constructs a new DeleteDlpJobRequest. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents a DeleteDlpJobRequest. + * @implements IDeleteDlpJobRequest + * @constructor + * @param {google.privacy.dlp.v2.IDeleteDlpJobRequest=} [properties] Properties to set + */ + function DeleteDlpJobRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteDlpJobRequest name. + * @member {string} name + * @memberof google.privacy.dlp.v2.DeleteDlpJobRequest + * @instance + */ + DeleteDlpJobRequest.prototype.name = ""; + + /** + * Creates a new DeleteDlpJobRequest instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.DeleteDlpJobRequest + * @static + * @param {google.privacy.dlp.v2.IDeleteDlpJobRequest=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.DeleteDlpJobRequest} DeleteDlpJobRequest instance + */ + DeleteDlpJobRequest.create = function create(properties) { + return new DeleteDlpJobRequest(properties); + }; + + /** + * Encodes the specified DeleteDlpJobRequest message. Does not implicitly {@link google.privacy.dlp.v2.DeleteDlpJobRequest.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.DeleteDlpJobRequest + * @static + * @param {google.privacy.dlp.v2.IDeleteDlpJobRequest} message DeleteDlpJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteDlpJobRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified DeleteDlpJobRequest message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.DeleteDlpJobRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.DeleteDlpJobRequest + * @static + * @param {google.privacy.dlp.v2.IDeleteDlpJobRequest} message DeleteDlpJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteDlpJobRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteDlpJobRequest message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.DeleteDlpJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.DeleteDlpJobRequest} DeleteDlpJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteDlpJobRequest.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.privacy.dlp.v2.DeleteDlpJobRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteDlpJobRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.DeleteDlpJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.DeleteDlpJobRequest} DeleteDlpJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteDlpJobRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteDlpJobRequest message. + * @function verify + * @memberof google.privacy.dlp.v2.DeleteDlpJobRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteDlpJobRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a DeleteDlpJobRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.DeleteDlpJobRequest + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.DeleteDlpJobRequest} DeleteDlpJobRequest + */ + DeleteDlpJobRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.DeleteDlpJobRequest) + return object; + var message = new $root.google.privacy.dlp.v2.DeleteDlpJobRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteDlpJobRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.DeleteDlpJobRequest + * @static + * @param {google.privacy.dlp.v2.DeleteDlpJobRequest} message DeleteDlpJobRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteDlpJobRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this DeleteDlpJobRequest to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.DeleteDlpJobRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteDlpJobRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeleteDlpJobRequest; + })(); + + v2.CreateDeidentifyTemplateRequest = (function() { + + /** + * Properties of a CreateDeidentifyTemplateRequest. + * @memberof google.privacy.dlp.v2 + * @interface ICreateDeidentifyTemplateRequest + * @property {string|null} [parent] CreateDeidentifyTemplateRequest parent + * @property {google.privacy.dlp.v2.IDeidentifyTemplate|null} [deidentifyTemplate] CreateDeidentifyTemplateRequest deidentifyTemplate + * @property {string|null} [templateId] CreateDeidentifyTemplateRequest templateId + * @property {string|null} [locationId] CreateDeidentifyTemplateRequest locationId + */ + + /** + * Constructs a new CreateDeidentifyTemplateRequest. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents a CreateDeidentifyTemplateRequest. + * @implements ICreateDeidentifyTemplateRequest + * @constructor + * @param {google.privacy.dlp.v2.ICreateDeidentifyTemplateRequest=} [properties] Properties to set + */ + function CreateDeidentifyTemplateRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateDeidentifyTemplateRequest parent. + * @member {string} parent + * @memberof google.privacy.dlp.v2.CreateDeidentifyTemplateRequest + * @instance + */ + CreateDeidentifyTemplateRequest.prototype.parent = ""; + + /** + * CreateDeidentifyTemplateRequest deidentifyTemplate. + * @member {google.privacy.dlp.v2.IDeidentifyTemplate|null|undefined} deidentifyTemplate + * @memberof google.privacy.dlp.v2.CreateDeidentifyTemplateRequest + * @instance + */ + CreateDeidentifyTemplateRequest.prototype.deidentifyTemplate = null; + + /** + * CreateDeidentifyTemplateRequest templateId. + * @member {string} templateId + * @memberof google.privacy.dlp.v2.CreateDeidentifyTemplateRequest + * @instance + */ + CreateDeidentifyTemplateRequest.prototype.templateId = ""; + + /** + * CreateDeidentifyTemplateRequest locationId. + * @member {string} locationId + * @memberof google.privacy.dlp.v2.CreateDeidentifyTemplateRequest + * @instance + */ + CreateDeidentifyTemplateRequest.prototype.locationId = ""; + + /** + * Creates a new CreateDeidentifyTemplateRequest instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.CreateDeidentifyTemplateRequest + * @static + * @param {google.privacy.dlp.v2.ICreateDeidentifyTemplateRequest=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.CreateDeidentifyTemplateRequest} CreateDeidentifyTemplateRequest instance + */ + CreateDeidentifyTemplateRequest.create = function create(properties) { + return new CreateDeidentifyTemplateRequest(properties); + }; + + /** + * Encodes the specified CreateDeidentifyTemplateRequest message. Does not implicitly {@link google.privacy.dlp.v2.CreateDeidentifyTemplateRequest.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.CreateDeidentifyTemplateRequest + * @static + * @param {google.privacy.dlp.v2.ICreateDeidentifyTemplateRequest} message CreateDeidentifyTemplateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateDeidentifyTemplateRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.deidentifyTemplate != null && Object.hasOwnProperty.call(message, "deidentifyTemplate")) + $root.google.privacy.dlp.v2.DeidentifyTemplate.encode(message.deidentifyTemplate, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.templateId != null && Object.hasOwnProperty.call(message, "templateId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.templateId); + if (message.locationId != null && Object.hasOwnProperty.call(message, "locationId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.locationId); + return writer; + }; + + /** + * Encodes the specified CreateDeidentifyTemplateRequest message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.CreateDeidentifyTemplateRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.CreateDeidentifyTemplateRequest + * @static + * @param {google.privacy.dlp.v2.ICreateDeidentifyTemplateRequest} message CreateDeidentifyTemplateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateDeidentifyTemplateRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateDeidentifyTemplateRequest message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.CreateDeidentifyTemplateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.CreateDeidentifyTemplateRequest} CreateDeidentifyTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateDeidentifyTemplateRequest.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.privacy.dlp.v2.CreateDeidentifyTemplateRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.deidentifyTemplate = $root.google.privacy.dlp.v2.DeidentifyTemplate.decode(reader, reader.uint32()); + break; + case 3: + message.templateId = reader.string(); + break; + case 4: + message.locationId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateDeidentifyTemplateRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.CreateDeidentifyTemplateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.CreateDeidentifyTemplateRequest} CreateDeidentifyTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateDeidentifyTemplateRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateDeidentifyTemplateRequest message. + * @function verify + * @memberof google.privacy.dlp.v2.CreateDeidentifyTemplateRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateDeidentifyTemplateRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.deidentifyTemplate != null && message.hasOwnProperty("deidentifyTemplate")) { + var error = $root.google.privacy.dlp.v2.DeidentifyTemplate.verify(message.deidentifyTemplate); + if (error) + return "deidentifyTemplate." + error; + } + if (message.templateId != null && message.hasOwnProperty("templateId")) + if (!$util.isString(message.templateId)) + return "templateId: string expected"; + if (message.locationId != null && message.hasOwnProperty("locationId")) + if (!$util.isString(message.locationId)) + return "locationId: string expected"; + return null; + }; + + /** + * Creates a CreateDeidentifyTemplateRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.CreateDeidentifyTemplateRequest + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.CreateDeidentifyTemplateRequest} CreateDeidentifyTemplateRequest + */ + CreateDeidentifyTemplateRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.CreateDeidentifyTemplateRequest) + return object; + var message = new $root.google.privacy.dlp.v2.CreateDeidentifyTemplateRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.deidentifyTemplate != null) { + if (typeof object.deidentifyTemplate !== "object") + throw TypeError(".google.privacy.dlp.v2.CreateDeidentifyTemplateRequest.deidentifyTemplate: object expected"); + message.deidentifyTemplate = $root.google.privacy.dlp.v2.DeidentifyTemplate.fromObject(object.deidentifyTemplate); + } + if (object.templateId != null) + message.templateId = String(object.templateId); + if (object.locationId != null) + message.locationId = String(object.locationId); + return message; + }; + + /** + * Creates a plain object from a CreateDeidentifyTemplateRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.CreateDeidentifyTemplateRequest + * @static + * @param {google.privacy.dlp.v2.CreateDeidentifyTemplateRequest} message CreateDeidentifyTemplateRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateDeidentifyTemplateRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.deidentifyTemplate = null; + object.templateId = ""; + object.locationId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.deidentifyTemplate != null && message.hasOwnProperty("deidentifyTemplate")) + object.deidentifyTemplate = $root.google.privacy.dlp.v2.DeidentifyTemplate.toObject(message.deidentifyTemplate, options); + if (message.templateId != null && message.hasOwnProperty("templateId")) + object.templateId = message.templateId; + if (message.locationId != null && message.hasOwnProperty("locationId")) + object.locationId = message.locationId; + return object; + }; + + /** + * Converts this CreateDeidentifyTemplateRequest to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.CreateDeidentifyTemplateRequest + * @instance + * @returns {Object.} JSON object + */ + CreateDeidentifyTemplateRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CreateDeidentifyTemplateRequest; + })(); + + v2.UpdateDeidentifyTemplateRequest = (function() { + + /** + * Properties of an UpdateDeidentifyTemplateRequest. + * @memberof google.privacy.dlp.v2 + * @interface IUpdateDeidentifyTemplateRequest + * @property {string|null} [name] UpdateDeidentifyTemplateRequest name + * @property {google.privacy.dlp.v2.IDeidentifyTemplate|null} [deidentifyTemplate] UpdateDeidentifyTemplateRequest deidentifyTemplate + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateDeidentifyTemplateRequest updateMask + */ + + /** + * Constructs a new UpdateDeidentifyTemplateRequest. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents an UpdateDeidentifyTemplateRequest. + * @implements IUpdateDeidentifyTemplateRequest + * @constructor + * @param {google.privacy.dlp.v2.IUpdateDeidentifyTemplateRequest=} [properties] Properties to set + */ + function UpdateDeidentifyTemplateRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateDeidentifyTemplateRequest name. + * @member {string} name + * @memberof google.privacy.dlp.v2.UpdateDeidentifyTemplateRequest + * @instance + */ + UpdateDeidentifyTemplateRequest.prototype.name = ""; + + /** + * UpdateDeidentifyTemplateRequest deidentifyTemplate. + * @member {google.privacy.dlp.v2.IDeidentifyTemplate|null|undefined} deidentifyTemplate + * @memberof google.privacy.dlp.v2.UpdateDeidentifyTemplateRequest + * @instance + */ + UpdateDeidentifyTemplateRequest.prototype.deidentifyTemplate = null; + + /** + * UpdateDeidentifyTemplateRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.privacy.dlp.v2.UpdateDeidentifyTemplateRequest + * @instance + */ + UpdateDeidentifyTemplateRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateDeidentifyTemplateRequest instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.UpdateDeidentifyTemplateRequest + * @static + * @param {google.privacy.dlp.v2.IUpdateDeidentifyTemplateRequest=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.UpdateDeidentifyTemplateRequest} UpdateDeidentifyTemplateRequest instance + */ + UpdateDeidentifyTemplateRequest.create = function create(properties) { + return new UpdateDeidentifyTemplateRequest(properties); + }; + + /** + * Encodes the specified UpdateDeidentifyTemplateRequest message. Does not implicitly {@link google.privacy.dlp.v2.UpdateDeidentifyTemplateRequest.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.UpdateDeidentifyTemplateRequest + * @static + * @param {google.privacy.dlp.v2.IUpdateDeidentifyTemplateRequest} message UpdateDeidentifyTemplateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateDeidentifyTemplateRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.deidentifyTemplate != null && Object.hasOwnProperty.call(message, "deidentifyTemplate")) + $root.google.privacy.dlp.v2.DeidentifyTemplate.encode(message.deidentifyTemplate, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateDeidentifyTemplateRequest message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.UpdateDeidentifyTemplateRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.UpdateDeidentifyTemplateRequest + * @static + * @param {google.privacy.dlp.v2.IUpdateDeidentifyTemplateRequest} message UpdateDeidentifyTemplateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateDeidentifyTemplateRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateDeidentifyTemplateRequest message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.UpdateDeidentifyTemplateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.UpdateDeidentifyTemplateRequest} UpdateDeidentifyTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateDeidentifyTemplateRequest.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.privacy.dlp.v2.UpdateDeidentifyTemplateRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.deidentifyTemplate = $root.google.privacy.dlp.v2.DeidentifyTemplate.decode(reader, reader.uint32()); + break; + case 3: + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateDeidentifyTemplateRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.UpdateDeidentifyTemplateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.UpdateDeidentifyTemplateRequest} UpdateDeidentifyTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateDeidentifyTemplateRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateDeidentifyTemplateRequest message. + * @function verify + * @memberof google.privacy.dlp.v2.UpdateDeidentifyTemplateRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateDeidentifyTemplateRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.deidentifyTemplate != null && message.hasOwnProperty("deidentifyTemplate")) { + var error = $root.google.privacy.dlp.v2.DeidentifyTemplate.verify(message.deidentifyTemplate); + if (error) + return "deidentifyTemplate." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateDeidentifyTemplateRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.UpdateDeidentifyTemplateRequest + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.UpdateDeidentifyTemplateRequest} UpdateDeidentifyTemplateRequest + */ + UpdateDeidentifyTemplateRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.UpdateDeidentifyTemplateRequest) + return object; + var message = new $root.google.privacy.dlp.v2.UpdateDeidentifyTemplateRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.deidentifyTemplate != null) { + if (typeof object.deidentifyTemplate !== "object") + throw TypeError(".google.privacy.dlp.v2.UpdateDeidentifyTemplateRequest.deidentifyTemplate: object expected"); + message.deidentifyTemplate = $root.google.privacy.dlp.v2.DeidentifyTemplate.fromObject(object.deidentifyTemplate); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.privacy.dlp.v2.UpdateDeidentifyTemplateRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateDeidentifyTemplateRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.UpdateDeidentifyTemplateRequest + * @static + * @param {google.privacy.dlp.v2.UpdateDeidentifyTemplateRequest} message UpdateDeidentifyTemplateRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateDeidentifyTemplateRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.deidentifyTemplate = null; + object.updateMask = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.deidentifyTemplate != null && message.hasOwnProperty("deidentifyTemplate")) + object.deidentifyTemplate = $root.google.privacy.dlp.v2.DeidentifyTemplate.toObject(message.deidentifyTemplate, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateDeidentifyTemplateRequest to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.UpdateDeidentifyTemplateRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateDeidentifyTemplateRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UpdateDeidentifyTemplateRequest; + })(); + + v2.GetDeidentifyTemplateRequest = (function() { + + /** + * Properties of a GetDeidentifyTemplateRequest. + * @memberof google.privacy.dlp.v2 + * @interface IGetDeidentifyTemplateRequest + * @property {string|null} [name] GetDeidentifyTemplateRequest name + */ + + /** + * Constructs a new GetDeidentifyTemplateRequest. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents a GetDeidentifyTemplateRequest. + * @implements IGetDeidentifyTemplateRequest + * @constructor + * @param {google.privacy.dlp.v2.IGetDeidentifyTemplateRequest=} [properties] Properties to set + */ + function GetDeidentifyTemplateRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetDeidentifyTemplateRequest name. + * @member {string} name + * @memberof google.privacy.dlp.v2.GetDeidentifyTemplateRequest + * @instance + */ + GetDeidentifyTemplateRequest.prototype.name = ""; + + /** + * Creates a new GetDeidentifyTemplateRequest instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.GetDeidentifyTemplateRequest + * @static + * @param {google.privacy.dlp.v2.IGetDeidentifyTemplateRequest=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.GetDeidentifyTemplateRequest} GetDeidentifyTemplateRequest instance + */ + GetDeidentifyTemplateRequest.create = function create(properties) { + return new GetDeidentifyTemplateRequest(properties); + }; + + /** + * Encodes the specified GetDeidentifyTemplateRequest message. Does not implicitly {@link google.privacy.dlp.v2.GetDeidentifyTemplateRequest.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.GetDeidentifyTemplateRequest + * @static + * @param {google.privacy.dlp.v2.IGetDeidentifyTemplateRequest} message GetDeidentifyTemplateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDeidentifyTemplateRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetDeidentifyTemplateRequest message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.GetDeidentifyTemplateRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.GetDeidentifyTemplateRequest + * @static + * @param {google.privacy.dlp.v2.IGetDeidentifyTemplateRequest} message GetDeidentifyTemplateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDeidentifyTemplateRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetDeidentifyTemplateRequest message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.GetDeidentifyTemplateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.GetDeidentifyTemplateRequest} GetDeidentifyTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDeidentifyTemplateRequest.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.privacy.dlp.v2.GetDeidentifyTemplateRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetDeidentifyTemplateRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.GetDeidentifyTemplateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.GetDeidentifyTemplateRequest} GetDeidentifyTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDeidentifyTemplateRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetDeidentifyTemplateRequest message. + * @function verify + * @memberof google.privacy.dlp.v2.GetDeidentifyTemplateRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetDeidentifyTemplateRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetDeidentifyTemplateRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.GetDeidentifyTemplateRequest + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.GetDeidentifyTemplateRequest} GetDeidentifyTemplateRequest + */ + GetDeidentifyTemplateRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.GetDeidentifyTemplateRequest) + return object; + var message = new $root.google.privacy.dlp.v2.GetDeidentifyTemplateRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetDeidentifyTemplateRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.GetDeidentifyTemplateRequest + * @static + * @param {google.privacy.dlp.v2.GetDeidentifyTemplateRequest} message GetDeidentifyTemplateRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetDeidentifyTemplateRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetDeidentifyTemplateRequest to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.GetDeidentifyTemplateRequest + * @instance + * @returns {Object.} JSON object + */ + GetDeidentifyTemplateRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetDeidentifyTemplateRequest; + })(); + + v2.ListDeidentifyTemplatesRequest = (function() { + + /** + * Properties of a ListDeidentifyTemplatesRequest. + * @memberof google.privacy.dlp.v2 + * @interface IListDeidentifyTemplatesRequest + * @property {string|null} [parent] ListDeidentifyTemplatesRequest parent + * @property {string|null} [pageToken] ListDeidentifyTemplatesRequest pageToken + * @property {number|null} [pageSize] ListDeidentifyTemplatesRequest pageSize + * @property {string|null} [orderBy] ListDeidentifyTemplatesRequest orderBy + * @property {string|null} [locationId] ListDeidentifyTemplatesRequest locationId + */ + + /** + * Constructs a new ListDeidentifyTemplatesRequest. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents a ListDeidentifyTemplatesRequest. + * @implements IListDeidentifyTemplatesRequest + * @constructor + * @param {google.privacy.dlp.v2.IListDeidentifyTemplatesRequest=} [properties] Properties to set + */ + function ListDeidentifyTemplatesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListDeidentifyTemplatesRequest parent. + * @member {string} parent + * @memberof google.privacy.dlp.v2.ListDeidentifyTemplatesRequest + * @instance + */ + ListDeidentifyTemplatesRequest.prototype.parent = ""; + + /** + * ListDeidentifyTemplatesRequest pageToken. + * @member {string} pageToken + * @memberof google.privacy.dlp.v2.ListDeidentifyTemplatesRequest + * @instance + */ + ListDeidentifyTemplatesRequest.prototype.pageToken = ""; + + /** + * ListDeidentifyTemplatesRequest pageSize. + * @member {number} pageSize + * @memberof google.privacy.dlp.v2.ListDeidentifyTemplatesRequest + * @instance + */ + ListDeidentifyTemplatesRequest.prototype.pageSize = 0; + + /** + * ListDeidentifyTemplatesRequest orderBy. + * @member {string} orderBy + * @memberof google.privacy.dlp.v2.ListDeidentifyTemplatesRequest + * @instance + */ + ListDeidentifyTemplatesRequest.prototype.orderBy = ""; + + /** + * ListDeidentifyTemplatesRequest locationId. + * @member {string} locationId + * @memberof google.privacy.dlp.v2.ListDeidentifyTemplatesRequest + * @instance + */ + ListDeidentifyTemplatesRequest.prototype.locationId = ""; + + /** + * Creates a new ListDeidentifyTemplatesRequest instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.ListDeidentifyTemplatesRequest + * @static + * @param {google.privacy.dlp.v2.IListDeidentifyTemplatesRequest=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.ListDeidentifyTemplatesRequest} ListDeidentifyTemplatesRequest instance + */ + ListDeidentifyTemplatesRequest.create = function create(properties) { + return new ListDeidentifyTemplatesRequest(properties); + }; + + /** + * Encodes the specified ListDeidentifyTemplatesRequest message. Does not implicitly {@link google.privacy.dlp.v2.ListDeidentifyTemplatesRequest.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.ListDeidentifyTemplatesRequest + * @static + * @param {google.privacy.dlp.v2.IListDeidentifyTemplatesRequest} message ListDeidentifyTemplatesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDeidentifyTemplatesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pageToken); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.orderBy); + if (message.locationId != null && Object.hasOwnProperty.call(message, "locationId")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.locationId); + return writer; + }; + + /** + * Encodes the specified ListDeidentifyTemplatesRequest message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.ListDeidentifyTemplatesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.ListDeidentifyTemplatesRequest + * @static + * @param {google.privacy.dlp.v2.IListDeidentifyTemplatesRequest} message ListDeidentifyTemplatesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDeidentifyTemplatesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListDeidentifyTemplatesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.ListDeidentifyTemplatesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.ListDeidentifyTemplatesRequest} ListDeidentifyTemplatesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDeidentifyTemplatesRequest.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.privacy.dlp.v2.ListDeidentifyTemplatesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.pageToken = reader.string(); + break; + case 3: + message.pageSize = reader.int32(); + break; + case 4: + message.orderBy = reader.string(); + break; + case 5: + message.locationId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListDeidentifyTemplatesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.ListDeidentifyTemplatesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.ListDeidentifyTemplatesRequest} ListDeidentifyTemplatesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDeidentifyTemplatesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListDeidentifyTemplatesRequest message. + * @function verify + * @memberof google.privacy.dlp.v2.ListDeidentifyTemplatesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListDeidentifyTemplatesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + if (message.locationId != null && message.hasOwnProperty("locationId")) + if (!$util.isString(message.locationId)) + return "locationId: string expected"; + return null; + }; + + /** + * Creates a ListDeidentifyTemplatesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.ListDeidentifyTemplatesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.ListDeidentifyTemplatesRequest} ListDeidentifyTemplatesRequest + */ + ListDeidentifyTemplatesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.ListDeidentifyTemplatesRequest) + return object; + var message = new $root.google.privacy.dlp.v2.ListDeidentifyTemplatesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.locationId != null) + message.locationId = String(object.locationId); + return message; + }; + + /** + * Creates a plain object from a ListDeidentifyTemplatesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.ListDeidentifyTemplatesRequest + * @static + * @param {google.privacy.dlp.v2.ListDeidentifyTemplatesRequest} message ListDeidentifyTemplatesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListDeidentifyTemplatesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageToken = ""; + object.pageSize = 0; + object.orderBy = ""; + object.locationId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + if (message.locationId != null && message.hasOwnProperty("locationId")) + object.locationId = message.locationId; + return object; + }; + + /** + * Converts this ListDeidentifyTemplatesRequest to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.ListDeidentifyTemplatesRequest + * @instance + * @returns {Object.} JSON object + */ + ListDeidentifyTemplatesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListDeidentifyTemplatesRequest; + })(); + + v2.ListDeidentifyTemplatesResponse = (function() { + + /** + * Properties of a ListDeidentifyTemplatesResponse. + * @memberof google.privacy.dlp.v2 + * @interface IListDeidentifyTemplatesResponse + * @property {Array.|null} [deidentifyTemplates] ListDeidentifyTemplatesResponse deidentifyTemplates + * @property {string|null} [nextPageToken] ListDeidentifyTemplatesResponse nextPageToken + */ + + /** + * Constructs a new ListDeidentifyTemplatesResponse. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents a ListDeidentifyTemplatesResponse. + * @implements IListDeidentifyTemplatesResponse + * @constructor + * @param {google.privacy.dlp.v2.IListDeidentifyTemplatesResponse=} [properties] Properties to set + */ + function ListDeidentifyTemplatesResponse(properties) { + this.deidentifyTemplates = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListDeidentifyTemplatesResponse deidentifyTemplates. + * @member {Array.} deidentifyTemplates + * @memberof google.privacy.dlp.v2.ListDeidentifyTemplatesResponse + * @instance + */ + ListDeidentifyTemplatesResponse.prototype.deidentifyTemplates = $util.emptyArray; + + /** + * ListDeidentifyTemplatesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.privacy.dlp.v2.ListDeidentifyTemplatesResponse + * @instance + */ + ListDeidentifyTemplatesResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListDeidentifyTemplatesResponse instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.ListDeidentifyTemplatesResponse + * @static + * @param {google.privacy.dlp.v2.IListDeidentifyTemplatesResponse=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.ListDeidentifyTemplatesResponse} ListDeidentifyTemplatesResponse instance + */ + ListDeidentifyTemplatesResponse.create = function create(properties) { + return new ListDeidentifyTemplatesResponse(properties); + }; + + /** + * Encodes the specified ListDeidentifyTemplatesResponse message. Does not implicitly {@link google.privacy.dlp.v2.ListDeidentifyTemplatesResponse.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.ListDeidentifyTemplatesResponse + * @static + * @param {google.privacy.dlp.v2.IListDeidentifyTemplatesResponse} message ListDeidentifyTemplatesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDeidentifyTemplatesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deidentifyTemplates != null && message.deidentifyTemplates.length) + for (var i = 0; i < message.deidentifyTemplates.length; ++i) + $root.google.privacy.dlp.v2.DeidentifyTemplate.encode(message.deidentifyTemplates[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListDeidentifyTemplatesResponse message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.ListDeidentifyTemplatesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.ListDeidentifyTemplatesResponse + * @static + * @param {google.privacy.dlp.v2.IListDeidentifyTemplatesResponse} message ListDeidentifyTemplatesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDeidentifyTemplatesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListDeidentifyTemplatesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.ListDeidentifyTemplatesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.ListDeidentifyTemplatesResponse} ListDeidentifyTemplatesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDeidentifyTemplatesResponse.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.privacy.dlp.v2.ListDeidentifyTemplatesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.deidentifyTemplates && message.deidentifyTemplates.length)) + message.deidentifyTemplates = []; + message.deidentifyTemplates.push($root.google.privacy.dlp.v2.DeidentifyTemplate.decode(reader, reader.uint32())); + break; + case 2: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListDeidentifyTemplatesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.ListDeidentifyTemplatesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.ListDeidentifyTemplatesResponse} ListDeidentifyTemplatesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDeidentifyTemplatesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListDeidentifyTemplatesResponse message. + * @function verify + * @memberof google.privacy.dlp.v2.ListDeidentifyTemplatesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListDeidentifyTemplatesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deidentifyTemplates != null && message.hasOwnProperty("deidentifyTemplates")) { + if (!Array.isArray(message.deidentifyTemplates)) + return "deidentifyTemplates: array expected"; + for (var i = 0; i < message.deidentifyTemplates.length; ++i) { + var error = $root.google.privacy.dlp.v2.DeidentifyTemplate.verify(message.deidentifyTemplates[i]); + if (error) + return "deidentifyTemplates." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListDeidentifyTemplatesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.ListDeidentifyTemplatesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.ListDeidentifyTemplatesResponse} ListDeidentifyTemplatesResponse + */ + ListDeidentifyTemplatesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.ListDeidentifyTemplatesResponse) + return object; + var message = new $root.google.privacy.dlp.v2.ListDeidentifyTemplatesResponse(); + if (object.deidentifyTemplates) { + if (!Array.isArray(object.deidentifyTemplates)) + throw TypeError(".google.privacy.dlp.v2.ListDeidentifyTemplatesResponse.deidentifyTemplates: array expected"); + message.deidentifyTemplates = []; + for (var i = 0; i < object.deidentifyTemplates.length; ++i) { + if (typeof object.deidentifyTemplates[i] !== "object") + throw TypeError(".google.privacy.dlp.v2.ListDeidentifyTemplatesResponse.deidentifyTemplates: object expected"); + message.deidentifyTemplates[i] = $root.google.privacy.dlp.v2.DeidentifyTemplate.fromObject(object.deidentifyTemplates[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListDeidentifyTemplatesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.ListDeidentifyTemplatesResponse + * @static + * @param {google.privacy.dlp.v2.ListDeidentifyTemplatesResponse} message ListDeidentifyTemplatesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListDeidentifyTemplatesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.deidentifyTemplates = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.deidentifyTemplates && message.deidentifyTemplates.length) { + object.deidentifyTemplates = []; + for (var j = 0; j < message.deidentifyTemplates.length; ++j) + object.deidentifyTemplates[j] = $root.google.privacy.dlp.v2.DeidentifyTemplate.toObject(message.deidentifyTemplates[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListDeidentifyTemplatesResponse to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.ListDeidentifyTemplatesResponse + * @instance + * @returns {Object.} JSON object + */ + ListDeidentifyTemplatesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListDeidentifyTemplatesResponse; + })(); + + v2.DeleteDeidentifyTemplateRequest = (function() { + + /** + * Properties of a DeleteDeidentifyTemplateRequest. + * @memberof google.privacy.dlp.v2 + * @interface IDeleteDeidentifyTemplateRequest + * @property {string|null} [name] DeleteDeidentifyTemplateRequest name + */ + + /** + * Constructs a new DeleteDeidentifyTemplateRequest. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents a DeleteDeidentifyTemplateRequest. + * @implements IDeleteDeidentifyTemplateRequest + * @constructor + * @param {google.privacy.dlp.v2.IDeleteDeidentifyTemplateRequest=} [properties] Properties to set + */ + function DeleteDeidentifyTemplateRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteDeidentifyTemplateRequest name. + * @member {string} name + * @memberof google.privacy.dlp.v2.DeleteDeidentifyTemplateRequest + * @instance + */ + DeleteDeidentifyTemplateRequest.prototype.name = ""; + + /** + * Creates a new DeleteDeidentifyTemplateRequest instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.DeleteDeidentifyTemplateRequest + * @static + * @param {google.privacy.dlp.v2.IDeleteDeidentifyTemplateRequest=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.DeleteDeidentifyTemplateRequest} DeleteDeidentifyTemplateRequest instance + */ + DeleteDeidentifyTemplateRequest.create = function create(properties) { + return new DeleteDeidentifyTemplateRequest(properties); + }; + + /** + * Encodes the specified DeleteDeidentifyTemplateRequest message. Does not implicitly {@link google.privacy.dlp.v2.DeleteDeidentifyTemplateRequest.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.DeleteDeidentifyTemplateRequest + * @static + * @param {google.privacy.dlp.v2.IDeleteDeidentifyTemplateRequest} message DeleteDeidentifyTemplateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteDeidentifyTemplateRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified DeleteDeidentifyTemplateRequest message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.DeleteDeidentifyTemplateRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.DeleteDeidentifyTemplateRequest + * @static + * @param {google.privacy.dlp.v2.IDeleteDeidentifyTemplateRequest} message DeleteDeidentifyTemplateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteDeidentifyTemplateRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteDeidentifyTemplateRequest message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.DeleteDeidentifyTemplateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.DeleteDeidentifyTemplateRequest} DeleteDeidentifyTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteDeidentifyTemplateRequest.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.privacy.dlp.v2.DeleteDeidentifyTemplateRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteDeidentifyTemplateRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.DeleteDeidentifyTemplateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.DeleteDeidentifyTemplateRequest} DeleteDeidentifyTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteDeidentifyTemplateRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteDeidentifyTemplateRequest message. + * @function verify + * @memberof google.privacy.dlp.v2.DeleteDeidentifyTemplateRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteDeidentifyTemplateRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a DeleteDeidentifyTemplateRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.DeleteDeidentifyTemplateRequest + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.DeleteDeidentifyTemplateRequest} DeleteDeidentifyTemplateRequest + */ + DeleteDeidentifyTemplateRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.DeleteDeidentifyTemplateRequest) + return object; + var message = new $root.google.privacy.dlp.v2.DeleteDeidentifyTemplateRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteDeidentifyTemplateRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.DeleteDeidentifyTemplateRequest + * @static + * @param {google.privacy.dlp.v2.DeleteDeidentifyTemplateRequest} message DeleteDeidentifyTemplateRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteDeidentifyTemplateRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this DeleteDeidentifyTemplateRequest to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.DeleteDeidentifyTemplateRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteDeidentifyTemplateRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeleteDeidentifyTemplateRequest; + })(); + + v2.LargeCustomDictionaryConfig = (function() { + + /** + * Properties of a LargeCustomDictionaryConfig. + * @memberof google.privacy.dlp.v2 + * @interface ILargeCustomDictionaryConfig + * @property {google.privacy.dlp.v2.ICloudStoragePath|null} [outputPath] LargeCustomDictionaryConfig outputPath + * @property {google.privacy.dlp.v2.ICloudStorageFileSet|null} [cloudStorageFileSet] LargeCustomDictionaryConfig cloudStorageFileSet + * @property {google.privacy.dlp.v2.IBigQueryField|null} [bigQueryField] LargeCustomDictionaryConfig bigQueryField + */ + + /** + * Constructs a new LargeCustomDictionaryConfig. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents a LargeCustomDictionaryConfig. + * @implements ILargeCustomDictionaryConfig + * @constructor + * @param {google.privacy.dlp.v2.ILargeCustomDictionaryConfig=} [properties] Properties to set + */ + function LargeCustomDictionaryConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LargeCustomDictionaryConfig outputPath. + * @member {google.privacy.dlp.v2.ICloudStoragePath|null|undefined} outputPath + * @memberof google.privacy.dlp.v2.LargeCustomDictionaryConfig + * @instance + */ + LargeCustomDictionaryConfig.prototype.outputPath = null; + + /** + * LargeCustomDictionaryConfig cloudStorageFileSet. + * @member {google.privacy.dlp.v2.ICloudStorageFileSet|null|undefined} cloudStorageFileSet + * @memberof google.privacy.dlp.v2.LargeCustomDictionaryConfig + * @instance + */ + LargeCustomDictionaryConfig.prototype.cloudStorageFileSet = null; + + /** + * LargeCustomDictionaryConfig bigQueryField. + * @member {google.privacy.dlp.v2.IBigQueryField|null|undefined} bigQueryField + * @memberof google.privacy.dlp.v2.LargeCustomDictionaryConfig + * @instance + */ + LargeCustomDictionaryConfig.prototype.bigQueryField = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * LargeCustomDictionaryConfig source. + * @member {"cloudStorageFileSet"|"bigQueryField"|undefined} source + * @memberof google.privacy.dlp.v2.LargeCustomDictionaryConfig + * @instance + */ + Object.defineProperty(LargeCustomDictionaryConfig.prototype, "source", { + get: $util.oneOfGetter($oneOfFields = ["cloudStorageFileSet", "bigQueryField"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new LargeCustomDictionaryConfig instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.LargeCustomDictionaryConfig + * @static + * @param {google.privacy.dlp.v2.ILargeCustomDictionaryConfig=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.LargeCustomDictionaryConfig} LargeCustomDictionaryConfig instance + */ + LargeCustomDictionaryConfig.create = function create(properties) { + return new LargeCustomDictionaryConfig(properties); + }; + + /** + * Encodes the specified LargeCustomDictionaryConfig message. Does not implicitly {@link google.privacy.dlp.v2.LargeCustomDictionaryConfig.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.LargeCustomDictionaryConfig + * @static + * @param {google.privacy.dlp.v2.ILargeCustomDictionaryConfig} message LargeCustomDictionaryConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LargeCustomDictionaryConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.outputPath != null && Object.hasOwnProperty.call(message, "outputPath")) + $root.google.privacy.dlp.v2.CloudStoragePath.encode(message.outputPath, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.cloudStorageFileSet != null && Object.hasOwnProperty.call(message, "cloudStorageFileSet")) + $root.google.privacy.dlp.v2.CloudStorageFileSet.encode(message.cloudStorageFileSet, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.bigQueryField != null && Object.hasOwnProperty.call(message, "bigQueryField")) + $root.google.privacy.dlp.v2.BigQueryField.encode(message.bigQueryField, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified LargeCustomDictionaryConfig message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.LargeCustomDictionaryConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.LargeCustomDictionaryConfig + * @static + * @param {google.privacy.dlp.v2.ILargeCustomDictionaryConfig} message LargeCustomDictionaryConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LargeCustomDictionaryConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LargeCustomDictionaryConfig message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.LargeCustomDictionaryConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.LargeCustomDictionaryConfig} LargeCustomDictionaryConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LargeCustomDictionaryConfig.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.privacy.dlp.v2.LargeCustomDictionaryConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.outputPath = $root.google.privacy.dlp.v2.CloudStoragePath.decode(reader, reader.uint32()); + break; + case 2: + message.cloudStorageFileSet = $root.google.privacy.dlp.v2.CloudStorageFileSet.decode(reader, reader.uint32()); + break; + case 3: + message.bigQueryField = $root.google.privacy.dlp.v2.BigQueryField.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LargeCustomDictionaryConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.LargeCustomDictionaryConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.LargeCustomDictionaryConfig} LargeCustomDictionaryConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LargeCustomDictionaryConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LargeCustomDictionaryConfig message. + * @function verify + * @memberof google.privacy.dlp.v2.LargeCustomDictionaryConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LargeCustomDictionaryConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.outputPath != null && message.hasOwnProperty("outputPath")) { + var error = $root.google.privacy.dlp.v2.CloudStoragePath.verify(message.outputPath); + if (error) + return "outputPath." + error; + } + if (message.cloudStorageFileSet != null && message.hasOwnProperty("cloudStorageFileSet")) { + properties.source = 1; + { + var error = $root.google.privacy.dlp.v2.CloudStorageFileSet.verify(message.cloudStorageFileSet); + if (error) + return "cloudStorageFileSet." + error; + } + } + if (message.bigQueryField != null && message.hasOwnProperty("bigQueryField")) { + if (properties.source === 1) + return "source: multiple values"; + properties.source = 1; + { + var error = $root.google.privacy.dlp.v2.BigQueryField.verify(message.bigQueryField); + if (error) + return "bigQueryField." + error; + } + } + return null; + }; + + /** + * Creates a LargeCustomDictionaryConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.LargeCustomDictionaryConfig + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.LargeCustomDictionaryConfig} LargeCustomDictionaryConfig + */ + LargeCustomDictionaryConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.LargeCustomDictionaryConfig) + return object; + var message = new $root.google.privacy.dlp.v2.LargeCustomDictionaryConfig(); + if (object.outputPath != null) { + if (typeof object.outputPath !== "object") + throw TypeError(".google.privacy.dlp.v2.LargeCustomDictionaryConfig.outputPath: object expected"); + message.outputPath = $root.google.privacy.dlp.v2.CloudStoragePath.fromObject(object.outputPath); + } + if (object.cloudStorageFileSet != null) { + if (typeof object.cloudStorageFileSet !== "object") + throw TypeError(".google.privacy.dlp.v2.LargeCustomDictionaryConfig.cloudStorageFileSet: object expected"); + message.cloudStorageFileSet = $root.google.privacy.dlp.v2.CloudStorageFileSet.fromObject(object.cloudStorageFileSet); + } + if (object.bigQueryField != null) { + if (typeof object.bigQueryField !== "object") + throw TypeError(".google.privacy.dlp.v2.LargeCustomDictionaryConfig.bigQueryField: object expected"); + message.bigQueryField = $root.google.privacy.dlp.v2.BigQueryField.fromObject(object.bigQueryField); + } + return message; + }; + + /** + * Creates a plain object from a LargeCustomDictionaryConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.LargeCustomDictionaryConfig + * @static + * @param {google.privacy.dlp.v2.LargeCustomDictionaryConfig} message LargeCustomDictionaryConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LargeCustomDictionaryConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.outputPath = null; + if (message.outputPath != null && message.hasOwnProperty("outputPath")) + object.outputPath = $root.google.privacy.dlp.v2.CloudStoragePath.toObject(message.outputPath, options); + if (message.cloudStorageFileSet != null && message.hasOwnProperty("cloudStorageFileSet")) { + object.cloudStorageFileSet = $root.google.privacy.dlp.v2.CloudStorageFileSet.toObject(message.cloudStorageFileSet, options); + if (options.oneofs) + object.source = "cloudStorageFileSet"; + } + if (message.bigQueryField != null && message.hasOwnProperty("bigQueryField")) { + object.bigQueryField = $root.google.privacy.dlp.v2.BigQueryField.toObject(message.bigQueryField, options); + if (options.oneofs) + object.source = "bigQueryField"; + } + return object; + }; + + /** + * Converts this LargeCustomDictionaryConfig to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.LargeCustomDictionaryConfig + * @instance + * @returns {Object.} JSON object + */ + LargeCustomDictionaryConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return LargeCustomDictionaryConfig; + })(); + + v2.LargeCustomDictionaryStats = (function() { + + /** + * Properties of a LargeCustomDictionaryStats. + * @memberof google.privacy.dlp.v2 + * @interface ILargeCustomDictionaryStats + * @property {number|Long|null} [approxNumPhrases] LargeCustomDictionaryStats approxNumPhrases + */ + + /** + * Constructs a new LargeCustomDictionaryStats. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents a LargeCustomDictionaryStats. + * @implements ILargeCustomDictionaryStats + * @constructor + * @param {google.privacy.dlp.v2.ILargeCustomDictionaryStats=} [properties] Properties to set + */ + function LargeCustomDictionaryStats(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LargeCustomDictionaryStats approxNumPhrases. + * @member {number|Long} approxNumPhrases + * @memberof google.privacy.dlp.v2.LargeCustomDictionaryStats + * @instance + */ + LargeCustomDictionaryStats.prototype.approxNumPhrases = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new LargeCustomDictionaryStats instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.LargeCustomDictionaryStats + * @static + * @param {google.privacy.dlp.v2.ILargeCustomDictionaryStats=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.LargeCustomDictionaryStats} LargeCustomDictionaryStats instance + */ + LargeCustomDictionaryStats.create = function create(properties) { + return new LargeCustomDictionaryStats(properties); + }; + + /** + * Encodes the specified LargeCustomDictionaryStats message. Does not implicitly {@link google.privacy.dlp.v2.LargeCustomDictionaryStats.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.LargeCustomDictionaryStats + * @static + * @param {google.privacy.dlp.v2.ILargeCustomDictionaryStats} message LargeCustomDictionaryStats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LargeCustomDictionaryStats.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.approxNumPhrases != null && Object.hasOwnProperty.call(message, "approxNumPhrases")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.approxNumPhrases); + return writer; + }; + + /** + * Encodes the specified LargeCustomDictionaryStats message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.LargeCustomDictionaryStats.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.LargeCustomDictionaryStats + * @static + * @param {google.privacy.dlp.v2.ILargeCustomDictionaryStats} message LargeCustomDictionaryStats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LargeCustomDictionaryStats.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LargeCustomDictionaryStats message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.LargeCustomDictionaryStats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.LargeCustomDictionaryStats} LargeCustomDictionaryStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LargeCustomDictionaryStats.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.privacy.dlp.v2.LargeCustomDictionaryStats(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.approxNumPhrases = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LargeCustomDictionaryStats message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.LargeCustomDictionaryStats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.LargeCustomDictionaryStats} LargeCustomDictionaryStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LargeCustomDictionaryStats.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LargeCustomDictionaryStats message. + * @function verify + * @memberof google.privacy.dlp.v2.LargeCustomDictionaryStats + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LargeCustomDictionaryStats.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.approxNumPhrases != null && message.hasOwnProperty("approxNumPhrases")) + if (!$util.isInteger(message.approxNumPhrases) && !(message.approxNumPhrases && $util.isInteger(message.approxNumPhrases.low) && $util.isInteger(message.approxNumPhrases.high))) + return "approxNumPhrases: integer|Long expected"; + return null; + }; + + /** + * Creates a LargeCustomDictionaryStats message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.LargeCustomDictionaryStats + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.LargeCustomDictionaryStats} LargeCustomDictionaryStats + */ + LargeCustomDictionaryStats.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.LargeCustomDictionaryStats) + return object; + var message = new $root.google.privacy.dlp.v2.LargeCustomDictionaryStats(); + if (object.approxNumPhrases != null) + if ($util.Long) + (message.approxNumPhrases = $util.Long.fromValue(object.approxNumPhrases)).unsigned = false; + else if (typeof object.approxNumPhrases === "string") + message.approxNumPhrases = parseInt(object.approxNumPhrases, 10); + else if (typeof object.approxNumPhrases === "number") + message.approxNumPhrases = object.approxNumPhrases; + else if (typeof object.approxNumPhrases === "object") + message.approxNumPhrases = new $util.LongBits(object.approxNumPhrases.low >>> 0, object.approxNumPhrases.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a LargeCustomDictionaryStats message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.LargeCustomDictionaryStats + * @static + * @param {google.privacy.dlp.v2.LargeCustomDictionaryStats} message LargeCustomDictionaryStats + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LargeCustomDictionaryStats.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.approxNumPhrases = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.approxNumPhrases = options.longs === String ? "0" : 0; + if (message.approxNumPhrases != null && message.hasOwnProperty("approxNumPhrases")) + if (typeof message.approxNumPhrases === "number") + object.approxNumPhrases = options.longs === String ? String(message.approxNumPhrases) : message.approxNumPhrases; + else + object.approxNumPhrases = options.longs === String ? $util.Long.prototype.toString.call(message.approxNumPhrases) : options.longs === Number ? new $util.LongBits(message.approxNumPhrases.low >>> 0, message.approxNumPhrases.high >>> 0).toNumber() : message.approxNumPhrases; + return object; + }; + + /** + * Converts this LargeCustomDictionaryStats to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.LargeCustomDictionaryStats + * @instance + * @returns {Object.} JSON object + */ + LargeCustomDictionaryStats.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return LargeCustomDictionaryStats; + })(); + + v2.StoredInfoTypeConfig = (function() { + + /** + * Properties of a StoredInfoTypeConfig. + * @memberof google.privacy.dlp.v2 + * @interface IStoredInfoTypeConfig + * @property {string|null} [displayName] StoredInfoTypeConfig displayName + * @property {string|null} [description] StoredInfoTypeConfig description + * @property {google.privacy.dlp.v2.ILargeCustomDictionaryConfig|null} [largeCustomDictionary] StoredInfoTypeConfig largeCustomDictionary + * @property {google.privacy.dlp.v2.CustomInfoType.IDictionary|null} [dictionary] StoredInfoTypeConfig dictionary + * @property {google.privacy.dlp.v2.CustomInfoType.IRegex|null} [regex] StoredInfoTypeConfig regex + */ + + /** + * Constructs a new StoredInfoTypeConfig. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents a StoredInfoTypeConfig. + * @implements IStoredInfoTypeConfig + * @constructor + * @param {google.privacy.dlp.v2.IStoredInfoTypeConfig=} [properties] Properties to set + */ + function StoredInfoTypeConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StoredInfoTypeConfig displayName. + * @member {string} displayName + * @memberof google.privacy.dlp.v2.StoredInfoTypeConfig + * @instance + */ + StoredInfoTypeConfig.prototype.displayName = ""; + + /** + * StoredInfoTypeConfig description. + * @member {string} description + * @memberof google.privacy.dlp.v2.StoredInfoTypeConfig + * @instance + */ + StoredInfoTypeConfig.prototype.description = ""; + + /** + * StoredInfoTypeConfig largeCustomDictionary. + * @member {google.privacy.dlp.v2.ILargeCustomDictionaryConfig|null|undefined} largeCustomDictionary + * @memberof google.privacy.dlp.v2.StoredInfoTypeConfig + * @instance + */ + StoredInfoTypeConfig.prototype.largeCustomDictionary = null; + + /** + * StoredInfoTypeConfig dictionary. + * @member {google.privacy.dlp.v2.CustomInfoType.IDictionary|null|undefined} dictionary + * @memberof google.privacy.dlp.v2.StoredInfoTypeConfig + * @instance + */ + StoredInfoTypeConfig.prototype.dictionary = null; + + /** + * StoredInfoTypeConfig regex. + * @member {google.privacy.dlp.v2.CustomInfoType.IRegex|null|undefined} regex + * @memberof google.privacy.dlp.v2.StoredInfoTypeConfig + * @instance + */ + StoredInfoTypeConfig.prototype.regex = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * StoredInfoTypeConfig type. + * @member {"largeCustomDictionary"|"dictionary"|"regex"|undefined} type + * @memberof google.privacy.dlp.v2.StoredInfoTypeConfig + * @instance + */ + Object.defineProperty(StoredInfoTypeConfig.prototype, "type", { + get: $util.oneOfGetter($oneOfFields = ["largeCustomDictionary", "dictionary", "regex"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new StoredInfoTypeConfig instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.StoredInfoTypeConfig + * @static + * @param {google.privacy.dlp.v2.IStoredInfoTypeConfig=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.StoredInfoTypeConfig} StoredInfoTypeConfig instance + */ + StoredInfoTypeConfig.create = function create(properties) { + return new StoredInfoTypeConfig(properties); + }; + + /** + * Encodes the specified StoredInfoTypeConfig message. Does not implicitly {@link google.privacy.dlp.v2.StoredInfoTypeConfig.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.StoredInfoTypeConfig + * @static + * @param {google.privacy.dlp.v2.IStoredInfoTypeConfig} message StoredInfoTypeConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StoredInfoTypeConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.displayName); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + if (message.largeCustomDictionary != null && Object.hasOwnProperty.call(message, "largeCustomDictionary")) + $root.google.privacy.dlp.v2.LargeCustomDictionaryConfig.encode(message.largeCustomDictionary, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.dictionary != null && Object.hasOwnProperty.call(message, "dictionary")) + $root.google.privacy.dlp.v2.CustomInfoType.Dictionary.encode(message.dictionary, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.regex != null && Object.hasOwnProperty.call(message, "regex")) + $root.google.privacy.dlp.v2.CustomInfoType.Regex.encode(message.regex, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified StoredInfoTypeConfig message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.StoredInfoTypeConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.StoredInfoTypeConfig + * @static + * @param {google.privacy.dlp.v2.IStoredInfoTypeConfig} message StoredInfoTypeConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StoredInfoTypeConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StoredInfoTypeConfig message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.StoredInfoTypeConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.StoredInfoTypeConfig} StoredInfoTypeConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StoredInfoTypeConfig.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.privacy.dlp.v2.StoredInfoTypeConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.displayName = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + message.largeCustomDictionary = $root.google.privacy.dlp.v2.LargeCustomDictionaryConfig.decode(reader, reader.uint32()); + break; + case 4: + message.dictionary = $root.google.privacy.dlp.v2.CustomInfoType.Dictionary.decode(reader, reader.uint32()); + break; + case 5: + message.regex = $root.google.privacy.dlp.v2.CustomInfoType.Regex.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StoredInfoTypeConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.StoredInfoTypeConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.StoredInfoTypeConfig} StoredInfoTypeConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StoredInfoTypeConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StoredInfoTypeConfig message. + * @function verify + * @memberof google.privacy.dlp.v2.StoredInfoTypeConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StoredInfoTypeConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.largeCustomDictionary != null && message.hasOwnProperty("largeCustomDictionary")) { + properties.type = 1; + { + var error = $root.google.privacy.dlp.v2.LargeCustomDictionaryConfig.verify(message.largeCustomDictionary); + if (error) + return "largeCustomDictionary." + error; + } + } + if (message.dictionary != null && message.hasOwnProperty("dictionary")) { + if (properties.type === 1) + return "type: multiple values"; + properties.type = 1; + { + var error = $root.google.privacy.dlp.v2.CustomInfoType.Dictionary.verify(message.dictionary); + if (error) + return "dictionary." + error; + } + } + if (message.regex != null && message.hasOwnProperty("regex")) { + if (properties.type === 1) + return "type: multiple values"; + properties.type = 1; + { + var error = $root.google.privacy.dlp.v2.CustomInfoType.Regex.verify(message.regex); + if (error) + return "regex." + error; + } + } + return null; + }; + + /** + * Creates a StoredInfoTypeConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.StoredInfoTypeConfig + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.StoredInfoTypeConfig} StoredInfoTypeConfig + */ + StoredInfoTypeConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.StoredInfoTypeConfig) + return object; + var message = new $root.google.privacy.dlp.v2.StoredInfoTypeConfig(); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.description != null) + message.description = String(object.description); + if (object.largeCustomDictionary != null) { + if (typeof object.largeCustomDictionary !== "object") + throw TypeError(".google.privacy.dlp.v2.StoredInfoTypeConfig.largeCustomDictionary: object expected"); + message.largeCustomDictionary = $root.google.privacy.dlp.v2.LargeCustomDictionaryConfig.fromObject(object.largeCustomDictionary); + } + if (object.dictionary != null) { + if (typeof object.dictionary !== "object") + throw TypeError(".google.privacy.dlp.v2.StoredInfoTypeConfig.dictionary: object expected"); + message.dictionary = $root.google.privacy.dlp.v2.CustomInfoType.Dictionary.fromObject(object.dictionary); + } + if (object.regex != null) { + if (typeof object.regex !== "object") + throw TypeError(".google.privacy.dlp.v2.StoredInfoTypeConfig.regex: object expected"); + message.regex = $root.google.privacy.dlp.v2.CustomInfoType.Regex.fromObject(object.regex); + } + return message; + }; + + /** + * Creates a plain object from a StoredInfoTypeConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.StoredInfoTypeConfig + * @static + * @param {google.privacy.dlp.v2.StoredInfoTypeConfig} message StoredInfoTypeConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StoredInfoTypeConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.displayName = ""; + object.description = ""; + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.largeCustomDictionary != null && message.hasOwnProperty("largeCustomDictionary")) { + object.largeCustomDictionary = $root.google.privacy.dlp.v2.LargeCustomDictionaryConfig.toObject(message.largeCustomDictionary, options); + if (options.oneofs) + object.type = "largeCustomDictionary"; + } + if (message.dictionary != null && message.hasOwnProperty("dictionary")) { + object.dictionary = $root.google.privacy.dlp.v2.CustomInfoType.Dictionary.toObject(message.dictionary, options); + if (options.oneofs) + object.type = "dictionary"; + } + if (message.regex != null && message.hasOwnProperty("regex")) { + object.regex = $root.google.privacy.dlp.v2.CustomInfoType.Regex.toObject(message.regex, options); + if (options.oneofs) + object.type = "regex"; + } + return object; + }; + + /** + * Converts this StoredInfoTypeConfig to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.StoredInfoTypeConfig + * @instance + * @returns {Object.} JSON object + */ + StoredInfoTypeConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return StoredInfoTypeConfig; + })(); + + v2.StoredInfoTypeStats = (function() { + + /** + * Properties of a StoredInfoTypeStats. + * @memberof google.privacy.dlp.v2 + * @interface IStoredInfoTypeStats + * @property {google.privacy.dlp.v2.ILargeCustomDictionaryStats|null} [largeCustomDictionary] StoredInfoTypeStats largeCustomDictionary + */ + + /** + * Constructs a new StoredInfoTypeStats. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents a StoredInfoTypeStats. + * @implements IStoredInfoTypeStats + * @constructor + * @param {google.privacy.dlp.v2.IStoredInfoTypeStats=} [properties] Properties to set + */ + function StoredInfoTypeStats(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StoredInfoTypeStats largeCustomDictionary. + * @member {google.privacy.dlp.v2.ILargeCustomDictionaryStats|null|undefined} largeCustomDictionary + * @memberof google.privacy.dlp.v2.StoredInfoTypeStats + * @instance + */ + StoredInfoTypeStats.prototype.largeCustomDictionary = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * StoredInfoTypeStats type. + * @member {"largeCustomDictionary"|undefined} type + * @memberof google.privacy.dlp.v2.StoredInfoTypeStats + * @instance + */ + Object.defineProperty(StoredInfoTypeStats.prototype, "type", { + get: $util.oneOfGetter($oneOfFields = ["largeCustomDictionary"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new StoredInfoTypeStats instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.StoredInfoTypeStats + * @static + * @param {google.privacy.dlp.v2.IStoredInfoTypeStats=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.StoredInfoTypeStats} StoredInfoTypeStats instance + */ + StoredInfoTypeStats.create = function create(properties) { + return new StoredInfoTypeStats(properties); + }; + + /** + * Encodes the specified StoredInfoTypeStats message. Does not implicitly {@link google.privacy.dlp.v2.StoredInfoTypeStats.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.StoredInfoTypeStats + * @static + * @param {google.privacy.dlp.v2.IStoredInfoTypeStats} message StoredInfoTypeStats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StoredInfoTypeStats.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.largeCustomDictionary != null && Object.hasOwnProperty.call(message, "largeCustomDictionary")) + $root.google.privacy.dlp.v2.LargeCustomDictionaryStats.encode(message.largeCustomDictionary, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified StoredInfoTypeStats message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.StoredInfoTypeStats.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.StoredInfoTypeStats + * @static + * @param {google.privacy.dlp.v2.IStoredInfoTypeStats} message StoredInfoTypeStats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StoredInfoTypeStats.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StoredInfoTypeStats message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.StoredInfoTypeStats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.StoredInfoTypeStats} StoredInfoTypeStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StoredInfoTypeStats.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.privacy.dlp.v2.StoredInfoTypeStats(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.largeCustomDictionary = $root.google.privacy.dlp.v2.LargeCustomDictionaryStats.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StoredInfoTypeStats message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.StoredInfoTypeStats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.StoredInfoTypeStats} StoredInfoTypeStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StoredInfoTypeStats.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StoredInfoTypeStats message. + * @function verify + * @memberof google.privacy.dlp.v2.StoredInfoTypeStats + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StoredInfoTypeStats.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.largeCustomDictionary != null && message.hasOwnProperty("largeCustomDictionary")) { + properties.type = 1; + { + var error = $root.google.privacy.dlp.v2.LargeCustomDictionaryStats.verify(message.largeCustomDictionary); + if (error) + return "largeCustomDictionary." + error; + } + } + return null; + }; + + /** + * Creates a StoredInfoTypeStats message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.StoredInfoTypeStats + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.StoredInfoTypeStats} StoredInfoTypeStats + */ + StoredInfoTypeStats.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.StoredInfoTypeStats) + return object; + var message = new $root.google.privacy.dlp.v2.StoredInfoTypeStats(); + if (object.largeCustomDictionary != null) { + if (typeof object.largeCustomDictionary !== "object") + throw TypeError(".google.privacy.dlp.v2.StoredInfoTypeStats.largeCustomDictionary: object expected"); + message.largeCustomDictionary = $root.google.privacy.dlp.v2.LargeCustomDictionaryStats.fromObject(object.largeCustomDictionary); + } + return message; + }; + + /** + * Creates a plain object from a StoredInfoTypeStats message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.StoredInfoTypeStats + * @static + * @param {google.privacy.dlp.v2.StoredInfoTypeStats} message StoredInfoTypeStats + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StoredInfoTypeStats.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.largeCustomDictionary != null && message.hasOwnProperty("largeCustomDictionary")) { + object.largeCustomDictionary = $root.google.privacy.dlp.v2.LargeCustomDictionaryStats.toObject(message.largeCustomDictionary, options); + if (options.oneofs) + object.type = "largeCustomDictionary"; + } + return object; + }; + + /** + * Converts this StoredInfoTypeStats to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.StoredInfoTypeStats + * @instance + * @returns {Object.} JSON object + */ + StoredInfoTypeStats.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return StoredInfoTypeStats; + })(); + + v2.StoredInfoTypeVersion = (function() { + + /** + * Properties of a StoredInfoTypeVersion. + * @memberof google.privacy.dlp.v2 + * @interface IStoredInfoTypeVersion + * @property {google.privacy.dlp.v2.IStoredInfoTypeConfig|null} [config] StoredInfoTypeVersion config + * @property {google.protobuf.ITimestamp|null} [createTime] StoredInfoTypeVersion createTime + * @property {google.privacy.dlp.v2.StoredInfoTypeState|null} [state] StoredInfoTypeVersion state + * @property {Array.|null} [errors] StoredInfoTypeVersion errors + * @property {google.privacy.dlp.v2.IStoredInfoTypeStats|null} [stats] StoredInfoTypeVersion stats + */ + + /** + * Constructs a new StoredInfoTypeVersion. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents a StoredInfoTypeVersion. + * @implements IStoredInfoTypeVersion + * @constructor + * @param {google.privacy.dlp.v2.IStoredInfoTypeVersion=} [properties] Properties to set + */ + function StoredInfoTypeVersion(properties) { + this.errors = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StoredInfoTypeVersion config. + * @member {google.privacy.dlp.v2.IStoredInfoTypeConfig|null|undefined} config + * @memberof google.privacy.dlp.v2.StoredInfoTypeVersion + * @instance + */ + StoredInfoTypeVersion.prototype.config = null; + + /** + * StoredInfoTypeVersion createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.privacy.dlp.v2.StoredInfoTypeVersion + * @instance + */ + StoredInfoTypeVersion.prototype.createTime = null; + + /** + * StoredInfoTypeVersion state. + * @member {google.privacy.dlp.v2.StoredInfoTypeState} state + * @memberof google.privacy.dlp.v2.StoredInfoTypeVersion + * @instance + */ + StoredInfoTypeVersion.prototype.state = 0; + + /** + * StoredInfoTypeVersion errors. + * @member {Array.} errors + * @memberof google.privacy.dlp.v2.StoredInfoTypeVersion + * @instance + */ + StoredInfoTypeVersion.prototype.errors = $util.emptyArray; + + /** + * StoredInfoTypeVersion stats. + * @member {google.privacy.dlp.v2.IStoredInfoTypeStats|null|undefined} stats + * @memberof google.privacy.dlp.v2.StoredInfoTypeVersion + * @instance + */ + StoredInfoTypeVersion.prototype.stats = null; + + /** + * Creates a new StoredInfoTypeVersion instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.StoredInfoTypeVersion + * @static + * @param {google.privacy.dlp.v2.IStoredInfoTypeVersion=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.StoredInfoTypeVersion} StoredInfoTypeVersion instance + */ + StoredInfoTypeVersion.create = function create(properties) { + return new StoredInfoTypeVersion(properties); + }; + + /** + * Encodes the specified StoredInfoTypeVersion message. Does not implicitly {@link google.privacy.dlp.v2.StoredInfoTypeVersion.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.StoredInfoTypeVersion + * @static + * @param {google.privacy.dlp.v2.IStoredInfoTypeVersion} message StoredInfoTypeVersion message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StoredInfoTypeVersion.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.config != null && Object.hasOwnProperty.call(message, "config")) + $root.google.privacy.dlp.v2.StoredInfoTypeConfig.encode(message.config, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.state); + if (message.errors != null && message.errors.length) + for (var i = 0; i < message.errors.length; ++i) + $root.google.privacy.dlp.v2.Error.encode(message.errors[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.stats != null && Object.hasOwnProperty.call(message, "stats")) + $root.google.privacy.dlp.v2.StoredInfoTypeStats.encode(message.stats, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified StoredInfoTypeVersion message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.StoredInfoTypeVersion.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.StoredInfoTypeVersion + * @static + * @param {google.privacy.dlp.v2.IStoredInfoTypeVersion} message StoredInfoTypeVersion message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StoredInfoTypeVersion.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StoredInfoTypeVersion message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.StoredInfoTypeVersion + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.StoredInfoTypeVersion} StoredInfoTypeVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StoredInfoTypeVersion.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.privacy.dlp.v2.StoredInfoTypeVersion(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.config = $root.google.privacy.dlp.v2.StoredInfoTypeConfig.decode(reader, reader.uint32()); + break; + case 2: + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 3: + message.state = reader.int32(); + break; + case 4: + if (!(message.errors && message.errors.length)) + message.errors = []; + message.errors.push($root.google.privacy.dlp.v2.Error.decode(reader, reader.uint32())); + break; + case 5: + message.stats = $root.google.privacy.dlp.v2.StoredInfoTypeStats.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StoredInfoTypeVersion message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.StoredInfoTypeVersion + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.StoredInfoTypeVersion} StoredInfoTypeVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StoredInfoTypeVersion.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StoredInfoTypeVersion message. + * @function verify + * @memberof google.privacy.dlp.v2.StoredInfoTypeVersion + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StoredInfoTypeVersion.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.config != null && message.hasOwnProperty("config")) { + var error = $root.google.privacy.dlp.v2.StoredInfoTypeConfig.verify(message.config); + if (error) + return "config." + error; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.errors != null && message.hasOwnProperty("errors")) { + if (!Array.isArray(message.errors)) + return "errors: array expected"; + for (var i = 0; i < message.errors.length; ++i) { + var error = $root.google.privacy.dlp.v2.Error.verify(message.errors[i]); + if (error) + return "errors." + error; + } + } + if (message.stats != null && message.hasOwnProperty("stats")) { + var error = $root.google.privacy.dlp.v2.StoredInfoTypeStats.verify(message.stats); + if (error) + return "stats." + error; + } + return null; + }; + + /** + * Creates a StoredInfoTypeVersion message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.StoredInfoTypeVersion + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.StoredInfoTypeVersion} StoredInfoTypeVersion + */ + StoredInfoTypeVersion.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.StoredInfoTypeVersion) + return object; + var message = new $root.google.privacy.dlp.v2.StoredInfoTypeVersion(); + if (object.config != null) { + if (typeof object.config !== "object") + throw TypeError(".google.privacy.dlp.v2.StoredInfoTypeVersion.config: object expected"); + message.config = $root.google.privacy.dlp.v2.StoredInfoTypeConfig.fromObject(object.config); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.privacy.dlp.v2.StoredInfoTypeVersion.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + switch (object.state) { + case "STORED_INFO_TYPE_STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "PENDING": + case 1: + message.state = 1; + break; + case "READY": + case 2: + message.state = 2; + break; + case "FAILED": + case 3: + message.state = 3; + break; + case "INVALID": + case 4: + message.state = 4; + break; + } + if (object.errors) { + if (!Array.isArray(object.errors)) + throw TypeError(".google.privacy.dlp.v2.StoredInfoTypeVersion.errors: array expected"); + message.errors = []; + for (var i = 0; i < object.errors.length; ++i) { + if (typeof object.errors[i] !== "object") + throw TypeError(".google.privacy.dlp.v2.StoredInfoTypeVersion.errors: object expected"); + message.errors[i] = $root.google.privacy.dlp.v2.Error.fromObject(object.errors[i]); + } + } + if (object.stats != null) { + if (typeof object.stats !== "object") + throw TypeError(".google.privacy.dlp.v2.StoredInfoTypeVersion.stats: object expected"); + message.stats = $root.google.privacy.dlp.v2.StoredInfoTypeStats.fromObject(object.stats); + } + return message; + }; + + /** + * Creates a plain object from a StoredInfoTypeVersion message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.StoredInfoTypeVersion + * @static + * @param {google.privacy.dlp.v2.StoredInfoTypeVersion} message StoredInfoTypeVersion + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StoredInfoTypeVersion.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.errors = []; + if (options.defaults) { + object.config = null; + object.createTime = null; + object.state = options.enums === String ? "STORED_INFO_TYPE_STATE_UNSPECIFIED" : 0; + object.stats = null; + } + if (message.config != null && message.hasOwnProperty("config")) + object.config = $root.google.privacy.dlp.v2.StoredInfoTypeConfig.toObject(message.config, options); + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.privacy.dlp.v2.StoredInfoTypeState[message.state] : message.state; + if (message.errors && message.errors.length) { + object.errors = []; + for (var j = 0; j < message.errors.length; ++j) + object.errors[j] = $root.google.privacy.dlp.v2.Error.toObject(message.errors[j], options); + } + if (message.stats != null && message.hasOwnProperty("stats")) + object.stats = $root.google.privacy.dlp.v2.StoredInfoTypeStats.toObject(message.stats, options); + return object; + }; + + /** + * Converts this StoredInfoTypeVersion to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.StoredInfoTypeVersion + * @instance + * @returns {Object.} JSON object + */ + StoredInfoTypeVersion.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return StoredInfoTypeVersion; + })(); + + v2.StoredInfoType = (function() { + + /** + * Properties of a StoredInfoType. + * @memberof google.privacy.dlp.v2 + * @interface IStoredInfoType + * @property {string|null} [name] StoredInfoType name + * @property {google.privacy.dlp.v2.IStoredInfoTypeVersion|null} [currentVersion] StoredInfoType currentVersion + * @property {Array.|null} [pendingVersions] StoredInfoType pendingVersions + */ + + /** + * Constructs a new StoredInfoType. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents a StoredInfoType. + * @implements IStoredInfoType + * @constructor + * @param {google.privacy.dlp.v2.IStoredInfoType=} [properties] Properties to set + */ + function StoredInfoType(properties) { + this.pendingVersions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StoredInfoType name. + * @member {string} name + * @memberof google.privacy.dlp.v2.StoredInfoType + * @instance + */ + StoredInfoType.prototype.name = ""; + + /** + * StoredInfoType currentVersion. + * @member {google.privacy.dlp.v2.IStoredInfoTypeVersion|null|undefined} currentVersion + * @memberof google.privacy.dlp.v2.StoredInfoType + * @instance + */ + StoredInfoType.prototype.currentVersion = null; + + /** + * StoredInfoType pendingVersions. + * @member {Array.} pendingVersions + * @memberof google.privacy.dlp.v2.StoredInfoType + * @instance + */ + StoredInfoType.prototype.pendingVersions = $util.emptyArray; + + /** + * Creates a new StoredInfoType instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.StoredInfoType + * @static + * @param {google.privacy.dlp.v2.IStoredInfoType=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.StoredInfoType} StoredInfoType instance + */ + StoredInfoType.create = function create(properties) { + return new StoredInfoType(properties); + }; + + /** + * Encodes the specified StoredInfoType message. Does not implicitly {@link google.privacy.dlp.v2.StoredInfoType.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.StoredInfoType + * @static + * @param {google.privacy.dlp.v2.IStoredInfoType} message StoredInfoType message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StoredInfoType.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.currentVersion != null && Object.hasOwnProperty.call(message, "currentVersion")) + $root.google.privacy.dlp.v2.StoredInfoTypeVersion.encode(message.currentVersion, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.pendingVersions != null && message.pendingVersions.length) + for (var i = 0; i < message.pendingVersions.length; ++i) + $root.google.privacy.dlp.v2.StoredInfoTypeVersion.encode(message.pendingVersions[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified StoredInfoType message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.StoredInfoType.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.StoredInfoType + * @static + * @param {google.privacy.dlp.v2.IStoredInfoType} message StoredInfoType message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StoredInfoType.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StoredInfoType message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.StoredInfoType + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.StoredInfoType} StoredInfoType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StoredInfoType.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.privacy.dlp.v2.StoredInfoType(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.currentVersion = $root.google.privacy.dlp.v2.StoredInfoTypeVersion.decode(reader, reader.uint32()); + break; + case 3: + if (!(message.pendingVersions && message.pendingVersions.length)) + message.pendingVersions = []; + message.pendingVersions.push($root.google.privacy.dlp.v2.StoredInfoTypeVersion.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StoredInfoType message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.StoredInfoType + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.StoredInfoType} StoredInfoType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StoredInfoType.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StoredInfoType message. + * @function verify + * @memberof google.privacy.dlp.v2.StoredInfoType + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StoredInfoType.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.currentVersion != null && message.hasOwnProperty("currentVersion")) { + var error = $root.google.privacy.dlp.v2.StoredInfoTypeVersion.verify(message.currentVersion); + if (error) + return "currentVersion." + error; + } + if (message.pendingVersions != null && message.hasOwnProperty("pendingVersions")) { + if (!Array.isArray(message.pendingVersions)) + return "pendingVersions: array expected"; + for (var i = 0; i < message.pendingVersions.length; ++i) { + var error = $root.google.privacy.dlp.v2.StoredInfoTypeVersion.verify(message.pendingVersions[i]); + if (error) + return "pendingVersions." + error; + } + } + return null; + }; + + /** + * Creates a StoredInfoType message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.StoredInfoType + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.StoredInfoType} StoredInfoType + */ + StoredInfoType.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.StoredInfoType) + return object; + var message = new $root.google.privacy.dlp.v2.StoredInfoType(); + if (object.name != null) + message.name = String(object.name); + if (object.currentVersion != null) { + if (typeof object.currentVersion !== "object") + throw TypeError(".google.privacy.dlp.v2.StoredInfoType.currentVersion: object expected"); + message.currentVersion = $root.google.privacy.dlp.v2.StoredInfoTypeVersion.fromObject(object.currentVersion); + } + if (object.pendingVersions) { + if (!Array.isArray(object.pendingVersions)) + throw TypeError(".google.privacy.dlp.v2.StoredInfoType.pendingVersions: array expected"); + message.pendingVersions = []; + for (var i = 0; i < object.pendingVersions.length; ++i) { + if (typeof object.pendingVersions[i] !== "object") + throw TypeError(".google.privacy.dlp.v2.StoredInfoType.pendingVersions: object expected"); + message.pendingVersions[i] = $root.google.privacy.dlp.v2.StoredInfoTypeVersion.fromObject(object.pendingVersions[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a StoredInfoType message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.StoredInfoType + * @static + * @param {google.privacy.dlp.v2.StoredInfoType} message StoredInfoType + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StoredInfoType.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.pendingVersions = []; + if (options.defaults) { + object.name = ""; + object.currentVersion = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.currentVersion != null && message.hasOwnProperty("currentVersion")) + object.currentVersion = $root.google.privacy.dlp.v2.StoredInfoTypeVersion.toObject(message.currentVersion, options); + if (message.pendingVersions && message.pendingVersions.length) { + object.pendingVersions = []; + for (var j = 0; j < message.pendingVersions.length; ++j) + object.pendingVersions[j] = $root.google.privacy.dlp.v2.StoredInfoTypeVersion.toObject(message.pendingVersions[j], options); + } + return object; + }; + + /** + * Converts this StoredInfoType to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.StoredInfoType + * @instance + * @returns {Object.} JSON object + */ + StoredInfoType.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return StoredInfoType; + })(); + + v2.CreateStoredInfoTypeRequest = (function() { + + /** + * Properties of a CreateStoredInfoTypeRequest. + * @memberof google.privacy.dlp.v2 + * @interface ICreateStoredInfoTypeRequest + * @property {string|null} [parent] CreateStoredInfoTypeRequest parent + * @property {google.privacy.dlp.v2.IStoredInfoTypeConfig|null} [config] CreateStoredInfoTypeRequest config + * @property {string|null} [storedInfoTypeId] CreateStoredInfoTypeRequest storedInfoTypeId + * @property {string|null} [locationId] CreateStoredInfoTypeRequest locationId + */ + + /** + * Constructs a new CreateStoredInfoTypeRequest. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents a CreateStoredInfoTypeRequest. + * @implements ICreateStoredInfoTypeRequest + * @constructor + * @param {google.privacy.dlp.v2.ICreateStoredInfoTypeRequest=} [properties] Properties to set + */ + function CreateStoredInfoTypeRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateStoredInfoTypeRequest parent. + * @member {string} parent + * @memberof google.privacy.dlp.v2.CreateStoredInfoTypeRequest + * @instance + */ + CreateStoredInfoTypeRequest.prototype.parent = ""; + + /** + * CreateStoredInfoTypeRequest config. + * @member {google.privacy.dlp.v2.IStoredInfoTypeConfig|null|undefined} config + * @memberof google.privacy.dlp.v2.CreateStoredInfoTypeRequest + * @instance + */ + CreateStoredInfoTypeRequest.prototype.config = null; + + /** + * CreateStoredInfoTypeRequest storedInfoTypeId. + * @member {string} storedInfoTypeId + * @memberof google.privacy.dlp.v2.CreateStoredInfoTypeRequest + * @instance + */ + CreateStoredInfoTypeRequest.prototype.storedInfoTypeId = ""; + + /** + * CreateStoredInfoTypeRequest locationId. + * @member {string} locationId + * @memberof google.privacy.dlp.v2.CreateStoredInfoTypeRequest + * @instance + */ + CreateStoredInfoTypeRequest.prototype.locationId = ""; + + /** + * Creates a new CreateStoredInfoTypeRequest instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.CreateStoredInfoTypeRequest + * @static + * @param {google.privacy.dlp.v2.ICreateStoredInfoTypeRequest=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.CreateStoredInfoTypeRequest} CreateStoredInfoTypeRequest instance + */ + CreateStoredInfoTypeRequest.create = function create(properties) { + return new CreateStoredInfoTypeRequest(properties); + }; + + /** + * Encodes the specified CreateStoredInfoTypeRequest message. Does not implicitly {@link google.privacy.dlp.v2.CreateStoredInfoTypeRequest.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.CreateStoredInfoTypeRequest + * @static + * @param {google.privacy.dlp.v2.ICreateStoredInfoTypeRequest} message CreateStoredInfoTypeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateStoredInfoTypeRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.config != null && Object.hasOwnProperty.call(message, "config")) + $root.google.privacy.dlp.v2.StoredInfoTypeConfig.encode(message.config, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.storedInfoTypeId != null && Object.hasOwnProperty.call(message, "storedInfoTypeId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.storedInfoTypeId); + if (message.locationId != null && Object.hasOwnProperty.call(message, "locationId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.locationId); + return writer; + }; + + /** + * Encodes the specified CreateStoredInfoTypeRequest message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.CreateStoredInfoTypeRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.CreateStoredInfoTypeRequest + * @static + * @param {google.privacy.dlp.v2.ICreateStoredInfoTypeRequest} message CreateStoredInfoTypeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateStoredInfoTypeRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateStoredInfoTypeRequest message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.CreateStoredInfoTypeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.CreateStoredInfoTypeRequest} CreateStoredInfoTypeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateStoredInfoTypeRequest.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.privacy.dlp.v2.CreateStoredInfoTypeRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.config = $root.google.privacy.dlp.v2.StoredInfoTypeConfig.decode(reader, reader.uint32()); + break; + case 3: + message.storedInfoTypeId = reader.string(); + break; + case 4: + message.locationId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateStoredInfoTypeRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.CreateStoredInfoTypeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.CreateStoredInfoTypeRequest} CreateStoredInfoTypeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateStoredInfoTypeRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateStoredInfoTypeRequest message. + * @function verify + * @memberof google.privacy.dlp.v2.CreateStoredInfoTypeRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateStoredInfoTypeRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.config != null && message.hasOwnProperty("config")) { + var error = $root.google.privacy.dlp.v2.StoredInfoTypeConfig.verify(message.config); + if (error) + return "config." + error; + } + if (message.storedInfoTypeId != null && message.hasOwnProperty("storedInfoTypeId")) + if (!$util.isString(message.storedInfoTypeId)) + return "storedInfoTypeId: string expected"; + if (message.locationId != null && message.hasOwnProperty("locationId")) + if (!$util.isString(message.locationId)) + return "locationId: string expected"; + return null; + }; + + /** + * Creates a CreateStoredInfoTypeRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.CreateStoredInfoTypeRequest + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.CreateStoredInfoTypeRequest} CreateStoredInfoTypeRequest + */ + CreateStoredInfoTypeRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.CreateStoredInfoTypeRequest) + return object; + var message = new $root.google.privacy.dlp.v2.CreateStoredInfoTypeRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.config != null) { + if (typeof object.config !== "object") + throw TypeError(".google.privacy.dlp.v2.CreateStoredInfoTypeRequest.config: object expected"); + message.config = $root.google.privacy.dlp.v2.StoredInfoTypeConfig.fromObject(object.config); + } + if (object.storedInfoTypeId != null) + message.storedInfoTypeId = String(object.storedInfoTypeId); + if (object.locationId != null) + message.locationId = String(object.locationId); + return message; + }; + + /** + * Creates a plain object from a CreateStoredInfoTypeRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.CreateStoredInfoTypeRequest + * @static + * @param {google.privacy.dlp.v2.CreateStoredInfoTypeRequest} message CreateStoredInfoTypeRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateStoredInfoTypeRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.config = null; + object.storedInfoTypeId = ""; + object.locationId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.config != null && message.hasOwnProperty("config")) + object.config = $root.google.privacy.dlp.v2.StoredInfoTypeConfig.toObject(message.config, options); + if (message.storedInfoTypeId != null && message.hasOwnProperty("storedInfoTypeId")) + object.storedInfoTypeId = message.storedInfoTypeId; + if (message.locationId != null && message.hasOwnProperty("locationId")) + object.locationId = message.locationId; + return object; + }; + + /** + * Converts this CreateStoredInfoTypeRequest to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.CreateStoredInfoTypeRequest + * @instance + * @returns {Object.} JSON object + */ + CreateStoredInfoTypeRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CreateStoredInfoTypeRequest; + })(); + + v2.UpdateStoredInfoTypeRequest = (function() { + + /** + * Properties of an UpdateStoredInfoTypeRequest. + * @memberof google.privacy.dlp.v2 + * @interface IUpdateStoredInfoTypeRequest + * @property {string|null} [name] UpdateStoredInfoTypeRequest name + * @property {google.privacy.dlp.v2.IStoredInfoTypeConfig|null} [config] UpdateStoredInfoTypeRequest config + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateStoredInfoTypeRequest updateMask + */ + + /** + * Constructs a new UpdateStoredInfoTypeRequest. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents an UpdateStoredInfoTypeRequest. + * @implements IUpdateStoredInfoTypeRequest + * @constructor + * @param {google.privacy.dlp.v2.IUpdateStoredInfoTypeRequest=} [properties] Properties to set + */ + function UpdateStoredInfoTypeRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateStoredInfoTypeRequest name. + * @member {string} name + * @memberof google.privacy.dlp.v2.UpdateStoredInfoTypeRequest + * @instance + */ + UpdateStoredInfoTypeRequest.prototype.name = ""; + + /** + * UpdateStoredInfoTypeRequest config. + * @member {google.privacy.dlp.v2.IStoredInfoTypeConfig|null|undefined} config + * @memberof google.privacy.dlp.v2.UpdateStoredInfoTypeRequest + * @instance + */ + UpdateStoredInfoTypeRequest.prototype.config = null; + + /** + * UpdateStoredInfoTypeRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.privacy.dlp.v2.UpdateStoredInfoTypeRequest + * @instance + */ + UpdateStoredInfoTypeRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateStoredInfoTypeRequest instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.UpdateStoredInfoTypeRequest + * @static + * @param {google.privacy.dlp.v2.IUpdateStoredInfoTypeRequest=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.UpdateStoredInfoTypeRequest} UpdateStoredInfoTypeRequest instance + */ + UpdateStoredInfoTypeRequest.create = function create(properties) { + return new UpdateStoredInfoTypeRequest(properties); + }; + + /** + * Encodes the specified UpdateStoredInfoTypeRequest message. Does not implicitly {@link google.privacy.dlp.v2.UpdateStoredInfoTypeRequest.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.UpdateStoredInfoTypeRequest + * @static + * @param {google.privacy.dlp.v2.IUpdateStoredInfoTypeRequest} message UpdateStoredInfoTypeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateStoredInfoTypeRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.config != null && Object.hasOwnProperty.call(message, "config")) + $root.google.privacy.dlp.v2.StoredInfoTypeConfig.encode(message.config, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateStoredInfoTypeRequest message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.UpdateStoredInfoTypeRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.UpdateStoredInfoTypeRequest + * @static + * @param {google.privacy.dlp.v2.IUpdateStoredInfoTypeRequest} message UpdateStoredInfoTypeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateStoredInfoTypeRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateStoredInfoTypeRequest message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.UpdateStoredInfoTypeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.UpdateStoredInfoTypeRequest} UpdateStoredInfoTypeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateStoredInfoTypeRequest.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.privacy.dlp.v2.UpdateStoredInfoTypeRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.config = $root.google.privacy.dlp.v2.StoredInfoTypeConfig.decode(reader, reader.uint32()); + break; + case 3: + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateStoredInfoTypeRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.UpdateStoredInfoTypeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.UpdateStoredInfoTypeRequest} UpdateStoredInfoTypeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateStoredInfoTypeRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateStoredInfoTypeRequest message. + * @function verify + * @memberof google.privacy.dlp.v2.UpdateStoredInfoTypeRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateStoredInfoTypeRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.config != null && message.hasOwnProperty("config")) { + var error = $root.google.privacy.dlp.v2.StoredInfoTypeConfig.verify(message.config); + if (error) + return "config." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateStoredInfoTypeRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.UpdateStoredInfoTypeRequest + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.UpdateStoredInfoTypeRequest} UpdateStoredInfoTypeRequest + */ + UpdateStoredInfoTypeRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.UpdateStoredInfoTypeRequest) + return object; + var message = new $root.google.privacy.dlp.v2.UpdateStoredInfoTypeRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.config != null) { + if (typeof object.config !== "object") + throw TypeError(".google.privacy.dlp.v2.UpdateStoredInfoTypeRequest.config: object expected"); + message.config = $root.google.privacy.dlp.v2.StoredInfoTypeConfig.fromObject(object.config); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.privacy.dlp.v2.UpdateStoredInfoTypeRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateStoredInfoTypeRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.UpdateStoredInfoTypeRequest + * @static + * @param {google.privacy.dlp.v2.UpdateStoredInfoTypeRequest} message UpdateStoredInfoTypeRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateStoredInfoTypeRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.config = null; + object.updateMask = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.config != null && message.hasOwnProperty("config")) + object.config = $root.google.privacy.dlp.v2.StoredInfoTypeConfig.toObject(message.config, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateStoredInfoTypeRequest to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.UpdateStoredInfoTypeRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateStoredInfoTypeRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UpdateStoredInfoTypeRequest; + })(); + + v2.GetStoredInfoTypeRequest = (function() { + + /** + * Properties of a GetStoredInfoTypeRequest. + * @memberof google.privacy.dlp.v2 + * @interface IGetStoredInfoTypeRequest + * @property {string|null} [name] GetStoredInfoTypeRequest name + */ + + /** + * Constructs a new GetStoredInfoTypeRequest. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents a GetStoredInfoTypeRequest. + * @implements IGetStoredInfoTypeRequest + * @constructor + * @param {google.privacy.dlp.v2.IGetStoredInfoTypeRequest=} [properties] Properties to set + */ + function GetStoredInfoTypeRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetStoredInfoTypeRequest name. + * @member {string} name + * @memberof google.privacy.dlp.v2.GetStoredInfoTypeRequest + * @instance + */ + GetStoredInfoTypeRequest.prototype.name = ""; + + /** + * Creates a new GetStoredInfoTypeRequest instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.GetStoredInfoTypeRequest + * @static + * @param {google.privacy.dlp.v2.IGetStoredInfoTypeRequest=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.GetStoredInfoTypeRequest} GetStoredInfoTypeRequest instance + */ + GetStoredInfoTypeRequest.create = function create(properties) { + return new GetStoredInfoTypeRequest(properties); + }; + + /** + * Encodes the specified GetStoredInfoTypeRequest message. Does not implicitly {@link google.privacy.dlp.v2.GetStoredInfoTypeRequest.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.GetStoredInfoTypeRequest + * @static + * @param {google.privacy.dlp.v2.IGetStoredInfoTypeRequest} message GetStoredInfoTypeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetStoredInfoTypeRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetStoredInfoTypeRequest message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.GetStoredInfoTypeRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.GetStoredInfoTypeRequest + * @static + * @param {google.privacy.dlp.v2.IGetStoredInfoTypeRequest} message GetStoredInfoTypeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetStoredInfoTypeRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetStoredInfoTypeRequest message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.GetStoredInfoTypeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.GetStoredInfoTypeRequest} GetStoredInfoTypeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetStoredInfoTypeRequest.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.privacy.dlp.v2.GetStoredInfoTypeRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetStoredInfoTypeRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.GetStoredInfoTypeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.GetStoredInfoTypeRequest} GetStoredInfoTypeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetStoredInfoTypeRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetStoredInfoTypeRequest message. + * @function verify + * @memberof google.privacy.dlp.v2.GetStoredInfoTypeRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetStoredInfoTypeRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetStoredInfoTypeRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.GetStoredInfoTypeRequest + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.GetStoredInfoTypeRequest} GetStoredInfoTypeRequest + */ + GetStoredInfoTypeRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.GetStoredInfoTypeRequest) + return object; + var message = new $root.google.privacy.dlp.v2.GetStoredInfoTypeRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetStoredInfoTypeRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.GetStoredInfoTypeRequest + * @static + * @param {google.privacy.dlp.v2.GetStoredInfoTypeRequest} message GetStoredInfoTypeRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetStoredInfoTypeRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetStoredInfoTypeRequest to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.GetStoredInfoTypeRequest + * @instance + * @returns {Object.} JSON object + */ + GetStoredInfoTypeRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetStoredInfoTypeRequest; + })(); + + v2.ListStoredInfoTypesRequest = (function() { + + /** + * Properties of a ListStoredInfoTypesRequest. + * @memberof google.privacy.dlp.v2 + * @interface IListStoredInfoTypesRequest + * @property {string|null} [parent] ListStoredInfoTypesRequest parent + * @property {string|null} [pageToken] ListStoredInfoTypesRequest pageToken + * @property {number|null} [pageSize] ListStoredInfoTypesRequest pageSize + * @property {string|null} [orderBy] ListStoredInfoTypesRequest orderBy + * @property {string|null} [locationId] ListStoredInfoTypesRequest locationId + */ + + /** + * Constructs a new ListStoredInfoTypesRequest. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents a ListStoredInfoTypesRequest. + * @implements IListStoredInfoTypesRequest + * @constructor + * @param {google.privacy.dlp.v2.IListStoredInfoTypesRequest=} [properties] Properties to set + */ + function ListStoredInfoTypesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListStoredInfoTypesRequest parent. + * @member {string} parent + * @memberof google.privacy.dlp.v2.ListStoredInfoTypesRequest + * @instance + */ + ListStoredInfoTypesRequest.prototype.parent = ""; + + /** + * ListStoredInfoTypesRequest pageToken. + * @member {string} pageToken + * @memberof google.privacy.dlp.v2.ListStoredInfoTypesRequest + * @instance + */ + ListStoredInfoTypesRequest.prototype.pageToken = ""; + + /** + * ListStoredInfoTypesRequest pageSize. + * @member {number} pageSize + * @memberof google.privacy.dlp.v2.ListStoredInfoTypesRequest + * @instance + */ + ListStoredInfoTypesRequest.prototype.pageSize = 0; + + /** + * ListStoredInfoTypesRequest orderBy. + * @member {string} orderBy + * @memberof google.privacy.dlp.v2.ListStoredInfoTypesRequest + * @instance + */ + ListStoredInfoTypesRequest.prototype.orderBy = ""; + + /** + * ListStoredInfoTypesRequest locationId. + * @member {string} locationId + * @memberof google.privacy.dlp.v2.ListStoredInfoTypesRequest + * @instance + */ + ListStoredInfoTypesRequest.prototype.locationId = ""; + + /** + * Creates a new ListStoredInfoTypesRequest instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.ListStoredInfoTypesRequest + * @static + * @param {google.privacy.dlp.v2.IListStoredInfoTypesRequest=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.ListStoredInfoTypesRequest} ListStoredInfoTypesRequest instance + */ + ListStoredInfoTypesRequest.create = function create(properties) { + return new ListStoredInfoTypesRequest(properties); + }; + + /** + * Encodes the specified ListStoredInfoTypesRequest message. Does not implicitly {@link google.privacy.dlp.v2.ListStoredInfoTypesRequest.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.ListStoredInfoTypesRequest + * @static + * @param {google.privacy.dlp.v2.IListStoredInfoTypesRequest} message ListStoredInfoTypesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListStoredInfoTypesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pageToken); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.orderBy); + if (message.locationId != null && Object.hasOwnProperty.call(message, "locationId")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.locationId); + return writer; + }; + + /** + * Encodes the specified ListStoredInfoTypesRequest message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.ListStoredInfoTypesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.ListStoredInfoTypesRequest + * @static + * @param {google.privacy.dlp.v2.IListStoredInfoTypesRequest} message ListStoredInfoTypesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListStoredInfoTypesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListStoredInfoTypesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.ListStoredInfoTypesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.ListStoredInfoTypesRequest} ListStoredInfoTypesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListStoredInfoTypesRequest.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.privacy.dlp.v2.ListStoredInfoTypesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.pageToken = reader.string(); + break; + case 3: + message.pageSize = reader.int32(); + break; + case 4: + message.orderBy = reader.string(); + break; + case 5: + message.locationId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListStoredInfoTypesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.ListStoredInfoTypesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.ListStoredInfoTypesRequest} ListStoredInfoTypesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListStoredInfoTypesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListStoredInfoTypesRequest message. + * @function verify + * @memberof google.privacy.dlp.v2.ListStoredInfoTypesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListStoredInfoTypesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + if (message.locationId != null && message.hasOwnProperty("locationId")) + if (!$util.isString(message.locationId)) + return "locationId: string expected"; + return null; + }; + + /** + * Creates a ListStoredInfoTypesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.ListStoredInfoTypesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.ListStoredInfoTypesRequest} ListStoredInfoTypesRequest + */ + ListStoredInfoTypesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.ListStoredInfoTypesRequest) + return object; + var message = new $root.google.privacy.dlp.v2.ListStoredInfoTypesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.locationId != null) + message.locationId = String(object.locationId); + return message; + }; + + /** + * Creates a plain object from a ListStoredInfoTypesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.ListStoredInfoTypesRequest + * @static + * @param {google.privacy.dlp.v2.ListStoredInfoTypesRequest} message ListStoredInfoTypesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListStoredInfoTypesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageToken = ""; + object.pageSize = 0; + object.orderBy = ""; + object.locationId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + if (message.locationId != null && message.hasOwnProperty("locationId")) + object.locationId = message.locationId; + return object; + }; + + /** + * Converts this ListStoredInfoTypesRequest to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.ListStoredInfoTypesRequest + * @instance + * @returns {Object.} JSON object + */ + ListStoredInfoTypesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListStoredInfoTypesRequest; + })(); + + v2.ListStoredInfoTypesResponse = (function() { + + /** + * Properties of a ListStoredInfoTypesResponse. + * @memberof google.privacy.dlp.v2 + * @interface IListStoredInfoTypesResponse + * @property {Array.|null} [storedInfoTypes] ListStoredInfoTypesResponse storedInfoTypes + * @property {string|null} [nextPageToken] ListStoredInfoTypesResponse nextPageToken + */ + + /** + * Constructs a new ListStoredInfoTypesResponse. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents a ListStoredInfoTypesResponse. + * @implements IListStoredInfoTypesResponse + * @constructor + * @param {google.privacy.dlp.v2.IListStoredInfoTypesResponse=} [properties] Properties to set + */ + function ListStoredInfoTypesResponse(properties) { + this.storedInfoTypes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListStoredInfoTypesResponse storedInfoTypes. + * @member {Array.} storedInfoTypes + * @memberof google.privacy.dlp.v2.ListStoredInfoTypesResponse + * @instance + */ + ListStoredInfoTypesResponse.prototype.storedInfoTypes = $util.emptyArray; + + /** + * ListStoredInfoTypesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.privacy.dlp.v2.ListStoredInfoTypesResponse + * @instance + */ + ListStoredInfoTypesResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListStoredInfoTypesResponse instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.ListStoredInfoTypesResponse + * @static + * @param {google.privacy.dlp.v2.IListStoredInfoTypesResponse=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.ListStoredInfoTypesResponse} ListStoredInfoTypesResponse instance + */ + ListStoredInfoTypesResponse.create = function create(properties) { + return new ListStoredInfoTypesResponse(properties); + }; + + /** + * Encodes the specified ListStoredInfoTypesResponse message. Does not implicitly {@link google.privacy.dlp.v2.ListStoredInfoTypesResponse.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.ListStoredInfoTypesResponse + * @static + * @param {google.privacy.dlp.v2.IListStoredInfoTypesResponse} message ListStoredInfoTypesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListStoredInfoTypesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.storedInfoTypes != null && message.storedInfoTypes.length) + for (var i = 0; i < message.storedInfoTypes.length; ++i) + $root.google.privacy.dlp.v2.StoredInfoType.encode(message.storedInfoTypes[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListStoredInfoTypesResponse message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.ListStoredInfoTypesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.ListStoredInfoTypesResponse + * @static + * @param {google.privacy.dlp.v2.IListStoredInfoTypesResponse} message ListStoredInfoTypesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListStoredInfoTypesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListStoredInfoTypesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.ListStoredInfoTypesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.ListStoredInfoTypesResponse} ListStoredInfoTypesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListStoredInfoTypesResponse.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.privacy.dlp.v2.ListStoredInfoTypesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.storedInfoTypes && message.storedInfoTypes.length)) + message.storedInfoTypes = []; + message.storedInfoTypes.push($root.google.privacy.dlp.v2.StoredInfoType.decode(reader, reader.uint32())); + break; + case 2: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListStoredInfoTypesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.ListStoredInfoTypesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.ListStoredInfoTypesResponse} ListStoredInfoTypesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListStoredInfoTypesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListStoredInfoTypesResponse message. + * @function verify + * @memberof google.privacy.dlp.v2.ListStoredInfoTypesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListStoredInfoTypesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.storedInfoTypes != null && message.hasOwnProperty("storedInfoTypes")) { + if (!Array.isArray(message.storedInfoTypes)) + return "storedInfoTypes: array expected"; + for (var i = 0; i < message.storedInfoTypes.length; ++i) { + var error = $root.google.privacy.dlp.v2.StoredInfoType.verify(message.storedInfoTypes[i]); + if (error) + return "storedInfoTypes." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListStoredInfoTypesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.ListStoredInfoTypesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.ListStoredInfoTypesResponse} ListStoredInfoTypesResponse + */ + ListStoredInfoTypesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.ListStoredInfoTypesResponse) + return object; + var message = new $root.google.privacy.dlp.v2.ListStoredInfoTypesResponse(); + if (object.storedInfoTypes) { + if (!Array.isArray(object.storedInfoTypes)) + throw TypeError(".google.privacy.dlp.v2.ListStoredInfoTypesResponse.storedInfoTypes: array expected"); + message.storedInfoTypes = []; + for (var i = 0; i < object.storedInfoTypes.length; ++i) { + if (typeof object.storedInfoTypes[i] !== "object") + throw TypeError(".google.privacy.dlp.v2.ListStoredInfoTypesResponse.storedInfoTypes: object expected"); + message.storedInfoTypes[i] = $root.google.privacy.dlp.v2.StoredInfoType.fromObject(object.storedInfoTypes[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListStoredInfoTypesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.ListStoredInfoTypesResponse + * @static + * @param {google.privacy.dlp.v2.ListStoredInfoTypesResponse} message ListStoredInfoTypesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListStoredInfoTypesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.storedInfoTypes = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.storedInfoTypes && message.storedInfoTypes.length) { + object.storedInfoTypes = []; + for (var j = 0; j < message.storedInfoTypes.length; ++j) + object.storedInfoTypes[j] = $root.google.privacy.dlp.v2.StoredInfoType.toObject(message.storedInfoTypes[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListStoredInfoTypesResponse to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.ListStoredInfoTypesResponse + * @instance + * @returns {Object.} JSON object + */ + ListStoredInfoTypesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListStoredInfoTypesResponse; + })(); + + v2.DeleteStoredInfoTypeRequest = (function() { + + /** + * Properties of a DeleteStoredInfoTypeRequest. + * @memberof google.privacy.dlp.v2 + * @interface IDeleteStoredInfoTypeRequest + * @property {string|null} [name] DeleteStoredInfoTypeRequest name + */ + + /** + * Constructs a new DeleteStoredInfoTypeRequest. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents a DeleteStoredInfoTypeRequest. + * @implements IDeleteStoredInfoTypeRequest + * @constructor + * @param {google.privacy.dlp.v2.IDeleteStoredInfoTypeRequest=} [properties] Properties to set + */ + function DeleteStoredInfoTypeRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteStoredInfoTypeRequest name. + * @member {string} name + * @memberof google.privacy.dlp.v2.DeleteStoredInfoTypeRequest + * @instance + */ + DeleteStoredInfoTypeRequest.prototype.name = ""; + + /** + * Creates a new DeleteStoredInfoTypeRequest instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.DeleteStoredInfoTypeRequest + * @static + * @param {google.privacy.dlp.v2.IDeleteStoredInfoTypeRequest=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.DeleteStoredInfoTypeRequest} DeleteStoredInfoTypeRequest instance + */ + DeleteStoredInfoTypeRequest.create = function create(properties) { + return new DeleteStoredInfoTypeRequest(properties); + }; + + /** + * Encodes the specified DeleteStoredInfoTypeRequest message. Does not implicitly {@link google.privacy.dlp.v2.DeleteStoredInfoTypeRequest.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.DeleteStoredInfoTypeRequest + * @static + * @param {google.privacy.dlp.v2.IDeleteStoredInfoTypeRequest} message DeleteStoredInfoTypeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteStoredInfoTypeRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified DeleteStoredInfoTypeRequest message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.DeleteStoredInfoTypeRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.DeleteStoredInfoTypeRequest + * @static + * @param {google.privacy.dlp.v2.IDeleteStoredInfoTypeRequest} message DeleteStoredInfoTypeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteStoredInfoTypeRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteStoredInfoTypeRequest message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.DeleteStoredInfoTypeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.DeleteStoredInfoTypeRequest} DeleteStoredInfoTypeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteStoredInfoTypeRequest.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.privacy.dlp.v2.DeleteStoredInfoTypeRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteStoredInfoTypeRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.DeleteStoredInfoTypeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.DeleteStoredInfoTypeRequest} DeleteStoredInfoTypeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteStoredInfoTypeRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteStoredInfoTypeRequest message. + * @function verify + * @memberof google.privacy.dlp.v2.DeleteStoredInfoTypeRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteStoredInfoTypeRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a DeleteStoredInfoTypeRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.DeleteStoredInfoTypeRequest + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.DeleteStoredInfoTypeRequest} DeleteStoredInfoTypeRequest + */ + DeleteStoredInfoTypeRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.DeleteStoredInfoTypeRequest) + return object; + var message = new $root.google.privacy.dlp.v2.DeleteStoredInfoTypeRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteStoredInfoTypeRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.DeleteStoredInfoTypeRequest + * @static + * @param {google.privacy.dlp.v2.DeleteStoredInfoTypeRequest} message DeleteStoredInfoTypeRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteStoredInfoTypeRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this DeleteStoredInfoTypeRequest to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.DeleteStoredInfoTypeRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteStoredInfoTypeRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeleteStoredInfoTypeRequest; + })(); + + v2.HybridInspectJobTriggerRequest = (function() { + + /** + * Properties of a HybridInspectJobTriggerRequest. + * @memberof google.privacy.dlp.v2 + * @interface IHybridInspectJobTriggerRequest + * @property {string|null} [name] HybridInspectJobTriggerRequest name + * @property {google.privacy.dlp.v2.IHybridContentItem|null} [hybridItem] HybridInspectJobTriggerRequest hybridItem + */ + + /** + * Constructs a new HybridInspectJobTriggerRequest. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents a HybridInspectJobTriggerRequest. + * @implements IHybridInspectJobTriggerRequest + * @constructor + * @param {google.privacy.dlp.v2.IHybridInspectJobTriggerRequest=} [properties] Properties to set + */ + function HybridInspectJobTriggerRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HybridInspectJobTriggerRequest name. + * @member {string} name + * @memberof google.privacy.dlp.v2.HybridInspectJobTriggerRequest + * @instance + */ + HybridInspectJobTriggerRequest.prototype.name = ""; + + /** + * HybridInspectJobTriggerRequest hybridItem. + * @member {google.privacy.dlp.v2.IHybridContentItem|null|undefined} hybridItem + * @memberof google.privacy.dlp.v2.HybridInspectJobTriggerRequest + * @instance + */ + HybridInspectJobTriggerRequest.prototype.hybridItem = null; + + /** + * Creates a new HybridInspectJobTriggerRequest instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.HybridInspectJobTriggerRequest + * @static + * @param {google.privacy.dlp.v2.IHybridInspectJobTriggerRequest=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.HybridInspectJobTriggerRequest} HybridInspectJobTriggerRequest instance + */ + HybridInspectJobTriggerRequest.create = function create(properties) { + return new HybridInspectJobTriggerRequest(properties); + }; + + /** + * Encodes the specified HybridInspectJobTriggerRequest message. Does not implicitly {@link google.privacy.dlp.v2.HybridInspectJobTriggerRequest.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.HybridInspectJobTriggerRequest + * @static + * @param {google.privacy.dlp.v2.IHybridInspectJobTriggerRequest} message HybridInspectJobTriggerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HybridInspectJobTriggerRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.hybridItem != null && Object.hasOwnProperty.call(message, "hybridItem")) + $root.google.privacy.dlp.v2.HybridContentItem.encode(message.hybridItem, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified HybridInspectJobTriggerRequest message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.HybridInspectJobTriggerRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.HybridInspectJobTriggerRequest + * @static + * @param {google.privacy.dlp.v2.IHybridInspectJobTriggerRequest} message HybridInspectJobTriggerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HybridInspectJobTriggerRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HybridInspectJobTriggerRequest message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.HybridInspectJobTriggerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.HybridInspectJobTriggerRequest} HybridInspectJobTriggerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HybridInspectJobTriggerRequest.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.privacy.dlp.v2.HybridInspectJobTriggerRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 3: + message.hybridItem = $root.google.privacy.dlp.v2.HybridContentItem.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HybridInspectJobTriggerRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.HybridInspectJobTriggerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.HybridInspectJobTriggerRequest} HybridInspectJobTriggerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HybridInspectJobTriggerRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HybridInspectJobTriggerRequest message. + * @function verify + * @memberof google.privacy.dlp.v2.HybridInspectJobTriggerRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HybridInspectJobTriggerRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.hybridItem != null && message.hasOwnProperty("hybridItem")) { + var error = $root.google.privacy.dlp.v2.HybridContentItem.verify(message.hybridItem); + if (error) + return "hybridItem." + error; + } + return null; + }; + + /** + * Creates a HybridInspectJobTriggerRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.HybridInspectJobTriggerRequest + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.HybridInspectJobTriggerRequest} HybridInspectJobTriggerRequest + */ + HybridInspectJobTriggerRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.HybridInspectJobTriggerRequest) + return object; + var message = new $root.google.privacy.dlp.v2.HybridInspectJobTriggerRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.hybridItem != null) { + if (typeof object.hybridItem !== "object") + throw TypeError(".google.privacy.dlp.v2.HybridInspectJobTriggerRequest.hybridItem: object expected"); + message.hybridItem = $root.google.privacy.dlp.v2.HybridContentItem.fromObject(object.hybridItem); + } + return message; + }; + + /** + * Creates a plain object from a HybridInspectJobTriggerRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.HybridInspectJobTriggerRequest + * @static + * @param {google.privacy.dlp.v2.HybridInspectJobTriggerRequest} message HybridInspectJobTriggerRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HybridInspectJobTriggerRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.hybridItem = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.hybridItem != null && message.hasOwnProperty("hybridItem")) + object.hybridItem = $root.google.privacy.dlp.v2.HybridContentItem.toObject(message.hybridItem, options); + return object; + }; + + /** + * Converts this HybridInspectJobTriggerRequest to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.HybridInspectJobTriggerRequest + * @instance + * @returns {Object.} JSON object + */ + HybridInspectJobTriggerRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return HybridInspectJobTriggerRequest; + })(); + + v2.HybridInspectDlpJobRequest = (function() { + + /** + * Properties of a HybridInspectDlpJobRequest. + * @memberof google.privacy.dlp.v2 + * @interface IHybridInspectDlpJobRequest + * @property {string|null} [name] HybridInspectDlpJobRequest name + * @property {google.privacy.dlp.v2.IHybridContentItem|null} [hybridItem] HybridInspectDlpJobRequest hybridItem + */ + + /** + * Constructs a new HybridInspectDlpJobRequest. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents a HybridInspectDlpJobRequest. + * @implements IHybridInspectDlpJobRequest + * @constructor + * @param {google.privacy.dlp.v2.IHybridInspectDlpJobRequest=} [properties] Properties to set + */ + function HybridInspectDlpJobRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HybridInspectDlpJobRequest name. + * @member {string} name + * @memberof google.privacy.dlp.v2.HybridInspectDlpJobRequest + * @instance + */ + HybridInspectDlpJobRequest.prototype.name = ""; + + /** + * HybridInspectDlpJobRequest hybridItem. + * @member {google.privacy.dlp.v2.IHybridContentItem|null|undefined} hybridItem + * @memberof google.privacy.dlp.v2.HybridInspectDlpJobRequest + * @instance + */ + HybridInspectDlpJobRequest.prototype.hybridItem = null; + + /** + * Creates a new HybridInspectDlpJobRequest instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.HybridInspectDlpJobRequest + * @static + * @param {google.privacy.dlp.v2.IHybridInspectDlpJobRequest=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.HybridInspectDlpJobRequest} HybridInspectDlpJobRequest instance + */ + HybridInspectDlpJobRequest.create = function create(properties) { + return new HybridInspectDlpJobRequest(properties); + }; + + /** + * Encodes the specified HybridInspectDlpJobRequest message. Does not implicitly {@link google.privacy.dlp.v2.HybridInspectDlpJobRequest.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.HybridInspectDlpJobRequest + * @static + * @param {google.privacy.dlp.v2.IHybridInspectDlpJobRequest} message HybridInspectDlpJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HybridInspectDlpJobRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.hybridItem != null && Object.hasOwnProperty.call(message, "hybridItem")) + $root.google.privacy.dlp.v2.HybridContentItem.encode(message.hybridItem, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified HybridInspectDlpJobRequest message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.HybridInspectDlpJobRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.HybridInspectDlpJobRequest + * @static + * @param {google.privacy.dlp.v2.IHybridInspectDlpJobRequest} message HybridInspectDlpJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HybridInspectDlpJobRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HybridInspectDlpJobRequest message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.HybridInspectDlpJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.HybridInspectDlpJobRequest} HybridInspectDlpJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HybridInspectDlpJobRequest.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.privacy.dlp.v2.HybridInspectDlpJobRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 3: + message.hybridItem = $root.google.privacy.dlp.v2.HybridContentItem.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HybridInspectDlpJobRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.HybridInspectDlpJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.HybridInspectDlpJobRequest} HybridInspectDlpJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HybridInspectDlpJobRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HybridInspectDlpJobRequest message. + * @function verify + * @memberof google.privacy.dlp.v2.HybridInspectDlpJobRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HybridInspectDlpJobRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.hybridItem != null && message.hasOwnProperty("hybridItem")) { + var error = $root.google.privacy.dlp.v2.HybridContentItem.verify(message.hybridItem); + if (error) + return "hybridItem." + error; + } + return null; + }; + + /** + * Creates a HybridInspectDlpJobRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.HybridInspectDlpJobRequest + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.HybridInspectDlpJobRequest} HybridInspectDlpJobRequest + */ + HybridInspectDlpJobRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.HybridInspectDlpJobRequest) + return object; + var message = new $root.google.privacy.dlp.v2.HybridInspectDlpJobRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.hybridItem != null) { + if (typeof object.hybridItem !== "object") + throw TypeError(".google.privacy.dlp.v2.HybridInspectDlpJobRequest.hybridItem: object expected"); + message.hybridItem = $root.google.privacy.dlp.v2.HybridContentItem.fromObject(object.hybridItem); + } + return message; + }; + + /** + * Creates a plain object from a HybridInspectDlpJobRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.HybridInspectDlpJobRequest + * @static + * @param {google.privacy.dlp.v2.HybridInspectDlpJobRequest} message HybridInspectDlpJobRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HybridInspectDlpJobRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.hybridItem = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.hybridItem != null && message.hasOwnProperty("hybridItem")) + object.hybridItem = $root.google.privacy.dlp.v2.HybridContentItem.toObject(message.hybridItem, options); + return object; + }; + + /** + * Converts this HybridInspectDlpJobRequest to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.HybridInspectDlpJobRequest + * @instance + * @returns {Object.} JSON object + */ + HybridInspectDlpJobRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return HybridInspectDlpJobRequest; + })(); + + v2.HybridContentItem = (function() { + + /** + * Properties of a HybridContentItem. + * @memberof google.privacy.dlp.v2 + * @interface IHybridContentItem + * @property {google.privacy.dlp.v2.IContentItem|null} [item] HybridContentItem item + * @property {google.privacy.dlp.v2.IHybridFindingDetails|null} [findingDetails] HybridContentItem findingDetails + */ + + /** + * Constructs a new HybridContentItem. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents a HybridContentItem. + * @implements IHybridContentItem + * @constructor + * @param {google.privacy.dlp.v2.IHybridContentItem=} [properties] Properties to set + */ + function HybridContentItem(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HybridContentItem item. + * @member {google.privacy.dlp.v2.IContentItem|null|undefined} item + * @memberof google.privacy.dlp.v2.HybridContentItem + * @instance + */ + HybridContentItem.prototype.item = null; + + /** + * HybridContentItem findingDetails. + * @member {google.privacy.dlp.v2.IHybridFindingDetails|null|undefined} findingDetails + * @memberof google.privacy.dlp.v2.HybridContentItem + * @instance + */ + HybridContentItem.prototype.findingDetails = null; + + /** + * Creates a new HybridContentItem instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.HybridContentItem + * @static + * @param {google.privacy.dlp.v2.IHybridContentItem=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.HybridContentItem} HybridContentItem instance + */ + HybridContentItem.create = function create(properties) { + return new HybridContentItem(properties); + }; + + /** + * Encodes the specified HybridContentItem message. Does not implicitly {@link google.privacy.dlp.v2.HybridContentItem.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.HybridContentItem + * @static + * @param {google.privacy.dlp.v2.IHybridContentItem} message HybridContentItem message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HybridContentItem.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.item != null && Object.hasOwnProperty.call(message, "item")) + $root.google.privacy.dlp.v2.ContentItem.encode(message.item, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.findingDetails != null && Object.hasOwnProperty.call(message, "findingDetails")) + $root.google.privacy.dlp.v2.HybridFindingDetails.encode(message.findingDetails, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified HybridContentItem message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.HybridContentItem.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.HybridContentItem + * @static + * @param {google.privacy.dlp.v2.IHybridContentItem} message HybridContentItem message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HybridContentItem.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HybridContentItem message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.HybridContentItem + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.HybridContentItem} HybridContentItem + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HybridContentItem.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.privacy.dlp.v2.HybridContentItem(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.item = $root.google.privacy.dlp.v2.ContentItem.decode(reader, reader.uint32()); + break; + case 2: + message.findingDetails = $root.google.privacy.dlp.v2.HybridFindingDetails.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HybridContentItem message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.HybridContentItem + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.HybridContentItem} HybridContentItem + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HybridContentItem.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HybridContentItem message. + * @function verify + * @memberof google.privacy.dlp.v2.HybridContentItem + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HybridContentItem.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.item != null && message.hasOwnProperty("item")) { + var error = $root.google.privacy.dlp.v2.ContentItem.verify(message.item); + if (error) + return "item." + error; + } + if (message.findingDetails != null && message.hasOwnProperty("findingDetails")) { + var error = $root.google.privacy.dlp.v2.HybridFindingDetails.verify(message.findingDetails); + if (error) + return "findingDetails." + error; + } + return null; + }; + + /** + * Creates a HybridContentItem message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.HybridContentItem + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.HybridContentItem} HybridContentItem + */ + HybridContentItem.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.HybridContentItem) + return object; + var message = new $root.google.privacy.dlp.v2.HybridContentItem(); + if (object.item != null) { + if (typeof object.item !== "object") + throw TypeError(".google.privacy.dlp.v2.HybridContentItem.item: object expected"); + message.item = $root.google.privacy.dlp.v2.ContentItem.fromObject(object.item); + } + if (object.findingDetails != null) { + if (typeof object.findingDetails !== "object") + throw TypeError(".google.privacy.dlp.v2.HybridContentItem.findingDetails: object expected"); + message.findingDetails = $root.google.privacy.dlp.v2.HybridFindingDetails.fromObject(object.findingDetails); + } + return message; + }; + + /** + * Creates a plain object from a HybridContentItem message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.HybridContentItem + * @static + * @param {google.privacy.dlp.v2.HybridContentItem} message HybridContentItem + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HybridContentItem.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.item = null; + object.findingDetails = null; + } + if (message.item != null && message.hasOwnProperty("item")) + object.item = $root.google.privacy.dlp.v2.ContentItem.toObject(message.item, options); + if (message.findingDetails != null && message.hasOwnProperty("findingDetails")) + object.findingDetails = $root.google.privacy.dlp.v2.HybridFindingDetails.toObject(message.findingDetails, options); + return object; + }; + + /** + * Converts this HybridContentItem to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.HybridContentItem + * @instance + * @returns {Object.} JSON object + */ + HybridContentItem.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return HybridContentItem; + })(); + + v2.HybridFindingDetails = (function() { + + /** + * Properties of a HybridFindingDetails. + * @memberof google.privacy.dlp.v2 + * @interface IHybridFindingDetails + * @property {google.privacy.dlp.v2.IContainer|null} [containerDetails] HybridFindingDetails containerDetails + * @property {number|Long|null} [fileOffset] HybridFindingDetails fileOffset + * @property {number|Long|null} [rowOffset] HybridFindingDetails rowOffset + * @property {google.privacy.dlp.v2.ITableOptions|null} [tableOptions] HybridFindingDetails tableOptions + * @property {Object.|null} [labels] HybridFindingDetails labels + */ + + /** + * Constructs a new HybridFindingDetails. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents a HybridFindingDetails. + * @implements IHybridFindingDetails + * @constructor + * @param {google.privacy.dlp.v2.IHybridFindingDetails=} [properties] Properties to set + */ + function HybridFindingDetails(properties) { + this.labels = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HybridFindingDetails containerDetails. + * @member {google.privacy.dlp.v2.IContainer|null|undefined} containerDetails + * @memberof google.privacy.dlp.v2.HybridFindingDetails + * @instance + */ + HybridFindingDetails.prototype.containerDetails = null; + + /** + * HybridFindingDetails fileOffset. + * @member {number|Long} fileOffset + * @memberof google.privacy.dlp.v2.HybridFindingDetails + * @instance + */ + HybridFindingDetails.prototype.fileOffset = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * HybridFindingDetails rowOffset. + * @member {number|Long} rowOffset + * @memberof google.privacy.dlp.v2.HybridFindingDetails + * @instance + */ + HybridFindingDetails.prototype.rowOffset = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * HybridFindingDetails tableOptions. + * @member {google.privacy.dlp.v2.ITableOptions|null|undefined} tableOptions + * @memberof google.privacy.dlp.v2.HybridFindingDetails + * @instance + */ + HybridFindingDetails.prototype.tableOptions = null; + + /** + * HybridFindingDetails labels. + * @member {Object.} labels + * @memberof google.privacy.dlp.v2.HybridFindingDetails + * @instance + */ + HybridFindingDetails.prototype.labels = $util.emptyObject; + + /** + * Creates a new HybridFindingDetails instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.HybridFindingDetails + * @static + * @param {google.privacy.dlp.v2.IHybridFindingDetails=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.HybridFindingDetails} HybridFindingDetails instance + */ + HybridFindingDetails.create = function create(properties) { + return new HybridFindingDetails(properties); + }; + + /** + * Encodes the specified HybridFindingDetails message. Does not implicitly {@link google.privacy.dlp.v2.HybridFindingDetails.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.HybridFindingDetails + * @static + * @param {google.privacy.dlp.v2.IHybridFindingDetails} message HybridFindingDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HybridFindingDetails.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.containerDetails != null && Object.hasOwnProperty.call(message, "containerDetails")) + $root.google.privacy.dlp.v2.Container.encode(message.containerDetails, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.fileOffset != null && Object.hasOwnProperty.call(message, "fileOffset")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.fileOffset); + if (message.rowOffset != null && Object.hasOwnProperty.call(message, "rowOffset")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.rowOffset); + if (message.tableOptions != null && Object.hasOwnProperty.call(message, "tableOptions")) + $root.google.privacy.dlp.v2.TableOptions.encode(message.tableOptions, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified HybridFindingDetails message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.HybridFindingDetails.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.HybridFindingDetails + * @static + * @param {google.privacy.dlp.v2.IHybridFindingDetails} message HybridFindingDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HybridFindingDetails.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HybridFindingDetails message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.HybridFindingDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.HybridFindingDetails} HybridFindingDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HybridFindingDetails.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.privacy.dlp.v2.HybridFindingDetails(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.containerDetails = $root.google.privacy.dlp.v2.Container.decode(reader, reader.uint32()); + break; + case 2: + message.fileOffset = reader.int64(); + break; + case 3: + message.rowOffset = reader.int64(); + break; + case 4: + message.tableOptions = $root.google.privacy.dlp.v2.TableOptions.decode(reader, reader.uint32()); + break; + case 5: + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HybridFindingDetails message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.HybridFindingDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.HybridFindingDetails} HybridFindingDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HybridFindingDetails.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HybridFindingDetails message. + * @function verify + * @memberof google.privacy.dlp.v2.HybridFindingDetails + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HybridFindingDetails.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.containerDetails != null && message.hasOwnProperty("containerDetails")) { + var error = $root.google.privacy.dlp.v2.Container.verify(message.containerDetails); + if (error) + return "containerDetails." + error; + } + if (message.fileOffset != null && message.hasOwnProperty("fileOffset")) + if (!$util.isInteger(message.fileOffset) && !(message.fileOffset && $util.isInteger(message.fileOffset.low) && $util.isInteger(message.fileOffset.high))) + return "fileOffset: integer|Long expected"; + if (message.rowOffset != null && message.hasOwnProperty("rowOffset")) + if (!$util.isInteger(message.rowOffset) && !(message.rowOffset && $util.isInteger(message.rowOffset.low) && $util.isInteger(message.rowOffset.high))) + return "rowOffset: integer|Long expected"; + if (message.tableOptions != null && message.hasOwnProperty("tableOptions")) { + var error = $root.google.privacy.dlp.v2.TableOptions.verify(message.tableOptions); + if (error) + return "tableOptions." + error; + } + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + return null; + }; + + /** + * Creates a HybridFindingDetails message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.HybridFindingDetails + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.HybridFindingDetails} HybridFindingDetails + */ + HybridFindingDetails.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.HybridFindingDetails) + return object; + var message = new $root.google.privacy.dlp.v2.HybridFindingDetails(); + if (object.containerDetails != null) { + if (typeof object.containerDetails !== "object") + throw TypeError(".google.privacy.dlp.v2.HybridFindingDetails.containerDetails: object expected"); + message.containerDetails = $root.google.privacy.dlp.v2.Container.fromObject(object.containerDetails); + } + if (object.fileOffset != null) + if ($util.Long) + (message.fileOffset = $util.Long.fromValue(object.fileOffset)).unsigned = false; + else if (typeof object.fileOffset === "string") + message.fileOffset = parseInt(object.fileOffset, 10); + else if (typeof object.fileOffset === "number") + message.fileOffset = object.fileOffset; + else if (typeof object.fileOffset === "object") + message.fileOffset = new $util.LongBits(object.fileOffset.low >>> 0, object.fileOffset.high >>> 0).toNumber(); + if (object.rowOffset != null) + if ($util.Long) + (message.rowOffset = $util.Long.fromValue(object.rowOffset)).unsigned = false; + else if (typeof object.rowOffset === "string") + message.rowOffset = parseInt(object.rowOffset, 10); + else if (typeof object.rowOffset === "number") + message.rowOffset = object.rowOffset; + else if (typeof object.rowOffset === "object") + message.rowOffset = new $util.LongBits(object.rowOffset.low >>> 0, object.rowOffset.high >>> 0).toNumber(); + if (object.tableOptions != null) { + if (typeof object.tableOptions !== "object") + throw TypeError(".google.privacy.dlp.v2.HybridFindingDetails.tableOptions: object expected"); + message.tableOptions = $root.google.privacy.dlp.v2.TableOptions.fromObject(object.tableOptions); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.privacy.dlp.v2.HybridFindingDetails.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + return message; + }; + + /** + * Creates a plain object from a HybridFindingDetails message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.HybridFindingDetails + * @static + * @param {google.privacy.dlp.v2.HybridFindingDetails} message HybridFindingDetails + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HybridFindingDetails.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.containerDetails = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.fileOffset = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.fileOffset = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.rowOffset = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.rowOffset = options.longs === String ? "0" : 0; + object.tableOptions = null; + } + if (message.containerDetails != null && message.hasOwnProperty("containerDetails")) + object.containerDetails = $root.google.privacy.dlp.v2.Container.toObject(message.containerDetails, options); + if (message.fileOffset != null && message.hasOwnProperty("fileOffset")) + if (typeof message.fileOffset === "number") + object.fileOffset = options.longs === String ? String(message.fileOffset) : message.fileOffset; + else + object.fileOffset = options.longs === String ? $util.Long.prototype.toString.call(message.fileOffset) : options.longs === Number ? new $util.LongBits(message.fileOffset.low >>> 0, message.fileOffset.high >>> 0).toNumber() : message.fileOffset; + if (message.rowOffset != null && message.hasOwnProperty("rowOffset")) + if (typeof message.rowOffset === "number") + object.rowOffset = options.longs === String ? String(message.rowOffset) : message.rowOffset; + else + object.rowOffset = options.longs === String ? $util.Long.prototype.toString.call(message.rowOffset) : options.longs === Number ? new $util.LongBits(message.rowOffset.low >>> 0, message.rowOffset.high >>> 0).toNumber() : message.rowOffset; + if (message.tableOptions != null && message.hasOwnProperty("tableOptions")) + object.tableOptions = $root.google.privacy.dlp.v2.TableOptions.toObject(message.tableOptions, options); + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + return object; + }; + + /** + * Converts this HybridFindingDetails to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.HybridFindingDetails + * @instance + * @returns {Object.} JSON object + */ + HybridFindingDetails.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return HybridFindingDetails; + })(); + + v2.HybridInspectResponse = (function() { + + /** + * Properties of a HybridInspectResponse. + * @memberof google.privacy.dlp.v2 + * @interface IHybridInspectResponse + */ + + /** + * Constructs a new HybridInspectResponse. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents a HybridInspectResponse. + * @implements IHybridInspectResponse + * @constructor + * @param {google.privacy.dlp.v2.IHybridInspectResponse=} [properties] Properties to set + */ + function HybridInspectResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new HybridInspectResponse instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.HybridInspectResponse + * @static + * @param {google.privacy.dlp.v2.IHybridInspectResponse=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.HybridInspectResponse} HybridInspectResponse instance + */ + HybridInspectResponse.create = function create(properties) { + return new HybridInspectResponse(properties); + }; + + /** + * Encodes the specified HybridInspectResponse message. Does not implicitly {@link google.privacy.dlp.v2.HybridInspectResponse.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.HybridInspectResponse + * @static + * @param {google.privacy.dlp.v2.IHybridInspectResponse} message HybridInspectResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HybridInspectResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified HybridInspectResponse message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.HybridInspectResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.HybridInspectResponse + * @static + * @param {google.privacy.dlp.v2.IHybridInspectResponse} message HybridInspectResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HybridInspectResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HybridInspectResponse message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.HybridInspectResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.HybridInspectResponse} HybridInspectResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HybridInspectResponse.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.privacy.dlp.v2.HybridInspectResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HybridInspectResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.HybridInspectResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.HybridInspectResponse} HybridInspectResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HybridInspectResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HybridInspectResponse message. + * @function verify + * @memberof google.privacy.dlp.v2.HybridInspectResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HybridInspectResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a HybridInspectResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.HybridInspectResponse + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.HybridInspectResponse} HybridInspectResponse + */ + HybridInspectResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.HybridInspectResponse) + return object; + return new $root.google.privacy.dlp.v2.HybridInspectResponse(); + }; + + /** + * Creates a plain object from a HybridInspectResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.HybridInspectResponse + * @static + * @param {google.privacy.dlp.v2.HybridInspectResponse} message HybridInspectResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HybridInspectResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this HybridInspectResponse to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.HybridInspectResponse + * @instance + * @returns {Object.} JSON object + */ + HybridInspectResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return HybridInspectResponse; + })(); + + /** + * RelationalOperator enum. + * @name google.privacy.dlp.v2.RelationalOperator + * @enum {number} + * @property {number} RELATIONAL_OPERATOR_UNSPECIFIED=0 RELATIONAL_OPERATOR_UNSPECIFIED value + * @property {number} EQUAL_TO=1 EQUAL_TO value + * @property {number} NOT_EQUAL_TO=2 NOT_EQUAL_TO value + * @property {number} GREATER_THAN=3 GREATER_THAN value + * @property {number} LESS_THAN=4 LESS_THAN value + * @property {number} GREATER_THAN_OR_EQUALS=5 GREATER_THAN_OR_EQUALS value + * @property {number} LESS_THAN_OR_EQUALS=6 LESS_THAN_OR_EQUALS value + * @property {number} EXISTS=7 EXISTS value + */ + v2.RelationalOperator = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "RELATIONAL_OPERATOR_UNSPECIFIED"] = 0; + values[valuesById[1] = "EQUAL_TO"] = 1; + values[valuesById[2] = "NOT_EQUAL_TO"] = 2; + values[valuesById[3] = "GREATER_THAN"] = 3; + values[valuesById[4] = "LESS_THAN"] = 4; + values[valuesById[5] = "GREATER_THAN_OR_EQUALS"] = 5; + values[valuesById[6] = "LESS_THAN_OR_EQUALS"] = 6; + values[valuesById[7] = "EXISTS"] = 7; + return values; + })(); + + /** + * MatchingType enum. + * @name google.privacy.dlp.v2.MatchingType + * @enum {number} + * @property {number} MATCHING_TYPE_UNSPECIFIED=0 MATCHING_TYPE_UNSPECIFIED value + * @property {number} MATCHING_TYPE_FULL_MATCH=1 MATCHING_TYPE_FULL_MATCH value + * @property {number} MATCHING_TYPE_PARTIAL_MATCH=2 MATCHING_TYPE_PARTIAL_MATCH value + * @property {number} MATCHING_TYPE_INVERSE_MATCH=3 MATCHING_TYPE_INVERSE_MATCH value + */ + v2.MatchingType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MATCHING_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "MATCHING_TYPE_FULL_MATCH"] = 1; + values[valuesById[2] = "MATCHING_TYPE_PARTIAL_MATCH"] = 2; + values[valuesById[3] = "MATCHING_TYPE_INVERSE_MATCH"] = 3; + return values; + })(); + + /** + * ContentOption enum. + * @name google.privacy.dlp.v2.ContentOption + * @enum {number} + * @property {number} CONTENT_UNSPECIFIED=0 CONTENT_UNSPECIFIED value + * @property {number} CONTENT_TEXT=1 CONTENT_TEXT value + * @property {number} CONTENT_IMAGE=2 CONTENT_IMAGE value + */ + v2.ContentOption = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CONTENT_UNSPECIFIED"] = 0; + values[valuesById[1] = "CONTENT_TEXT"] = 1; + values[valuesById[2] = "CONTENT_IMAGE"] = 2; + return values; + })(); + + /** + * MetadataType enum. + * @name google.privacy.dlp.v2.MetadataType + * @enum {number} + * @property {number} METADATATYPE_UNSPECIFIED=0 METADATATYPE_UNSPECIFIED value + * @property {number} STORAGE_METADATA=2 STORAGE_METADATA value + */ + v2.MetadataType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "METADATATYPE_UNSPECIFIED"] = 0; + values[valuesById[2] = "STORAGE_METADATA"] = 2; + return values; + })(); + + /** + * InfoTypeSupportedBy enum. + * @name google.privacy.dlp.v2.InfoTypeSupportedBy + * @enum {number} + * @property {number} ENUM_TYPE_UNSPECIFIED=0 ENUM_TYPE_UNSPECIFIED value + * @property {number} INSPECT=1 INSPECT value + * @property {number} RISK_ANALYSIS=2 RISK_ANALYSIS value + */ + v2.InfoTypeSupportedBy = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ENUM_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "INSPECT"] = 1; + values[valuesById[2] = "RISK_ANALYSIS"] = 2; + return values; + })(); + + /** + * DlpJobType enum. + * @name google.privacy.dlp.v2.DlpJobType + * @enum {number} + * @property {number} DLP_JOB_TYPE_UNSPECIFIED=0 DLP_JOB_TYPE_UNSPECIFIED value + * @property {number} INSPECT_JOB=1 INSPECT_JOB value + * @property {number} RISK_ANALYSIS_JOB=2 RISK_ANALYSIS_JOB value + */ + v2.DlpJobType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DLP_JOB_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "INSPECT_JOB"] = 1; + values[valuesById[2] = "RISK_ANALYSIS_JOB"] = 2; + return values; + })(); + + /** + * StoredInfoTypeState enum. + * @name google.privacy.dlp.v2.StoredInfoTypeState + * @enum {number} + * @property {number} STORED_INFO_TYPE_STATE_UNSPECIFIED=0 STORED_INFO_TYPE_STATE_UNSPECIFIED value + * @property {number} PENDING=1 PENDING value + * @property {number} READY=2 READY value + * @property {number} FAILED=3 FAILED value + * @property {number} INVALID=4 INVALID value + */ + v2.StoredInfoTypeState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STORED_INFO_TYPE_STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "PENDING"] = 1; + values[valuesById[2] = "READY"] = 2; + values[valuesById[3] = "FAILED"] = 3; + values[valuesById[4] = "INVALID"] = 4; + return values; + })(); + + v2.InfoType = (function() { + + /** + * Properties of an InfoType. + * @memberof google.privacy.dlp.v2 + * @interface IInfoType + * @property {string|null} [name] InfoType name + */ + + /** + * Constructs a new InfoType. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents an InfoType. + * @implements IInfoType + * @constructor + * @param {google.privacy.dlp.v2.IInfoType=} [properties] Properties to set + */ + function InfoType(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InfoType name. + * @member {string} name + * @memberof google.privacy.dlp.v2.InfoType + * @instance + */ + InfoType.prototype.name = ""; + + /** + * Creates a new InfoType instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.InfoType + * @static + * @param {google.privacy.dlp.v2.IInfoType=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.InfoType} InfoType instance + */ + InfoType.create = function create(properties) { + return new InfoType(properties); + }; + + /** + * Encodes the specified InfoType message. Does not implicitly {@link google.privacy.dlp.v2.InfoType.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.InfoType + * @static + * @param {google.privacy.dlp.v2.IInfoType} message InfoType message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InfoType.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified InfoType message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.InfoType.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.InfoType + * @static + * @param {google.privacy.dlp.v2.IInfoType} message InfoType message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InfoType.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InfoType message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.InfoType + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.InfoType} InfoType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InfoType.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.privacy.dlp.v2.InfoType(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InfoType message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.InfoType + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.InfoType} InfoType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InfoType.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InfoType message. + * @function verify + * @memberof google.privacy.dlp.v2.InfoType + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InfoType.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates an InfoType message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.InfoType + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.InfoType} InfoType + */ + InfoType.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.InfoType) + return object; + var message = new $root.google.privacy.dlp.v2.InfoType(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from an InfoType message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.InfoType + * @static + * @param {google.privacy.dlp.v2.InfoType} message InfoType + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InfoType.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this InfoType to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.InfoType + * @instance + * @returns {Object.} JSON object + */ + InfoType.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InfoType; + })(); + + v2.StoredType = (function() { + + /** + * Properties of a StoredType. + * @memberof google.privacy.dlp.v2 + * @interface IStoredType + * @property {string|null} [name] StoredType name + * @property {google.protobuf.ITimestamp|null} [createTime] StoredType createTime + */ + + /** + * Constructs a new StoredType. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents a StoredType. + * @implements IStoredType + * @constructor + * @param {google.privacy.dlp.v2.IStoredType=} [properties] Properties to set + */ + function StoredType(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StoredType name. + * @member {string} name + * @memberof google.privacy.dlp.v2.StoredType + * @instance + */ + StoredType.prototype.name = ""; + + /** + * StoredType createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.privacy.dlp.v2.StoredType + * @instance + */ + StoredType.prototype.createTime = null; + + /** + * Creates a new StoredType instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.StoredType + * @static + * @param {google.privacy.dlp.v2.IStoredType=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.StoredType} StoredType instance + */ + StoredType.create = function create(properties) { + return new StoredType(properties); + }; + + /** + * Encodes the specified StoredType message. Does not implicitly {@link google.privacy.dlp.v2.StoredType.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.StoredType + * @static + * @param {google.privacy.dlp.v2.IStoredType} message StoredType message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StoredType.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified StoredType message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.StoredType.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.StoredType + * @static + * @param {google.privacy.dlp.v2.IStoredType} message StoredType message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StoredType.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StoredType message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.StoredType + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.StoredType} StoredType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StoredType.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.privacy.dlp.v2.StoredType(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StoredType message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.StoredType + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.StoredType} StoredType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StoredType.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StoredType message. + * @function verify + * @memberof google.privacy.dlp.v2.StoredType + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StoredType.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + return null; + }; + + /** + * Creates a StoredType message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.StoredType + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.StoredType} StoredType + */ + StoredType.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.StoredType) + return object; + var message = new $root.google.privacy.dlp.v2.StoredType(); + if (object.name != null) + message.name = String(object.name); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.privacy.dlp.v2.StoredType.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + return message; + }; + + /** + * Creates a plain object from a StoredType message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.StoredType + * @static + * @param {google.privacy.dlp.v2.StoredType} message StoredType + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StoredType.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.createTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + return object; + }; + + /** + * Converts this StoredType to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.StoredType + * @instance + * @returns {Object.} JSON object + */ + StoredType.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + 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() { + + /** + * Properties of a CustomInfoType. + * @memberof google.privacy.dlp.v2 + * @interface ICustomInfoType + * @property {google.privacy.dlp.v2.IInfoType|null} [infoType] CustomInfoType infoType + * @property {google.privacy.dlp.v2.Likelihood|null} [likelihood] CustomInfoType likelihood + * @property {google.privacy.dlp.v2.CustomInfoType.IDictionary|null} [dictionary] CustomInfoType dictionary + * @property {google.privacy.dlp.v2.CustomInfoType.IRegex|null} [regex] CustomInfoType regex + * @property {google.privacy.dlp.v2.CustomInfoType.ISurrogateType|null} [surrogateType] CustomInfoType surrogateType + * @property {google.privacy.dlp.v2.IStoredType|null} [storedType] CustomInfoType storedType + * @property {Array.|null} [detectionRules] CustomInfoType detectionRules + * @property {google.privacy.dlp.v2.CustomInfoType.ExclusionType|null} [exclusionType] CustomInfoType exclusionType + */ + + /** + * Constructs a new CustomInfoType. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents a CustomInfoType. + * @implements ICustomInfoType + * @constructor + * @param {google.privacy.dlp.v2.ICustomInfoType=} [properties] Properties to set + */ + function CustomInfoType(properties) { + this.detectionRules = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CustomInfoType infoType. + * @member {google.privacy.dlp.v2.IInfoType|null|undefined} infoType + * @memberof google.privacy.dlp.v2.CustomInfoType + * @instance + */ + CustomInfoType.prototype.infoType = null; + + /** + * CustomInfoType likelihood. + * @member {google.privacy.dlp.v2.Likelihood} likelihood + * @memberof google.privacy.dlp.v2.CustomInfoType + * @instance + */ + CustomInfoType.prototype.likelihood = 0; + + /** + * CustomInfoType dictionary. + * @member {google.privacy.dlp.v2.CustomInfoType.IDictionary|null|undefined} dictionary + * @memberof google.privacy.dlp.v2.CustomInfoType + * @instance + */ + CustomInfoType.prototype.dictionary = null; + + /** + * CustomInfoType regex. + * @member {google.privacy.dlp.v2.CustomInfoType.IRegex|null|undefined} regex + * @memberof google.privacy.dlp.v2.CustomInfoType + * @instance + */ + CustomInfoType.prototype.regex = null; + + /** + * CustomInfoType surrogateType. + * @member {google.privacy.dlp.v2.CustomInfoType.ISurrogateType|null|undefined} surrogateType + * @memberof google.privacy.dlp.v2.CustomInfoType + * @instance + */ + CustomInfoType.prototype.surrogateType = null; + + /** + * CustomInfoType storedType. + * @member {google.privacy.dlp.v2.IStoredType|null|undefined} storedType + * @memberof google.privacy.dlp.v2.CustomInfoType + * @instance + */ + CustomInfoType.prototype.storedType = null; + + /** + * CustomInfoType detectionRules. + * @member {Array.} detectionRules + * @memberof google.privacy.dlp.v2.CustomInfoType + * @instance + */ + CustomInfoType.prototype.detectionRules = $util.emptyArray; + + /** + * CustomInfoType exclusionType. + * @member {google.privacy.dlp.v2.CustomInfoType.ExclusionType} exclusionType + * @memberof google.privacy.dlp.v2.CustomInfoType + * @instance + */ + CustomInfoType.prototype.exclusionType = 0; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * CustomInfoType type. + * @member {"dictionary"|"regex"|"surrogateType"|"storedType"|undefined} type + * @memberof google.privacy.dlp.v2.CustomInfoType + * @instance + */ + Object.defineProperty(CustomInfoType.prototype, "type", { + get: $util.oneOfGetter($oneOfFields = ["dictionary", "regex", "surrogateType", "storedType"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CustomInfoType instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.CustomInfoType + * @static + * @param {google.privacy.dlp.v2.ICustomInfoType=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.CustomInfoType} CustomInfoType instance + */ + CustomInfoType.create = function create(properties) { + return new CustomInfoType(properties); + }; + + /** + * Encodes the specified CustomInfoType message. Does not implicitly {@link google.privacy.dlp.v2.CustomInfoType.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.CustomInfoType + * @static + * @param {google.privacy.dlp.v2.ICustomInfoType} message CustomInfoType message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomInfoType.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.infoType != null && Object.hasOwnProperty.call(message, "infoType")) + $root.google.privacy.dlp.v2.InfoType.encode(message.infoType, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.dictionary != null && Object.hasOwnProperty.call(message, "dictionary")) + $root.google.privacy.dlp.v2.CustomInfoType.Dictionary.encode(message.dictionary, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.regex != null && Object.hasOwnProperty.call(message, "regex")) + $root.google.privacy.dlp.v2.CustomInfoType.Regex.encode(message.regex, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.surrogateType != null && Object.hasOwnProperty.call(message, "surrogateType")) + $root.google.privacy.dlp.v2.CustomInfoType.SurrogateType.encode(message.surrogateType, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.storedType != null && Object.hasOwnProperty.call(message, "storedType")) + $root.google.privacy.dlp.v2.StoredType.encode(message.storedType, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.likelihood != null && Object.hasOwnProperty.call(message, "likelihood")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.likelihood); + if (message.detectionRules != null && message.detectionRules.length) + for (var i = 0; i < message.detectionRules.length; ++i) + $root.google.privacy.dlp.v2.CustomInfoType.DetectionRule.encode(message.detectionRules[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.exclusionType != null && Object.hasOwnProperty.call(message, "exclusionType")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.exclusionType); + return writer; + }; + + /** + * Encodes the specified CustomInfoType message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.CustomInfoType.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.CustomInfoType + * @static + * @param {google.privacy.dlp.v2.ICustomInfoType} message CustomInfoType message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomInfoType.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CustomInfoType message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.CustomInfoType + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.CustomInfoType} CustomInfoType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomInfoType.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.privacy.dlp.v2.CustomInfoType(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.infoType = $root.google.privacy.dlp.v2.InfoType.decode(reader, reader.uint32()); + break; + case 6: + message.likelihood = reader.int32(); + break; + case 2: + message.dictionary = $root.google.privacy.dlp.v2.CustomInfoType.Dictionary.decode(reader, reader.uint32()); + break; + case 3: + message.regex = $root.google.privacy.dlp.v2.CustomInfoType.Regex.decode(reader, reader.uint32()); + break; + case 4: + message.surrogateType = $root.google.privacy.dlp.v2.CustomInfoType.SurrogateType.decode(reader, reader.uint32()); + break; + case 5: + message.storedType = $root.google.privacy.dlp.v2.StoredType.decode(reader, reader.uint32()); + break; + case 7: + if (!(message.detectionRules && message.detectionRules.length)) + message.detectionRules = []; + message.detectionRules.push($root.google.privacy.dlp.v2.CustomInfoType.DetectionRule.decode(reader, reader.uint32())); + break; + case 8: + message.exclusionType = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CustomInfoType message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.CustomInfoType + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.CustomInfoType} CustomInfoType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomInfoType.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CustomInfoType message. + * @function verify + * @memberof google.privacy.dlp.v2.CustomInfoType + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CustomInfoType.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.infoType != null && message.hasOwnProperty("infoType")) { + var error = $root.google.privacy.dlp.v2.InfoType.verify(message.infoType); + if (error) + return "infoType." + error; + } + if (message.likelihood != null && message.hasOwnProperty("likelihood")) + switch (message.likelihood) { + default: + return "likelihood: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.dictionary != null && message.hasOwnProperty("dictionary")) { + properties.type = 1; + { + var error = $root.google.privacy.dlp.v2.CustomInfoType.Dictionary.verify(message.dictionary); + if (error) + return "dictionary." + error; + } + } + if (message.regex != null && message.hasOwnProperty("regex")) { + if (properties.type === 1) + return "type: multiple values"; + properties.type = 1; + { + var error = $root.google.privacy.dlp.v2.CustomInfoType.Regex.verify(message.regex); + if (error) + return "regex." + error; + } + } + if (message.surrogateType != null && message.hasOwnProperty("surrogateType")) { + if (properties.type === 1) + return "type: multiple values"; + properties.type = 1; + { + var error = $root.google.privacy.dlp.v2.CustomInfoType.SurrogateType.verify(message.surrogateType); + if (error) + return "surrogateType." + error; + } + } + if (message.storedType != null && message.hasOwnProperty("storedType")) { + if (properties.type === 1) + return "type: multiple values"; + properties.type = 1; + { + var error = $root.google.privacy.dlp.v2.StoredType.verify(message.storedType); + if (error) + return "storedType." + error; + } + } + if (message.detectionRules != null && message.hasOwnProperty("detectionRules")) { + if (!Array.isArray(message.detectionRules)) + return "detectionRules: array expected"; + for (var i = 0; i < message.detectionRules.length; ++i) { + var error = $root.google.privacy.dlp.v2.CustomInfoType.DetectionRule.verify(message.detectionRules[i]); + if (error) + return "detectionRules." + error; + } + } + if (message.exclusionType != null && message.hasOwnProperty("exclusionType")) + switch (message.exclusionType) { + default: + return "exclusionType: enum value expected"; + case 0: + case 1: + break; + } + return null; + }; + + /** + * Creates a CustomInfoType message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.CustomInfoType + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.CustomInfoType} CustomInfoType + */ + CustomInfoType.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.CustomInfoType) + return object; + var message = new $root.google.privacy.dlp.v2.CustomInfoType(); + if (object.infoType != null) { + if (typeof object.infoType !== "object") + throw TypeError(".google.privacy.dlp.v2.CustomInfoType.infoType: object expected"); + message.infoType = $root.google.privacy.dlp.v2.InfoType.fromObject(object.infoType); + } + switch (object.likelihood) { + case "LIKELIHOOD_UNSPECIFIED": + case 0: + message.likelihood = 0; + break; + case "VERY_UNLIKELY": + case 1: + message.likelihood = 1; + break; + case "UNLIKELY": + case 2: + message.likelihood = 2; + break; + case "POSSIBLE": + case 3: + message.likelihood = 3; + break; + case "LIKELY": + case 4: + message.likelihood = 4; + break; + case "VERY_LIKELY": + case 5: + message.likelihood = 5; + break; + } + if (object.dictionary != null) { + if (typeof object.dictionary !== "object") + throw TypeError(".google.privacy.dlp.v2.CustomInfoType.dictionary: object expected"); + message.dictionary = $root.google.privacy.dlp.v2.CustomInfoType.Dictionary.fromObject(object.dictionary); + } + if (object.regex != null) { + if (typeof object.regex !== "object") + throw TypeError(".google.privacy.dlp.v2.CustomInfoType.regex: object expected"); + message.regex = $root.google.privacy.dlp.v2.CustomInfoType.Regex.fromObject(object.regex); + } + if (object.surrogateType != null) { + if (typeof object.surrogateType !== "object") + throw TypeError(".google.privacy.dlp.v2.CustomInfoType.surrogateType: object expected"); + message.surrogateType = $root.google.privacy.dlp.v2.CustomInfoType.SurrogateType.fromObject(object.surrogateType); + } + if (object.storedType != null) { + if (typeof object.storedType !== "object") + throw TypeError(".google.privacy.dlp.v2.CustomInfoType.storedType: object expected"); + message.storedType = $root.google.privacy.dlp.v2.StoredType.fromObject(object.storedType); + } + if (object.detectionRules) { + if (!Array.isArray(object.detectionRules)) + throw TypeError(".google.privacy.dlp.v2.CustomInfoType.detectionRules: array expected"); + message.detectionRules = []; + for (var i = 0; i < object.detectionRules.length; ++i) { + if (typeof object.detectionRules[i] !== "object") + throw TypeError(".google.privacy.dlp.v2.CustomInfoType.detectionRules: object expected"); + message.detectionRules[i] = $root.google.privacy.dlp.v2.CustomInfoType.DetectionRule.fromObject(object.detectionRules[i]); + } + } + switch (object.exclusionType) { + case "EXCLUSION_TYPE_UNSPECIFIED": + case 0: + message.exclusionType = 0; + break; + case "EXCLUSION_TYPE_EXCLUDE": + case 1: + message.exclusionType = 1; + break; + } + return message; + }; + + /** + * Creates a plain object from a CustomInfoType message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.CustomInfoType + * @static + * @param {google.privacy.dlp.v2.CustomInfoType} message CustomInfoType + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CustomInfoType.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.detectionRules = []; + if (options.defaults) { + object.infoType = null; + object.likelihood = options.enums === String ? "LIKELIHOOD_UNSPECIFIED" : 0; + object.exclusionType = options.enums === String ? "EXCLUSION_TYPE_UNSPECIFIED" : 0; + } + if (message.infoType != null && message.hasOwnProperty("infoType")) + object.infoType = $root.google.privacy.dlp.v2.InfoType.toObject(message.infoType, options); + if (message.dictionary != null && message.hasOwnProperty("dictionary")) { + object.dictionary = $root.google.privacy.dlp.v2.CustomInfoType.Dictionary.toObject(message.dictionary, options); + if (options.oneofs) + object.type = "dictionary"; + } + if (message.regex != null && message.hasOwnProperty("regex")) { + object.regex = $root.google.privacy.dlp.v2.CustomInfoType.Regex.toObject(message.regex, options); + if (options.oneofs) + object.type = "regex"; + } + if (message.surrogateType != null && message.hasOwnProperty("surrogateType")) { + object.surrogateType = $root.google.privacy.dlp.v2.CustomInfoType.SurrogateType.toObject(message.surrogateType, options); + if (options.oneofs) + object.type = "surrogateType"; + } + if (message.storedType != null && message.hasOwnProperty("storedType")) { + object.storedType = $root.google.privacy.dlp.v2.StoredType.toObject(message.storedType, options); + if (options.oneofs) + object.type = "storedType"; + } + if (message.likelihood != null && message.hasOwnProperty("likelihood")) + object.likelihood = options.enums === String ? $root.google.privacy.dlp.v2.Likelihood[message.likelihood] : message.likelihood; + if (message.detectionRules && message.detectionRules.length) { + object.detectionRules = []; + for (var j = 0; j < message.detectionRules.length; ++j) + object.detectionRules[j] = $root.google.privacy.dlp.v2.CustomInfoType.DetectionRule.toObject(message.detectionRules[j], options); + } + if (message.exclusionType != null && message.hasOwnProperty("exclusionType")) + object.exclusionType = options.enums === String ? $root.google.privacy.dlp.v2.CustomInfoType.ExclusionType[message.exclusionType] : message.exclusionType; + return object; + }; + + /** + * Converts this CustomInfoType to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.CustomInfoType + * @instance + * @returns {Object.} JSON object + */ + CustomInfoType.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + CustomInfoType.Dictionary = (function() { + + /** + * Properties of a Dictionary. + * @memberof google.privacy.dlp.v2.CustomInfoType + * @interface IDictionary + * @property {google.privacy.dlp.v2.CustomInfoType.Dictionary.IWordList|null} [wordList] Dictionary wordList + * @property {google.privacy.dlp.v2.ICloudStoragePath|null} [cloudStoragePath] Dictionary cloudStoragePath + */ + + /** + * Constructs a new Dictionary. + * @memberof google.privacy.dlp.v2.CustomInfoType + * @classdesc Represents a Dictionary. + * @implements IDictionary + * @constructor + * @param {google.privacy.dlp.v2.CustomInfoType.IDictionary=} [properties] Properties to set + */ + function Dictionary(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Dictionary wordList. + * @member {google.privacy.dlp.v2.CustomInfoType.Dictionary.IWordList|null|undefined} wordList + * @memberof google.privacy.dlp.v2.CustomInfoType.Dictionary + * @instance + */ + Dictionary.prototype.wordList = null; + + /** + * Dictionary cloudStoragePath. + * @member {google.privacy.dlp.v2.ICloudStoragePath|null|undefined} cloudStoragePath + * @memberof google.privacy.dlp.v2.CustomInfoType.Dictionary + * @instance + */ + Dictionary.prototype.cloudStoragePath = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Dictionary source. + * @member {"wordList"|"cloudStoragePath"|undefined} source + * @memberof google.privacy.dlp.v2.CustomInfoType.Dictionary + * @instance + */ + Object.defineProperty(Dictionary.prototype, "source", { + get: $util.oneOfGetter($oneOfFields = ["wordList", "cloudStoragePath"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Dictionary instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.CustomInfoType.Dictionary + * @static + * @param {google.privacy.dlp.v2.CustomInfoType.IDictionary=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.CustomInfoType.Dictionary} Dictionary instance + */ + Dictionary.create = function create(properties) { + return new Dictionary(properties); + }; + + /** + * Encodes the specified Dictionary message. Does not implicitly {@link google.privacy.dlp.v2.CustomInfoType.Dictionary.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.CustomInfoType.Dictionary + * @static + * @param {google.privacy.dlp.v2.CustomInfoType.IDictionary} message Dictionary message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Dictionary.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.wordList != null && Object.hasOwnProperty.call(message, "wordList")) + $root.google.privacy.dlp.v2.CustomInfoType.Dictionary.WordList.encode(message.wordList, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.cloudStoragePath != null && Object.hasOwnProperty.call(message, "cloudStoragePath")) + $root.google.privacy.dlp.v2.CloudStoragePath.encode(message.cloudStoragePath, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Dictionary message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.CustomInfoType.Dictionary.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.CustomInfoType.Dictionary + * @static + * @param {google.privacy.dlp.v2.CustomInfoType.IDictionary} message Dictionary message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Dictionary.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Dictionary message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.CustomInfoType.Dictionary + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.CustomInfoType.Dictionary} Dictionary + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Dictionary.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.privacy.dlp.v2.CustomInfoType.Dictionary(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.wordList = $root.google.privacy.dlp.v2.CustomInfoType.Dictionary.WordList.decode(reader, reader.uint32()); + break; + case 3: + message.cloudStoragePath = $root.google.privacy.dlp.v2.CloudStoragePath.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Dictionary message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.CustomInfoType.Dictionary + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.CustomInfoType.Dictionary} Dictionary + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Dictionary.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Dictionary message. + * @function verify + * @memberof google.privacy.dlp.v2.CustomInfoType.Dictionary + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Dictionary.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.wordList != null && message.hasOwnProperty("wordList")) { + properties.source = 1; + { + var error = $root.google.privacy.dlp.v2.CustomInfoType.Dictionary.WordList.verify(message.wordList); + if (error) + return "wordList." + error; + } + } + if (message.cloudStoragePath != null && message.hasOwnProperty("cloudStoragePath")) { + if (properties.source === 1) + return "source: multiple values"; + properties.source = 1; + { + var error = $root.google.privacy.dlp.v2.CloudStoragePath.verify(message.cloudStoragePath); + if (error) + return "cloudStoragePath." + error; + } + } + return null; + }; + + /** + * Creates a Dictionary message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.CustomInfoType.Dictionary + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.CustomInfoType.Dictionary} Dictionary + */ + Dictionary.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.CustomInfoType.Dictionary) + return object; + var message = new $root.google.privacy.dlp.v2.CustomInfoType.Dictionary(); + if (object.wordList != null) { + if (typeof object.wordList !== "object") + throw TypeError(".google.privacy.dlp.v2.CustomInfoType.Dictionary.wordList: object expected"); + message.wordList = $root.google.privacy.dlp.v2.CustomInfoType.Dictionary.WordList.fromObject(object.wordList); + } + if (object.cloudStoragePath != null) { + if (typeof object.cloudStoragePath !== "object") + throw TypeError(".google.privacy.dlp.v2.CustomInfoType.Dictionary.cloudStoragePath: object expected"); + message.cloudStoragePath = $root.google.privacy.dlp.v2.CloudStoragePath.fromObject(object.cloudStoragePath); + } + return message; + }; + + /** + * Creates a plain object from a Dictionary message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.CustomInfoType.Dictionary + * @static + * @param {google.privacy.dlp.v2.CustomInfoType.Dictionary} message Dictionary + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Dictionary.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.wordList != null && message.hasOwnProperty("wordList")) { + object.wordList = $root.google.privacy.dlp.v2.CustomInfoType.Dictionary.WordList.toObject(message.wordList, options); + if (options.oneofs) + object.source = "wordList"; + } + if (message.cloudStoragePath != null && message.hasOwnProperty("cloudStoragePath")) { + object.cloudStoragePath = $root.google.privacy.dlp.v2.CloudStoragePath.toObject(message.cloudStoragePath, options); + if (options.oneofs) + object.source = "cloudStoragePath"; + } + return object; + }; + + /** + * Converts this Dictionary to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.CustomInfoType.Dictionary + * @instance + * @returns {Object.} JSON object + */ + Dictionary.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + Dictionary.WordList = (function() { + + /** + * Properties of a WordList. + * @memberof google.privacy.dlp.v2.CustomInfoType.Dictionary + * @interface IWordList + * @property {Array.|null} [words] WordList words + */ + + /** + * Constructs a new WordList. + * @memberof google.privacy.dlp.v2.CustomInfoType.Dictionary + * @classdesc Represents a WordList. + * @implements IWordList + * @constructor + * @param {google.privacy.dlp.v2.CustomInfoType.Dictionary.IWordList=} [properties] Properties to set + */ + function WordList(properties) { + this.words = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WordList words. + * @member {Array.} words + * @memberof google.privacy.dlp.v2.CustomInfoType.Dictionary.WordList + * @instance + */ + WordList.prototype.words = $util.emptyArray; + + /** + * Creates a new WordList instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.CustomInfoType.Dictionary.WordList + * @static + * @param {google.privacy.dlp.v2.CustomInfoType.Dictionary.IWordList=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.CustomInfoType.Dictionary.WordList} WordList instance + */ + WordList.create = function create(properties) { + return new WordList(properties); + }; + + /** + * Encodes the specified WordList message. Does not implicitly {@link google.privacy.dlp.v2.CustomInfoType.Dictionary.WordList.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.CustomInfoType.Dictionary.WordList + * @static + * @param {google.privacy.dlp.v2.CustomInfoType.Dictionary.IWordList} message WordList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WordList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.words != null && message.words.length) + for (var i = 0; i < message.words.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.words[i]); + return writer; + }; + + /** + * Encodes the specified WordList message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.CustomInfoType.Dictionary.WordList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.CustomInfoType.Dictionary.WordList + * @static + * @param {google.privacy.dlp.v2.CustomInfoType.Dictionary.IWordList} message WordList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WordList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WordList message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.CustomInfoType.Dictionary.WordList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.CustomInfoType.Dictionary.WordList} WordList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WordList.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.privacy.dlp.v2.CustomInfoType.Dictionary.WordList(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.words && message.words.length)) + message.words = []; + message.words.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WordList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.CustomInfoType.Dictionary.WordList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.CustomInfoType.Dictionary.WordList} WordList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WordList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WordList message. + * @function verify + * @memberof google.privacy.dlp.v2.CustomInfoType.Dictionary.WordList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WordList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.words != null && message.hasOwnProperty("words")) { + if (!Array.isArray(message.words)) + return "words: array expected"; + for (var i = 0; i < message.words.length; ++i) + if (!$util.isString(message.words[i])) + return "words: string[] expected"; + } + return null; + }; + + /** + * Creates a WordList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.CustomInfoType.Dictionary.WordList + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.CustomInfoType.Dictionary.WordList} WordList + */ + WordList.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.CustomInfoType.Dictionary.WordList) + return object; + var message = new $root.google.privacy.dlp.v2.CustomInfoType.Dictionary.WordList(); + if (object.words) { + if (!Array.isArray(object.words)) + throw TypeError(".google.privacy.dlp.v2.CustomInfoType.Dictionary.WordList.words: array expected"); + message.words = []; + for (var i = 0; i < object.words.length; ++i) + message.words[i] = String(object.words[i]); + } + return message; + }; + + /** + * Creates a plain object from a WordList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.CustomInfoType.Dictionary.WordList + * @static + * @param {google.privacy.dlp.v2.CustomInfoType.Dictionary.WordList} message WordList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WordList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.words = []; + if (message.words && message.words.length) { + object.words = []; + for (var j = 0; j < message.words.length; ++j) + object.words[j] = message.words[j]; + } + return object; + }; + + /** + * Converts this WordList to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.CustomInfoType.Dictionary.WordList + * @instance + * @returns {Object.} JSON object + */ + WordList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return WordList; + })(); + + return Dictionary; + })(); + + CustomInfoType.Regex = (function() { + + /** + * Properties of a Regex. + * @memberof google.privacy.dlp.v2.CustomInfoType + * @interface IRegex + * @property {string|null} [pattern] Regex pattern + * @property {Array.|null} [groupIndexes] Regex groupIndexes + */ + + /** + * Constructs a new Regex. + * @memberof google.privacy.dlp.v2.CustomInfoType + * @classdesc Represents a Regex. + * @implements IRegex + * @constructor + * @param {google.privacy.dlp.v2.CustomInfoType.IRegex=} [properties] Properties to set + */ + function Regex(properties) { + this.groupIndexes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Regex pattern. + * @member {string} pattern + * @memberof google.privacy.dlp.v2.CustomInfoType.Regex + * @instance + */ + Regex.prototype.pattern = ""; + + /** + * Regex groupIndexes. + * @member {Array.} groupIndexes + * @memberof google.privacy.dlp.v2.CustomInfoType.Regex + * @instance + */ + Regex.prototype.groupIndexes = $util.emptyArray; + + /** + * Creates a new Regex instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.CustomInfoType.Regex + * @static + * @param {google.privacy.dlp.v2.CustomInfoType.IRegex=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.CustomInfoType.Regex} Regex instance + */ + Regex.create = function create(properties) { + return new Regex(properties); + }; + + /** + * Encodes the specified Regex message. Does not implicitly {@link google.privacy.dlp.v2.CustomInfoType.Regex.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.CustomInfoType.Regex + * @static + * @param {google.privacy.dlp.v2.CustomInfoType.IRegex} message Regex message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Regex.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pattern != null && Object.hasOwnProperty.call(message, "pattern")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.pattern); + if (message.groupIndexes != null && message.groupIndexes.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.groupIndexes.length; ++i) + writer.int32(message.groupIndexes[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified Regex message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.CustomInfoType.Regex.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.CustomInfoType.Regex + * @static + * @param {google.privacy.dlp.v2.CustomInfoType.IRegex} message Regex message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Regex.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Regex message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.CustomInfoType.Regex + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.CustomInfoType.Regex} Regex + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Regex.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.privacy.dlp.v2.CustomInfoType.Regex(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pattern = reader.string(); + break; + case 2: + if (!(message.groupIndexes && message.groupIndexes.length)) + message.groupIndexes = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.groupIndexes.push(reader.int32()); + } else + message.groupIndexes.push(reader.int32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Regex message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.CustomInfoType.Regex + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.CustomInfoType.Regex} Regex + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Regex.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Regex message. + * @function verify + * @memberof google.privacy.dlp.v2.CustomInfoType.Regex + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Regex.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.pattern != null && message.hasOwnProperty("pattern")) + if (!$util.isString(message.pattern)) + return "pattern: string expected"; + if (message.groupIndexes != null && message.hasOwnProperty("groupIndexes")) { + if (!Array.isArray(message.groupIndexes)) + return "groupIndexes: array expected"; + for (var i = 0; i < message.groupIndexes.length; ++i) + if (!$util.isInteger(message.groupIndexes[i])) + return "groupIndexes: integer[] expected"; + } + return null; + }; + + /** + * Creates a Regex message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.CustomInfoType.Regex + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.CustomInfoType.Regex} Regex + */ + Regex.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.CustomInfoType.Regex) + return object; + var message = new $root.google.privacy.dlp.v2.CustomInfoType.Regex(); + if (object.pattern != null) + message.pattern = String(object.pattern); + if (object.groupIndexes) { + if (!Array.isArray(object.groupIndexes)) + throw TypeError(".google.privacy.dlp.v2.CustomInfoType.Regex.groupIndexes: array expected"); + message.groupIndexes = []; + for (var i = 0; i < object.groupIndexes.length; ++i) + message.groupIndexes[i] = object.groupIndexes[i] | 0; + } + return message; + }; + + /** + * Creates a plain object from a Regex message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.CustomInfoType.Regex + * @static + * @param {google.privacy.dlp.v2.CustomInfoType.Regex} message Regex + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Regex.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.groupIndexes = []; + if (options.defaults) + object.pattern = ""; + if (message.pattern != null && message.hasOwnProperty("pattern")) + object.pattern = message.pattern; + if (message.groupIndexes && message.groupIndexes.length) { + object.groupIndexes = []; + for (var j = 0; j < message.groupIndexes.length; ++j) + object.groupIndexes[j] = message.groupIndexes[j]; + } + return object; + }; + + /** + * Converts this Regex to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.CustomInfoType.Regex + * @instance + * @returns {Object.} JSON object + */ + Regex.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Regex; + })(); + + CustomInfoType.SurrogateType = (function() { + + /** + * Properties of a SurrogateType. + * @memberof google.privacy.dlp.v2.CustomInfoType + * @interface ISurrogateType + */ + + /** + * Constructs a new SurrogateType. + * @memberof google.privacy.dlp.v2.CustomInfoType + * @classdesc Represents a SurrogateType. + * @implements ISurrogateType + * @constructor + * @param {google.privacy.dlp.v2.CustomInfoType.ISurrogateType=} [properties] Properties to set + */ + function SurrogateType(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new SurrogateType instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.CustomInfoType.SurrogateType + * @static + * @param {google.privacy.dlp.v2.CustomInfoType.ISurrogateType=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.CustomInfoType.SurrogateType} SurrogateType instance + */ + SurrogateType.create = function create(properties) { + return new SurrogateType(properties); + }; + + /** + * Encodes the specified SurrogateType message. Does not implicitly {@link google.privacy.dlp.v2.CustomInfoType.SurrogateType.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.CustomInfoType.SurrogateType + * @static + * @param {google.privacy.dlp.v2.CustomInfoType.ISurrogateType} message SurrogateType message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SurrogateType.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified SurrogateType message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.CustomInfoType.SurrogateType.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.CustomInfoType.SurrogateType + * @static + * @param {google.privacy.dlp.v2.CustomInfoType.ISurrogateType} message SurrogateType message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SurrogateType.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SurrogateType message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.CustomInfoType.SurrogateType + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.CustomInfoType.SurrogateType} SurrogateType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SurrogateType.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.privacy.dlp.v2.CustomInfoType.SurrogateType(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SurrogateType message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.CustomInfoType.SurrogateType + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.CustomInfoType.SurrogateType} SurrogateType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SurrogateType.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SurrogateType message. + * @function verify + * @memberof google.privacy.dlp.v2.CustomInfoType.SurrogateType + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SurrogateType.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a SurrogateType message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.CustomInfoType.SurrogateType + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.CustomInfoType.SurrogateType} SurrogateType + */ + SurrogateType.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.CustomInfoType.SurrogateType) + return object; + return new $root.google.privacy.dlp.v2.CustomInfoType.SurrogateType(); + }; + + /** + * Creates a plain object from a SurrogateType message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.CustomInfoType.SurrogateType + * @static + * @param {google.privacy.dlp.v2.CustomInfoType.SurrogateType} message SurrogateType + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SurrogateType.toObject = function toObject() { + return {}; + }; + + /** + * Converts this SurrogateType to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.CustomInfoType.SurrogateType + * @instance + * @returns {Object.} JSON object + */ + SurrogateType.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SurrogateType; + })(); + + CustomInfoType.DetectionRule = (function() { + + /** + * Properties of a DetectionRule. + * @memberof google.privacy.dlp.v2.CustomInfoType + * @interface IDetectionRule + * @property {google.privacy.dlp.v2.CustomInfoType.DetectionRule.IHotwordRule|null} [hotwordRule] DetectionRule hotwordRule + */ + + /** + * Constructs a new DetectionRule. + * @memberof google.privacy.dlp.v2.CustomInfoType + * @classdesc Represents a DetectionRule. + * @implements IDetectionRule + * @constructor + * @param {google.privacy.dlp.v2.CustomInfoType.IDetectionRule=} [properties] Properties to set + */ + function DetectionRule(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DetectionRule hotwordRule. + * @member {google.privacy.dlp.v2.CustomInfoType.DetectionRule.IHotwordRule|null|undefined} hotwordRule + * @memberof google.privacy.dlp.v2.CustomInfoType.DetectionRule + * @instance + */ + DetectionRule.prototype.hotwordRule = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DetectionRule type. + * @member {"hotwordRule"|undefined} type + * @memberof google.privacy.dlp.v2.CustomInfoType.DetectionRule + * @instance + */ + Object.defineProperty(DetectionRule.prototype, "type", { + get: $util.oneOfGetter($oneOfFields = ["hotwordRule"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DetectionRule instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.CustomInfoType.DetectionRule + * @static + * @param {google.privacy.dlp.v2.CustomInfoType.IDetectionRule=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.CustomInfoType.DetectionRule} DetectionRule instance + */ + DetectionRule.create = function create(properties) { + return new DetectionRule(properties); + }; + + /** + * Encodes the specified DetectionRule message. Does not implicitly {@link google.privacy.dlp.v2.CustomInfoType.DetectionRule.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.CustomInfoType.DetectionRule + * @static + * @param {google.privacy.dlp.v2.CustomInfoType.IDetectionRule} message DetectionRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DetectionRule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.hotwordRule != null && Object.hasOwnProperty.call(message, "hotwordRule")) + $root.google.privacy.dlp.v2.CustomInfoType.DetectionRule.HotwordRule.encode(message.hotwordRule, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DetectionRule message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.CustomInfoType.DetectionRule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.CustomInfoType.DetectionRule + * @static + * @param {google.privacy.dlp.v2.CustomInfoType.IDetectionRule} message DetectionRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DetectionRule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DetectionRule message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.CustomInfoType.DetectionRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.CustomInfoType.DetectionRule} DetectionRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DetectionRule.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.privacy.dlp.v2.CustomInfoType.DetectionRule(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.hotwordRule = $root.google.privacy.dlp.v2.CustomInfoType.DetectionRule.HotwordRule.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DetectionRule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.CustomInfoType.DetectionRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.CustomInfoType.DetectionRule} DetectionRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DetectionRule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DetectionRule message. + * @function verify + * @memberof google.privacy.dlp.v2.CustomInfoType.DetectionRule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DetectionRule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.hotwordRule != null && message.hasOwnProperty("hotwordRule")) { + properties.type = 1; + { + var error = $root.google.privacy.dlp.v2.CustomInfoType.DetectionRule.HotwordRule.verify(message.hotwordRule); + if (error) + return "hotwordRule." + error; + } + } + return null; + }; + + /** + * Creates a DetectionRule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.CustomInfoType.DetectionRule + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.CustomInfoType.DetectionRule} DetectionRule + */ + DetectionRule.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.CustomInfoType.DetectionRule) + return object; + var message = new $root.google.privacy.dlp.v2.CustomInfoType.DetectionRule(); + if (object.hotwordRule != null) { + if (typeof object.hotwordRule !== "object") + throw TypeError(".google.privacy.dlp.v2.CustomInfoType.DetectionRule.hotwordRule: object expected"); + message.hotwordRule = $root.google.privacy.dlp.v2.CustomInfoType.DetectionRule.HotwordRule.fromObject(object.hotwordRule); + } + return message; + }; + + /** + * Creates a plain object from a DetectionRule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.CustomInfoType.DetectionRule + * @static + * @param {google.privacy.dlp.v2.CustomInfoType.DetectionRule} message DetectionRule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DetectionRule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.hotwordRule != null && message.hasOwnProperty("hotwordRule")) { + object.hotwordRule = $root.google.privacy.dlp.v2.CustomInfoType.DetectionRule.HotwordRule.toObject(message.hotwordRule, options); + if (options.oneofs) + object.type = "hotwordRule"; + } + return object; + }; + + /** + * Converts this DetectionRule to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.CustomInfoType.DetectionRule + * @instance + * @returns {Object.} JSON object + */ + DetectionRule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + DetectionRule.Proximity = (function() { + + /** + * Properties of a Proximity. + * @memberof google.privacy.dlp.v2.CustomInfoType.DetectionRule + * @interface IProximity + * @property {number|null} [windowBefore] Proximity windowBefore + * @property {number|null} [windowAfter] Proximity windowAfter + */ + + /** + * Constructs a new Proximity. + * @memberof google.privacy.dlp.v2.CustomInfoType.DetectionRule + * @classdesc Represents a Proximity. + * @implements IProximity + * @constructor + * @param {google.privacy.dlp.v2.CustomInfoType.DetectionRule.IProximity=} [properties] Properties to set + */ + function Proximity(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Proximity windowBefore. + * @member {number} windowBefore + * @memberof google.privacy.dlp.v2.CustomInfoType.DetectionRule.Proximity + * @instance + */ + Proximity.prototype.windowBefore = 0; + + /** + * Proximity windowAfter. + * @member {number} windowAfter + * @memberof google.privacy.dlp.v2.CustomInfoType.DetectionRule.Proximity + * @instance + */ + Proximity.prototype.windowAfter = 0; + + /** + * Creates a new Proximity instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.CustomInfoType.DetectionRule.Proximity + * @static + * @param {google.privacy.dlp.v2.CustomInfoType.DetectionRule.IProximity=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.CustomInfoType.DetectionRule.Proximity} Proximity instance + */ + Proximity.create = function create(properties) { + return new Proximity(properties); + }; + + /** + * Encodes the specified Proximity message. Does not implicitly {@link google.privacy.dlp.v2.CustomInfoType.DetectionRule.Proximity.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.CustomInfoType.DetectionRule.Proximity + * @static + * @param {google.privacy.dlp.v2.CustomInfoType.DetectionRule.IProximity} message Proximity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Proximity.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.windowBefore != null && Object.hasOwnProperty.call(message, "windowBefore")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.windowBefore); + if (message.windowAfter != null && Object.hasOwnProperty.call(message, "windowAfter")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.windowAfter); + return writer; + }; + + /** + * Encodes the specified Proximity message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.CustomInfoType.DetectionRule.Proximity.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.CustomInfoType.DetectionRule.Proximity + * @static + * @param {google.privacy.dlp.v2.CustomInfoType.DetectionRule.IProximity} message Proximity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Proximity.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Proximity message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.CustomInfoType.DetectionRule.Proximity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.CustomInfoType.DetectionRule.Proximity} Proximity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Proximity.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.privacy.dlp.v2.CustomInfoType.DetectionRule.Proximity(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.windowBefore = reader.int32(); + break; + case 2: + message.windowAfter = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Proximity message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.CustomInfoType.DetectionRule.Proximity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.CustomInfoType.DetectionRule.Proximity} Proximity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Proximity.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Proximity message. + * @function verify + * @memberof google.privacy.dlp.v2.CustomInfoType.DetectionRule.Proximity + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Proximity.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.windowBefore != null && message.hasOwnProperty("windowBefore")) + if (!$util.isInteger(message.windowBefore)) + return "windowBefore: integer expected"; + if (message.windowAfter != null && message.hasOwnProperty("windowAfter")) + if (!$util.isInteger(message.windowAfter)) + return "windowAfter: integer expected"; + return null; + }; + + /** + * Creates a Proximity message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.CustomInfoType.DetectionRule.Proximity + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.CustomInfoType.DetectionRule.Proximity} Proximity + */ + Proximity.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.CustomInfoType.DetectionRule.Proximity) + return object; + var message = new $root.google.privacy.dlp.v2.CustomInfoType.DetectionRule.Proximity(); + if (object.windowBefore != null) + message.windowBefore = object.windowBefore | 0; + if (object.windowAfter != null) + message.windowAfter = object.windowAfter | 0; + return message; + }; + + /** + * Creates a plain object from a Proximity message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.CustomInfoType.DetectionRule.Proximity + * @static + * @param {google.privacy.dlp.v2.CustomInfoType.DetectionRule.Proximity} message Proximity + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Proximity.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.windowBefore = 0; + object.windowAfter = 0; + } + if (message.windowBefore != null && message.hasOwnProperty("windowBefore")) + object.windowBefore = message.windowBefore; + if (message.windowAfter != null && message.hasOwnProperty("windowAfter")) + object.windowAfter = message.windowAfter; + return object; + }; + + /** + * Converts this Proximity to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.CustomInfoType.DetectionRule.Proximity + * @instance + * @returns {Object.} JSON object + */ + Proximity.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Proximity; + })(); + + DetectionRule.LikelihoodAdjustment = (function() { + + /** + * Properties of a LikelihoodAdjustment. + * @memberof google.privacy.dlp.v2.CustomInfoType.DetectionRule + * @interface ILikelihoodAdjustment + * @property {google.privacy.dlp.v2.Likelihood|null} [fixedLikelihood] LikelihoodAdjustment fixedLikelihood + * @property {number|null} [relativeLikelihood] LikelihoodAdjustment relativeLikelihood + */ + + /** + * Constructs a new LikelihoodAdjustment. + * @memberof google.privacy.dlp.v2.CustomInfoType.DetectionRule + * @classdesc Represents a LikelihoodAdjustment. + * @implements ILikelihoodAdjustment + * @constructor + * @param {google.privacy.dlp.v2.CustomInfoType.DetectionRule.ILikelihoodAdjustment=} [properties] Properties to set + */ + function LikelihoodAdjustment(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LikelihoodAdjustment fixedLikelihood. + * @member {google.privacy.dlp.v2.Likelihood} fixedLikelihood + * @memberof google.privacy.dlp.v2.CustomInfoType.DetectionRule.LikelihoodAdjustment + * @instance + */ + LikelihoodAdjustment.prototype.fixedLikelihood = 0; + + /** + * LikelihoodAdjustment relativeLikelihood. + * @member {number} relativeLikelihood + * @memberof google.privacy.dlp.v2.CustomInfoType.DetectionRule.LikelihoodAdjustment + * @instance + */ + LikelihoodAdjustment.prototype.relativeLikelihood = 0; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * LikelihoodAdjustment adjustment. + * @member {"fixedLikelihood"|"relativeLikelihood"|undefined} adjustment + * @memberof google.privacy.dlp.v2.CustomInfoType.DetectionRule.LikelihoodAdjustment + * @instance + */ + Object.defineProperty(LikelihoodAdjustment.prototype, "adjustment", { + get: $util.oneOfGetter($oneOfFields = ["fixedLikelihood", "relativeLikelihood"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new LikelihoodAdjustment instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.CustomInfoType.DetectionRule.LikelihoodAdjustment + * @static + * @param {google.privacy.dlp.v2.CustomInfoType.DetectionRule.ILikelihoodAdjustment=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.CustomInfoType.DetectionRule.LikelihoodAdjustment} LikelihoodAdjustment instance + */ + LikelihoodAdjustment.create = function create(properties) { + return new LikelihoodAdjustment(properties); + }; + + /** + * Encodes the specified LikelihoodAdjustment message. Does not implicitly {@link google.privacy.dlp.v2.CustomInfoType.DetectionRule.LikelihoodAdjustment.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.CustomInfoType.DetectionRule.LikelihoodAdjustment + * @static + * @param {google.privacy.dlp.v2.CustomInfoType.DetectionRule.ILikelihoodAdjustment} message LikelihoodAdjustment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LikelihoodAdjustment.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fixedLikelihood != null && Object.hasOwnProperty.call(message, "fixedLikelihood")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.fixedLikelihood); + if (message.relativeLikelihood != null && Object.hasOwnProperty.call(message, "relativeLikelihood")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.relativeLikelihood); + return writer; + }; + + /** + * Encodes the specified LikelihoodAdjustment message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.CustomInfoType.DetectionRule.LikelihoodAdjustment.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.CustomInfoType.DetectionRule.LikelihoodAdjustment + * @static + * @param {google.privacy.dlp.v2.CustomInfoType.DetectionRule.ILikelihoodAdjustment} message LikelihoodAdjustment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LikelihoodAdjustment.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LikelihoodAdjustment message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.CustomInfoType.DetectionRule.LikelihoodAdjustment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.CustomInfoType.DetectionRule.LikelihoodAdjustment} LikelihoodAdjustment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LikelihoodAdjustment.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.privacy.dlp.v2.CustomInfoType.DetectionRule.LikelihoodAdjustment(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.fixedLikelihood = reader.int32(); + break; + case 2: + message.relativeLikelihood = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LikelihoodAdjustment message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.CustomInfoType.DetectionRule.LikelihoodAdjustment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.CustomInfoType.DetectionRule.LikelihoodAdjustment} LikelihoodAdjustment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LikelihoodAdjustment.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LikelihoodAdjustment message. + * @function verify + * @memberof google.privacy.dlp.v2.CustomInfoType.DetectionRule.LikelihoodAdjustment + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LikelihoodAdjustment.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.fixedLikelihood != null && message.hasOwnProperty("fixedLikelihood")) { + properties.adjustment = 1; + switch (message.fixedLikelihood) { + default: + return "fixedLikelihood: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + } + if (message.relativeLikelihood != null && message.hasOwnProperty("relativeLikelihood")) { + if (properties.adjustment === 1) + return "adjustment: multiple values"; + properties.adjustment = 1; + if (!$util.isInteger(message.relativeLikelihood)) + return "relativeLikelihood: integer expected"; + } + return null; + }; + + /** + * Creates a LikelihoodAdjustment message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.CustomInfoType.DetectionRule.LikelihoodAdjustment + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.CustomInfoType.DetectionRule.LikelihoodAdjustment} LikelihoodAdjustment + */ + LikelihoodAdjustment.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.CustomInfoType.DetectionRule.LikelihoodAdjustment) + return object; + var message = new $root.google.privacy.dlp.v2.CustomInfoType.DetectionRule.LikelihoodAdjustment(); + switch (object.fixedLikelihood) { + case "LIKELIHOOD_UNSPECIFIED": + case 0: + message.fixedLikelihood = 0; + break; + case "VERY_UNLIKELY": + case 1: + message.fixedLikelihood = 1; + break; + case "UNLIKELY": + case 2: + message.fixedLikelihood = 2; + break; + case "POSSIBLE": + case 3: + message.fixedLikelihood = 3; + break; + case "LIKELY": + case 4: + message.fixedLikelihood = 4; + break; + case "VERY_LIKELY": + case 5: + message.fixedLikelihood = 5; + break; + } + if (object.relativeLikelihood != null) + message.relativeLikelihood = object.relativeLikelihood | 0; + return message; + }; + + /** + * Creates a plain object from a LikelihoodAdjustment message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.CustomInfoType.DetectionRule.LikelihoodAdjustment + * @static + * @param {google.privacy.dlp.v2.CustomInfoType.DetectionRule.LikelihoodAdjustment} message LikelihoodAdjustment + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LikelihoodAdjustment.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.fixedLikelihood != null && message.hasOwnProperty("fixedLikelihood")) { + object.fixedLikelihood = options.enums === String ? $root.google.privacy.dlp.v2.Likelihood[message.fixedLikelihood] : message.fixedLikelihood; + if (options.oneofs) + object.adjustment = "fixedLikelihood"; + } + if (message.relativeLikelihood != null && message.hasOwnProperty("relativeLikelihood")) { + object.relativeLikelihood = message.relativeLikelihood; + if (options.oneofs) + object.adjustment = "relativeLikelihood"; + } + return object; + }; + + /** + * Converts this LikelihoodAdjustment to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.CustomInfoType.DetectionRule.LikelihoodAdjustment + * @instance + * @returns {Object.} JSON object + */ + LikelihoodAdjustment.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return LikelihoodAdjustment; + })(); + + DetectionRule.HotwordRule = (function() { + + /** + * Properties of a HotwordRule. + * @memberof google.privacy.dlp.v2.CustomInfoType.DetectionRule + * @interface IHotwordRule + * @property {google.privacy.dlp.v2.CustomInfoType.IRegex|null} [hotwordRegex] HotwordRule hotwordRegex + * @property {google.privacy.dlp.v2.CustomInfoType.DetectionRule.IProximity|null} [proximity] HotwordRule proximity + * @property {google.privacy.dlp.v2.CustomInfoType.DetectionRule.ILikelihoodAdjustment|null} [likelihoodAdjustment] HotwordRule likelihoodAdjustment + */ + + /** + * Constructs a new HotwordRule. + * @memberof google.privacy.dlp.v2.CustomInfoType.DetectionRule + * @classdesc Represents a HotwordRule. + * @implements IHotwordRule + * @constructor + * @param {google.privacy.dlp.v2.CustomInfoType.DetectionRule.IHotwordRule=} [properties] Properties to set + */ + function HotwordRule(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HotwordRule hotwordRegex. + * @member {google.privacy.dlp.v2.CustomInfoType.IRegex|null|undefined} hotwordRegex + * @memberof google.privacy.dlp.v2.CustomInfoType.DetectionRule.HotwordRule + * @instance + */ + HotwordRule.prototype.hotwordRegex = null; + + /** + * HotwordRule proximity. + * @member {google.privacy.dlp.v2.CustomInfoType.DetectionRule.IProximity|null|undefined} proximity + * @memberof google.privacy.dlp.v2.CustomInfoType.DetectionRule.HotwordRule + * @instance + */ + HotwordRule.prototype.proximity = null; + + /** + * HotwordRule likelihoodAdjustment. + * @member {google.privacy.dlp.v2.CustomInfoType.DetectionRule.ILikelihoodAdjustment|null|undefined} likelihoodAdjustment + * @memberof google.privacy.dlp.v2.CustomInfoType.DetectionRule.HotwordRule + * @instance + */ + HotwordRule.prototype.likelihoodAdjustment = null; + + /** + * Creates a new HotwordRule instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.CustomInfoType.DetectionRule.HotwordRule + * @static + * @param {google.privacy.dlp.v2.CustomInfoType.DetectionRule.IHotwordRule=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.CustomInfoType.DetectionRule.HotwordRule} HotwordRule instance + */ + HotwordRule.create = function create(properties) { + return new HotwordRule(properties); + }; + + /** + * Encodes the specified HotwordRule message. Does not implicitly {@link google.privacy.dlp.v2.CustomInfoType.DetectionRule.HotwordRule.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.CustomInfoType.DetectionRule.HotwordRule + * @static + * @param {google.privacy.dlp.v2.CustomInfoType.DetectionRule.IHotwordRule} message HotwordRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HotwordRule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.hotwordRegex != null && Object.hasOwnProperty.call(message, "hotwordRegex")) + $root.google.privacy.dlp.v2.CustomInfoType.Regex.encode(message.hotwordRegex, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.proximity != null && Object.hasOwnProperty.call(message, "proximity")) + $root.google.privacy.dlp.v2.CustomInfoType.DetectionRule.Proximity.encode(message.proximity, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.likelihoodAdjustment != null && Object.hasOwnProperty.call(message, "likelihoodAdjustment")) + $root.google.privacy.dlp.v2.CustomInfoType.DetectionRule.LikelihoodAdjustment.encode(message.likelihoodAdjustment, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified HotwordRule message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.CustomInfoType.DetectionRule.HotwordRule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.CustomInfoType.DetectionRule.HotwordRule + * @static + * @param {google.privacy.dlp.v2.CustomInfoType.DetectionRule.IHotwordRule} message HotwordRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HotwordRule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HotwordRule message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.CustomInfoType.DetectionRule.HotwordRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.CustomInfoType.DetectionRule.HotwordRule} HotwordRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HotwordRule.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.privacy.dlp.v2.CustomInfoType.DetectionRule.HotwordRule(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.hotwordRegex = $root.google.privacy.dlp.v2.CustomInfoType.Regex.decode(reader, reader.uint32()); + break; + case 2: + message.proximity = $root.google.privacy.dlp.v2.CustomInfoType.DetectionRule.Proximity.decode(reader, reader.uint32()); + break; + case 3: + message.likelihoodAdjustment = $root.google.privacy.dlp.v2.CustomInfoType.DetectionRule.LikelihoodAdjustment.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HotwordRule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.CustomInfoType.DetectionRule.HotwordRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.CustomInfoType.DetectionRule.HotwordRule} HotwordRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HotwordRule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HotwordRule message. + * @function verify + * @memberof google.privacy.dlp.v2.CustomInfoType.DetectionRule.HotwordRule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HotwordRule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.hotwordRegex != null && message.hasOwnProperty("hotwordRegex")) { + var error = $root.google.privacy.dlp.v2.CustomInfoType.Regex.verify(message.hotwordRegex); + if (error) + return "hotwordRegex." + error; + } + if (message.proximity != null && message.hasOwnProperty("proximity")) { + var error = $root.google.privacy.dlp.v2.CustomInfoType.DetectionRule.Proximity.verify(message.proximity); + if (error) + return "proximity." + error; + } + if (message.likelihoodAdjustment != null && message.hasOwnProperty("likelihoodAdjustment")) { + var error = $root.google.privacy.dlp.v2.CustomInfoType.DetectionRule.LikelihoodAdjustment.verify(message.likelihoodAdjustment); + if (error) + return "likelihoodAdjustment." + error; + } + return null; + }; + + /** + * Creates a HotwordRule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.CustomInfoType.DetectionRule.HotwordRule + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.CustomInfoType.DetectionRule.HotwordRule} HotwordRule + */ + HotwordRule.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.CustomInfoType.DetectionRule.HotwordRule) + return object; + var message = new $root.google.privacy.dlp.v2.CustomInfoType.DetectionRule.HotwordRule(); + if (object.hotwordRegex != null) { + if (typeof object.hotwordRegex !== "object") + throw TypeError(".google.privacy.dlp.v2.CustomInfoType.DetectionRule.HotwordRule.hotwordRegex: object expected"); + message.hotwordRegex = $root.google.privacy.dlp.v2.CustomInfoType.Regex.fromObject(object.hotwordRegex); + } + if (object.proximity != null) { + if (typeof object.proximity !== "object") + throw TypeError(".google.privacy.dlp.v2.CustomInfoType.DetectionRule.HotwordRule.proximity: object expected"); + message.proximity = $root.google.privacy.dlp.v2.CustomInfoType.DetectionRule.Proximity.fromObject(object.proximity); + } + if (object.likelihoodAdjustment != null) { + if (typeof object.likelihoodAdjustment !== "object") + throw TypeError(".google.privacy.dlp.v2.CustomInfoType.DetectionRule.HotwordRule.likelihoodAdjustment: object expected"); + message.likelihoodAdjustment = $root.google.privacy.dlp.v2.CustomInfoType.DetectionRule.LikelihoodAdjustment.fromObject(object.likelihoodAdjustment); + } + return message; + }; + + /** + * Creates a plain object from a HotwordRule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.CustomInfoType.DetectionRule.HotwordRule + * @static + * @param {google.privacy.dlp.v2.CustomInfoType.DetectionRule.HotwordRule} message HotwordRule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HotwordRule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.hotwordRegex = null; + object.proximity = null; + object.likelihoodAdjustment = null; + } + if (message.hotwordRegex != null && message.hasOwnProperty("hotwordRegex")) + object.hotwordRegex = $root.google.privacy.dlp.v2.CustomInfoType.Regex.toObject(message.hotwordRegex, options); + if (message.proximity != null && message.hasOwnProperty("proximity")) + object.proximity = $root.google.privacy.dlp.v2.CustomInfoType.DetectionRule.Proximity.toObject(message.proximity, options); + if (message.likelihoodAdjustment != null && message.hasOwnProperty("likelihoodAdjustment")) + object.likelihoodAdjustment = $root.google.privacy.dlp.v2.CustomInfoType.DetectionRule.LikelihoodAdjustment.toObject(message.likelihoodAdjustment, options); + return object; + }; + + /** + * Converts this HotwordRule to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.CustomInfoType.DetectionRule.HotwordRule + * @instance + * @returns {Object.} JSON object + */ + HotwordRule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return HotwordRule; + })(); + + return DetectionRule; + })(); + + /** + * ExclusionType enum. + * @name google.privacy.dlp.v2.CustomInfoType.ExclusionType + * @enum {number} + * @property {number} EXCLUSION_TYPE_UNSPECIFIED=0 EXCLUSION_TYPE_UNSPECIFIED value + * @property {number} EXCLUSION_TYPE_EXCLUDE=1 EXCLUSION_TYPE_EXCLUDE value + */ + CustomInfoType.ExclusionType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "EXCLUSION_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "EXCLUSION_TYPE_EXCLUDE"] = 1; + return values; + })(); + + return CustomInfoType; + })(); + + v2.FieldId = (function() { + + /** + * Properties of a FieldId. + * @memberof google.privacy.dlp.v2 + * @interface IFieldId + * @property {string|null} [name] FieldId name + */ + + /** + * Constructs a new FieldId. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents a FieldId. + * @implements IFieldId + * @constructor + * @param {google.privacy.dlp.v2.IFieldId=} [properties] Properties to set + */ + function FieldId(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldId name. + * @member {string} name + * @memberof google.privacy.dlp.v2.FieldId + * @instance + */ + FieldId.prototype.name = ""; + + /** + * Creates a new FieldId instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.FieldId + * @static + * @param {google.privacy.dlp.v2.IFieldId=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.FieldId} FieldId instance + */ + FieldId.create = function create(properties) { + return new FieldId(properties); + }; + + /** + * Encodes the specified FieldId message. Does not implicitly {@link google.privacy.dlp.v2.FieldId.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.FieldId + * @static + * @param {google.privacy.dlp.v2.IFieldId} message FieldId message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldId.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified FieldId message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.FieldId.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.FieldId + * @static + * @param {google.privacy.dlp.v2.IFieldId} message FieldId message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldId.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldId message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.FieldId + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.FieldId} FieldId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldId.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.privacy.dlp.v2.FieldId(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldId message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.FieldId + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.FieldId} FieldId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldId.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldId message. + * @function verify + * @memberof google.privacy.dlp.v2.FieldId + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldId.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a FieldId message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.FieldId + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.FieldId} FieldId + */ + FieldId.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.FieldId) + return object; + var message = new $root.google.privacy.dlp.v2.FieldId(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a FieldId message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.FieldId + * @static + * @param {google.privacy.dlp.v2.FieldId} message FieldId + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldId.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this FieldId to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.FieldId + * @instance + * @returns {Object.} JSON object + */ + FieldId.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return FieldId; + })(); + + v2.PartitionId = (function() { + + /** + * Properties of a PartitionId. + * @memberof google.privacy.dlp.v2 + * @interface IPartitionId + * @property {string|null} [projectId] PartitionId projectId + * @property {string|null} [namespaceId] PartitionId namespaceId + */ + + /** + * Constructs a new PartitionId. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents a PartitionId. + * @implements IPartitionId + * @constructor + * @param {google.privacy.dlp.v2.IPartitionId=} [properties] Properties to set + */ + function PartitionId(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PartitionId projectId. + * @member {string} projectId + * @memberof google.privacy.dlp.v2.PartitionId + * @instance + */ + PartitionId.prototype.projectId = ""; + + /** + * PartitionId namespaceId. + * @member {string} namespaceId + * @memberof google.privacy.dlp.v2.PartitionId + * @instance + */ + PartitionId.prototype.namespaceId = ""; + + /** + * Creates a new PartitionId instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.PartitionId + * @static + * @param {google.privacy.dlp.v2.IPartitionId=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.PartitionId} PartitionId instance + */ + PartitionId.create = function create(properties) { + return new PartitionId(properties); + }; + + /** + * Encodes the specified PartitionId message. Does not implicitly {@link google.privacy.dlp.v2.PartitionId.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.PartitionId + * @static + * @param {google.privacy.dlp.v2.IPartitionId} message PartitionId message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PartitionId.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.projectId); + if (message.namespaceId != null && Object.hasOwnProperty.call(message, "namespaceId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.namespaceId); + return writer; + }; + + /** + * Encodes the specified PartitionId message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.PartitionId.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.PartitionId + * @static + * @param {google.privacy.dlp.v2.IPartitionId} message PartitionId message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PartitionId.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PartitionId message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.PartitionId + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.PartitionId} PartitionId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PartitionId.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.privacy.dlp.v2.PartitionId(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + message.projectId = reader.string(); + break; + case 4: + message.namespaceId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PartitionId message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.PartitionId + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.PartitionId} PartitionId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PartitionId.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PartitionId message. + * @function verify + * @memberof google.privacy.dlp.v2.PartitionId + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PartitionId.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.projectId != null && message.hasOwnProperty("projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + if (message.namespaceId != null && message.hasOwnProperty("namespaceId")) + if (!$util.isString(message.namespaceId)) + return "namespaceId: string expected"; + return null; + }; + + /** + * Creates a PartitionId message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.PartitionId + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.PartitionId} PartitionId + */ + PartitionId.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.PartitionId) + return object; + var message = new $root.google.privacy.dlp.v2.PartitionId(); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.namespaceId != null) + message.namespaceId = String(object.namespaceId); + return message; + }; + + /** + * Creates a plain object from a PartitionId message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.PartitionId + * @static + * @param {google.privacy.dlp.v2.PartitionId} message PartitionId + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PartitionId.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.projectId = ""; + object.namespaceId = ""; + } + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + if (message.namespaceId != null && message.hasOwnProperty("namespaceId")) + object.namespaceId = message.namespaceId; + return object; + }; + + /** + * Converts this PartitionId to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.PartitionId + * @instance + * @returns {Object.} JSON object + */ + PartitionId.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return PartitionId; + })(); + + v2.KindExpression = (function() { + + /** + * Properties of a KindExpression. + * @memberof google.privacy.dlp.v2 + * @interface IKindExpression + * @property {string|null} [name] KindExpression name + */ + + /** + * Constructs a new KindExpression. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents a KindExpression. + * @implements IKindExpression + * @constructor + * @param {google.privacy.dlp.v2.IKindExpression=} [properties] Properties to set + */ + function KindExpression(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * KindExpression name. + * @member {string} name + * @memberof google.privacy.dlp.v2.KindExpression + * @instance + */ + KindExpression.prototype.name = ""; + + /** + * Creates a new KindExpression instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.KindExpression + * @static + * @param {google.privacy.dlp.v2.IKindExpression=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.KindExpression} KindExpression instance + */ + KindExpression.create = function create(properties) { + return new KindExpression(properties); + }; + + /** + * Encodes the specified KindExpression message. Does not implicitly {@link google.privacy.dlp.v2.KindExpression.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.KindExpression + * @static + * @param {google.privacy.dlp.v2.IKindExpression} message KindExpression message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KindExpression.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified KindExpression message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.KindExpression.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.KindExpression + * @static + * @param {google.privacy.dlp.v2.IKindExpression} message KindExpression message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KindExpression.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a KindExpression message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.KindExpression + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.KindExpression} KindExpression + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KindExpression.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.privacy.dlp.v2.KindExpression(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a KindExpression message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.KindExpression + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.KindExpression} KindExpression + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KindExpression.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a KindExpression message. + * @function verify + * @memberof google.privacy.dlp.v2.KindExpression + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + KindExpression.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a KindExpression message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.KindExpression + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.KindExpression} KindExpression + */ + KindExpression.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.KindExpression) + return object; + var message = new $root.google.privacy.dlp.v2.KindExpression(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a KindExpression message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.KindExpression + * @static + * @param {google.privacy.dlp.v2.KindExpression} message KindExpression + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + KindExpression.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this KindExpression to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.KindExpression + * @instance + * @returns {Object.} JSON object + */ + KindExpression.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return KindExpression; + })(); + + v2.DatastoreOptions = (function() { + + /** + * Properties of a DatastoreOptions. + * @memberof google.privacy.dlp.v2 + * @interface IDatastoreOptions + * @property {google.privacy.dlp.v2.IPartitionId|null} [partitionId] DatastoreOptions partitionId + * @property {google.privacy.dlp.v2.IKindExpression|null} [kind] DatastoreOptions kind + */ + + /** + * Constructs a new DatastoreOptions. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents a DatastoreOptions. + * @implements IDatastoreOptions + * @constructor + * @param {google.privacy.dlp.v2.IDatastoreOptions=} [properties] Properties to set + */ + function DatastoreOptions(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DatastoreOptions partitionId. + * @member {google.privacy.dlp.v2.IPartitionId|null|undefined} partitionId + * @memberof google.privacy.dlp.v2.DatastoreOptions + * @instance + */ + DatastoreOptions.prototype.partitionId = null; + + /** + * DatastoreOptions kind. + * @member {google.privacy.dlp.v2.IKindExpression|null|undefined} kind + * @memberof google.privacy.dlp.v2.DatastoreOptions + * @instance + */ + DatastoreOptions.prototype.kind = null; + + /** + * Creates a new DatastoreOptions instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.DatastoreOptions + * @static + * @param {google.privacy.dlp.v2.IDatastoreOptions=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.DatastoreOptions} DatastoreOptions instance + */ + DatastoreOptions.create = function create(properties) { + return new DatastoreOptions(properties); + }; + + /** + * Encodes the specified DatastoreOptions message. Does not implicitly {@link google.privacy.dlp.v2.DatastoreOptions.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.DatastoreOptions + * @static + * @param {google.privacy.dlp.v2.IDatastoreOptions} message DatastoreOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DatastoreOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.partitionId != null && Object.hasOwnProperty.call(message, "partitionId")) + $root.google.privacy.dlp.v2.PartitionId.encode(message.partitionId, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + $root.google.privacy.dlp.v2.KindExpression.encode(message.kind, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DatastoreOptions message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.DatastoreOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.DatastoreOptions + * @static + * @param {google.privacy.dlp.v2.IDatastoreOptions} message DatastoreOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DatastoreOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DatastoreOptions message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.DatastoreOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.DatastoreOptions} DatastoreOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DatastoreOptions.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.privacy.dlp.v2.DatastoreOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.partitionId = $root.google.privacy.dlp.v2.PartitionId.decode(reader, reader.uint32()); + break; + case 2: + message.kind = $root.google.privacy.dlp.v2.KindExpression.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DatastoreOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.DatastoreOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.DatastoreOptions} DatastoreOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DatastoreOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DatastoreOptions message. + * @function verify + * @memberof google.privacy.dlp.v2.DatastoreOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DatastoreOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.partitionId != null && message.hasOwnProperty("partitionId")) { + var error = $root.google.privacy.dlp.v2.PartitionId.verify(message.partitionId); + if (error) + return "partitionId." + error; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + var error = $root.google.privacy.dlp.v2.KindExpression.verify(message.kind); + if (error) + return "kind." + error; + } + return null; + }; + + /** + * Creates a DatastoreOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.DatastoreOptions + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.DatastoreOptions} DatastoreOptions + */ + DatastoreOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.DatastoreOptions) + return object; + var message = new $root.google.privacy.dlp.v2.DatastoreOptions(); + if (object.partitionId != null) { + if (typeof object.partitionId !== "object") + throw TypeError(".google.privacy.dlp.v2.DatastoreOptions.partitionId: object expected"); + message.partitionId = $root.google.privacy.dlp.v2.PartitionId.fromObject(object.partitionId); + } + if (object.kind != null) { + if (typeof object.kind !== "object") + throw TypeError(".google.privacy.dlp.v2.DatastoreOptions.kind: object expected"); + message.kind = $root.google.privacy.dlp.v2.KindExpression.fromObject(object.kind); + } + return message; + }; + + /** + * Creates a plain object from a DatastoreOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.DatastoreOptions + * @static + * @param {google.privacy.dlp.v2.DatastoreOptions} message DatastoreOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DatastoreOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.partitionId = null; + object.kind = null; + } + if (message.partitionId != null && message.hasOwnProperty("partitionId")) + object.partitionId = $root.google.privacy.dlp.v2.PartitionId.toObject(message.partitionId, options); + if (message.kind != null && message.hasOwnProperty("kind")) + object.kind = $root.google.privacy.dlp.v2.KindExpression.toObject(message.kind, options); + return object; + }; + + /** + * Converts this DatastoreOptions to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.DatastoreOptions + * @instance + * @returns {Object.} JSON object + */ + DatastoreOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DatastoreOptions; + })(); + + v2.CloudStorageRegexFileSet = (function() { + + /** + * Properties of a CloudStorageRegexFileSet. + * @memberof google.privacy.dlp.v2 + * @interface ICloudStorageRegexFileSet + * @property {string|null} [bucketName] CloudStorageRegexFileSet bucketName + * @property {Array.|null} [includeRegex] CloudStorageRegexFileSet includeRegex + * @property {Array.|null} [excludeRegex] CloudStorageRegexFileSet excludeRegex + */ + + /** + * Constructs a new CloudStorageRegexFileSet. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents a CloudStorageRegexFileSet. + * @implements ICloudStorageRegexFileSet + * @constructor + * @param {google.privacy.dlp.v2.ICloudStorageRegexFileSet=} [properties] Properties to set + */ + function CloudStorageRegexFileSet(properties) { + this.includeRegex = []; + this.excludeRegex = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CloudStorageRegexFileSet bucketName. + * @member {string} bucketName + * @memberof google.privacy.dlp.v2.CloudStorageRegexFileSet + * @instance + */ + CloudStorageRegexFileSet.prototype.bucketName = ""; + + /** + * CloudStorageRegexFileSet includeRegex. + * @member {Array.} includeRegex + * @memberof google.privacy.dlp.v2.CloudStorageRegexFileSet + * @instance + */ + CloudStorageRegexFileSet.prototype.includeRegex = $util.emptyArray; + + /** + * CloudStorageRegexFileSet excludeRegex. + * @member {Array.} excludeRegex + * @memberof google.privacy.dlp.v2.CloudStorageRegexFileSet + * @instance + */ + CloudStorageRegexFileSet.prototype.excludeRegex = $util.emptyArray; + + /** + * Creates a new CloudStorageRegexFileSet instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.CloudStorageRegexFileSet + * @static + * @param {google.privacy.dlp.v2.ICloudStorageRegexFileSet=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.CloudStorageRegexFileSet} CloudStorageRegexFileSet instance + */ + CloudStorageRegexFileSet.create = function create(properties) { + return new CloudStorageRegexFileSet(properties); + }; + + /** + * Encodes the specified CloudStorageRegexFileSet message. Does not implicitly {@link google.privacy.dlp.v2.CloudStorageRegexFileSet.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.CloudStorageRegexFileSet + * @static + * @param {google.privacy.dlp.v2.ICloudStorageRegexFileSet} message CloudStorageRegexFileSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloudStorageRegexFileSet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.bucketName != null && Object.hasOwnProperty.call(message, "bucketName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.bucketName); + if (message.includeRegex != null && message.includeRegex.length) + for (var i = 0; i < message.includeRegex.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.includeRegex[i]); + if (message.excludeRegex != null && message.excludeRegex.length) + for (var i = 0; i < message.excludeRegex.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.excludeRegex[i]); + return writer; + }; + + /** + * Encodes the specified CloudStorageRegexFileSet message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.CloudStorageRegexFileSet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.CloudStorageRegexFileSet + * @static + * @param {google.privacy.dlp.v2.ICloudStorageRegexFileSet} message CloudStorageRegexFileSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloudStorageRegexFileSet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CloudStorageRegexFileSet message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.CloudStorageRegexFileSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.CloudStorageRegexFileSet} CloudStorageRegexFileSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloudStorageRegexFileSet.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.privacy.dlp.v2.CloudStorageRegexFileSet(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.bucketName = reader.string(); + break; + case 2: + if (!(message.includeRegex && message.includeRegex.length)) + message.includeRegex = []; + message.includeRegex.push(reader.string()); + break; + case 3: + if (!(message.excludeRegex && message.excludeRegex.length)) + message.excludeRegex = []; + message.excludeRegex.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CloudStorageRegexFileSet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.CloudStorageRegexFileSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.CloudStorageRegexFileSet} CloudStorageRegexFileSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloudStorageRegexFileSet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CloudStorageRegexFileSet message. + * @function verify + * @memberof google.privacy.dlp.v2.CloudStorageRegexFileSet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CloudStorageRegexFileSet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.bucketName != null && message.hasOwnProperty("bucketName")) + if (!$util.isString(message.bucketName)) + return "bucketName: string expected"; + if (message.includeRegex != null && message.hasOwnProperty("includeRegex")) { + if (!Array.isArray(message.includeRegex)) + return "includeRegex: array expected"; + for (var i = 0; i < message.includeRegex.length; ++i) + if (!$util.isString(message.includeRegex[i])) + return "includeRegex: string[] expected"; + } + if (message.excludeRegex != null && message.hasOwnProperty("excludeRegex")) { + if (!Array.isArray(message.excludeRegex)) + return "excludeRegex: array expected"; + for (var i = 0; i < message.excludeRegex.length; ++i) + if (!$util.isString(message.excludeRegex[i])) + return "excludeRegex: string[] expected"; + } + return null; + }; + + /** + * Creates a CloudStorageRegexFileSet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.CloudStorageRegexFileSet + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.CloudStorageRegexFileSet} CloudStorageRegexFileSet + */ + CloudStorageRegexFileSet.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.CloudStorageRegexFileSet) + return object; + var message = new $root.google.privacy.dlp.v2.CloudStorageRegexFileSet(); + if (object.bucketName != null) + message.bucketName = String(object.bucketName); + if (object.includeRegex) { + if (!Array.isArray(object.includeRegex)) + throw TypeError(".google.privacy.dlp.v2.CloudStorageRegexFileSet.includeRegex: array expected"); + message.includeRegex = []; + for (var i = 0; i < object.includeRegex.length; ++i) + message.includeRegex[i] = String(object.includeRegex[i]); + } + if (object.excludeRegex) { + if (!Array.isArray(object.excludeRegex)) + throw TypeError(".google.privacy.dlp.v2.CloudStorageRegexFileSet.excludeRegex: array expected"); + message.excludeRegex = []; + for (var i = 0; i < object.excludeRegex.length; ++i) + message.excludeRegex[i] = String(object.excludeRegex[i]); + } + return message; + }; + + /** + * Creates a plain object from a CloudStorageRegexFileSet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.CloudStorageRegexFileSet + * @static + * @param {google.privacy.dlp.v2.CloudStorageRegexFileSet} message CloudStorageRegexFileSet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CloudStorageRegexFileSet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.includeRegex = []; + object.excludeRegex = []; + } + if (options.defaults) + object.bucketName = ""; + if (message.bucketName != null && message.hasOwnProperty("bucketName")) + object.bucketName = message.bucketName; + if (message.includeRegex && message.includeRegex.length) { + object.includeRegex = []; + for (var j = 0; j < message.includeRegex.length; ++j) + object.includeRegex[j] = message.includeRegex[j]; + } + if (message.excludeRegex && message.excludeRegex.length) { + object.excludeRegex = []; + for (var j = 0; j < message.excludeRegex.length; ++j) + object.excludeRegex[j] = message.excludeRegex[j]; + } + return object; + }; + + /** + * Converts this CloudStorageRegexFileSet to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.CloudStorageRegexFileSet + * @instance + * @returns {Object.} JSON object + */ + CloudStorageRegexFileSet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CloudStorageRegexFileSet; + })(); + + v2.CloudStorageOptions = (function() { + + /** + * Properties of a CloudStorageOptions. + * @memberof google.privacy.dlp.v2 + * @interface ICloudStorageOptions + * @property {google.privacy.dlp.v2.CloudStorageOptions.IFileSet|null} [fileSet] CloudStorageOptions fileSet + * @property {number|Long|null} [bytesLimitPerFile] CloudStorageOptions bytesLimitPerFile + * @property {number|null} [bytesLimitPerFilePercent] CloudStorageOptions bytesLimitPerFilePercent + * @property {Array.|null} [fileTypes] CloudStorageOptions fileTypes + * @property {google.privacy.dlp.v2.CloudStorageOptions.SampleMethod|null} [sampleMethod] CloudStorageOptions sampleMethod + * @property {number|null} [filesLimitPercent] CloudStorageOptions filesLimitPercent + */ + + /** + * Constructs a new CloudStorageOptions. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents a CloudStorageOptions. + * @implements ICloudStorageOptions + * @constructor + * @param {google.privacy.dlp.v2.ICloudStorageOptions=} [properties] Properties to set + */ + function CloudStorageOptions(properties) { + this.fileTypes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CloudStorageOptions fileSet. + * @member {google.privacy.dlp.v2.CloudStorageOptions.IFileSet|null|undefined} fileSet + * @memberof google.privacy.dlp.v2.CloudStorageOptions + * @instance + */ + CloudStorageOptions.prototype.fileSet = null; + + /** + * CloudStorageOptions bytesLimitPerFile. + * @member {number|Long} bytesLimitPerFile + * @memberof google.privacy.dlp.v2.CloudStorageOptions + * @instance + */ + CloudStorageOptions.prototype.bytesLimitPerFile = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * CloudStorageOptions bytesLimitPerFilePercent. + * @member {number} bytesLimitPerFilePercent + * @memberof google.privacy.dlp.v2.CloudStorageOptions + * @instance + */ + CloudStorageOptions.prototype.bytesLimitPerFilePercent = 0; + + /** + * CloudStorageOptions fileTypes. + * @member {Array.} fileTypes + * @memberof google.privacy.dlp.v2.CloudStorageOptions + * @instance + */ + CloudStorageOptions.prototype.fileTypes = $util.emptyArray; + + /** + * CloudStorageOptions sampleMethod. + * @member {google.privacy.dlp.v2.CloudStorageOptions.SampleMethod} sampleMethod + * @memberof google.privacy.dlp.v2.CloudStorageOptions + * @instance + */ + CloudStorageOptions.prototype.sampleMethod = 0; + + /** + * CloudStorageOptions filesLimitPercent. + * @member {number} filesLimitPercent + * @memberof google.privacy.dlp.v2.CloudStorageOptions + * @instance + */ + CloudStorageOptions.prototype.filesLimitPercent = 0; + + /** + * Creates a new CloudStorageOptions instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.CloudStorageOptions + * @static + * @param {google.privacy.dlp.v2.ICloudStorageOptions=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.CloudStorageOptions} CloudStorageOptions instance + */ + CloudStorageOptions.create = function create(properties) { + return new CloudStorageOptions(properties); + }; + + /** + * Encodes the specified CloudStorageOptions message. Does not implicitly {@link google.privacy.dlp.v2.CloudStorageOptions.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.CloudStorageOptions + * @static + * @param {google.privacy.dlp.v2.ICloudStorageOptions} message CloudStorageOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloudStorageOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fileSet != null && Object.hasOwnProperty.call(message, "fileSet")) + $root.google.privacy.dlp.v2.CloudStorageOptions.FileSet.encode(message.fileSet, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.bytesLimitPerFile != null && Object.hasOwnProperty.call(message, "bytesLimitPerFile")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.bytesLimitPerFile); + if (message.fileTypes != null && message.fileTypes.length) { + writer.uint32(/* id 5, wireType 2 =*/42).fork(); + for (var i = 0; i < message.fileTypes.length; ++i) + writer.int32(message.fileTypes[i]); + writer.ldelim(); + } + if (message.sampleMethod != null && Object.hasOwnProperty.call(message, "sampleMethod")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.sampleMethod); + if (message.filesLimitPercent != null && Object.hasOwnProperty.call(message, "filesLimitPercent")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.filesLimitPercent); + if (message.bytesLimitPerFilePercent != null && Object.hasOwnProperty.call(message, "bytesLimitPerFilePercent")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.bytesLimitPerFilePercent); + return writer; + }; + + /** + * Encodes the specified CloudStorageOptions message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.CloudStorageOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.CloudStorageOptions + * @static + * @param {google.privacy.dlp.v2.ICloudStorageOptions} message CloudStorageOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloudStorageOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CloudStorageOptions message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.CloudStorageOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.CloudStorageOptions} CloudStorageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloudStorageOptions.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.privacy.dlp.v2.CloudStorageOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.fileSet = $root.google.privacy.dlp.v2.CloudStorageOptions.FileSet.decode(reader, reader.uint32()); + break; + case 4: + message.bytesLimitPerFile = reader.int64(); + break; + case 8: + message.bytesLimitPerFilePercent = reader.int32(); + break; + case 5: + if (!(message.fileTypes && message.fileTypes.length)) + message.fileTypes = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.fileTypes.push(reader.int32()); + } else + message.fileTypes.push(reader.int32()); + break; + case 6: + message.sampleMethod = reader.int32(); + break; + case 7: + message.filesLimitPercent = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CloudStorageOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.CloudStorageOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.CloudStorageOptions} CloudStorageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloudStorageOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CloudStorageOptions message. + * @function verify + * @memberof google.privacy.dlp.v2.CloudStorageOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CloudStorageOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.fileSet != null && message.hasOwnProperty("fileSet")) { + var error = $root.google.privacy.dlp.v2.CloudStorageOptions.FileSet.verify(message.fileSet); + if (error) + return "fileSet." + error; + } + if (message.bytesLimitPerFile != null && message.hasOwnProperty("bytesLimitPerFile")) + if (!$util.isInteger(message.bytesLimitPerFile) && !(message.bytesLimitPerFile && $util.isInteger(message.bytesLimitPerFile.low) && $util.isInteger(message.bytesLimitPerFile.high))) + return "bytesLimitPerFile: integer|Long expected"; + if (message.bytesLimitPerFilePercent != null && message.hasOwnProperty("bytesLimitPerFilePercent")) + if (!$util.isInteger(message.bytesLimitPerFilePercent)) + return "bytesLimitPerFilePercent: integer expected"; + if (message.fileTypes != null && message.hasOwnProperty("fileTypes")) { + if (!Array.isArray(message.fileTypes)) + return "fileTypes: array expected"; + for (var i = 0; i < message.fileTypes.length; ++i) + switch (message.fileTypes[i]) { + default: + return "fileTypes: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 5: + case 6: + case 7: + case 8: + case 9: + break; + } + } + if (message.sampleMethod != null && message.hasOwnProperty("sampleMethod")) + switch (message.sampleMethod) { + default: + return "sampleMethod: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.filesLimitPercent != null && message.hasOwnProperty("filesLimitPercent")) + if (!$util.isInteger(message.filesLimitPercent)) + return "filesLimitPercent: integer expected"; + return null; + }; + + /** + * Creates a CloudStorageOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.CloudStorageOptions + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.CloudStorageOptions} CloudStorageOptions + */ + CloudStorageOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.CloudStorageOptions) + return object; + var message = new $root.google.privacy.dlp.v2.CloudStorageOptions(); + if (object.fileSet != null) { + if (typeof object.fileSet !== "object") + throw TypeError(".google.privacy.dlp.v2.CloudStorageOptions.fileSet: object expected"); + message.fileSet = $root.google.privacy.dlp.v2.CloudStorageOptions.FileSet.fromObject(object.fileSet); + } + if (object.bytesLimitPerFile != null) + if ($util.Long) + (message.bytesLimitPerFile = $util.Long.fromValue(object.bytesLimitPerFile)).unsigned = false; + else if (typeof object.bytesLimitPerFile === "string") + message.bytesLimitPerFile = parseInt(object.bytesLimitPerFile, 10); + else if (typeof object.bytesLimitPerFile === "number") + message.bytesLimitPerFile = object.bytesLimitPerFile; + else if (typeof object.bytesLimitPerFile === "object") + message.bytesLimitPerFile = new $util.LongBits(object.bytesLimitPerFile.low >>> 0, object.bytesLimitPerFile.high >>> 0).toNumber(); + if (object.bytesLimitPerFilePercent != null) + message.bytesLimitPerFilePercent = object.bytesLimitPerFilePercent | 0; + if (object.fileTypes) { + if (!Array.isArray(object.fileTypes)) + throw TypeError(".google.privacy.dlp.v2.CloudStorageOptions.fileTypes: array expected"); + message.fileTypes = []; + for (var i = 0; i < object.fileTypes.length; ++i) + switch (object.fileTypes[i]) { + default: + case "FILE_TYPE_UNSPECIFIED": + case 0: + message.fileTypes[i] = 0; + break; + case "BINARY_FILE": + case 1: + message.fileTypes[i] = 1; + break; + case "TEXT_FILE": + case 2: + message.fileTypes[i] = 2; + break; + case "IMAGE": + case 3: + message.fileTypes[i] = 3; + break; + case "WORD": + case 5: + message.fileTypes[i] = 5; + break; + case "PDF": + case 6: + message.fileTypes[i] = 6; + break; + case "AVRO": + case 7: + message.fileTypes[i] = 7; + break; + case "CSV": + case 8: + message.fileTypes[i] = 8; + break; + case "TSV": + case 9: + message.fileTypes[i] = 9; + break; + } + } + switch (object.sampleMethod) { + case "SAMPLE_METHOD_UNSPECIFIED": + case 0: + message.sampleMethod = 0; + break; + case "TOP": + case 1: + message.sampleMethod = 1; + break; + case "RANDOM_START": + case 2: + message.sampleMethod = 2; + break; + } + if (object.filesLimitPercent != null) + message.filesLimitPercent = object.filesLimitPercent | 0; + return message; + }; + + /** + * Creates a plain object from a CloudStorageOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.CloudStorageOptions + * @static + * @param {google.privacy.dlp.v2.CloudStorageOptions} message CloudStorageOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CloudStorageOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.fileTypes = []; + if (options.defaults) { + object.fileSet = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.bytesLimitPerFile = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.bytesLimitPerFile = options.longs === String ? "0" : 0; + object.sampleMethod = options.enums === String ? "SAMPLE_METHOD_UNSPECIFIED" : 0; + object.filesLimitPercent = 0; + object.bytesLimitPerFilePercent = 0; + } + if (message.fileSet != null && message.hasOwnProperty("fileSet")) + object.fileSet = $root.google.privacy.dlp.v2.CloudStorageOptions.FileSet.toObject(message.fileSet, options); + if (message.bytesLimitPerFile != null && message.hasOwnProperty("bytesLimitPerFile")) + if (typeof message.bytesLimitPerFile === "number") + object.bytesLimitPerFile = options.longs === String ? String(message.bytesLimitPerFile) : message.bytesLimitPerFile; + else + object.bytesLimitPerFile = options.longs === String ? $util.Long.prototype.toString.call(message.bytesLimitPerFile) : options.longs === Number ? new $util.LongBits(message.bytesLimitPerFile.low >>> 0, message.bytesLimitPerFile.high >>> 0).toNumber() : message.bytesLimitPerFile; + if (message.fileTypes && message.fileTypes.length) { + object.fileTypes = []; + for (var j = 0; j < message.fileTypes.length; ++j) + object.fileTypes[j] = options.enums === String ? $root.google.privacy.dlp.v2.FileType[message.fileTypes[j]] : message.fileTypes[j]; + } + if (message.sampleMethod != null && message.hasOwnProperty("sampleMethod")) + object.sampleMethod = options.enums === String ? $root.google.privacy.dlp.v2.CloudStorageOptions.SampleMethod[message.sampleMethod] : message.sampleMethod; + if (message.filesLimitPercent != null && message.hasOwnProperty("filesLimitPercent")) + object.filesLimitPercent = message.filesLimitPercent; + if (message.bytesLimitPerFilePercent != null && message.hasOwnProperty("bytesLimitPerFilePercent")) + object.bytesLimitPerFilePercent = message.bytesLimitPerFilePercent; + return object; + }; + + /** + * Converts this CloudStorageOptions to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.CloudStorageOptions + * @instance + * @returns {Object.} JSON object + */ + CloudStorageOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + CloudStorageOptions.FileSet = (function() { + + /** + * Properties of a FileSet. + * @memberof google.privacy.dlp.v2.CloudStorageOptions + * @interface IFileSet + * @property {string|null} [url] FileSet url + * @property {google.privacy.dlp.v2.ICloudStorageRegexFileSet|null} [regexFileSet] FileSet regexFileSet + */ + + /** + * Constructs a new FileSet. + * @memberof google.privacy.dlp.v2.CloudStorageOptions + * @classdesc Represents a FileSet. + * @implements IFileSet + * @constructor + * @param {google.privacy.dlp.v2.CloudStorageOptions.IFileSet=} [properties] Properties to set + */ + function FileSet(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileSet url. + * @member {string} url + * @memberof google.privacy.dlp.v2.CloudStorageOptions.FileSet + * @instance + */ + FileSet.prototype.url = ""; + + /** + * FileSet regexFileSet. + * @member {google.privacy.dlp.v2.ICloudStorageRegexFileSet|null|undefined} regexFileSet + * @memberof google.privacy.dlp.v2.CloudStorageOptions.FileSet + * @instance + */ + FileSet.prototype.regexFileSet = null; + + /** + * Creates a new FileSet instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.CloudStorageOptions.FileSet + * @static + * @param {google.privacy.dlp.v2.CloudStorageOptions.IFileSet=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.CloudStorageOptions.FileSet} FileSet instance + */ + FileSet.create = function create(properties) { + return new FileSet(properties); + }; + + /** + * Encodes the specified FileSet message. Does not implicitly {@link google.privacy.dlp.v2.CloudStorageOptions.FileSet.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.CloudStorageOptions.FileSet + * @static + * @param {google.privacy.dlp.v2.CloudStorageOptions.IFileSet} message FileSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileSet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.url != null && Object.hasOwnProperty.call(message, "url")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.url); + if (message.regexFileSet != null && Object.hasOwnProperty.call(message, "regexFileSet")) + $root.google.privacy.dlp.v2.CloudStorageRegexFileSet.encode(message.regexFileSet, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FileSet message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.CloudStorageOptions.FileSet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.CloudStorageOptions.FileSet + * @static + * @param {google.privacy.dlp.v2.CloudStorageOptions.IFileSet} message FileSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileSet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileSet message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.CloudStorageOptions.FileSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.CloudStorageOptions.FileSet} FileSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileSet.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.privacy.dlp.v2.CloudStorageOptions.FileSet(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.url = reader.string(); + break; + case 2: + message.regexFileSet = $root.google.privacy.dlp.v2.CloudStorageRegexFileSet.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileSet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.CloudStorageOptions.FileSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.CloudStorageOptions.FileSet} FileSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileSet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileSet message. + * @function verify + * @memberof google.privacy.dlp.v2.CloudStorageOptions.FileSet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileSet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.url != null && message.hasOwnProperty("url")) + if (!$util.isString(message.url)) + return "url: string expected"; + if (message.regexFileSet != null && message.hasOwnProperty("regexFileSet")) { + var error = $root.google.privacy.dlp.v2.CloudStorageRegexFileSet.verify(message.regexFileSet); + if (error) + return "regexFileSet." + error; + } + return null; + }; + + /** + * Creates a FileSet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.CloudStorageOptions.FileSet + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.CloudStorageOptions.FileSet} FileSet + */ + FileSet.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.CloudStorageOptions.FileSet) + return object; + var message = new $root.google.privacy.dlp.v2.CloudStorageOptions.FileSet(); + if (object.url != null) + message.url = String(object.url); + if (object.regexFileSet != null) { + if (typeof object.regexFileSet !== "object") + throw TypeError(".google.privacy.dlp.v2.CloudStorageOptions.FileSet.regexFileSet: object expected"); + message.regexFileSet = $root.google.privacy.dlp.v2.CloudStorageRegexFileSet.fromObject(object.regexFileSet); + } + return message; + }; + + /** + * Creates a plain object from a FileSet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.CloudStorageOptions.FileSet + * @static + * @param {google.privacy.dlp.v2.CloudStorageOptions.FileSet} message FileSet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileSet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.url = ""; + object.regexFileSet = null; + } + if (message.url != null && message.hasOwnProperty("url")) + object.url = message.url; + if (message.regexFileSet != null && message.hasOwnProperty("regexFileSet")) + object.regexFileSet = $root.google.privacy.dlp.v2.CloudStorageRegexFileSet.toObject(message.regexFileSet, options); + return object; + }; + + /** + * Converts this FileSet to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.CloudStorageOptions.FileSet + * @instance + * @returns {Object.} JSON object + */ + FileSet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return FileSet; + })(); + + /** + * SampleMethod enum. + * @name google.privacy.dlp.v2.CloudStorageOptions.SampleMethod + * @enum {number} + * @property {number} SAMPLE_METHOD_UNSPECIFIED=0 SAMPLE_METHOD_UNSPECIFIED value + * @property {number} TOP=1 TOP value + * @property {number} RANDOM_START=2 RANDOM_START value + */ + CloudStorageOptions.SampleMethod = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SAMPLE_METHOD_UNSPECIFIED"] = 0; + values[valuesById[1] = "TOP"] = 1; + values[valuesById[2] = "RANDOM_START"] = 2; + return values; + })(); + + return CloudStorageOptions; + })(); + + v2.CloudStorageFileSet = (function() { + + /** + * Properties of a CloudStorageFileSet. + * @memberof google.privacy.dlp.v2 + * @interface ICloudStorageFileSet + * @property {string|null} [url] CloudStorageFileSet url + */ + + /** + * Constructs a new CloudStorageFileSet. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents a CloudStorageFileSet. + * @implements ICloudStorageFileSet + * @constructor + * @param {google.privacy.dlp.v2.ICloudStorageFileSet=} [properties] Properties to set + */ + function CloudStorageFileSet(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CloudStorageFileSet url. + * @member {string} url + * @memberof google.privacy.dlp.v2.CloudStorageFileSet + * @instance + */ + CloudStorageFileSet.prototype.url = ""; + + /** + * Creates a new CloudStorageFileSet instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.CloudStorageFileSet + * @static + * @param {google.privacy.dlp.v2.ICloudStorageFileSet=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.CloudStorageFileSet} CloudStorageFileSet instance + */ + CloudStorageFileSet.create = function create(properties) { + return new CloudStorageFileSet(properties); + }; + + /** + * Encodes the specified CloudStorageFileSet message. Does not implicitly {@link google.privacy.dlp.v2.CloudStorageFileSet.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.CloudStorageFileSet + * @static + * @param {google.privacy.dlp.v2.ICloudStorageFileSet} message CloudStorageFileSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloudStorageFileSet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.url != null && Object.hasOwnProperty.call(message, "url")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.url); + return writer; + }; + + /** + * Encodes the specified CloudStorageFileSet message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.CloudStorageFileSet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.CloudStorageFileSet + * @static + * @param {google.privacy.dlp.v2.ICloudStorageFileSet} message CloudStorageFileSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloudStorageFileSet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CloudStorageFileSet message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.CloudStorageFileSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.CloudStorageFileSet} CloudStorageFileSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloudStorageFileSet.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.privacy.dlp.v2.CloudStorageFileSet(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.url = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CloudStorageFileSet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.CloudStorageFileSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.CloudStorageFileSet} CloudStorageFileSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloudStorageFileSet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CloudStorageFileSet message. + * @function verify + * @memberof google.privacy.dlp.v2.CloudStorageFileSet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CloudStorageFileSet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.url != null && message.hasOwnProperty("url")) + if (!$util.isString(message.url)) + return "url: string expected"; + return null; + }; + + /** + * Creates a CloudStorageFileSet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.CloudStorageFileSet + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.CloudStorageFileSet} CloudStorageFileSet + */ + CloudStorageFileSet.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.CloudStorageFileSet) + return object; + var message = new $root.google.privacy.dlp.v2.CloudStorageFileSet(); + if (object.url != null) + message.url = String(object.url); + return message; + }; + + /** + * Creates a plain object from a CloudStorageFileSet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.CloudStorageFileSet + * @static + * @param {google.privacy.dlp.v2.CloudStorageFileSet} message CloudStorageFileSet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CloudStorageFileSet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.url = ""; + if (message.url != null && message.hasOwnProperty("url")) + object.url = message.url; + return object; + }; + + /** + * Converts this CloudStorageFileSet to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.CloudStorageFileSet + * @instance + * @returns {Object.} JSON object + */ + CloudStorageFileSet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CloudStorageFileSet; + })(); + + v2.CloudStoragePath = (function() { + + /** + * Properties of a CloudStoragePath. + * @memberof google.privacy.dlp.v2 + * @interface ICloudStoragePath + * @property {string|null} [path] CloudStoragePath path + */ + + /** + * Constructs a new CloudStoragePath. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents a CloudStoragePath. + * @implements ICloudStoragePath + * @constructor + * @param {google.privacy.dlp.v2.ICloudStoragePath=} [properties] Properties to set + */ + function CloudStoragePath(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CloudStoragePath path. + * @member {string} path + * @memberof google.privacy.dlp.v2.CloudStoragePath + * @instance + */ + CloudStoragePath.prototype.path = ""; + + /** + * Creates a new CloudStoragePath instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.CloudStoragePath + * @static + * @param {google.privacy.dlp.v2.ICloudStoragePath=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.CloudStoragePath} CloudStoragePath instance + */ + CloudStoragePath.create = function create(properties) { + return new CloudStoragePath(properties); + }; + + /** + * Encodes the specified CloudStoragePath message. Does not implicitly {@link google.privacy.dlp.v2.CloudStoragePath.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.CloudStoragePath + * @static + * @param {google.privacy.dlp.v2.ICloudStoragePath} message CloudStoragePath message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloudStoragePath.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && Object.hasOwnProperty.call(message, "path")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.path); + return writer; + }; + + /** + * Encodes the specified CloudStoragePath message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.CloudStoragePath.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.CloudStoragePath + * @static + * @param {google.privacy.dlp.v2.ICloudStoragePath} message CloudStoragePath message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloudStoragePath.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CloudStoragePath message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.CloudStoragePath + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.CloudStoragePath} CloudStoragePath + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloudStoragePath.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.privacy.dlp.v2.CloudStoragePath(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.path = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CloudStoragePath message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.CloudStoragePath + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.CloudStoragePath} CloudStoragePath + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloudStoragePath.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CloudStoragePath message. + * @function verify + * @memberof google.privacy.dlp.v2.CloudStoragePath + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CloudStoragePath.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.path != null && message.hasOwnProperty("path")) + if (!$util.isString(message.path)) + return "path: string expected"; + return null; + }; + + /** + * Creates a CloudStoragePath message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.CloudStoragePath + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.CloudStoragePath} CloudStoragePath + */ + CloudStoragePath.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.CloudStoragePath) + return object; + var message = new $root.google.privacy.dlp.v2.CloudStoragePath(); + if (object.path != null) + message.path = String(object.path); + return message; + }; + + /** + * Creates a plain object from a CloudStoragePath message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.CloudStoragePath + * @static + * @param {google.privacy.dlp.v2.CloudStoragePath} message CloudStoragePath + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CloudStoragePath.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.path = ""; + if (message.path != null && message.hasOwnProperty("path")) + object.path = message.path; + return object; + }; + + /** + * Converts this CloudStoragePath to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.CloudStoragePath + * @instance + * @returns {Object.} JSON object + */ + CloudStoragePath.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CloudStoragePath; + })(); + + v2.BigQueryOptions = (function() { + + /** + * Properties of a BigQueryOptions. + * @memberof google.privacy.dlp.v2 + * @interface IBigQueryOptions + * @property {google.privacy.dlp.v2.IBigQueryTable|null} [tableReference] BigQueryOptions tableReference + * @property {Array.|null} [identifyingFields] BigQueryOptions identifyingFields + * @property {number|Long|null} [rowsLimit] BigQueryOptions rowsLimit + * @property {number|null} [rowsLimitPercent] BigQueryOptions rowsLimitPercent + * @property {google.privacy.dlp.v2.BigQueryOptions.SampleMethod|null} [sampleMethod] BigQueryOptions sampleMethod + * @property {Array.|null} [excludedFields] BigQueryOptions excludedFields + */ + + /** + * Constructs a new BigQueryOptions. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents a BigQueryOptions. + * @implements IBigQueryOptions + * @constructor + * @param {google.privacy.dlp.v2.IBigQueryOptions=} [properties] Properties to set + */ + function BigQueryOptions(properties) { + this.identifyingFields = []; + this.excludedFields = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BigQueryOptions tableReference. + * @member {google.privacy.dlp.v2.IBigQueryTable|null|undefined} tableReference + * @memberof google.privacy.dlp.v2.BigQueryOptions + * @instance + */ + BigQueryOptions.prototype.tableReference = null; + + /** + * BigQueryOptions identifyingFields. + * @member {Array.} identifyingFields + * @memberof google.privacy.dlp.v2.BigQueryOptions + * @instance + */ + BigQueryOptions.prototype.identifyingFields = $util.emptyArray; + + /** + * BigQueryOptions rowsLimit. + * @member {number|Long} rowsLimit + * @memberof google.privacy.dlp.v2.BigQueryOptions + * @instance + */ + BigQueryOptions.prototype.rowsLimit = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * BigQueryOptions rowsLimitPercent. + * @member {number} rowsLimitPercent + * @memberof google.privacy.dlp.v2.BigQueryOptions + * @instance + */ + BigQueryOptions.prototype.rowsLimitPercent = 0; + + /** + * BigQueryOptions sampleMethod. + * @member {google.privacy.dlp.v2.BigQueryOptions.SampleMethod} sampleMethod + * @memberof google.privacy.dlp.v2.BigQueryOptions + * @instance + */ + BigQueryOptions.prototype.sampleMethod = 0; + + /** + * BigQueryOptions excludedFields. + * @member {Array.} excludedFields + * @memberof google.privacy.dlp.v2.BigQueryOptions + * @instance + */ + BigQueryOptions.prototype.excludedFields = $util.emptyArray; + + /** + * Creates a new BigQueryOptions instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.BigQueryOptions + * @static + * @param {google.privacy.dlp.v2.IBigQueryOptions=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.BigQueryOptions} BigQueryOptions instance + */ + BigQueryOptions.create = function create(properties) { + return new BigQueryOptions(properties); + }; + + /** + * Encodes the specified BigQueryOptions message. Does not implicitly {@link google.privacy.dlp.v2.BigQueryOptions.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.BigQueryOptions + * @static + * @param {google.privacy.dlp.v2.IBigQueryOptions} message BigQueryOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BigQueryOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tableReference != null && Object.hasOwnProperty.call(message, "tableReference")) + $root.google.privacy.dlp.v2.BigQueryTable.encode(message.tableReference, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.identifyingFields != null && message.identifyingFields.length) + for (var i = 0; i < message.identifyingFields.length; ++i) + $root.google.privacy.dlp.v2.FieldId.encode(message.identifyingFields[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.rowsLimit != null && Object.hasOwnProperty.call(message, "rowsLimit")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.rowsLimit); + if (message.sampleMethod != null && Object.hasOwnProperty.call(message, "sampleMethod")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.sampleMethod); + if (message.excludedFields != null && message.excludedFields.length) + for (var i = 0; i < message.excludedFields.length; ++i) + $root.google.privacy.dlp.v2.FieldId.encode(message.excludedFields[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.rowsLimitPercent != null && Object.hasOwnProperty.call(message, "rowsLimitPercent")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.rowsLimitPercent); + return writer; + }; + + /** + * Encodes the specified BigQueryOptions message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.BigQueryOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.BigQueryOptions + * @static + * @param {google.privacy.dlp.v2.IBigQueryOptions} message BigQueryOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BigQueryOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BigQueryOptions message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.BigQueryOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.BigQueryOptions} BigQueryOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BigQueryOptions.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.privacy.dlp.v2.BigQueryOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.tableReference = $root.google.privacy.dlp.v2.BigQueryTable.decode(reader, reader.uint32()); + break; + case 2: + if (!(message.identifyingFields && message.identifyingFields.length)) + message.identifyingFields = []; + message.identifyingFields.push($root.google.privacy.dlp.v2.FieldId.decode(reader, reader.uint32())); + break; + case 3: + message.rowsLimit = reader.int64(); + break; + case 6: + message.rowsLimitPercent = reader.int32(); + break; + case 4: + message.sampleMethod = reader.int32(); + break; + case 5: + if (!(message.excludedFields && message.excludedFields.length)) + message.excludedFields = []; + message.excludedFields.push($root.google.privacy.dlp.v2.FieldId.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BigQueryOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.BigQueryOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.BigQueryOptions} BigQueryOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BigQueryOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BigQueryOptions message. + * @function verify + * @memberof google.privacy.dlp.v2.BigQueryOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BigQueryOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tableReference != null && message.hasOwnProperty("tableReference")) { + var error = $root.google.privacy.dlp.v2.BigQueryTable.verify(message.tableReference); + if (error) + return "tableReference." + error; + } + if (message.identifyingFields != null && message.hasOwnProperty("identifyingFields")) { + if (!Array.isArray(message.identifyingFields)) + return "identifyingFields: array expected"; + for (var i = 0; i < message.identifyingFields.length; ++i) { + var error = $root.google.privacy.dlp.v2.FieldId.verify(message.identifyingFields[i]); + if (error) + return "identifyingFields." + error; + } + } + if (message.rowsLimit != null && message.hasOwnProperty("rowsLimit")) + if (!$util.isInteger(message.rowsLimit) && !(message.rowsLimit && $util.isInteger(message.rowsLimit.low) && $util.isInteger(message.rowsLimit.high))) + return "rowsLimit: integer|Long expected"; + if (message.rowsLimitPercent != null && message.hasOwnProperty("rowsLimitPercent")) + if (!$util.isInteger(message.rowsLimitPercent)) + return "rowsLimitPercent: integer expected"; + if (message.sampleMethod != null && message.hasOwnProperty("sampleMethod")) + switch (message.sampleMethod) { + default: + return "sampleMethod: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.excludedFields != null && message.hasOwnProperty("excludedFields")) { + if (!Array.isArray(message.excludedFields)) + return "excludedFields: array expected"; + for (var i = 0; i < message.excludedFields.length; ++i) { + var error = $root.google.privacy.dlp.v2.FieldId.verify(message.excludedFields[i]); + if (error) + return "excludedFields." + error; + } + } + return null; + }; + + /** + * Creates a BigQueryOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.BigQueryOptions + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.BigQueryOptions} BigQueryOptions + */ + BigQueryOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.BigQueryOptions) + return object; + var message = new $root.google.privacy.dlp.v2.BigQueryOptions(); + if (object.tableReference != null) { + if (typeof object.tableReference !== "object") + throw TypeError(".google.privacy.dlp.v2.BigQueryOptions.tableReference: object expected"); + message.tableReference = $root.google.privacy.dlp.v2.BigQueryTable.fromObject(object.tableReference); + } + if (object.identifyingFields) { + if (!Array.isArray(object.identifyingFields)) + throw TypeError(".google.privacy.dlp.v2.BigQueryOptions.identifyingFields: array expected"); + message.identifyingFields = []; + for (var i = 0; i < object.identifyingFields.length; ++i) { + if (typeof object.identifyingFields[i] !== "object") + throw TypeError(".google.privacy.dlp.v2.BigQueryOptions.identifyingFields: object expected"); + message.identifyingFields[i] = $root.google.privacy.dlp.v2.FieldId.fromObject(object.identifyingFields[i]); + } + } + if (object.rowsLimit != null) + if ($util.Long) + (message.rowsLimit = $util.Long.fromValue(object.rowsLimit)).unsigned = false; + else if (typeof object.rowsLimit === "string") + message.rowsLimit = parseInt(object.rowsLimit, 10); + else if (typeof object.rowsLimit === "number") + message.rowsLimit = object.rowsLimit; + else if (typeof object.rowsLimit === "object") + message.rowsLimit = new $util.LongBits(object.rowsLimit.low >>> 0, object.rowsLimit.high >>> 0).toNumber(); + if (object.rowsLimitPercent != null) + message.rowsLimitPercent = object.rowsLimitPercent | 0; + switch (object.sampleMethod) { + case "SAMPLE_METHOD_UNSPECIFIED": + case 0: + message.sampleMethod = 0; + break; + case "TOP": + case 1: + message.sampleMethod = 1; + break; + case "RANDOM_START": + case 2: + message.sampleMethod = 2; + break; + } + if (object.excludedFields) { + if (!Array.isArray(object.excludedFields)) + throw TypeError(".google.privacy.dlp.v2.BigQueryOptions.excludedFields: array expected"); + message.excludedFields = []; + for (var i = 0; i < object.excludedFields.length; ++i) { + if (typeof object.excludedFields[i] !== "object") + throw TypeError(".google.privacy.dlp.v2.BigQueryOptions.excludedFields: object expected"); + message.excludedFields[i] = $root.google.privacy.dlp.v2.FieldId.fromObject(object.excludedFields[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a BigQueryOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.BigQueryOptions + * @static + * @param {google.privacy.dlp.v2.BigQueryOptions} message BigQueryOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BigQueryOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.identifyingFields = []; + object.excludedFields = []; + } + if (options.defaults) { + object.tableReference = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.rowsLimit = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.rowsLimit = options.longs === String ? "0" : 0; + object.sampleMethod = options.enums === String ? "SAMPLE_METHOD_UNSPECIFIED" : 0; + object.rowsLimitPercent = 0; + } + if (message.tableReference != null && message.hasOwnProperty("tableReference")) + object.tableReference = $root.google.privacy.dlp.v2.BigQueryTable.toObject(message.tableReference, options); + if (message.identifyingFields && message.identifyingFields.length) { + object.identifyingFields = []; + for (var j = 0; j < message.identifyingFields.length; ++j) + object.identifyingFields[j] = $root.google.privacy.dlp.v2.FieldId.toObject(message.identifyingFields[j], options); + } + if (message.rowsLimit != null && message.hasOwnProperty("rowsLimit")) + if (typeof message.rowsLimit === "number") + object.rowsLimit = options.longs === String ? String(message.rowsLimit) : message.rowsLimit; + else + object.rowsLimit = options.longs === String ? $util.Long.prototype.toString.call(message.rowsLimit) : options.longs === Number ? new $util.LongBits(message.rowsLimit.low >>> 0, message.rowsLimit.high >>> 0).toNumber() : message.rowsLimit; + if (message.sampleMethod != null && message.hasOwnProperty("sampleMethod")) + object.sampleMethod = options.enums === String ? $root.google.privacy.dlp.v2.BigQueryOptions.SampleMethod[message.sampleMethod] : message.sampleMethod; + if (message.excludedFields && message.excludedFields.length) { + object.excludedFields = []; + for (var j = 0; j < message.excludedFields.length; ++j) + object.excludedFields[j] = $root.google.privacy.dlp.v2.FieldId.toObject(message.excludedFields[j], options); + } + if (message.rowsLimitPercent != null && message.hasOwnProperty("rowsLimitPercent")) + object.rowsLimitPercent = message.rowsLimitPercent; + return object; + }; + + /** + * Converts this BigQueryOptions to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.BigQueryOptions + * @instance + * @returns {Object.} JSON object + */ + BigQueryOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * SampleMethod enum. + * @name google.privacy.dlp.v2.BigQueryOptions.SampleMethod + * @enum {number} + * @property {number} SAMPLE_METHOD_UNSPECIFIED=0 SAMPLE_METHOD_UNSPECIFIED value + * @property {number} TOP=1 TOP value + * @property {number} RANDOM_START=2 RANDOM_START value + */ + BigQueryOptions.SampleMethod = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SAMPLE_METHOD_UNSPECIFIED"] = 0; + values[valuesById[1] = "TOP"] = 1; + values[valuesById[2] = "RANDOM_START"] = 2; + return values; + })(); + + return BigQueryOptions; + })(); + + v2.StorageConfig = (function() { + + /** + * Properties of a StorageConfig. + * @memberof google.privacy.dlp.v2 + * @interface IStorageConfig + * @property {google.privacy.dlp.v2.IDatastoreOptions|null} [datastoreOptions] StorageConfig datastoreOptions + * @property {google.privacy.dlp.v2.ICloudStorageOptions|null} [cloudStorageOptions] StorageConfig cloudStorageOptions + * @property {google.privacy.dlp.v2.IBigQueryOptions|null} [bigQueryOptions] StorageConfig bigQueryOptions + * @property {google.privacy.dlp.v2.IHybridOptions|null} [hybridOptions] StorageConfig hybridOptions + * @property {google.privacy.dlp.v2.StorageConfig.ITimespanConfig|null} [timespanConfig] StorageConfig timespanConfig + */ + + /** + * Constructs a new StorageConfig. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents a StorageConfig. + * @implements IStorageConfig + * @constructor + * @param {google.privacy.dlp.v2.IStorageConfig=} [properties] Properties to set + */ + function StorageConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StorageConfig datastoreOptions. + * @member {google.privacy.dlp.v2.IDatastoreOptions|null|undefined} datastoreOptions + * @memberof google.privacy.dlp.v2.StorageConfig + * @instance + */ + StorageConfig.prototype.datastoreOptions = null; + + /** + * StorageConfig cloudStorageOptions. + * @member {google.privacy.dlp.v2.ICloudStorageOptions|null|undefined} cloudStorageOptions + * @memberof google.privacy.dlp.v2.StorageConfig + * @instance + */ + StorageConfig.prototype.cloudStorageOptions = null; + + /** + * StorageConfig bigQueryOptions. + * @member {google.privacy.dlp.v2.IBigQueryOptions|null|undefined} bigQueryOptions + * @memberof google.privacy.dlp.v2.StorageConfig + * @instance + */ + StorageConfig.prototype.bigQueryOptions = null; + + /** + * StorageConfig hybridOptions. + * @member {google.privacy.dlp.v2.IHybridOptions|null|undefined} hybridOptions + * @memberof google.privacy.dlp.v2.StorageConfig + * @instance + */ + StorageConfig.prototype.hybridOptions = null; + + /** + * StorageConfig timespanConfig. + * @member {google.privacy.dlp.v2.StorageConfig.ITimespanConfig|null|undefined} timespanConfig + * @memberof google.privacy.dlp.v2.StorageConfig + * @instance + */ + StorageConfig.prototype.timespanConfig = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * StorageConfig type. + * @member {"datastoreOptions"|"cloudStorageOptions"|"bigQueryOptions"|"hybridOptions"|undefined} type + * @memberof google.privacy.dlp.v2.StorageConfig + * @instance + */ + Object.defineProperty(StorageConfig.prototype, "type", { + get: $util.oneOfGetter($oneOfFields = ["datastoreOptions", "cloudStorageOptions", "bigQueryOptions", "hybridOptions"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new StorageConfig instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.StorageConfig + * @static + * @param {google.privacy.dlp.v2.IStorageConfig=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.StorageConfig} StorageConfig instance + */ + StorageConfig.create = function create(properties) { + return new StorageConfig(properties); + }; + + /** + * Encodes the specified StorageConfig message. Does not implicitly {@link google.privacy.dlp.v2.StorageConfig.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.StorageConfig + * @static + * @param {google.privacy.dlp.v2.IStorageConfig} message StorageConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StorageConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.datastoreOptions != null && Object.hasOwnProperty.call(message, "datastoreOptions")) + $root.google.privacy.dlp.v2.DatastoreOptions.encode(message.datastoreOptions, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.cloudStorageOptions != null && Object.hasOwnProperty.call(message, "cloudStorageOptions")) + $root.google.privacy.dlp.v2.CloudStorageOptions.encode(message.cloudStorageOptions, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.bigQueryOptions != null && Object.hasOwnProperty.call(message, "bigQueryOptions")) + $root.google.privacy.dlp.v2.BigQueryOptions.encode(message.bigQueryOptions, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.timespanConfig != null && Object.hasOwnProperty.call(message, "timespanConfig")) + $root.google.privacy.dlp.v2.StorageConfig.TimespanConfig.encode(message.timespanConfig, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.hybridOptions != null && Object.hasOwnProperty.call(message, "hybridOptions")) + $root.google.privacy.dlp.v2.HybridOptions.encode(message.hybridOptions, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified StorageConfig message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.StorageConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.StorageConfig + * @static + * @param {google.privacy.dlp.v2.IStorageConfig} message StorageConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StorageConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StorageConfig message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.StorageConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.StorageConfig} StorageConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StorageConfig.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.privacy.dlp.v2.StorageConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + message.datastoreOptions = $root.google.privacy.dlp.v2.DatastoreOptions.decode(reader, reader.uint32()); + break; + case 3: + message.cloudStorageOptions = $root.google.privacy.dlp.v2.CloudStorageOptions.decode(reader, reader.uint32()); + break; + case 4: + message.bigQueryOptions = $root.google.privacy.dlp.v2.BigQueryOptions.decode(reader, reader.uint32()); + break; + case 9: + message.hybridOptions = $root.google.privacy.dlp.v2.HybridOptions.decode(reader, reader.uint32()); + break; + case 6: + message.timespanConfig = $root.google.privacy.dlp.v2.StorageConfig.TimespanConfig.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StorageConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.StorageConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.StorageConfig} StorageConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StorageConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StorageConfig message. + * @function verify + * @memberof google.privacy.dlp.v2.StorageConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StorageConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.datastoreOptions != null && message.hasOwnProperty("datastoreOptions")) { + properties.type = 1; + { + var error = $root.google.privacy.dlp.v2.DatastoreOptions.verify(message.datastoreOptions); + if (error) + return "datastoreOptions." + error; + } + } + if (message.cloudStorageOptions != null && message.hasOwnProperty("cloudStorageOptions")) { + if (properties.type === 1) + return "type: multiple values"; + properties.type = 1; + { + var error = $root.google.privacy.dlp.v2.CloudStorageOptions.verify(message.cloudStorageOptions); + if (error) + return "cloudStorageOptions." + error; + } + } + if (message.bigQueryOptions != null && message.hasOwnProperty("bigQueryOptions")) { + if (properties.type === 1) + return "type: multiple values"; + properties.type = 1; + { + var error = $root.google.privacy.dlp.v2.BigQueryOptions.verify(message.bigQueryOptions); + if (error) + return "bigQueryOptions." + error; + } + } + if (message.hybridOptions != null && message.hasOwnProperty("hybridOptions")) { + if (properties.type === 1) + return "type: multiple values"; + properties.type = 1; + { + var error = $root.google.privacy.dlp.v2.HybridOptions.verify(message.hybridOptions); + if (error) + return "hybridOptions." + error; + } + } + if (message.timespanConfig != null && message.hasOwnProperty("timespanConfig")) { + var error = $root.google.privacy.dlp.v2.StorageConfig.TimespanConfig.verify(message.timespanConfig); + if (error) + return "timespanConfig." + error; + } + return null; + }; + + /** + * Creates a StorageConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.StorageConfig + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.StorageConfig} StorageConfig + */ + StorageConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.StorageConfig) + return object; + var message = new $root.google.privacy.dlp.v2.StorageConfig(); + if (object.datastoreOptions != null) { + if (typeof object.datastoreOptions !== "object") + throw TypeError(".google.privacy.dlp.v2.StorageConfig.datastoreOptions: object expected"); + message.datastoreOptions = $root.google.privacy.dlp.v2.DatastoreOptions.fromObject(object.datastoreOptions); + } + if (object.cloudStorageOptions != null) { + if (typeof object.cloudStorageOptions !== "object") + throw TypeError(".google.privacy.dlp.v2.StorageConfig.cloudStorageOptions: object expected"); + message.cloudStorageOptions = $root.google.privacy.dlp.v2.CloudStorageOptions.fromObject(object.cloudStorageOptions); + } + if (object.bigQueryOptions != null) { + if (typeof object.bigQueryOptions !== "object") + throw TypeError(".google.privacy.dlp.v2.StorageConfig.bigQueryOptions: object expected"); + message.bigQueryOptions = $root.google.privacy.dlp.v2.BigQueryOptions.fromObject(object.bigQueryOptions); + } + if (object.hybridOptions != null) { + if (typeof object.hybridOptions !== "object") + throw TypeError(".google.privacy.dlp.v2.StorageConfig.hybridOptions: object expected"); + message.hybridOptions = $root.google.privacy.dlp.v2.HybridOptions.fromObject(object.hybridOptions); + } + if (object.timespanConfig != null) { + if (typeof object.timespanConfig !== "object") + throw TypeError(".google.privacy.dlp.v2.StorageConfig.timespanConfig: object expected"); + message.timespanConfig = $root.google.privacy.dlp.v2.StorageConfig.TimespanConfig.fromObject(object.timespanConfig); + } + return message; + }; + + /** + * Creates a plain object from a StorageConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.StorageConfig + * @static + * @param {google.privacy.dlp.v2.StorageConfig} message StorageConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StorageConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.timespanConfig = null; + if (message.datastoreOptions != null && message.hasOwnProperty("datastoreOptions")) { + object.datastoreOptions = $root.google.privacy.dlp.v2.DatastoreOptions.toObject(message.datastoreOptions, options); + if (options.oneofs) + object.type = "datastoreOptions"; + } + if (message.cloudStorageOptions != null && message.hasOwnProperty("cloudStorageOptions")) { + object.cloudStorageOptions = $root.google.privacy.dlp.v2.CloudStorageOptions.toObject(message.cloudStorageOptions, options); + if (options.oneofs) + object.type = "cloudStorageOptions"; + } + if (message.bigQueryOptions != null && message.hasOwnProperty("bigQueryOptions")) { + object.bigQueryOptions = $root.google.privacy.dlp.v2.BigQueryOptions.toObject(message.bigQueryOptions, options); + if (options.oneofs) + object.type = "bigQueryOptions"; + } + if (message.timespanConfig != null && message.hasOwnProperty("timespanConfig")) + object.timespanConfig = $root.google.privacy.dlp.v2.StorageConfig.TimespanConfig.toObject(message.timespanConfig, options); + if (message.hybridOptions != null && message.hasOwnProperty("hybridOptions")) { + object.hybridOptions = $root.google.privacy.dlp.v2.HybridOptions.toObject(message.hybridOptions, options); + if (options.oneofs) + object.type = "hybridOptions"; + } + return object; + }; + + /** + * Converts this StorageConfig to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.StorageConfig + * @instance + * @returns {Object.} JSON object + */ + StorageConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + StorageConfig.TimespanConfig = (function() { + + /** + * Properties of a TimespanConfig. + * @memberof google.privacy.dlp.v2.StorageConfig + * @interface ITimespanConfig + * @property {google.protobuf.ITimestamp|null} [startTime] TimespanConfig startTime + * @property {google.protobuf.ITimestamp|null} [endTime] TimespanConfig endTime + * @property {google.privacy.dlp.v2.IFieldId|null} [timestampField] TimespanConfig timestampField + * @property {boolean|null} [enableAutoPopulationOfTimespanConfig] TimespanConfig enableAutoPopulationOfTimespanConfig + */ + + /** + * Constructs a new TimespanConfig. + * @memberof google.privacy.dlp.v2.StorageConfig + * @classdesc Represents a TimespanConfig. + * @implements ITimespanConfig + * @constructor + * @param {google.privacy.dlp.v2.StorageConfig.ITimespanConfig=} [properties] Properties to set + */ + function TimespanConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TimespanConfig startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.privacy.dlp.v2.StorageConfig.TimespanConfig + * @instance + */ + TimespanConfig.prototype.startTime = null; + + /** + * TimespanConfig endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.privacy.dlp.v2.StorageConfig.TimespanConfig + * @instance + */ + TimespanConfig.prototype.endTime = null; + + /** + * TimespanConfig timestampField. + * @member {google.privacy.dlp.v2.IFieldId|null|undefined} timestampField + * @memberof google.privacy.dlp.v2.StorageConfig.TimespanConfig + * @instance + */ + TimespanConfig.prototype.timestampField = null; + + /** + * TimespanConfig enableAutoPopulationOfTimespanConfig. + * @member {boolean} enableAutoPopulationOfTimespanConfig + * @memberof google.privacy.dlp.v2.StorageConfig.TimespanConfig + * @instance + */ + TimespanConfig.prototype.enableAutoPopulationOfTimespanConfig = false; + + /** + * Creates a new TimespanConfig instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.StorageConfig.TimespanConfig + * @static + * @param {google.privacy.dlp.v2.StorageConfig.ITimespanConfig=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.StorageConfig.TimespanConfig} TimespanConfig instance + */ + TimespanConfig.create = function create(properties) { + return new TimespanConfig(properties); + }; + + /** + * Encodes the specified TimespanConfig message. Does not implicitly {@link google.privacy.dlp.v2.StorageConfig.TimespanConfig.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.StorageConfig.TimespanConfig + * @static + * @param {google.privacy.dlp.v2.StorageConfig.ITimespanConfig} message TimespanConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimespanConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.timestampField != null && Object.hasOwnProperty.call(message, "timestampField")) + $root.google.privacy.dlp.v2.FieldId.encode(message.timestampField, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.enableAutoPopulationOfTimespanConfig != null && Object.hasOwnProperty.call(message, "enableAutoPopulationOfTimespanConfig")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.enableAutoPopulationOfTimespanConfig); + return writer; + }; + + /** + * Encodes the specified TimespanConfig message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.StorageConfig.TimespanConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.StorageConfig.TimespanConfig + * @static + * @param {google.privacy.dlp.v2.StorageConfig.ITimespanConfig} message TimespanConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimespanConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TimespanConfig message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.StorageConfig.TimespanConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.StorageConfig.TimespanConfig} TimespanConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimespanConfig.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.privacy.dlp.v2.StorageConfig.TimespanConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 2: + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 3: + message.timestampField = $root.google.privacy.dlp.v2.FieldId.decode(reader, reader.uint32()); + break; + case 4: + message.enableAutoPopulationOfTimespanConfig = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TimespanConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.StorageConfig.TimespanConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.StorageConfig.TimespanConfig} TimespanConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimespanConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TimespanConfig message. + * @function verify + * @memberof google.privacy.dlp.v2.StorageConfig.TimespanConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TimespanConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + if (message.timestampField != null && message.hasOwnProperty("timestampField")) { + var error = $root.google.privacy.dlp.v2.FieldId.verify(message.timestampField); + if (error) + return "timestampField." + error; + } + if (message.enableAutoPopulationOfTimespanConfig != null && message.hasOwnProperty("enableAutoPopulationOfTimespanConfig")) + if (typeof message.enableAutoPopulationOfTimespanConfig !== "boolean") + return "enableAutoPopulationOfTimespanConfig: boolean expected"; + return null; + }; + + /** + * Creates a TimespanConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.StorageConfig.TimespanConfig + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.StorageConfig.TimespanConfig} TimespanConfig + */ + TimespanConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.StorageConfig.TimespanConfig) + return object; + var message = new $root.google.privacy.dlp.v2.StorageConfig.TimespanConfig(); + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.privacy.dlp.v2.StorageConfig.TimespanConfig.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.privacy.dlp.v2.StorageConfig.TimespanConfig.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + if (object.timestampField != null) { + if (typeof object.timestampField !== "object") + throw TypeError(".google.privacy.dlp.v2.StorageConfig.TimespanConfig.timestampField: object expected"); + message.timestampField = $root.google.privacy.dlp.v2.FieldId.fromObject(object.timestampField); + } + if (object.enableAutoPopulationOfTimespanConfig != null) + message.enableAutoPopulationOfTimespanConfig = Boolean(object.enableAutoPopulationOfTimespanConfig); + return message; + }; + + /** + * Creates a plain object from a TimespanConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.StorageConfig.TimespanConfig + * @static + * @param {google.privacy.dlp.v2.StorageConfig.TimespanConfig} message TimespanConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TimespanConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.startTime = null; + object.endTime = null; + object.timestampField = null; + object.enableAutoPopulationOfTimespanConfig = false; + } + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + if (message.timestampField != null && message.hasOwnProperty("timestampField")) + object.timestampField = $root.google.privacy.dlp.v2.FieldId.toObject(message.timestampField, options); + if (message.enableAutoPopulationOfTimespanConfig != null && message.hasOwnProperty("enableAutoPopulationOfTimespanConfig")) + object.enableAutoPopulationOfTimespanConfig = message.enableAutoPopulationOfTimespanConfig; + return object; + }; + + /** + * Converts this TimespanConfig to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.StorageConfig.TimespanConfig + * @instance + * @returns {Object.} JSON object + */ + TimespanConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TimespanConfig; + })(); + + 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() { + + /** + * Properties of a HybridOptions. + * @memberof google.privacy.dlp.v2 + * @interface IHybridOptions + * @property {string|null} [description] HybridOptions description + * @property {Array.|null} [requiredFindingLabelKeys] HybridOptions requiredFindingLabelKeys + * @property {Object.|null} [labels] HybridOptions labels + * @property {google.privacy.dlp.v2.ITableOptions|null} [tableOptions] HybridOptions tableOptions + */ + + /** + * Constructs a new HybridOptions. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents a HybridOptions. + * @implements IHybridOptions + * @constructor + * @param {google.privacy.dlp.v2.IHybridOptions=} [properties] Properties to set + */ + function HybridOptions(properties) { + this.requiredFindingLabelKeys = []; + this.labels = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HybridOptions description. + * @member {string} description + * @memberof google.privacy.dlp.v2.HybridOptions + * @instance + */ + HybridOptions.prototype.description = ""; + + /** + * HybridOptions requiredFindingLabelKeys. + * @member {Array.} requiredFindingLabelKeys + * @memberof google.privacy.dlp.v2.HybridOptions + * @instance + */ + HybridOptions.prototype.requiredFindingLabelKeys = $util.emptyArray; + + /** + * HybridOptions labels. + * @member {Object.} labels + * @memberof google.privacy.dlp.v2.HybridOptions + * @instance + */ + HybridOptions.prototype.labels = $util.emptyObject; + + /** + * HybridOptions tableOptions. + * @member {google.privacy.dlp.v2.ITableOptions|null|undefined} tableOptions + * @memberof google.privacy.dlp.v2.HybridOptions + * @instance + */ + HybridOptions.prototype.tableOptions = null; + + /** + * Creates a new HybridOptions instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.HybridOptions + * @static + * @param {google.privacy.dlp.v2.IHybridOptions=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.HybridOptions} HybridOptions instance + */ + HybridOptions.create = function create(properties) { + return new HybridOptions(properties); + }; + + /** + * Encodes the specified HybridOptions message. Does not implicitly {@link google.privacy.dlp.v2.HybridOptions.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.HybridOptions + * @static + * @param {google.privacy.dlp.v2.IHybridOptions} message HybridOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HybridOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.description); + if (message.requiredFindingLabelKeys != null && message.requiredFindingLabelKeys.length) + for (var i = 0; i < message.requiredFindingLabelKeys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requiredFindingLabelKeys[i]); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.tableOptions != null && Object.hasOwnProperty.call(message, "tableOptions")) + $root.google.privacy.dlp.v2.TableOptions.encode(message.tableOptions, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified HybridOptions message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.HybridOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.HybridOptions + * @static + * @param {google.privacy.dlp.v2.IHybridOptions} message HybridOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HybridOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HybridOptions message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.HybridOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.HybridOptions} HybridOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HybridOptions.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.privacy.dlp.v2.HybridOptions(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.description = reader.string(); + break; + case 2: + if (!(message.requiredFindingLabelKeys && message.requiredFindingLabelKeys.length)) + message.requiredFindingLabelKeys = []; + message.requiredFindingLabelKeys.push(reader.string()); + break; + case 3: + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + case 4: + message.tableOptions = $root.google.privacy.dlp.v2.TableOptions.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HybridOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.HybridOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.HybridOptions} HybridOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HybridOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HybridOptions message. + * @function verify + * @memberof google.privacy.dlp.v2.HybridOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HybridOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.requiredFindingLabelKeys != null && message.hasOwnProperty("requiredFindingLabelKeys")) { + if (!Array.isArray(message.requiredFindingLabelKeys)) + return "requiredFindingLabelKeys: array expected"; + for (var i = 0; i < message.requiredFindingLabelKeys.length; ++i) + if (!$util.isString(message.requiredFindingLabelKeys[i])) + return "requiredFindingLabelKeys: string[] expected"; + } + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.tableOptions != null && message.hasOwnProperty("tableOptions")) { + var error = $root.google.privacy.dlp.v2.TableOptions.verify(message.tableOptions); + if (error) + return "tableOptions." + error; + } + return null; + }; + + /** + * Creates a HybridOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.HybridOptions + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.HybridOptions} HybridOptions + */ + HybridOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.HybridOptions) + return object; + var message = new $root.google.privacy.dlp.v2.HybridOptions(); + if (object.description != null) + message.description = String(object.description); + if (object.requiredFindingLabelKeys) { + if (!Array.isArray(object.requiredFindingLabelKeys)) + throw TypeError(".google.privacy.dlp.v2.HybridOptions.requiredFindingLabelKeys: array expected"); + message.requiredFindingLabelKeys = []; + for (var i = 0; i < object.requiredFindingLabelKeys.length; ++i) + message.requiredFindingLabelKeys[i] = String(object.requiredFindingLabelKeys[i]); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.privacy.dlp.v2.HybridOptions.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + if (object.tableOptions != null) { + if (typeof object.tableOptions !== "object") + throw TypeError(".google.privacy.dlp.v2.HybridOptions.tableOptions: object expected"); + message.tableOptions = $root.google.privacy.dlp.v2.TableOptions.fromObject(object.tableOptions); + } + return message; + }; + + /** + * Creates a plain object from a HybridOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.HybridOptions + * @static + * @param {google.privacy.dlp.v2.HybridOptions} message HybridOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HybridOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.requiredFindingLabelKeys = []; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.description = ""; + object.tableOptions = null; + } + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.requiredFindingLabelKeys && message.requiredFindingLabelKeys.length) { + object.requiredFindingLabelKeys = []; + for (var j = 0; j < message.requiredFindingLabelKeys.length; ++j) + object.requiredFindingLabelKeys[j] = message.requiredFindingLabelKeys[j]; + } + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + if (message.tableOptions != null && message.hasOwnProperty("tableOptions")) + object.tableOptions = $root.google.privacy.dlp.v2.TableOptions.toObject(message.tableOptions, options); + return object; + }; + + /** + * Converts this HybridOptions to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.HybridOptions + * @instance + * @returns {Object.} JSON object + */ + HybridOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return HybridOptions; + })(); + + v2.BigQueryKey = (function() { + + /** + * Properties of a BigQueryKey. + * @memberof google.privacy.dlp.v2 + * @interface IBigQueryKey + * @property {google.privacy.dlp.v2.IBigQueryTable|null} [tableReference] BigQueryKey tableReference + * @property {number|Long|null} [rowNumber] BigQueryKey rowNumber + */ + + /** + * Constructs a new BigQueryKey. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents a BigQueryKey. + * @implements IBigQueryKey + * @constructor + * @param {google.privacy.dlp.v2.IBigQueryKey=} [properties] Properties to set + */ + function BigQueryKey(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BigQueryKey tableReference. + * @member {google.privacy.dlp.v2.IBigQueryTable|null|undefined} tableReference + * @memberof google.privacy.dlp.v2.BigQueryKey + * @instance + */ + BigQueryKey.prototype.tableReference = null; + + /** + * BigQueryKey rowNumber. + * @member {number|Long} rowNumber + * @memberof google.privacy.dlp.v2.BigQueryKey + * @instance + */ + BigQueryKey.prototype.rowNumber = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new BigQueryKey instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.BigQueryKey + * @static + * @param {google.privacy.dlp.v2.IBigQueryKey=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.BigQueryKey} BigQueryKey instance + */ + BigQueryKey.create = function create(properties) { + return new BigQueryKey(properties); + }; + + /** + * Encodes the specified BigQueryKey message. Does not implicitly {@link google.privacy.dlp.v2.BigQueryKey.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.BigQueryKey + * @static + * @param {google.privacy.dlp.v2.IBigQueryKey} message BigQueryKey message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BigQueryKey.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tableReference != null && Object.hasOwnProperty.call(message, "tableReference")) + $root.google.privacy.dlp.v2.BigQueryTable.encode(message.tableReference, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.rowNumber != null && Object.hasOwnProperty.call(message, "rowNumber")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.rowNumber); + return writer; + }; + + /** + * Encodes the specified BigQueryKey message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.BigQueryKey.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.BigQueryKey + * @static + * @param {google.privacy.dlp.v2.IBigQueryKey} message BigQueryKey message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BigQueryKey.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BigQueryKey message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.BigQueryKey + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.BigQueryKey} BigQueryKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BigQueryKey.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.privacy.dlp.v2.BigQueryKey(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.tableReference = $root.google.privacy.dlp.v2.BigQueryTable.decode(reader, reader.uint32()); + break; + case 2: + message.rowNumber = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BigQueryKey message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.BigQueryKey + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.BigQueryKey} BigQueryKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BigQueryKey.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BigQueryKey message. + * @function verify + * @memberof google.privacy.dlp.v2.BigQueryKey + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BigQueryKey.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tableReference != null && message.hasOwnProperty("tableReference")) { + var error = $root.google.privacy.dlp.v2.BigQueryTable.verify(message.tableReference); + if (error) + return "tableReference." + error; + } + if (message.rowNumber != null && message.hasOwnProperty("rowNumber")) + if (!$util.isInteger(message.rowNumber) && !(message.rowNumber && $util.isInteger(message.rowNumber.low) && $util.isInteger(message.rowNumber.high))) + return "rowNumber: integer|Long expected"; + return null; + }; + + /** + * Creates a BigQueryKey message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.BigQueryKey + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.BigQueryKey} BigQueryKey + */ + BigQueryKey.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.BigQueryKey) + return object; + var message = new $root.google.privacy.dlp.v2.BigQueryKey(); + if (object.tableReference != null) { + if (typeof object.tableReference !== "object") + throw TypeError(".google.privacy.dlp.v2.BigQueryKey.tableReference: object expected"); + message.tableReference = $root.google.privacy.dlp.v2.BigQueryTable.fromObject(object.tableReference); + } + if (object.rowNumber != null) + if ($util.Long) + (message.rowNumber = $util.Long.fromValue(object.rowNumber)).unsigned = false; + else if (typeof object.rowNumber === "string") + message.rowNumber = parseInt(object.rowNumber, 10); + else if (typeof object.rowNumber === "number") + message.rowNumber = object.rowNumber; + else if (typeof object.rowNumber === "object") + message.rowNumber = new $util.LongBits(object.rowNumber.low >>> 0, object.rowNumber.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a BigQueryKey message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.BigQueryKey + * @static + * @param {google.privacy.dlp.v2.BigQueryKey} message BigQueryKey + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BigQueryKey.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.tableReference = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.rowNumber = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.rowNumber = options.longs === String ? "0" : 0; + } + if (message.tableReference != null && message.hasOwnProperty("tableReference")) + object.tableReference = $root.google.privacy.dlp.v2.BigQueryTable.toObject(message.tableReference, options); + if (message.rowNumber != null && message.hasOwnProperty("rowNumber")) + if (typeof message.rowNumber === "number") + object.rowNumber = options.longs === String ? String(message.rowNumber) : message.rowNumber; + else + object.rowNumber = options.longs === String ? $util.Long.prototype.toString.call(message.rowNumber) : options.longs === Number ? new $util.LongBits(message.rowNumber.low >>> 0, message.rowNumber.high >>> 0).toNumber() : message.rowNumber; + return object; + }; + + /** + * Converts this BigQueryKey to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.BigQueryKey + * @instance + * @returns {Object.} JSON object + */ + BigQueryKey.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return BigQueryKey; + })(); + + v2.DatastoreKey = (function() { + + /** + * Properties of a DatastoreKey. + * @memberof google.privacy.dlp.v2 + * @interface IDatastoreKey + * @property {google.privacy.dlp.v2.IKey|null} [entityKey] DatastoreKey entityKey + */ + + /** + * Constructs a new DatastoreKey. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents a DatastoreKey. + * @implements IDatastoreKey + * @constructor + * @param {google.privacy.dlp.v2.IDatastoreKey=} [properties] Properties to set + */ + function DatastoreKey(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DatastoreKey entityKey. + * @member {google.privacy.dlp.v2.IKey|null|undefined} entityKey + * @memberof google.privacy.dlp.v2.DatastoreKey + * @instance + */ + DatastoreKey.prototype.entityKey = null; + + /** + * Creates a new DatastoreKey instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.DatastoreKey + * @static + * @param {google.privacy.dlp.v2.IDatastoreKey=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.DatastoreKey} DatastoreKey instance + */ + DatastoreKey.create = function create(properties) { + return new DatastoreKey(properties); + }; + + /** + * Encodes the specified DatastoreKey message. Does not implicitly {@link google.privacy.dlp.v2.DatastoreKey.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.DatastoreKey + * @static + * @param {google.privacy.dlp.v2.IDatastoreKey} message DatastoreKey message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DatastoreKey.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.entityKey != null && Object.hasOwnProperty.call(message, "entityKey")) + $root.google.privacy.dlp.v2.Key.encode(message.entityKey, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DatastoreKey message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.DatastoreKey.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.DatastoreKey + * @static + * @param {google.privacy.dlp.v2.IDatastoreKey} message DatastoreKey message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DatastoreKey.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DatastoreKey message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.DatastoreKey + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.DatastoreKey} DatastoreKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DatastoreKey.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.privacy.dlp.v2.DatastoreKey(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.entityKey = $root.google.privacy.dlp.v2.Key.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DatastoreKey message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.DatastoreKey + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.DatastoreKey} DatastoreKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DatastoreKey.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DatastoreKey message. + * @function verify + * @memberof google.privacy.dlp.v2.DatastoreKey + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DatastoreKey.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.entityKey != null && message.hasOwnProperty("entityKey")) { + var error = $root.google.privacy.dlp.v2.Key.verify(message.entityKey); + if (error) + return "entityKey." + error; + } + return null; + }; + + /** + * Creates a DatastoreKey message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.DatastoreKey + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.DatastoreKey} DatastoreKey + */ + DatastoreKey.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.DatastoreKey) + return object; + var message = new $root.google.privacy.dlp.v2.DatastoreKey(); + if (object.entityKey != null) { + if (typeof object.entityKey !== "object") + throw TypeError(".google.privacy.dlp.v2.DatastoreKey.entityKey: object expected"); + message.entityKey = $root.google.privacy.dlp.v2.Key.fromObject(object.entityKey); + } + return message; + }; + + /** + * Creates a plain object from a DatastoreKey message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.DatastoreKey + * @static + * @param {google.privacy.dlp.v2.DatastoreKey} message DatastoreKey + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DatastoreKey.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.entityKey = null; + if (message.entityKey != null && message.hasOwnProperty("entityKey")) + object.entityKey = $root.google.privacy.dlp.v2.Key.toObject(message.entityKey, options); + return object; + }; + + /** + * Converts this DatastoreKey to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.DatastoreKey + * @instance + * @returns {Object.} JSON object + */ + DatastoreKey.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DatastoreKey; + })(); + + v2.Key = (function() { + + /** + * Properties of a Key. + * @memberof google.privacy.dlp.v2 + * @interface IKey + * @property {google.privacy.dlp.v2.IPartitionId|null} [partitionId] Key partitionId + * @property {Array.|null} [path] Key path + */ + + /** + * Constructs a new Key. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents a Key. + * @implements IKey + * @constructor + * @param {google.privacy.dlp.v2.IKey=} [properties] Properties to set + */ + function Key(properties) { + this.path = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Key partitionId. + * @member {google.privacy.dlp.v2.IPartitionId|null|undefined} partitionId + * @memberof google.privacy.dlp.v2.Key + * @instance + */ + Key.prototype.partitionId = null; + + /** + * Key path. + * @member {Array.} path + * @memberof google.privacy.dlp.v2.Key + * @instance + */ + Key.prototype.path = $util.emptyArray; + + /** + * Creates a new Key instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.Key + * @static + * @param {google.privacy.dlp.v2.IKey=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.Key} Key instance + */ + Key.create = function create(properties) { + return new Key(properties); + }; + + /** + * Encodes the specified Key message. Does not implicitly {@link google.privacy.dlp.v2.Key.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.Key + * @static + * @param {google.privacy.dlp.v2.IKey} message Key message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Key.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.partitionId != null && Object.hasOwnProperty.call(message, "partitionId")) + $root.google.privacy.dlp.v2.PartitionId.encode(message.partitionId, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.path != null && message.path.length) + for (var i = 0; i < message.path.length; ++i) + $root.google.privacy.dlp.v2.Key.PathElement.encode(message.path[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Key message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.Key.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.Key + * @static + * @param {google.privacy.dlp.v2.IKey} message Key message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Key.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Key message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.Key + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.Key} Key + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Key.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.privacy.dlp.v2.Key(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.partitionId = $root.google.privacy.dlp.v2.PartitionId.decode(reader, reader.uint32()); + break; + case 2: + if (!(message.path && message.path.length)) + message.path = []; + message.path.push($root.google.privacy.dlp.v2.Key.PathElement.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Key message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.Key + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.Key} Key + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Key.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Key message. + * @function verify + * @memberof google.privacy.dlp.v2.Key + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Key.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.partitionId != null && message.hasOwnProperty("partitionId")) { + var error = $root.google.privacy.dlp.v2.PartitionId.verify(message.partitionId); + if (error) + return "partitionId." + error; + } + if (message.path != null && message.hasOwnProperty("path")) { + if (!Array.isArray(message.path)) + return "path: array expected"; + for (var i = 0; i < message.path.length; ++i) { + var error = $root.google.privacy.dlp.v2.Key.PathElement.verify(message.path[i]); + if (error) + return "path." + error; + } + } + return null; + }; + + /** + * Creates a Key message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.Key + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.Key} Key + */ + Key.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.Key) + return object; + var message = new $root.google.privacy.dlp.v2.Key(); + if (object.partitionId != null) { + if (typeof object.partitionId !== "object") + throw TypeError(".google.privacy.dlp.v2.Key.partitionId: object expected"); + message.partitionId = $root.google.privacy.dlp.v2.PartitionId.fromObject(object.partitionId); + } + if (object.path) { + if (!Array.isArray(object.path)) + throw TypeError(".google.privacy.dlp.v2.Key.path: array expected"); + message.path = []; + for (var i = 0; i < object.path.length; ++i) { + if (typeof object.path[i] !== "object") + throw TypeError(".google.privacy.dlp.v2.Key.path: object expected"); + message.path[i] = $root.google.privacy.dlp.v2.Key.PathElement.fromObject(object.path[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Key message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.Key + * @static + * @param {google.privacy.dlp.v2.Key} message Key + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Key.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.path = []; + if (options.defaults) + object.partitionId = null; + if (message.partitionId != null && message.hasOwnProperty("partitionId")) + object.partitionId = $root.google.privacy.dlp.v2.PartitionId.toObject(message.partitionId, options); + if (message.path && message.path.length) { + object.path = []; + for (var j = 0; j < message.path.length; ++j) + object.path[j] = $root.google.privacy.dlp.v2.Key.PathElement.toObject(message.path[j], options); + } + return object; + }; + + /** + * Converts this Key to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.Key + * @instance + * @returns {Object.} JSON object + */ + Key.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + Key.PathElement = (function() { + + /** + * Properties of a PathElement. + * @memberof google.privacy.dlp.v2.Key + * @interface IPathElement + * @property {string|null} [kind] PathElement kind + * @property {number|Long|null} [id] PathElement id + * @property {string|null} [name] PathElement name + */ + + /** + * Constructs a new PathElement. + * @memberof google.privacy.dlp.v2.Key + * @classdesc Represents a PathElement. + * @implements IPathElement + * @constructor + * @param {google.privacy.dlp.v2.Key.IPathElement=} [properties] Properties to set + */ + function PathElement(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PathElement kind. + * @member {string} kind + * @memberof google.privacy.dlp.v2.Key.PathElement + * @instance + */ + PathElement.prototype.kind = ""; + + /** + * PathElement id. + * @member {number|Long} id + * @memberof google.privacy.dlp.v2.Key.PathElement + * @instance + */ + PathElement.prototype.id = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * PathElement name. + * @member {string} name + * @memberof google.privacy.dlp.v2.Key.PathElement + * @instance + */ + PathElement.prototype.name = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * PathElement idType. + * @member {"id"|"name"|undefined} idType + * @memberof google.privacy.dlp.v2.Key.PathElement + * @instance + */ + Object.defineProperty(PathElement.prototype, "idType", { + get: $util.oneOfGetter($oneOfFields = ["id", "name"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PathElement instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.Key.PathElement + * @static + * @param {google.privacy.dlp.v2.Key.IPathElement=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.Key.PathElement} PathElement instance + */ + PathElement.create = function create(properties) { + return new PathElement(properties); + }; + + /** + * Encodes the specified PathElement message. Does not implicitly {@link google.privacy.dlp.v2.Key.PathElement.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.Key.PathElement + * @static + * @param {google.privacy.dlp.v2.Key.IPathElement} message PathElement message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PathElement.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.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.id); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.name); + return writer; + }; + + /** + * Encodes the specified PathElement message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.Key.PathElement.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.Key.PathElement + * @static + * @param {google.privacy.dlp.v2.Key.IPathElement} message PathElement message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PathElement.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PathElement message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.Key.PathElement + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.Key.PathElement} PathElement + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PathElement.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.privacy.dlp.v2.Key.PathElement(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.kind = reader.string(); + break; + case 2: + message.id = reader.int64(); + break; + case 3: + message.name = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PathElement message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.Key.PathElement + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.Key.PathElement} PathElement + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PathElement.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PathElement message. + * @function verify + * @memberof google.privacy.dlp.v2.Key.PathElement + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PathElement.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.kind != null && message.hasOwnProperty("kind")) + if (!$util.isString(message.kind)) + return "kind: string expected"; + if (message.id != null && message.hasOwnProperty("id")) { + properties.idType = 1; + if (!$util.isInteger(message.id) && !(message.id && $util.isInteger(message.id.low) && $util.isInteger(message.id.high))) + return "id: integer|Long expected"; + } + if (message.name != null && message.hasOwnProperty("name")) { + if (properties.idType === 1) + return "idType: multiple values"; + properties.idType = 1; + if (!$util.isString(message.name)) + return "name: string expected"; + } + return null; + }; + + /** + * Creates a PathElement message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.Key.PathElement + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.Key.PathElement} PathElement + */ + PathElement.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.Key.PathElement) + return object; + var message = new $root.google.privacy.dlp.v2.Key.PathElement(); + if (object.kind != null) + message.kind = String(object.kind); + if (object.id != null) + if ($util.Long) + (message.id = $util.Long.fromValue(object.id)).unsigned = false; + else if (typeof object.id === "string") + message.id = parseInt(object.id, 10); + else if (typeof object.id === "number") + message.id = object.id; + else if (typeof object.id === "object") + message.id = new $util.LongBits(object.id.low >>> 0, object.id.high >>> 0).toNumber(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a PathElement message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.Key.PathElement + * @static + * @param {google.privacy.dlp.v2.Key.PathElement} message PathElement + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PathElement.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.kind = ""; + if (message.kind != null && message.hasOwnProperty("kind")) + object.kind = message.kind; + if (message.id != null && message.hasOwnProperty("id")) { + if (typeof message.id === "number") + object.id = options.longs === String ? String(message.id) : message.id; + else + object.id = options.longs === String ? $util.Long.prototype.toString.call(message.id) : options.longs === Number ? new $util.LongBits(message.id.low >>> 0, message.id.high >>> 0).toNumber() : message.id; + if (options.oneofs) + object.idType = "id"; + } + if (message.name != null && message.hasOwnProperty("name")) { + object.name = message.name; + if (options.oneofs) + object.idType = "name"; + } + return object; + }; + + /** + * Converts this PathElement to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.Key.PathElement + * @instance + * @returns {Object.} JSON object + */ + PathElement.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return PathElement; + })(); + + return Key; + })(); + + v2.RecordKey = (function() { + + /** + * Properties of a RecordKey. + * @memberof google.privacy.dlp.v2 + * @interface IRecordKey + * @property {google.privacy.dlp.v2.IDatastoreKey|null} [datastoreKey] RecordKey datastoreKey + * @property {google.privacy.dlp.v2.IBigQueryKey|null} [bigQueryKey] RecordKey bigQueryKey + * @property {Array.|null} [idValues] RecordKey idValues + */ + + /** + * Constructs a new RecordKey. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents a RecordKey. + * @implements IRecordKey + * @constructor + * @param {google.privacy.dlp.v2.IRecordKey=} [properties] Properties to set + */ + function RecordKey(properties) { + this.idValues = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RecordKey datastoreKey. + * @member {google.privacy.dlp.v2.IDatastoreKey|null|undefined} datastoreKey + * @memberof google.privacy.dlp.v2.RecordKey + * @instance + */ + RecordKey.prototype.datastoreKey = null; + + /** + * RecordKey bigQueryKey. + * @member {google.privacy.dlp.v2.IBigQueryKey|null|undefined} bigQueryKey + * @memberof google.privacy.dlp.v2.RecordKey + * @instance + */ + RecordKey.prototype.bigQueryKey = null; + + /** + * RecordKey idValues. + * @member {Array.} idValues + * @memberof google.privacy.dlp.v2.RecordKey + * @instance + */ + RecordKey.prototype.idValues = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * RecordKey type. + * @member {"datastoreKey"|"bigQueryKey"|undefined} type + * @memberof google.privacy.dlp.v2.RecordKey + * @instance + */ + Object.defineProperty(RecordKey.prototype, "type", { + get: $util.oneOfGetter($oneOfFields = ["datastoreKey", "bigQueryKey"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RecordKey instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.RecordKey + * @static + * @param {google.privacy.dlp.v2.IRecordKey=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.RecordKey} RecordKey instance + */ + RecordKey.create = function create(properties) { + return new RecordKey(properties); + }; + + /** + * Encodes the specified RecordKey message. Does not implicitly {@link google.privacy.dlp.v2.RecordKey.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.RecordKey + * @static + * @param {google.privacy.dlp.v2.IRecordKey} message RecordKey message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RecordKey.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.datastoreKey != null && Object.hasOwnProperty.call(message, "datastoreKey")) + $root.google.privacy.dlp.v2.DatastoreKey.encode(message.datastoreKey, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.bigQueryKey != null && Object.hasOwnProperty.call(message, "bigQueryKey")) + $root.google.privacy.dlp.v2.BigQueryKey.encode(message.bigQueryKey, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.idValues != null && message.idValues.length) + for (var i = 0; i < message.idValues.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.idValues[i]); + return writer; + }; + + /** + * Encodes the specified RecordKey message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.RecordKey.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.RecordKey + * @static + * @param {google.privacy.dlp.v2.IRecordKey} message RecordKey message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RecordKey.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RecordKey message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.RecordKey + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.RecordKey} RecordKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RecordKey.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.privacy.dlp.v2.RecordKey(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + message.datastoreKey = $root.google.privacy.dlp.v2.DatastoreKey.decode(reader, reader.uint32()); + break; + case 3: + message.bigQueryKey = $root.google.privacy.dlp.v2.BigQueryKey.decode(reader, reader.uint32()); + break; + case 5: + if (!(message.idValues && message.idValues.length)) + message.idValues = []; + message.idValues.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RecordKey message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.RecordKey + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.RecordKey} RecordKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RecordKey.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RecordKey message. + * @function verify + * @memberof google.privacy.dlp.v2.RecordKey + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RecordKey.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.datastoreKey != null && message.hasOwnProperty("datastoreKey")) { + properties.type = 1; + { + var error = $root.google.privacy.dlp.v2.DatastoreKey.verify(message.datastoreKey); + if (error) + return "datastoreKey." + error; + } + } + if (message.bigQueryKey != null && message.hasOwnProperty("bigQueryKey")) { + if (properties.type === 1) + return "type: multiple values"; + properties.type = 1; + { + var error = $root.google.privacy.dlp.v2.BigQueryKey.verify(message.bigQueryKey); + if (error) + return "bigQueryKey." + error; + } + } + if (message.idValues != null && message.hasOwnProperty("idValues")) { + if (!Array.isArray(message.idValues)) + return "idValues: array expected"; + for (var i = 0; i < message.idValues.length; ++i) + if (!$util.isString(message.idValues[i])) + return "idValues: string[] expected"; + } + return null; + }; + + /** + * Creates a RecordKey message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.RecordKey + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.RecordKey} RecordKey + */ + RecordKey.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.RecordKey) + return object; + var message = new $root.google.privacy.dlp.v2.RecordKey(); + if (object.datastoreKey != null) { + if (typeof object.datastoreKey !== "object") + throw TypeError(".google.privacy.dlp.v2.RecordKey.datastoreKey: object expected"); + message.datastoreKey = $root.google.privacy.dlp.v2.DatastoreKey.fromObject(object.datastoreKey); + } + if (object.bigQueryKey != null) { + if (typeof object.bigQueryKey !== "object") + throw TypeError(".google.privacy.dlp.v2.RecordKey.bigQueryKey: object expected"); + message.bigQueryKey = $root.google.privacy.dlp.v2.BigQueryKey.fromObject(object.bigQueryKey); + } + if (object.idValues) { + if (!Array.isArray(object.idValues)) + throw TypeError(".google.privacy.dlp.v2.RecordKey.idValues: array expected"); + message.idValues = []; + for (var i = 0; i < object.idValues.length; ++i) + message.idValues[i] = String(object.idValues[i]); + } + return message; + }; + + /** + * Creates a plain object from a RecordKey message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.RecordKey + * @static + * @param {google.privacy.dlp.v2.RecordKey} message RecordKey + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RecordKey.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.idValues = []; + if (message.datastoreKey != null && message.hasOwnProperty("datastoreKey")) { + object.datastoreKey = $root.google.privacy.dlp.v2.DatastoreKey.toObject(message.datastoreKey, options); + if (options.oneofs) + object.type = "datastoreKey"; + } + if (message.bigQueryKey != null && message.hasOwnProperty("bigQueryKey")) { + object.bigQueryKey = $root.google.privacy.dlp.v2.BigQueryKey.toObject(message.bigQueryKey, options); + if (options.oneofs) + object.type = "bigQueryKey"; + } + if (message.idValues && message.idValues.length) { + object.idValues = []; + for (var j = 0; j < message.idValues.length; ++j) + object.idValues[j] = message.idValues[j]; + } + return object; + }; + + /** + * Converts this RecordKey to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.RecordKey + * @instance + * @returns {Object.} JSON object + */ + RecordKey.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RecordKey; + })(); + + v2.BigQueryTable = (function() { + + /** + * Properties of a BigQueryTable. + * @memberof google.privacy.dlp.v2 + * @interface IBigQueryTable + * @property {string|null} [projectId] BigQueryTable projectId + * @property {string|null} [datasetId] BigQueryTable datasetId + * @property {string|null} [tableId] BigQueryTable tableId + */ + + /** + * Constructs a new BigQueryTable. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents a BigQueryTable. + * @implements IBigQueryTable + * @constructor + * @param {google.privacy.dlp.v2.IBigQueryTable=} [properties] Properties to set + */ + function BigQueryTable(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BigQueryTable projectId. + * @member {string} projectId + * @memberof google.privacy.dlp.v2.BigQueryTable + * @instance + */ + BigQueryTable.prototype.projectId = ""; + + /** + * BigQueryTable datasetId. + * @member {string} datasetId + * @memberof google.privacy.dlp.v2.BigQueryTable + * @instance + */ + BigQueryTable.prototype.datasetId = ""; + + /** + * BigQueryTable tableId. + * @member {string} tableId + * @memberof google.privacy.dlp.v2.BigQueryTable + * @instance + */ + BigQueryTable.prototype.tableId = ""; + + /** + * Creates a new BigQueryTable instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.BigQueryTable + * @static + * @param {google.privacy.dlp.v2.IBigQueryTable=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.BigQueryTable} BigQueryTable instance + */ + BigQueryTable.create = function create(properties) { + return new BigQueryTable(properties); + }; + + /** + * Encodes the specified BigQueryTable message. Does not implicitly {@link google.privacy.dlp.v2.BigQueryTable.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.BigQueryTable + * @static + * @param {google.privacy.dlp.v2.IBigQueryTable} message BigQueryTable message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BigQueryTable.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); + if (message.datasetId != null && Object.hasOwnProperty.call(message, "datasetId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.datasetId); + if (message.tableId != null && Object.hasOwnProperty.call(message, "tableId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.tableId); + return writer; + }; + + /** + * Encodes the specified BigQueryTable message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.BigQueryTable.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.BigQueryTable + * @static + * @param {google.privacy.dlp.v2.IBigQueryTable} message BigQueryTable message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BigQueryTable.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BigQueryTable message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.BigQueryTable + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.BigQueryTable} BigQueryTable + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BigQueryTable.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.privacy.dlp.v2.BigQueryTable(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.projectId = reader.string(); + break; + case 2: + message.datasetId = reader.string(); + break; + case 3: + message.tableId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BigQueryTable message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.BigQueryTable + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.BigQueryTable} BigQueryTable + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BigQueryTable.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BigQueryTable message. + * @function verify + * @memberof google.privacy.dlp.v2.BigQueryTable + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BigQueryTable.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.projectId != null && message.hasOwnProperty("projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + if (message.datasetId != null && message.hasOwnProperty("datasetId")) + if (!$util.isString(message.datasetId)) + return "datasetId: string expected"; + if (message.tableId != null && message.hasOwnProperty("tableId")) + if (!$util.isString(message.tableId)) + return "tableId: string expected"; + return null; + }; + + /** + * Creates a BigQueryTable message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.BigQueryTable + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.BigQueryTable} BigQueryTable + */ + BigQueryTable.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.BigQueryTable) + return object; + var message = new $root.google.privacy.dlp.v2.BigQueryTable(); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.datasetId != null) + message.datasetId = String(object.datasetId); + if (object.tableId != null) + message.tableId = String(object.tableId); + return message; + }; + + /** + * Creates a plain object from a BigQueryTable message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.BigQueryTable + * @static + * @param {google.privacy.dlp.v2.BigQueryTable} message BigQueryTable + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BigQueryTable.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.projectId = ""; + object.datasetId = ""; + object.tableId = ""; + } + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + if (message.datasetId != null && message.hasOwnProperty("datasetId")) + object.datasetId = message.datasetId; + if (message.tableId != null && message.hasOwnProperty("tableId")) + object.tableId = message.tableId; + return object; + }; + + /** + * Converts this BigQueryTable to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.BigQueryTable + * @instance + * @returns {Object.} JSON object + */ + BigQueryTable.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return BigQueryTable; + })(); + + v2.BigQueryField = (function() { + + /** + * Properties of a BigQueryField. + * @memberof google.privacy.dlp.v2 + * @interface IBigQueryField + * @property {google.privacy.dlp.v2.IBigQueryTable|null} [table] BigQueryField table + * @property {google.privacy.dlp.v2.IFieldId|null} [field] BigQueryField field + */ + + /** + * Constructs a new BigQueryField. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents a BigQueryField. + * @implements IBigQueryField + * @constructor + * @param {google.privacy.dlp.v2.IBigQueryField=} [properties] Properties to set + */ + function BigQueryField(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BigQueryField table. + * @member {google.privacy.dlp.v2.IBigQueryTable|null|undefined} table + * @memberof google.privacy.dlp.v2.BigQueryField + * @instance + */ + BigQueryField.prototype.table = null; + + /** + * BigQueryField field. + * @member {google.privacy.dlp.v2.IFieldId|null|undefined} field + * @memberof google.privacy.dlp.v2.BigQueryField + * @instance + */ + BigQueryField.prototype.field = null; + + /** + * Creates a new BigQueryField instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.BigQueryField + * @static + * @param {google.privacy.dlp.v2.IBigQueryField=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.BigQueryField} BigQueryField instance + */ + BigQueryField.create = function create(properties) { + return new BigQueryField(properties); + }; + + /** + * Encodes the specified BigQueryField message. Does not implicitly {@link google.privacy.dlp.v2.BigQueryField.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.BigQueryField + * @static + * @param {google.privacy.dlp.v2.IBigQueryField} message BigQueryField message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BigQueryField.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.table != null && Object.hasOwnProperty.call(message, "table")) + $root.google.privacy.dlp.v2.BigQueryTable.encode(message.table, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.field != null && Object.hasOwnProperty.call(message, "field")) + $root.google.privacy.dlp.v2.FieldId.encode(message.field, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BigQueryField message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.BigQueryField.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.BigQueryField + * @static + * @param {google.privacy.dlp.v2.IBigQueryField} message BigQueryField message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BigQueryField.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BigQueryField message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.BigQueryField + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.BigQueryField} BigQueryField + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BigQueryField.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.privacy.dlp.v2.BigQueryField(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.table = $root.google.privacy.dlp.v2.BigQueryTable.decode(reader, reader.uint32()); + break; + case 2: + message.field = $root.google.privacy.dlp.v2.FieldId.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BigQueryField message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.BigQueryField + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.BigQueryField} BigQueryField + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BigQueryField.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BigQueryField message. + * @function verify + * @memberof google.privacy.dlp.v2.BigQueryField + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BigQueryField.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.table != null && message.hasOwnProperty("table")) { + var error = $root.google.privacy.dlp.v2.BigQueryTable.verify(message.table); + if (error) + return "table." + error; + } + if (message.field != null && message.hasOwnProperty("field")) { + var error = $root.google.privacy.dlp.v2.FieldId.verify(message.field); + if (error) + return "field." + error; + } + return null; + }; + + /** + * Creates a BigQueryField message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.BigQueryField + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.BigQueryField} BigQueryField + */ + BigQueryField.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.BigQueryField) + return object; + var message = new $root.google.privacy.dlp.v2.BigQueryField(); + if (object.table != null) { + if (typeof object.table !== "object") + throw TypeError(".google.privacy.dlp.v2.BigQueryField.table: object expected"); + message.table = $root.google.privacy.dlp.v2.BigQueryTable.fromObject(object.table); + } + if (object.field != null) { + if (typeof object.field !== "object") + throw TypeError(".google.privacy.dlp.v2.BigQueryField.field: object expected"); + message.field = $root.google.privacy.dlp.v2.FieldId.fromObject(object.field); + } + return message; + }; + + /** + * Creates a plain object from a BigQueryField message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.BigQueryField + * @static + * @param {google.privacy.dlp.v2.BigQueryField} message BigQueryField + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BigQueryField.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.table = null; + object.field = null; + } + if (message.table != null && message.hasOwnProperty("table")) + object.table = $root.google.privacy.dlp.v2.BigQueryTable.toObject(message.table, options); + if (message.field != null && message.hasOwnProperty("field")) + object.field = $root.google.privacy.dlp.v2.FieldId.toObject(message.field, options); + return object; + }; + + /** + * Converts this BigQueryField to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.BigQueryField + * @instance + * @returns {Object.} JSON object + */ + BigQueryField.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return BigQueryField; + })(); + + v2.EntityId = (function() { + + /** + * Properties of an EntityId. + * @memberof google.privacy.dlp.v2 + * @interface IEntityId + * @property {google.privacy.dlp.v2.IFieldId|null} [field] EntityId field + */ + + /** + * Constructs a new EntityId. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents an EntityId. + * @implements IEntityId + * @constructor + * @param {google.privacy.dlp.v2.IEntityId=} [properties] Properties to set + */ + function EntityId(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EntityId field. + * @member {google.privacy.dlp.v2.IFieldId|null|undefined} field + * @memberof google.privacy.dlp.v2.EntityId + * @instance + */ + EntityId.prototype.field = null; + + /** + * Creates a new EntityId instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.EntityId + * @static + * @param {google.privacy.dlp.v2.IEntityId=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.EntityId} EntityId instance + */ + EntityId.create = function create(properties) { + return new EntityId(properties); + }; + + /** + * Encodes the specified EntityId message. Does not implicitly {@link google.privacy.dlp.v2.EntityId.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.EntityId + * @static + * @param {google.privacy.dlp.v2.IEntityId} message EntityId message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EntityId.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.field != null && Object.hasOwnProperty.call(message, "field")) + $root.google.privacy.dlp.v2.FieldId.encode(message.field, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EntityId message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.EntityId.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.EntityId + * @static + * @param {google.privacy.dlp.v2.IEntityId} message EntityId message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EntityId.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EntityId message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.EntityId + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.EntityId} EntityId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EntityId.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.privacy.dlp.v2.EntityId(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.field = $root.google.privacy.dlp.v2.FieldId.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EntityId message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.EntityId + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.EntityId} EntityId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EntityId.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EntityId message. + * @function verify + * @memberof google.privacy.dlp.v2.EntityId + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EntityId.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.field != null && message.hasOwnProperty("field")) { + var error = $root.google.privacy.dlp.v2.FieldId.verify(message.field); + if (error) + return "field." + error; + } + return null; + }; + + /** + * Creates an EntityId message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.EntityId + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.EntityId} EntityId + */ + EntityId.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.EntityId) + return object; + var message = new $root.google.privacy.dlp.v2.EntityId(); + if (object.field != null) { + if (typeof object.field !== "object") + throw TypeError(".google.privacy.dlp.v2.EntityId.field: object expected"); + message.field = $root.google.privacy.dlp.v2.FieldId.fromObject(object.field); + } + return message; + }; + + /** + * Creates a plain object from an EntityId message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.EntityId + * @static + * @param {google.privacy.dlp.v2.EntityId} message EntityId + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EntityId.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.field = null; + if (message.field != null && message.hasOwnProperty("field")) + object.field = $root.google.privacy.dlp.v2.FieldId.toObject(message.field, options); + return object; + }; + + /** + * Converts this EntityId to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.EntityId + * @instance + * @returns {Object.} JSON object + */ + EntityId.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return EntityId; + })(); + + v2.TableOptions = (function() { + + /** + * Properties of a TableOptions. + * @memberof google.privacy.dlp.v2 + * @interface ITableOptions + * @property {Array.|null} [identifyingFields] TableOptions identifyingFields + */ + + /** + * Constructs a new TableOptions. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents a TableOptions. + * @implements ITableOptions + * @constructor + * @param {google.privacy.dlp.v2.ITableOptions=} [properties] Properties to set + */ + function TableOptions(properties) { + this.identifyingFields = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TableOptions identifyingFields. + * @member {Array.} identifyingFields + * @memberof google.privacy.dlp.v2.TableOptions + * @instance + */ + TableOptions.prototype.identifyingFields = $util.emptyArray; + + /** + * Creates a new TableOptions instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.TableOptions + * @static + * @param {google.privacy.dlp.v2.ITableOptions=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.TableOptions} TableOptions instance + */ + TableOptions.create = function create(properties) { + return new TableOptions(properties); + }; + + /** + * Encodes the specified TableOptions message. Does not implicitly {@link google.privacy.dlp.v2.TableOptions.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.TableOptions + * @static + * @param {google.privacy.dlp.v2.ITableOptions} message TableOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TableOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.identifyingFields != null && message.identifyingFields.length) + for (var i = 0; i < message.identifyingFields.length; ++i) + $root.google.privacy.dlp.v2.FieldId.encode(message.identifyingFields[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TableOptions message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.TableOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.TableOptions + * @static + * @param {google.privacy.dlp.v2.ITableOptions} message TableOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TableOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TableOptions message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.TableOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.TableOptions} TableOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TableOptions.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.privacy.dlp.v2.TableOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.identifyingFields && message.identifyingFields.length)) + message.identifyingFields = []; + message.identifyingFields.push($root.google.privacy.dlp.v2.FieldId.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TableOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.TableOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.TableOptions} TableOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TableOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TableOptions message. + * @function verify + * @memberof google.privacy.dlp.v2.TableOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TableOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.identifyingFields != null && message.hasOwnProperty("identifyingFields")) { + if (!Array.isArray(message.identifyingFields)) + return "identifyingFields: array expected"; + for (var i = 0; i < message.identifyingFields.length; ++i) { + var error = $root.google.privacy.dlp.v2.FieldId.verify(message.identifyingFields[i]); + if (error) + return "identifyingFields." + error; + } + } + return null; + }; + + /** + * Creates a TableOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.TableOptions + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.TableOptions} TableOptions + */ + TableOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.TableOptions) + return object; + var message = new $root.google.privacy.dlp.v2.TableOptions(); + if (object.identifyingFields) { + if (!Array.isArray(object.identifyingFields)) + throw TypeError(".google.privacy.dlp.v2.TableOptions.identifyingFields: array expected"); + message.identifyingFields = []; + for (var i = 0; i < object.identifyingFields.length; ++i) { + if (typeof object.identifyingFields[i] !== "object") + throw TypeError(".google.privacy.dlp.v2.TableOptions.identifyingFields: object expected"); + message.identifyingFields[i] = $root.google.privacy.dlp.v2.FieldId.fromObject(object.identifyingFields[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a TableOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.TableOptions + * @static + * @param {google.privacy.dlp.v2.TableOptions} message TableOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TableOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.identifyingFields = []; + if (message.identifyingFields && message.identifyingFields.length) { + object.identifyingFields = []; + for (var j = 0; j < message.identifyingFields.length; ++j) + object.identifyingFields[j] = $root.google.privacy.dlp.v2.FieldId.toObject(message.identifyingFields[j], options); + } + return object; + }; + + /** + * Converts this TableOptions to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.TableOptions + * @instance + * @returns {Object.} JSON object + */ + TableOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TableOptions; + })(); + + return v2; + })(); + + return dlp; + })(); + + return privacy; + })(); + + google.api = (function() { + + /** + * Namespace api. + * @memberof google + * @namespace + */ + 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 + */ + 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; + return values; + })(); + + api.ResourceDescriptor = (function() { + + /** + * Properties of a ResourceDescriptor. + * @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 + */ + + /** + * Constructs a new ResourceDescriptor. + * @memberof google.api + * @classdesc Represents a ResourceDescriptor. + * @implements IResourceDescriptor + * @constructor + * @param {google.api.IResourceDescriptor=} [properties] Properties to set + */ + 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) + this[keys[i]] = properties[keys[i]]; + } + + /** + * 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 + * @instance + */ + ResourceDescriptor.prototype.singular = ""; + + /** + * ResourceDescriptor style. + * @member {Array.} style + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.style = $util.emptyArray; + + /** + * Creates a new ResourceDescriptor instance using the specified properties. + * @function create + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor=} [properties] Properties to set + * @returns {google.api.ResourceDescriptor} ResourceDescriptor instance + */ + ResourceDescriptor.create = function create(properties) { + return new ResourceDescriptor(properties); + }; + + /** + * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @function encode + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceDescriptor.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(); + } + return writer; + }; + + /** + * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceDescriptor.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer. + * @function decode + * @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.ResourceDescriptor} ResourceDescriptor + * @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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + 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.type = reader.string(); + 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()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ResourceDescriptor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @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 + */ + ResourceDescriptor.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceDescriptor message. + * @function verify + * @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 + */ + ResourceDescriptor.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.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 ResourceDescriptor message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ResourceDescriptor + * @static + * @param {Object.} object Plain object + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + */ + ResourceDescriptor.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceDescriptor) + 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; + } + } + return message; + }; + + /** + * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.ResourceDescriptor} message ResourceDescriptor + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceDescriptor.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]; + } + return object; + }; + + /** + * Converts this ResourceDescriptor to JSON. + * @function toJSON + * @memberof google.api.ResourceDescriptor + * @instance + * @returns {Object.} JSON object + */ + ResourceDescriptor.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; + })(); + + api.ResourceReference = (function() { + + /** + * Properties of a ResourceReference. + * @memberof google.api + * @interface IResourceReference + * @property {string|null} [type] ResourceReference type + * @property {string|null} [childType] ResourceReference childType + */ + + /** + * Constructs a new ResourceReference. + * @memberof google.api + * @classdesc Represents a ResourceReference. + * @implements IResourceReference + * @constructor + * @param {google.api.IResourceReference=} [properties] Properties to set + */ + function ResourceReference(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourceReference type. + * @member {string} type + * @memberof google.api.ResourceReference + * @instance + */ + ResourceReference.prototype.type = ""; + + /** + * ResourceReference childType. + * @member {string} childType + * @memberof google.api.ResourceReference + * @instance + */ + ResourceReference.prototype.childType = ""; + + /** + * Creates a new ResourceReference instance using the specified properties. + * @function create + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference=} [properties] Properties to set + * @returns {google.api.ResourceReference} ResourceReference instance + */ + ResourceReference.create = function create(properties) { + return new ResourceReference(properties); + }; + + /** + * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @function encode + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceReference.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); + return writer; + }; + + /** + * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceReference.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceReference message from the specified reader or buffer. + * @function decode + * @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.ResourceReference} ResourceReference + * @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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + 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.type = reader.string(); + break; + case 2: + message.childType = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceReference message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ResourceReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @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 + */ + ResourceReference.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceReference message. + * @function verify + * @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 + */ + ResourceReference.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"; + return null; + }; + + /** + * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ResourceReference + * @static + * @param {Object.} object Plain object + * @returns {google.api.ResourceReference} ResourceReference + */ + ResourceReference.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceReference) + 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); + return message; + }; + + /** + * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ResourceReference + * @static + * @param {google.api.ResourceReference} message ResourceReference + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceReference.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = ""; + object.childType = ""; + } + 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 ResourceReference to JSON. + * @function toJSON + * @memberof google.api.ResourceReference + * @instance + * @returns {Object.} JSON object + */ + ResourceReference.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ResourceReference; + })(); + + api.Http = (function() { + + /** + * Properties of a Http. + * @memberof google.api + * @interface IHttp + * @property {Array.|null} [rules] Http rules + * @property {boolean|null} [fullyDecodeReservedExpansion] Http fullyDecodeReservedExpansion + */ + + /** + * Constructs a new Http. + * @memberof google.api + * @classdesc Represents a Http. + * @implements IHttp + * @constructor + * @param {google.api.IHttp=} [properties] Properties to set + */ + function Http(properties) { + this.rules = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Http rules. + * @member {Array.} rules + * @memberof google.api.Http + * @instance + */ + Http.prototype.rules = $util.emptyArray; + + /** + * Http fullyDecodeReservedExpansion. + * @member {boolean} fullyDecodeReservedExpansion + * @memberof google.api.Http + * @instance + */ + Http.prototype.fullyDecodeReservedExpansion = false; + + /** + * Creates a new Http instance using the specified properties. + * @function create + * @memberof google.api.Http + * @static + * @param {google.api.IHttp=} [properties] Properties to set + * @returns {google.api.Http} Http instance + */ + Http.create = function create(properties) { + return new Http(properties); + }; + + /** + * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @function encode + * @memberof google.api.Http + * @static + * @param {google.api.IHttp} message Http message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Http.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); + return writer; + }; + + /** + * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.Http + * @static + * @param {google.api.IHttp} message Http message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Http.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Http message from the specified reader or buffer. + * @function decode + * @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.Http} Http + * @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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + 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: + if (!(message.rules && message.rules.length)) + message.rules = []; + message.rules.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + break; + case 2: + message.fullyDecodeReservedExpansion = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Http message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.Http + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @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 + */ + Http.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Http message. + * @function verify + * @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 + */ + Http.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"; + return null; + }; + + /** + * Creates a Http message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.Http + * @static + * @param {Object.} object Plain object + * @returns {google.api.Http} Http + */ + Http.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Http) + 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); + return message; + }; + + /** + * Creates a plain object from a Http message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.Http + * @static + * @param {google.api.Http} message Http + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Http.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 (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + object.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion; + return object; + }; + + /** + * Converts this Http to JSON. + * @function toJSON + * @memberof google.api.Http + * @instance + * @returns {Object.} JSON object + */ + Http.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Http; + })(); + + api.HttpRule = (function() { + + /** + * Properties of a HttpRule. + * @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 + */ + + /** + * Constructs a new HttpRule. + * @memberof google.api + * @classdesc Represents a HttpRule. + * @implements IHttpRule + * @constructor + * @param {google.api.IHttpRule=} [properties] Properties to set + */ + function HttpRule(properties) { + this.additionalBindings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HttpRule selector. + * @member {string} selector + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.selector = ""; + + /** + * HttpRule get. + * @member {string} get + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.get = ""; + + /** + * HttpRule put. + * @member {string} put + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.put = ""; + + /** + * HttpRule post. + * @member {string} post + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.post = ""; + + /** + * HttpRule delete. + * @member {string} delete + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype["delete"] = ""; + + /** + * HttpRule patch. + * @member {string} patch + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.patch = ""; + + /** + * 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.HttpRule + * @static + * @param {google.api.IHttpRule=} [properties] Properties to set + * @returns {google.api.HttpRule} HttpRule instance + */ + HttpRule.create = function create(properties) { + return new HttpRule(properties); + }; + + /** + * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @function encode + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpRule.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); + return writer; + }; + + /** + * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpRule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HttpRule message from the specified reader or buffer. + * @function decode + * @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.HttpRule} HttpRule + * @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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + 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.selector = reader.string(); + break; + case 2: + 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); + break; + } + } + return message; + }; + + /** + * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.HttpRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @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 + */ + HttpRule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HttpRule message. + * @function verify + * @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 + */ + HttpRule.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.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 HttpRule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.HttpRule + * @static + * @param {Object.} object Plain object + * @returns {google.api.HttpRule} HttpRule + */ + HttpRule.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.HttpRule) + 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); + } + 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 HttpRule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.HttpRule + * @static + * @param {google.api.HttpRule} message HttpRule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HttpRule.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 (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 HttpRule to JSON. + * @function toJSON + * @memberof google.api.HttpRule + * @instance + * @returns {Object.} JSON object + */ + HttpRule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return HttpRule; + })(); + + api.CustomHttpPattern = (function() { + + /** + * Properties of a CustomHttpPattern. + * @memberof google.api + * @interface ICustomHttpPattern + * @property {string|null} [kind] CustomHttpPattern kind + * @property {string|null} [path] CustomHttpPattern path + */ + + /** + * Constructs a new CustomHttpPattern. + * @memberof google.api + * @classdesc Represents a CustomHttpPattern. + * @implements ICustomHttpPattern + * @constructor + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + */ + function CustomHttpPattern(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CustomHttpPattern kind. + * @member {string} kind + * @memberof google.api.CustomHttpPattern + * @instance + */ + CustomHttpPattern.prototype.kind = ""; + + /** + * CustomHttpPattern path. + * @member {string} path + * @memberof google.api.CustomHttpPattern + * @instance + */ + CustomHttpPattern.prototype.path = ""; + + /** + * Creates a new CustomHttpPattern instance using the specified properties. + * @function create + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + * @returns {google.api.CustomHttpPattern} CustomHttpPattern instance + */ + CustomHttpPattern.create = function create(properties) { + return new CustomHttpPattern(properties); + }; + + /** + * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @function encode + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomHttpPattern.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); + return writer; + }; + + /** + * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomHttpPattern.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer. + * @function decode + * @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.CustomHttpPattern} CustomHttpPattern + * @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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + 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: + message.kind = reader.string(); + break; + case 2: + message.path = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.CustomHttpPattern + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @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 + */ + CustomHttpPattern.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CustomHttpPattern message. + * @function verify + * @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 + */ + CustomHttpPattern.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"; + return null; + }; + + /** + * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.CustomHttpPattern + * @static + * @param {Object.} object Plain object + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + */ + CustomHttpPattern.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CustomHttpPattern) + 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); + return message; + }; + + /** + * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.CustomHttpPattern} message CustomHttpPattern + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CustomHttpPattern.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.kind = ""; + object.path = ""; + } + 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 CustomHttpPattern to JSON. + * @function toJSON + * @memberof google.api.CustomHttpPattern + * @instance + * @returns {Object.} JSON object + */ + CustomHttpPattern.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CustomHttpPattern; + })(); + + return api; + })(); + + google.protobuf = (function() { + + /** + * Namespace protobuf. + * @memberof google + * @namespace + */ + var protobuf = {}; + + protobuf.FileDescriptorSet = (function() { + + /** + * Properties of a FileDescriptorSet. + * @memberof google.protobuf + * @interface IFileDescriptorSet + * @property {Array.|null} [file] FileDescriptorSet file + */ + + /** + * Constructs a new FileDescriptorSet. + * @memberof google.protobuf + * @classdesc Represents a FileDescriptorSet. + * @implements IFileDescriptorSet + * @constructor + * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set + */ + function FileDescriptorSet(properties) { + this.file = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileDescriptorSet file. + * @member {Array.} file + * @memberof google.protobuf.FileDescriptorSet + * @instance + */ + FileDescriptorSet.prototype.file = $util.emptyArray; + + /** + * Creates a new FileDescriptorSet instance using the specified properties. + * @function create + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet instance + */ + FileDescriptorSet.create = function create(properties) { + return new FileDescriptorSet(properties); + }; + + /** + * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorSet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.file != null && message.file.length) + for (var i = 0; i < message.file.length; ++i) + $root.google.protobuf.FileDescriptorProto.encode(message.file[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorSet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorSet.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.protobuf.FileDescriptorSet(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.file && message.file.length)) + message.file = []; + message.file.push($root.google.protobuf.FileDescriptorProto.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorSet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileDescriptorSet message. + * @function verify + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileDescriptorSet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.file != null && message.hasOwnProperty("file")) { + if (!Array.isArray(message.file)) + return "file: array expected"; + for (var i = 0; i < message.file.length; ++i) { + var error = $root.google.protobuf.FileDescriptorProto.verify(message.file[i]); + if (error) + return "file." + error; + } + } + return null; + }; + + /** + * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + */ + FileDescriptorSet.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileDescriptorSet) + return object; + var message = new $root.google.protobuf.FileDescriptorSet(); + if (object.file) { + if (!Array.isArray(object.file)) + throw TypeError(".google.protobuf.FileDescriptorSet.file: array expected"); + message.file = []; + for (var i = 0; i < object.file.length; ++i) { + if (typeof object.file[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorSet.file: object expected"); + message.file[i] = $root.google.protobuf.FileDescriptorProto.fromObject(object.file[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.FileDescriptorSet} message FileDescriptorSet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileDescriptorSet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.file = []; + if (message.file && message.file.length) { + object.file = []; + for (var j = 0; j < message.file.length; ++j) + object.file[j] = $root.google.protobuf.FileDescriptorProto.toObject(message.file[j], options); + } + return object; + }; + + /** + * Converts this FileDescriptorSet to JSON. + * @function toJSON + * @memberof google.protobuf.FileDescriptorSet + * @instance + * @returns {Object.} JSON object + */ + FileDescriptorSet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return FileDescriptorSet; + })(); + + protobuf.FileDescriptorProto = (function() { + + /** + * Properties of a FileDescriptorProto. + * @memberof google.protobuf + * @interface IFileDescriptorProto + * @property {string|null} [name] FileDescriptorProto name + * @property {string|null} ["package"] FileDescriptorProto package + * @property {Array.|null} [dependency] FileDescriptorProto dependency + * @property {Array.|null} [publicDependency] FileDescriptorProto publicDependency + * @property {Array.|null} [weakDependency] FileDescriptorProto weakDependency + * @property {Array.|null} [messageType] FileDescriptorProto messageType + * @property {Array.|null} [enumType] FileDescriptorProto enumType + * @property {Array.|null} [service] FileDescriptorProto service + * @property {Array.|null} [extension] FileDescriptorProto extension + * @property {google.protobuf.IFileOptions|null} [options] FileDescriptorProto options + * @property {google.protobuf.ISourceCodeInfo|null} [sourceCodeInfo] FileDescriptorProto sourceCodeInfo + * @property {string|null} [syntax] FileDescriptorProto syntax + */ + + /** + * Constructs a new FileDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a FileDescriptorProto. + * @implements IFileDescriptorProto + * @constructor + * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set + */ + function FileDescriptorProto(properties) { + this.dependency = []; + this.publicDependency = []; + this.weakDependency = []; + this.messageType = []; + this.enumType = []; + this.service = []; + this.extension = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.name = ""; + + /** + * FileDescriptorProto package. + * @member {string} package + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype["package"] = ""; + + /** + * FileDescriptorProto dependency. + * @member {Array.} dependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.dependency = $util.emptyArray; + + /** + * FileDescriptorProto publicDependency. + * @member {Array.} publicDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.publicDependency = $util.emptyArray; + + /** + * FileDescriptorProto weakDependency. + * @member {Array.} weakDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.weakDependency = $util.emptyArray; + + /** + * FileDescriptorProto messageType. + * @member {Array.} messageType + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.messageType = $util.emptyArray; + + /** + * FileDescriptorProto enumType. + * @member {Array.} enumType + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.enumType = $util.emptyArray; + + /** + * FileDescriptorProto service. + * @member {Array.} service + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.service = $util.emptyArray; + + /** + * FileDescriptorProto extension. + * @member {Array.} extension + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.extension = $util.emptyArray; + + /** + * FileDescriptorProto options. + * @member {google.protobuf.IFileOptions|null|undefined} options + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.options = null; + + /** + * FileDescriptorProto sourceCodeInfo. + * @member {google.protobuf.ISourceCodeInfo|null|undefined} sourceCodeInfo + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.sourceCodeInfo = null; + + /** + * FileDescriptorProto syntax. + * @member {string} syntax + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.syntax = ""; + + /** + * Creates a new FileDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto instance + */ + FileDescriptorProto.create = function create(properties) { + return new FileDescriptorProto(properties); + }; + + /** + * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message["package"] != null && Object.hasOwnProperty.call(message, "package")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message["package"]); + if (message.dependency != null && message.dependency.length) + for (var i = 0; i < message.dependency.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.dependency[i]); + if (message.messageType != null && message.messageType.length) + for (var i = 0; i < message.messageType.length; ++i) + $root.google.protobuf.DescriptorProto.encode(message.messageType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.enumType != null && message.enumType.length) + for (var i = 0; i < message.enumType.length; ++i) + $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.service != null && message.service.length) + for (var i = 0; i < message.service.length; ++i) + $root.google.protobuf.ServiceDescriptorProto.encode(message.service[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.extension != null && message.extension.length) + for (var i = 0; i < message.extension.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.FileOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.sourceCodeInfo != null && Object.hasOwnProperty.call(message, "sourceCodeInfo")) + $root.google.protobuf.SourceCodeInfo.encode(message.sourceCodeInfo, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.publicDependency != null && message.publicDependency.length) + for (var i = 0; i < message.publicDependency.length; ++i) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.publicDependency[i]); + if (message.weakDependency != null && message.weakDependency.length) + for (var i = 0; i < message.weakDependency.length; ++i) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.weakDependency[i]); + if (message.syntax != null && Object.hasOwnProperty.call(message, "syntax")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.syntax); + return writer; + }; + + /** + * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorProto.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.protobuf.FileDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message["package"] = reader.string(); + break; + case 3: + if (!(message.dependency && message.dependency.length)) + message.dependency = []; + message.dependency.push(reader.string()); + break; + case 10: + if (!(message.publicDependency && message.publicDependency.length)) + message.publicDependency = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.publicDependency.push(reader.int32()); + } else + message.publicDependency.push(reader.int32()); + break; + case 11: + if (!(message.weakDependency && message.weakDependency.length)) + message.weakDependency = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.weakDependency.push(reader.int32()); + } else + message.weakDependency.push(reader.int32()); + break; + case 4: + if (!(message.messageType && message.messageType.length)) + message.messageType = []; + message.messageType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); + break; + case 5: + if (!(message.enumType && message.enumType.length)) + message.enumType = []; + message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); + break; + case 6: + if (!(message.service && message.service.length)) + message.service = []; + message.service.push($root.google.protobuf.ServiceDescriptorProto.decode(reader, reader.uint32())); + break; + case 7: + if (!(message.extension && message.extension.length)) + message.extension = []; + message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + case 8: + message.options = $root.google.protobuf.FileOptions.decode(reader, reader.uint32()); + break; + case 9: + message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.decode(reader, reader.uint32()); + break; + case 12: + message.syntax = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileDescriptorProto message. + * @function verify + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message["package"] != null && message.hasOwnProperty("package")) + if (!$util.isString(message["package"])) + return "package: string expected"; + if (message.dependency != null && message.hasOwnProperty("dependency")) { + if (!Array.isArray(message.dependency)) + return "dependency: array expected"; + for (var i = 0; i < message.dependency.length; ++i) + if (!$util.isString(message.dependency[i])) + return "dependency: string[] expected"; + } + if (message.publicDependency != null && message.hasOwnProperty("publicDependency")) { + if (!Array.isArray(message.publicDependency)) + return "publicDependency: array expected"; + for (var i = 0; i < message.publicDependency.length; ++i) + if (!$util.isInteger(message.publicDependency[i])) + return "publicDependency: integer[] expected"; + } + if (message.weakDependency != null && message.hasOwnProperty("weakDependency")) { + if (!Array.isArray(message.weakDependency)) + return "weakDependency: array expected"; + for (var i = 0; i < message.weakDependency.length; ++i) + if (!$util.isInteger(message.weakDependency[i])) + return "weakDependency: integer[] expected"; + } + if (message.messageType != null && message.hasOwnProperty("messageType")) { + if (!Array.isArray(message.messageType)) + return "messageType: array expected"; + for (var i = 0; i < message.messageType.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.verify(message.messageType[i]); + if (error) + return "messageType." + error; + } + } + if (message.enumType != null && message.hasOwnProperty("enumType")) { + if (!Array.isArray(message.enumType)) + return "enumType: array expected"; + for (var i = 0; i < message.enumType.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); + if (error) + return "enumType." + error; + } + } + if (message.service != null && message.hasOwnProperty("service")) { + if (!Array.isArray(message.service)) + return "service: array expected"; + for (var i = 0; i < message.service.length; ++i) { + var error = $root.google.protobuf.ServiceDescriptorProto.verify(message.service[i]); + if (error) + return "service." + error; + } + } + if (message.extension != null && message.hasOwnProperty("extension")) { + if (!Array.isArray(message.extension)) + return "extension: array expected"; + for (var i = 0; i < message.extension.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); + if (error) + return "extension." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.FileOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) { + var error = $root.google.protobuf.SourceCodeInfo.verify(message.sourceCodeInfo); + if (error) + return "sourceCodeInfo." + error; + } + if (message.syntax != null && message.hasOwnProperty("syntax")) + if (!$util.isString(message.syntax)) + return "syntax: string expected"; + return null; + }; + + /** + * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + */ + FileDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileDescriptorProto) + return object; + var message = new $root.google.protobuf.FileDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object["package"] != null) + message["package"] = String(object["package"]); + if (object.dependency) { + if (!Array.isArray(object.dependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.dependency: array expected"); + message.dependency = []; + for (var i = 0; i < object.dependency.length; ++i) + message.dependency[i] = String(object.dependency[i]); + } + if (object.publicDependency) { + if (!Array.isArray(object.publicDependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.publicDependency: array expected"); + message.publicDependency = []; + for (var i = 0; i < object.publicDependency.length; ++i) + message.publicDependency[i] = object.publicDependency[i] | 0; + } + if (object.weakDependency) { + if (!Array.isArray(object.weakDependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.weakDependency: array expected"); + message.weakDependency = []; + for (var i = 0; i < object.weakDependency.length; ++i) + message.weakDependency[i] = object.weakDependency[i] | 0; + } + if (object.messageType) { + if (!Array.isArray(object.messageType)) + throw TypeError(".google.protobuf.FileDescriptorProto.messageType: array expected"); + message.messageType = []; + for (var i = 0; i < object.messageType.length; ++i) { + if (typeof object.messageType[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.messageType: object expected"); + message.messageType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.messageType[i]); + } + } + if (object.enumType) { + if (!Array.isArray(object.enumType)) + throw TypeError(".google.protobuf.FileDescriptorProto.enumType: array expected"); + message.enumType = []; + for (var i = 0; i < object.enumType.length; ++i) { + if (typeof object.enumType[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.enumType: object expected"); + message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); + } + } + if (object.service) { + if (!Array.isArray(object.service)) + throw TypeError(".google.protobuf.FileDescriptorProto.service: array expected"); + message.service = []; + for (var i = 0; i < object.service.length; ++i) { + if (typeof object.service[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.service: object expected"); + message.service[i] = $root.google.protobuf.ServiceDescriptorProto.fromObject(object.service[i]); + } + } + if (object.extension) { + if (!Array.isArray(object.extension)) + throw TypeError(".google.protobuf.FileDescriptorProto.extension: array expected"); + message.extension = []; + for (var i = 0; i < object.extension.length; ++i) { + if (typeof object.extension[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.extension: object expected"); + message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.FileOptions.fromObject(object.options); + } + if (object.sourceCodeInfo != null) { + if (typeof object.sourceCodeInfo !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.sourceCodeInfo: object expected"); + message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.fromObject(object.sourceCodeInfo); + } + if (object.syntax != null) + message.syntax = String(object.syntax); + return message; + }; + + /** + * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.FileDescriptorProto} message FileDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.dependency = []; + object.messageType = []; + object.enumType = []; + object.service = []; + object.extension = []; + object.publicDependency = []; + object.weakDependency = []; + } + if (options.defaults) { + object.name = ""; + object["package"] = ""; + object.options = null; + object.sourceCodeInfo = null; + object.syntax = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message["package"] != null && message.hasOwnProperty("package")) + object["package"] = message["package"]; + if (message.dependency && message.dependency.length) { + object.dependency = []; + for (var j = 0; j < message.dependency.length; ++j) + object.dependency[j] = message.dependency[j]; + } + if (message.messageType && message.messageType.length) { + object.messageType = []; + for (var j = 0; j < message.messageType.length; ++j) + object.messageType[j] = $root.google.protobuf.DescriptorProto.toObject(message.messageType[j], options); + } + if (message.enumType && message.enumType.length) { + object.enumType = []; + for (var j = 0; j < message.enumType.length; ++j) + object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); + } + if (message.service && message.service.length) { + object.service = []; + for (var j = 0; j < message.service.length; ++j) + object.service[j] = $root.google.protobuf.ServiceDescriptorProto.toObject(message.service[j], options); + } + if (message.extension && message.extension.length) { + object.extension = []; + for (var j = 0; j < message.extension.length; ++j) + object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.FileOptions.toObject(message.options, options); + if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) + object.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.toObject(message.sourceCodeInfo, options); + if (message.publicDependency && message.publicDependency.length) { + object.publicDependency = []; + for (var j = 0; j < message.publicDependency.length; ++j) + object.publicDependency[j] = message.publicDependency[j]; + } + if (message.weakDependency && message.weakDependency.length) { + object.weakDependency = []; + for (var j = 0; j < message.weakDependency.length; ++j) + object.weakDependency[j] = message.weakDependency[j]; + } + if (message.syntax != null && message.hasOwnProperty("syntax")) + object.syntax = message.syntax; + return object; + }; + + /** + * Converts this FileDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.FileDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + FileDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return FileDescriptorProto; + })(); + + protobuf.DescriptorProto = (function() { + + /** + * Properties of a DescriptorProto. + * @memberof google.protobuf + * @interface IDescriptorProto + * @property {string|null} [name] DescriptorProto name + * @property {Array.|null} [field] DescriptorProto field + * @property {Array.|null} [extension] DescriptorProto extension + * @property {Array.|null} [nestedType] DescriptorProto nestedType + * @property {Array.|null} [enumType] DescriptorProto enumType + * @property {Array.|null} [extensionRange] DescriptorProto extensionRange + * @property {Array.|null} [oneofDecl] DescriptorProto oneofDecl + * @property {google.protobuf.IMessageOptions|null} [options] DescriptorProto options + * @property {Array.|null} [reservedRange] DescriptorProto reservedRange + * @property {Array.|null} [reservedName] DescriptorProto reservedName + */ + + /** + * Constructs a new DescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a DescriptorProto. + * @implements IDescriptorProto + * @constructor + * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set + */ + function DescriptorProto(properties) { + this.field = []; + this.extension = []; + this.nestedType = []; + this.enumType = []; + this.extensionRange = []; + this.oneofDecl = []; + this.reservedRange = []; + this.reservedName = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DescriptorProto name. + * @member {string} name + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.name = ""; + + /** + * DescriptorProto field. + * @member {Array.} field + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.field = $util.emptyArray; + + /** + * DescriptorProto extension. + * @member {Array.} extension + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.extension = $util.emptyArray; + + /** + * DescriptorProto nestedType. + * @member {Array.} nestedType + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.nestedType = $util.emptyArray; + + /** + * DescriptorProto enumType. + * @member {Array.} enumType + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.enumType = $util.emptyArray; + + /** + * DescriptorProto extensionRange. + * @member {Array.} extensionRange + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.extensionRange = $util.emptyArray; + + /** + * DescriptorProto oneofDecl. + * @member {Array.} oneofDecl + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.oneofDecl = $util.emptyArray; + + /** + * DescriptorProto options. + * @member {google.protobuf.IMessageOptions|null|undefined} options + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.options = null; + + /** + * DescriptorProto reservedRange. + * @member {Array.} reservedRange + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.reservedRange = $util.emptyArray; + + /** + * DescriptorProto reservedName. + * @member {Array.} reservedName + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.reservedName = $util.emptyArray; + + /** + * Creates a new DescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto} DescriptorProto instance + */ + DescriptorProto.create = function create(properties) { + return new DescriptorProto(properties); + }; + + /** + * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.field != null && message.field.length) + for (var i = 0; i < message.field.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.field[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.nestedType != null && message.nestedType.length) + for (var i = 0; i < message.nestedType.length; ++i) + $root.google.protobuf.DescriptorProto.encode(message.nestedType[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.enumType != null && message.enumType.length) + for (var i = 0; i < message.enumType.length; ++i) + $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.extensionRange != null && message.extensionRange.length) + for (var i = 0; i < message.extensionRange.length; ++i) + $root.google.protobuf.DescriptorProto.ExtensionRange.encode(message.extensionRange[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.extension != null && message.extension.length) + for (var i = 0; i < message.extension.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.MessageOptions.encode(message.options, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.oneofDecl != null && message.oneofDecl.length) + for (var i = 0; i < message.oneofDecl.length; ++i) + $root.google.protobuf.OneofDescriptorProto.encode(message.oneofDecl[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.reservedRange != null && message.reservedRange.length) + for (var i = 0; i < message.reservedRange.length; ++i) + $root.google.protobuf.DescriptorProto.ReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.reservedName != null && message.reservedName.length) + for (var i = 0; i < message.reservedName.length; ++i) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.reservedName[i]); + return writer; + }; + + /** + * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto} DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DescriptorProto.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.protobuf.DescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + if (!(message.field && message.field.length)) + message.field = []; + message.field.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + case 6: + if (!(message.extension && message.extension.length)) + message.extension = []; + message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + case 3: + if (!(message.nestedType && message.nestedType.length)) + message.nestedType = []; + message.nestedType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); + break; + case 4: + if (!(message.enumType && message.enumType.length)) + message.enumType = []; + message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); + break; + case 5: + if (!(message.extensionRange && message.extensionRange.length)) + message.extensionRange = []; + message.extensionRange.push($root.google.protobuf.DescriptorProto.ExtensionRange.decode(reader, reader.uint32())); + break; + case 8: + if (!(message.oneofDecl && message.oneofDecl.length)) + message.oneofDecl = []; + message.oneofDecl.push($root.google.protobuf.OneofDescriptorProto.decode(reader, reader.uint32())); + break; + case 7: + message.options = $root.google.protobuf.MessageOptions.decode(reader, reader.uint32()); + break; + case 9: + if (!(message.reservedRange && message.reservedRange.length)) + message.reservedRange = []; + message.reservedRange.push($root.google.protobuf.DescriptorProto.ReservedRange.decode(reader, reader.uint32())); + break; + case 10: + if (!(message.reservedName && message.reservedName.length)) + message.reservedName = []; + message.reservedName.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto} DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DescriptorProto message. + * @function verify + * @memberof google.protobuf.DescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.field != null && message.hasOwnProperty("field")) { + if (!Array.isArray(message.field)) + return "field: array expected"; + for (var i = 0; i < message.field.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.field[i]); + if (error) + return "field." + error; + } + } + if (message.extension != null && message.hasOwnProperty("extension")) { + if (!Array.isArray(message.extension)) + return "extension: array expected"; + for (var i = 0; i < message.extension.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); + if (error) + return "extension." + error; + } + } + if (message.nestedType != null && message.hasOwnProperty("nestedType")) { + if (!Array.isArray(message.nestedType)) + return "nestedType: array expected"; + for (var i = 0; i < message.nestedType.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.verify(message.nestedType[i]); + if (error) + return "nestedType." + error; + } + } + if (message.enumType != null && message.hasOwnProperty("enumType")) { + if (!Array.isArray(message.enumType)) + return "enumType: array expected"; + for (var i = 0; i < message.enumType.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); + if (error) + return "enumType." + error; + } + } + if (message.extensionRange != null && message.hasOwnProperty("extensionRange")) { + if (!Array.isArray(message.extensionRange)) + return "extensionRange: array expected"; + for (var i = 0; i < message.extensionRange.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.ExtensionRange.verify(message.extensionRange[i]); + if (error) + return "extensionRange." + error; + } + } + if (message.oneofDecl != null && message.hasOwnProperty("oneofDecl")) { + if (!Array.isArray(message.oneofDecl)) + return "oneofDecl: array expected"; + for (var i = 0; i < message.oneofDecl.length; ++i) { + var error = $root.google.protobuf.OneofDescriptorProto.verify(message.oneofDecl[i]); + if (error) + return "oneofDecl." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.MessageOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { + if (!Array.isArray(message.reservedRange)) + return "reservedRange: array expected"; + for (var i = 0; i < message.reservedRange.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.ReservedRange.verify(message.reservedRange[i]); + if (error) + return "reservedRange." + error; + } + } + if (message.reservedName != null && message.hasOwnProperty("reservedName")) { + if (!Array.isArray(message.reservedName)) + return "reservedName: array expected"; + for (var i = 0; i < message.reservedName.length; ++i) + if (!$util.isString(message.reservedName[i])) + return "reservedName: string[] expected"; + } + return null; + }; + + /** + * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto} DescriptorProto + */ + DescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto) + return object; + var message = new $root.google.protobuf.DescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.field) { + if (!Array.isArray(object.field)) + throw TypeError(".google.protobuf.DescriptorProto.field: array expected"); + message.field = []; + for (var i = 0; i < object.field.length; ++i) { + if (typeof object.field[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.field: object expected"); + message.field[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.field[i]); + } + } + if (object.extension) { + if (!Array.isArray(object.extension)) + throw TypeError(".google.protobuf.DescriptorProto.extension: array expected"); + message.extension = []; + for (var i = 0; i < object.extension.length; ++i) { + if (typeof object.extension[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.extension: object expected"); + message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); + } + } + if (object.nestedType) { + if (!Array.isArray(object.nestedType)) + throw TypeError(".google.protobuf.DescriptorProto.nestedType: array expected"); + message.nestedType = []; + for (var i = 0; i < object.nestedType.length; ++i) { + if (typeof object.nestedType[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.nestedType: object expected"); + message.nestedType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.nestedType[i]); + } + } + if (object.enumType) { + if (!Array.isArray(object.enumType)) + throw TypeError(".google.protobuf.DescriptorProto.enumType: array expected"); + message.enumType = []; + for (var i = 0; i < object.enumType.length; ++i) { + if (typeof object.enumType[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.enumType: object expected"); + message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); + } + } + if (object.extensionRange) { + if (!Array.isArray(object.extensionRange)) + throw TypeError(".google.protobuf.DescriptorProto.extensionRange: array expected"); + message.extensionRange = []; + for (var i = 0; i < object.extensionRange.length; ++i) { + if (typeof object.extensionRange[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.extensionRange: object expected"); + message.extensionRange[i] = $root.google.protobuf.DescriptorProto.ExtensionRange.fromObject(object.extensionRange[i]); + } + } + if (object.oneofDecl) { + if (!Array.isArray(object.oneofDecl)) + throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: array expected"); + message.oneofDecl = []; + for (var i = 0; i < object.oneofDecl.length; ++i) { + if (typeof object.oneofDecl[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: object expected"); + message.oneofDecl[i] = $root.google.protobuf.OneofDescriptorProto.fromObject(object.oneofDecl[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.DescriptorProto.options: object expected"); + message.options = $root.google.protobuf.MessageOptions.fromObject(object.options); + } + if (object.reservedRange) { + if (!Array.isArray(object.reservedRange)) + throw TypeError(".google.protobuf.DescriptorProto.reservedRange: array expected"); + message.reservedRange = []; + for (var i = 0; i < object.reservedRange.length; ++i) { + if (typeof object.reservedRange[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.reservedRange: object expected"); + message.reservedRange[i] = $root.google.protobuf.DescriptorProto.ReservedRange.fromObject(object.reservedRange[i]); + } + } + if (object.reservedName) { + if (!Array.isArray(object.reservedName)) + throw TypeError(".google.protobuf.DescriptorProto.reservedName: array expected"); + message.reservedName = []; + for (var i = 0; i < object.reservedName.length; ++i) + message.reservedName[i] = String(object.reservedName[i]); + } + return message; + }; + + /** + * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.DescriptorProto} message DescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.field = []; + object.nestedType = []; + object.enumType = []; + object.extensionRange = []; + object.extension = []; + object.oneofDecl = []; + object.reservedRange = []; + object.reservedName = []; + } + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.field && message.field.length) { + object.field = []; + for (var j = 0; j < message.field.length; ++j) + object.field[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.field[j], options); + } + if (message.nestedType && message.nestedType.length) { + object.nestedType = []; + for (var j = 0; j < message.nestedType.length; ++j) + object.nestedType[j] = $root.google.protobuf.DescriptorProto.toObject(message.nestedType[j], options); + } + if (message.enumType && message.enumType.length) { + object.enumType = []; + for (var j = 0; j < message.enumType.length; ++j) + object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); + } + if (message.extensionRange && message.extensionRange.length) { + object.extensionRange = []; + for (var j = 0; j < message.extensionRange.length; ++j) + object.extensionRange[j] = $root.google.protobuf.DescriptorProto.ExtensionRange.toObject(message.extensionRange[j], options); + } + if (message.extension && message.extension.length) { + object.extension = []; + for (var j = 0; j < message.extension.length; ++j) + object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.MessageOptions.toObject(message.options, options); + if (message.oneofDecl && message.oneofDecl.length) { + object.oneofDecl = []; + for (var j = 0; j < message.oneofDecl.length; ++j) + object.oneofDecl[j] = $root.google.protobuf.OneofDescriptorProto.toObject(message.oneofDecl[j], options); + } + if (message.reservedRange && message.reservedRange.length) { + object.reservedRange = []; + for (var j = 0; j < message.reservedRange.length; ++j) + object.reservedRange[j] = $root.google.protobuf.DescriptorProto.ReservedRange.toObject(message.reservedRange[j], options); + } + if (message.reservedName && message.reservedName.length) { + object.reservedName = []; + for (var j = 0; j < message.reservedName.length; ++j) + object.reservedName[j] = message.reservedName[j]; + } + return object; + }; + + /** + * Converts this DescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto + * @instance + * @returns {Object.} JSON object + */ + DescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + DescriptorProto.ExtensionRange = (function() { + + /** + * Properties of an ExtensionRange. + * @memberof google.protobuf.DescriptorProto + * @interface IExtensionRange + * @property {number|null} [start] ExtensionRange start + * @property {number|null} [end] ExtensionRange end + * @property {google.protobuf.IExtensionRangeOptions|null} [options] ExtensionRange options + */ + + /** + * Constructs a new ExtensionRange. + * @memberof google.protobuf.DescriptorProto + * @classdesc Represents an ExtensionRange. + * @implements IExtensionRange + * @constructor + * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set + */ + function ExtensionRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExtensionRange start. + * @member {number} start + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.start = 0; + + /** + * ExtensionRange end. + * @member {number} end + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.end = 0; + + /** + * ExtensionRange options. + * @member {google.protobuf.IExtensionRangeOptions|null|undefined} options + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.options = null; + + /** + * Creates a new ExtensionRange instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange instance + */ + ExtensionRange.create = function create(properties) { + return new ExtensionRange(properties); + }; + + /** + * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.ExtensionRangeOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRange.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.protobuf.DescriptorProto.ExtensionRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.start = reader.int32(); + break; + case 2: + message.end = reader.int32(); + break; + case 3: + message.options = $root.google.protobuf.ExtensionRangeOptions.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExtensionRange message. + * @function verify + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExtensionRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.ExtensionRangeOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + */ + ExtensionRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto.ExtensionRange) + return object; + var message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.DescriptorProto.ExtensionRange.options: object expected"); + message.options = $root.google.protobuf.ExtensionRangeOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.ExtensionRange} message ExtensionRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExtensionRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + object.options = null; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.ExtensionRangeOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this ExtensionRange to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + * @returns {Object.} JSON object + */ + ExtensionRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ExtensionRange; + })(); + + DescriptorProto.ReservedRange = (function() { + + /** + * Properties of a ReservedRange. + * @memberof google.protobuf.DescriptorProto + * @interface IReservedRange + * @property {number|null} [start] ReservedRange start + * @property {number|null} [end] ReservedRange end + */ + + /** + * Constructs a new ReservedRange. + * @memberof google.protobuf.DescriptorProto + * @classdesc Represents a ReservedRange. + * @implements IReservedRange + * @constructor + * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set + */ + function ReservedRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReservedRange start. + * @member {number} start + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + */ + ReservedRange.prototype.start = 0; + + /** + * ReservedRange end. + * @member {number} end + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + */ + ReservedRange.prototype.end = 0; + + /** + * Creates a new ReservedRange instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange instance + */ + ReservedRange.create = function create(properties) { + return new ReservedRange(properties); + }; + + /** + * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReservedRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + return writer; + }; + + /** + * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReservedRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReservedRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReservedRange.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.protobuf.DescriptorProto.ReservedRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.start = reader.int32(); + break; + case 2: + message.end = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReservedRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReservedRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReservedRange message. + * @function verify + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReservedRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + return null; + }; + + /** + * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + */ + ReservedRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto.ReservedRange) + return object; + var message = new $root.google.protobuf.DescriptorProto.ReservedRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + return message; + }; + + /** + * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.ReservedRange} message ReservedRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReservedRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + return object; + }; + + /** + * Converts this ReservedRange to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + * @returns {Object.} JSON object + */ + ReservedRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ReservedRange; + })(); + + return DescriptorProto; + })(); + + protobuf.ExtensionRangeOptions = (function() { + + /** + * Properties of an ExtensionRangeOptions. + * @memberof google.protobuf + * @interface IExtensionRangeOptions + * @property {Array.|null} [uninterpretedOption] ExtensionRangeOptions uninterpretedOption + */ + + /** + * Constructs a new ExtensionRangeOptions. + * @memberof google.protobuf + * @classdesc Represents an ExtensionRangeOptions. + * @implements IExtensionRangeOptions + * @constructor + * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set + */ + function ExtensionRangeOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExtensionRangeOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new ExtensionRangeOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions instance + */ + ExtensionRangeOptions.create = function create(properties) { + return new ExtensionRangeOptions(properties); + }; + + /** + * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRangeOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRangeOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRangeOptions.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.protobuf.ExtensionRangeOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 999: + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRangeOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExtensionRangeOptions message. + * @function verify + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExtensionRangeOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + */ + ExtensionRangeOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ExtensionRangeOptions) + return object; + var message = new $root.google.protobuf.ExtensionRangeOptions(); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.ExtensionRangeOptions} message ExtensionRangeOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExtensionRangeOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this ExtensionRangeOptions to JSON. + * @function toJSON + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + * @returns {Object.} JSON object + */ + ExtensionRangeOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ExtensionRangeOptions; + })(); + + protobuf.FieldDescriptorProto = (function() { + + /** + * Properties of a FieldDescriptorProto. + * @memberof google.protobuf + * @interface IFieldDescriptorProto + * @property {string|null} [name] FieldDescriptorProto name + * @property {number|null} [number] FieldDescriptorProto number + * @property {google.protobuf.FieldDescriptorProto.Label|null} [label] FieldDescriptorProto label + * @property {google.protobuf.FieldDescriptorProto.Type|null} [type] FieldDescriptorProto type + * @property {string|null} [typeName] FieldDescriptorProto typeName + * @property {string|null} [extendee] FieldDescriptorProto extendee + * @property {string|null} [defaultValue] FieldDescriptorProto defaultValue + * @property {number|null} [oneofIndex] FieldDescriptorProto oneofIndex + * @property {string|null} [jsonName] FieldDescriptorProto jsonName + * @property {google.protobuf.IFieldOptions|null} [options] FieldDescriptorProto options + * @property {boolean|null} [proto3Optional] FieldDescriptorProto proto3Optional + */ + + /** + * Constructs a new FieldDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a FieldDescriptorProto. + * @implements IFieldDescriptorProto + * @constructor + * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set + */ + function FieldDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.name = ""; + + /** + * FieldDescriptorProto number. + * @member {number} number + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.number = 0; + + /** + * FieldDescriptorProto label. + * @member {google.protobuf.FieldDescriptorProto.Label} label + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.label = 1; + + /** + * FieldDescriptorProto type. + * @member {google.protobuf.FieldDescriptorProto.Type} type + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.type = 1; + + /** + * FieldDescriptorProto typeName. + * @member {string} typeName + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.typeName = ""; + + /** + * FieldDescriptorProto extendee. + * @member {string} extendee + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.extendee = ""; + + /** + * FieldDescriptorProto defaultValue. + * @member {string} defaultValue + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.defaultValue = ""; + + /** + * FieldDescriptorProto oneofIndex. + * @member {number} oneofIndex + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.oneofIndex = 0; + + /** + * FieldDescriptorProto jsonName. + * @member {string} jsonName + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.jsonName = ""; + + /** + * FieldDescriptorProto options. + * @member {google.protobuf.IFieldOptions|null|undefined} options + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.options = null; + + /** + * FieldDescriptorProto proto3Optional. + * @member {boolean} proto3Optional + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.proto3Optional = false; + + /** + * Creates a new FieldDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto instance + */ + FieldDescriptorProto.create = function create(properties) { + return new FieldDescriptorProto(properties); + }; + + /** + * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.extendee != null && Object.hasOwnProperty.call(message, "extendee")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.extendee); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.number); + if (message.label != null && Object.hasOwnProperty.call(message, "label")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.label); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type); + if (message.typeName != null && Object.hasOwnProperty.call(message, "typeName")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.typeName); + if (message.defaultValue != null && Object.hasOwnProperty.call(message, "defaultValue")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.defaultValue); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.FieldOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.oneofIndex != null && Object.hasOwnProperty.call(message, "oneofIndex")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.oneofIndex); + if (message.jsonName != null && Object.hasOwnProperty.call(message, "jsonName")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.jsonName); + if (message.proto3Optional != null && Object.hasOwnProperty.call(message, "proto3Optional")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.proto3Optional); + return writer; + }; + + /** + * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldDescriptorProto.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.protobuf.FieldDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 3: + message.number = reader.int32(); + break; + case 4: + message.label = reader.int32(); + break; + case 5: + message.type = reader.int32(); + break; + case 6: + message.typeName = reader.string(); + break; + case 2: + message.extendee = reader.string(); + break; + case 7: + message.defaultValue = reader.string(); + break; + case 9: + message.oneofIndex = reader.int32(); + break; + case 10: + message.jsonName = reader.string(); + break; + case 8: + message.options = $root.google.protobuf.FieldOptions.decode(reader, reader.uint32()); + break; + case 17: + message.proto3Optional = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldDescriptorProto message. + * @function verify + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.label != null && message.hasOwnProperty("label")) + switch (message.label) { + default: + return "label: enum value expected"; + case 1: + case 2: + case 3: + break; + } + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + case 18: + break; + } + if (message.typeName != null && message.hasOwnProperty("typeName")) + if (!$util.isString(message.typeName)) + return "typeName: string expected"; + if (message.extendee != null && message.hasOwnProperty("extendee")) + if (!$util.isString(message.extendee)) + return "extendee: string expected"; + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + if (!$util.isString(message.defaultValue)) + return "defaultValue: string expected"; + if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) + if (!$util.isInteger(message.oneofIndex)) + return "oneofIndex: integer expected"; + if (message.jsonName != null && message.hasOwnProperty("jsonName")) + if (!$util.isString(message.jsonName)) + return "jsonName: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.FieldOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) + if (typeof message.proto3Optional !== "boolean") + return "proto3Optional: boolean expected"; + return null; + }; + + /** + * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + */ + FieldDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldDescriptorProto) + return object; + var message = new $root.google.protobuf.FieldDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.number != null) + message.number = object.number | 0; + switch (object.label) { + case "LABEL_OPTIONAL": + case 1: + message.label = 1; + break; + case "LABEL_REQUIRED": + case 2: + message.label = 2; + break; + case "LABEL_REPEATED": + case 3: + message.label = 3; + break; + } + switch (object.type) { + case "TYPE_DOUBLE": + case 1: + message.type = 1; + break; + case "TYPE_FLOAT": + case 2: + message.type = 2; + break; + case "TYPE_INT64": + case 3: + message.type = 3; + break; + case "TYPE_UINT64": + case 4: + message.type = 4; + break; + case "TYPE_INT32": + case 5: + message.type = 5; + break; + case "TYPE_FIXED64": + case 6: + message.type = 6; + break; + case "TYPE_FIXED32": + case 7: + message.type = 7; + break; + case "TYPE_BOOL": + case 8: + message.type = 8; + break; + case "TYPE_STRING": + case 9: + message.type = 9; + break; + case "TYPE_GROUP": + case 10: + message.type = 10; + break; + case "TYPE_MESSAGE": + case 11: + message.type = 11; + break; + case "TYPE_BYTES": + case 12: + message.type = 12; + break; + case "TYPE_UINT32": + case 13: + message.type = 13; + break; + case "TYPE_ENUM": + case 14: + message.type = 14; + break; + case "TYPE_SFIXED32": + case 15: + message.type = 15; + break; + case "TYPE_SFIXED64": + case 16: + message.type = 16; + break; + case "TYPE_SINT32": + case 17: + message.type = 17; + break; + case "TYPE_SINT64": + case 18: + message.type = 18; + break; + } + if (object.typeName != null) + message.typeName = String(object.typeName); + if (object.extendee != null) + message.extendee = String(object.extendee); + if (object.defaultValue != null) + message.defaultValue = String(object.defaultValue); + if (object.oneofIndex != null) + message.oneofIndex = object.oneofIndex | 0; + if (object.jsonName != null) + message.jsonName = String(object.jsonName); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.FieldDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.FieldOptions.fromObject(object.options); + } + if (object.proto3Optional != null) + message.proto3Optional = Boolean(object.proto3Optional); + return message; + }; + + /** + * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.FieldDescriptorProto} message FieldDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.extendee = ""; + object.number = 0; + object.label = options.enums === String ? "LABEL_OPTIONAL" : 1; + object.type = options.enums === String ? "TYPE_DOUBLE" : 1; + object.typeName = ""; + object.defaultValue = ""; + object.options = null; + object.oneofIndex = 0; + object.jsonName = ""; + object.proto3Optional = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.extendee != null && message.hasOwnProperty("extendee")) + object.extendee = message.extendee; + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.label != null && message.hasOwnProperty("label")) + object.label = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Label[message.label] : message.label; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Type[message.type] : message.type; + if (message.typeName != null && message.hasOwnProperty("typeName")) + object.typeName = message.typeName; + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + object.defaultValue = message.defaultValue; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.FieldOptions.toObject(message.options, options); + if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) + object.oneofIndex = message.oneofIndex; + if (message.jsonName != null && message.hasOwnProperty("jsonName")) + object.jsonName = message.jsonName; + if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) + object.proto3Optional = message.proto3Optional; + return object; + }; + + /** + * Converts this FieldDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.FieldDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + FieldDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Type enum. + * @name google.protobuf.FieldDescriptorProto.Type + * @enum {number} + * @property {number} TYPE_DOUBLE=1 TYPE_DOUBLE value + * @property {number} TYPE_FLOAT=2 TYPE_FLOAT value + * @property {number} TYPE_INT64=3 TYPE_INT64 value + * @property {number} TYPE_UINT64=4 TYPE_UINT64 value + * @property {number} TYPE_INT32=5 TYPE_INT32 value + * @property {number} TYPE_FIXED64=6 TYPE_FIXED64 value + * @property {number} TYPE_FIXED32=7 TYPE_FIXED32 value + * @property {number} TYPE_BOOL=8 TYPE_BOOL value + * @property {number} TYPE_STRING=9 TYPE_STRING value + * @property {number} TYPE_GROUP=10 TYPE_GROUP value + * @property {number} TYPE_MESSAGE=11 TYPE_MESSAGE value + * @property {number} TYPE_BYTES=12 TYPE_BYTES value + * @property {number} TYPE_UINT32=13 TYPE_UINT32 value + * @property {number} TYPE_ENUM=14 TYPE_ENUM value + * @property {number} TYPE_SFIXED32=15 TYPE_SFIXED32 value + * @property {number} TYPE_SFIXED64=16 TYPE_SFIXED64 value + * @property {number} TYPE_SINT32=17 TYPE_SINT32 value + * @property {number} TYPE_SINT64=18 TYPE_SINT64 value + */ + FieldDescriptorProto.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "TYPE_DOUBLE"] = 1; + values[valuesById[2] = "TYPE_FLOAT"] = 2; + values[valuesById[3] = "TYPE_INT64"] = 3; + values[valuesById[4] = "TYPE_UINT64"] = 4; + values[valuesById[5] = "TYPE_INT32"] = 5; + values[valuesById[6] = "TYPE_FIXED64"] = 6; + values[valuesById[7] = "TYPE_FIXED32"] = 7; + values[valuesById[8] = "TYPE_BOOL"] = 8; + values[valuesById[9] = "TYPE_STRING"] = 9; + values[valuesById[10] = "TYPE_GROUP"] = 10; + values[valuesById[11] = "TYPE_MESSAGE"] = 11; + values[valuesById[12] = "TYPE_BYTES"] = 12; + values[valuesById[13] = "TYPE_UINT32"] = 13; + values[valuesById[14] = "TYPE_ENUM"] = 14; + values[valuesById[15] = "TYPE_SFIXED32"] = 15; + values[valuesById[16] = "TYPE_SFIXED64"] = 16; + values[valuesById[17] = "TYPE_SINT32"] = 17; + values[valuesById[18] = "TYPE_SINT64"] = 18; + return values; + })(); + + /** + * Label enum. + * @name google.protobuf.FieldDescriptorProto.Label + * @enum {number} + * @property {number} LABEL_OPTIONAL=1 LABEL_OPTIONAL value + * @property {number} LABEL_REQUIRED=2 LABEL_REQUIRED value + * @property {number} LABEL_REPEATED=3 LABEL_REPEATED value + */ + FieldDescriptorProto.Label = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "LABEL_OPTIONAL"] = 1; + values[valuesById[2] = "LABEL_REQUIRED"] = 2; + values[valuesById[3] = "LABEL_REPEATED"] = 3; + return values; + })(); + + return FieldDescriptorProto; + })(); + + protobuf.OneofDescriptorProto = (function() { + + /** + * Properties of an OneofDescriptorProto. + * @memberof google.protobuf + * @interface IOneofDescriptorProto + * @property {string|null} [name] OneofDescriptorProto name + * @property {google.protobuf.IOneofOptions|null} [options] OneofDescriptorProto options + */ + + /** + * Constructs a new OneofDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an OneofDescriptorProto. + * @implements IOneofDescriptorProto + * @constructor + * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set + */ + function OneofDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OneofDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.OneofDescriptorProto + * @instance + */ + OneofDescriptorProto.prototype.name = ""; + + /** + * OneofDescriptorProto options. + * @member {google.protobuf.IOneofOptions|null|undefined} options + * @memberof google.protobuf.OneofDescriptorProto + * @instance + */ + OneofDescriptorProto.prototype.options = null; + + /** + * Creates a new OneofDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto instance + */ + OneofDescriptorProto.create = function create(properties) { + return new OneofDescriptorProto(properties); + }; + + /** + * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.OneofOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofDescriptorProto.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.protobuf.OneofDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.options = $root.google.protobuf.OneofOptions.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OneofDescriptorProto message. + * @function verify + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OneofDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.OneofOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + */ + OneofDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.OneofDescriptorProto) + return object; + var message = new $root.google.protobuf.OneofDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.OneofDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.OneofOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.OneofDescriptorProto} message OneofDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OneofDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.OneofOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this OneofDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.OneofDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + OneofDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return OneofDescriptorProto; + })(); + + protobuf.EnumDescriptorProto = (function() { + + /** + * Properties of an EnumDescriptorProto. + * @memberof google.protobuf + * @interface IEnumDescriptorProto + * @property {string|null} [name] EnumDescriptorProto name + * @property {Array.|null} [value] EnumDescriptorProto value + * @property {google.protobuf.IEnumOptions|null} [options] EnumDescriptorProto options + * @property {Array.|null} [reservedRange] EnumDescriptorProto reservedRange + * @property {Array.|null} [reservedName] EnumDescriptorProto reservedName + */ + + /** + * Constructs a new EnumDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an EnumDescriptorProto. + * @implements IEnumDescriptorProto + * @constructor + * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set + */ + function EnumDescriptorProto(properties) { + this.value = []; + this.reservedRange = []; + this.reservedName = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.name = ""; + + /** + * EnumDescriptorProto value. + * @member {Array.} value + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.value = $util.emptyArray; + + /** + * EnumDescriptorProto options. + * @member {google.protobuf.IEnumOptions|null|undefined} options + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.options = null; + + /** + * EnumDescriptorProto reservedRange. + * @member {Array.} reservedRange + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.reservedRange = $util.emptyArray; + + /** + * EnumDescriptorProto reservedName. + * @member {Array.} reservedName + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.reservedName = $util.emptyArray; + + /** + * Creates a new EnumDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto instance + */ + EnumDescriptorProto.create = function create(properties) { + return new EnumDescriptorProto(properties); + }; + + /** + * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.value != null && message.value.length) + for (var i = 0; i < message.value.length; ++i) + $root.google.protobuf.EnumValueDescriptorProto.encode(message.value[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.EnumOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.reservedRange != null && message.reservedRange.length) + for (var i = 0; i < message.reservedRange.length; ++i) + $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.reservedName != null && message.reservedName.length) + for (var i = 0; i < message.reservedName.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.reservedName[i]); + return writer; + }; + + /** + * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumDescriptorProto.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.protobuf.EnumDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + if (!(message.value && message.value.length)) + message.value = []; + message.value.push($root.google.protobuf.EnumValueDescriptorProto.decode(reader, reader.uint32())); + break; + case 3: + message.options = $root.google.protobuf.EnumOptions.decode(reader, reader.uint32()); + break; + case 4: + if (!(message.reservedRange && message.reservedRange.length)) + message.reservedRange = []; + message.reservedRange.push($root.google.protobuf.EnumDescriptorProto.EnumReservedRange.decode(reader, reader.uint32())); + break; + case 5: + if (!(message.reservedName && message.reservedName.length)) + message.reservedName = []; + message.reservedName.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumDescriptorProto message. + * @function verify + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.value != null && message.hasOwnProperty("value")) { + if (!Array.isArray(message.value)) + return "value: array expected"; + for (var i = 0; i < message.value.length; ++i) { + var error = $root.google.protobuf.EnumValueDescriptorProto.verify(message.value[i]); + if (error) + return "value." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.EnumOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { + if (!Array.isArray(message.reservedRange)) + return "reservedRange: array expected"; + for (var i = 0; i < message.reservedRange.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.verify(message.reservedRange[i]); + if (error) + return "reservedRange." + error; + } + } + if (message.reservedName != null && message.hasOwnProperty("reservedName")) { + if (!Array.isArray(message.reservedName)) + return "reservedName: array expected"; + for (var i = 0; i < message.reservedName.length; ++i) + if (!$util.isString(message.reservedName[i])) + return "reservedName: string[] expected"; + } + return null; + }; + + /** + * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + */ + EnumDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumDescriptorProto) + return object; + var message = new $root.google.protobuf.EnumDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.value) { + if (!Array.isArray(object.value)) + throw TypeError(".google.protobuf.EnumDescriptorProto.value: array expected"); + message.value = []; + for (var i = 0; i < object.value.length; ++i) { + if (typeof object.value[i] !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.value: object expected"); + message.value[i] = $root.google.protobuf.EnumValueDescriptorProto.fromObject(object.value[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.EnumOptions.fromObject(object.options); + } + if (object.reservedRange) { + if (!Array.isArray(object.reservedRange)) + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: array expected"); + message.reservedRange = []; + for (var i = 0; i < object.reservedRange.length; ++i) { + if (typeof object.reservedRange[i] !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: object expected"); + message.reservedRange[i] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.fromObject(object.reservedRange[i]); + } + } + if (object.reservedName) { + if (!Array.isArray(object.reservedName)) + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedName: array expected"); + message.reservedName = []; + for (var i = 0; i < object.reservedName.length; ++i) + message.reservedName[i] = String(object.reservedName[i]); + } + return message; + }; + + /** + * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.EnumDescriptorProto} message EnumDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.value = []; + object.reservedRange = []; + object.reservedName = []; + } + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.value && message.value.length) { + object.value = []; + for (var j = 0; j < message.value.length; ++j) + object.value[j] = $root.google.protobuf.EnumValueDescriptorProto.toObject(message.value[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.EnumOptions.toObject(message.options, options); + if (message.reservedRange && message.reservedRange.length) { + object.reservedRange = []; + for (var j = 0; j < message.reservedRange.length; ++j) + object.reservedRange[j] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.toObject(message.reservedRange[j], options); + } + if (message.reservedName && message.reservedName.length) { + object.reservedName = []; + for (var j = 0; j < message.reservedName.length; ++j) + object.reservedName[j] = message.reservedName[j]; + } + return object; + }; + + /** + * Converts this EnumDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.EnumDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + EnumDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + EnumDescriptorProto.EnumReservedRange = (function() { + + /** + * Properties of an EnumReservedRange. + * @memberof google.protobuf.EnumDescriptorProto + * @interface IEnumReservedRange + * @property {number|null} [start] EnumReservedRange start + * @property {number|null} [end] EnumReservedRange end + */ + + /** + * Constructs a new EnumReservedRange. + * @memberof google.protobuf.EnumDescriptorProto + * @classdesc Represents an EnumReservedRange. + * @implements IEnumReservedRange + * @constructor + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set + */ + function EnumReservedRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumReservedRange start. + * @member {number} start + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + */ + EnumReservedRange.prototype.start = 0; + + /** + * EnumReservedRange end. + * @member {number} end + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + */ + EnumReservedRange.prototype.end = 0; + + /** + * Creates a new EnumReservedRange instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange instance + */ + EnumReservedRange.create = function create(properties) { + return new EnumReservedRange(properties); + }; + + /** + * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumReservedRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + return writer; + }; + + /** + * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumReservedRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumReservedRange.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.protobuf.EnumDescriptorProto.EnumReservedRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.start = reader.int32(); + break; + case 2: + message.end = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumReservedRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumReservedRange message. + * @function verify + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumReservedRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + return null; + }; + + /** + * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + */ + EnumReservedRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumDescriptorProto.EnumReservedRange) + return object; + var message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + return message; + }; + + /** + * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.EnumReservedRange} message EnumReservedRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumReservedRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + return object; + }; + + /** + * Converts this EnumReservedRange to JSON. + * @function toJSON + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + * @returns {Object.} JSON object + */ + EnumReservedRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return EnumReservedRange; + })(); + + return EnumDescriptorProto; + })(); + + protobuf.EnumValueDescriptorProto = (function() { + + /** + * Properties of an EnumValueDescriptorProto. + * @memberof google.protobuf + * @interface IEnumValueDescriptorProto + * @property {string|null} [name] EnumValueDescriptorProto name + * @property {number|null} [number] EnumValueDescriptorProto number + * @property {google.protobuf.IEnumValueOptions|null} [options] EnumValueDescriptorProto options + */ + + /** + * Constructs a new EnumValueDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an EnumValueDescriptorProto. + * @implements IEnumValueDescriptorProto + * @constructor + * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set + */ + function EnumValueDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumValueDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.name = ""; + + /** + * EnumValueDescriptorProto number. + * @member {number} number + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.number = 0; + + /** + * EnumValueDescriptorProto options. + * @member {google.protobuf.IEnumValueOptions|null|undefined} options + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.options = null; + + /** + * Creates a new EnumValueDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto instance + */ + EnumValueDescriptorProto.create = function create(properties) { + return new EnumValueDescriptorProto(properties); + }; + + /** + * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.number); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.EnumValueOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueDescriptorProto.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.protobuf.EnumValueDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.number = reader.int32(); + break; + case 3: + message.options = $root.google.protobuf.EnumValueOptions.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumValueDescriptorProto message. + * @function verify + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumValueDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.EnumValueOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + */ + EnumValueDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumValueDescriptorProto) + return object; + var message = new $root.google.protobuf.EnumValueDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.number != null) + message.number = object.number | 0; + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.EnumValueDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.EnumValueOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.EnumValueDescriptorProto} message EnumValueDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumValueDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.number = 0; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.EnumValueOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this EnumValueDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + EnumValueDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return EnumValueDescriptorProto; + })(); + + protobuf.ServiceDescriptorProto = (function() { + + /** + * Properties of a ServiceDescriptorProto. + * @memberof google.protobuf + * @interface IServiceDescriptorProto + * @property {string|null} [name] ServiceDescriptorProto name + * @property {Array.|null} [method] ServiceDescriptorProto method + * @property {google.protobuf.IServiceOptions|null} [options] ServiceDescriptorProto options + */ + + /** + * Constructs a new ServiceDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a ServiceDescriptorProto. + * @implements IServiceDescriptorProto + * @constructor + * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set + */ + function ServiceDescriptorProto(properties) { + this.method = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ServiceDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.name = ""; + + /** + * ServiceDescriptorProto method. + * @member {Array.} method + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.method = $util.emptyArray; + + /** + * ServiceDescriptorProto options. + * @member {google.protobuf.IServiceOptions|null|undefined} options + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.options = null; + + /** + * Creates a new ServiceDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto instance + */ + ServiceDescriptorProto.create = function create(properties) { + return new ServiceDescriptorProto(properties); + }; + + /** + * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.method != null && message.method.length) + for (var i = 0; i < message.method.length; ++i) + $root.google.protobuf.MethodDescriptorProto.encode(message.method[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.ServiceOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceDescriptorProto.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.protobuf.ServiceDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + if (!(message.method && message.method.length)) + message.method = []; + message.method.push($root.google.protobuf.MethodDescriptorProto.decode(reader, reader.uint32())); + break; + case 3: + message.options = $root.google.protobuf.ServiceOptions.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceDescriptorProto message. + * @function verify + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.method != null && message.hasOwnProperty("method")) { + if (!Array.isArray(message.method)) + return "method: array expected"; + for (var i = 0; i < message.method.length; ++i) { + var error = $root.google.protobuf.MethodDescriptorProto.verify(message.method[i]); + if (error) + return "method." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.ServiceOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + */ + ServiceDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ServiceDescriptorProto) + return object; + var message = new $root.google.protobuf.ServiceDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.method) { + if (!Array.isArray(object.method)) + throw TypeError(".google.protobuf.ServiceDescriptorProto.method: array expected"); + message.method = []; + for (var i = 0; i < object.method.length; ++i) { + if (typeof object.method[i] !== "object") + throw TypeError(".google.protobuf.ServiceDescriptorProto.method: object expected"); + message.method[i] = $root.google.protobuf.MethodDescriptorProto.fromObject(object.method[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.ServiceDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.ServiceOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.ServiceDescriptorProto} message ServiceDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.method = []; + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.method && message.method.length) { + object.method = []; + for (var j = 0; j < message.method.length; ++j) + object.method[j] = $root.google.protobuf.MethodDescriptorProto.toObject(message.method[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.ServiceOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this ServiceDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + ServiceDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ServiceDescriptorProto; + })(); + + protobuf.MethodDescriptorProto = (function() { + + /** + * Properties of a MethodDescriptorProto. + * @memberof google.protobuf + * @interface IMethodDescriptorProto + * @property {string|null} [name] MethodDescriptorProto name + * @property {string|null} [inputType] MethodDescriptorProto inputType + * @property {string|null} [outputType] MethodDescriptorProto outputType + * @property {google.protobuf.IMethodOptions|null} [options] MethodDescriptorProto options + * @property {boolean|null} [clientStreaming] MethodDescriptorProto clientStreaming + * @property {boolean|null} [serverStreaming] MethodDescriptorProto serverStreaming + */ + + /** + * Constructs a new MethodDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a MethodDescriptorProto. + * @implements IMethodDescriptorProto + * @constructor + * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set + */ + function MethodDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MethodDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.name = ""; + + /** + * MethodDescriptorProto inputType. + * @member {string} inputType + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.inputType = ""; + + /** + * MethodDescriptorProto outputType. + * @member {string} outputType + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.outputType = ""; + + /** + * MethodDescriptorProto options. + * @member {google.protobuf.IMethodOptions|null|undefined} options + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.options = null; + + /** + * MethodDescriptorProto clientStreaming. + * @member {boolean} clientStreaming + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.clientStreaming = false; + + /** + * MethodDescriptorProto serverStreaming. + * @member {boolean} serverStreaming + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.serverStreaming = false; + + /** + * Creates a new MethodDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto instance + */ + MethodDescriptorProto.create = function create(properties) { + return new MethodDescriptorProto(properties); + }; + + /** + * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.inputType != null && Object.hasOwnProperty.call(message, "inputType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.inputType); + if (message.outputType != null && Object.hasOwnProperty.call(message, "outputType")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.outputType); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.MethodOptions.encode(message.options, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.clientStreaming != null && Object.hasOwnProperty.call(message, "clientStreaming")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.clientStreaming); + if (message.serverStreaming != null && Object.hasOwnProperty.call(message, "serverStreaming")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.serverStreaming); + return writer; + }; + + /** + * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodDescriptorProto.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.protobuf.MethodDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.inputType = reader.string(); + break; + case 3: + message.outputType = reader.string(); + break; + case 4: + message.options = $root.google.protobuf.MethodOptions.decode(reader, reader.uint32()); + break; + case 5: + message.clientStreaming = reader.bool(); + break; + case 6: + message.serverStreaming = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodDescriptorProto message. + * @function verify + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.inputType != null && message.hasOwnProperty("inputType")) + if (!$util.isString(message.inputType)) + return "inputType: string expected"; + if (message.outputType != null && message.hasOwnProperty("outputType")) + if (!$util.isString(message.outputType)) + return "outputType: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.MethodOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) + if (typeof message.clientStreaming !== "boolean") + return "clientStreaming: boolean expected"; + if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) + if (typeof message.serverStreaming !== "boolean") + return "serverStreaming: boolean expected"; + return null; + }; + + /** + * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + */ + MethodDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MethodDescriptorProto) + return object; + var message = new $root.google.protobuf.MethodDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.inputType != null) + message.inputType = String(object.inputType); + if (object.outputType != null) + message.outputType = String(object.outputType); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.MethodDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.MethodOptions.fromObject(object.options); + } + if (object.clientStreaming != null) + message.clientStreaming = Boolean(object.clientStreaming); + if (object.serverStreaming != null) + message.serverStreaming = Boolean(object.serverStreaming); + return message; + }; + + /** + * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.MethodDescriptorProto} message MethodDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.inputType = ""; + object.outputType = ""; + object.options = null; + object.clientStreaming = false; + object.serverStreaming = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.inputType != null && message.hasOwnProperty("inputType")) + object.inputType = message.inputType; + if (message.outputType != null && message.hasOwnProperty("outputType")) + object.outputType = message.outputType; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.MethodOptions.toObject(message.options, options); + if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) + object.clientStreaming = message.clientStreaming; + if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) + object.serverStreaming = message.serverStreaming; + return object; + }; + + /** + * Converts this MethodDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.MethodDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + MethodDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MethodDescriptorProto; + })(); + + protobuf.FileOptions = (function() { + + /** + * Properties of a FileOptions. + * @memberof google.protobuf + * @interface IFileOptions + * @property {string|null} [javaPackage] FileOptions javaPackage + * @property {string|null} [javaOuterClassname] FileOptions javaOuterClassname + * @property {boolean|null} [javaMultipleFiles] FileOptions javaMultipleFiles + * @property {boolean|null} [javaGenerateEqualsAndHash] FileOptions javaGenerateEqualsAndHash + * @property {boolean|null} [javaStringCheckUtf8] FileOptions javaStringCheckUtf8 + * @property {google.protobuf.FileOptions.OptimizeMode|null} [optimizeFor] FileOptions optimizeFor + * @property {string|null} [goPackage] FileOptions goPackage + * @property {boolean|null} [ccGenericServices] FileOptions ccGenericServices + * @property {boolean|null} [javaGenericServices] FileOptions javaGenericServices + * @property {boolean|null} [pyGenericServices] FileOptions pyGenericServices + * @property {boolean|null} [phpGenericServices] FileOptions phpGenericServices + * @property {boolean|null} [deprecated] FileOptions deprecated + * @property {boolean|null} [ccEnableArenas] FileOptions ccEnableArenas + * @property {string|null} [objcClassPrefix] FileOptions objcClassPrefix + * @property {string|null} [csharpNamespace] FileOptions csharpNamespace + * @property {string|null} [swiftPrefix] FileOptions swiftPrefix + * @property {string|null} [phpClassPrefix] FileOptions phpClassPrefix + * @property {string|null} [phpNamespace] FileOptions phpNamespace + * @property {string|null} [phpMetadataNamespace] FileOptions phpMetadataNamespace + * @property {string|null} [rubyPackage] FileOptions rubyPackage + * @property {Array.|null} [uninterpretedOption] FileOptions uninterpretedOption + * @property {Array.|null} [".google.api.resourceDefinition"] FileOptions .google.api.resourceDefinition + */ + + /** + * Constructs a new FileOptions. + * @memberof google.protobuf + * @classdesc Represents a FileOptions. + * @implements IFileOptions + * @constructor + * @param {google.protobuf.IFileOptions=} [properties] Properties to set + */ + function FileOptions(properties) { + this.uninterpretedOption = []; + this[".google.api.resourceDefinition"] = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileOptions javaPackage. + * @member {string} javaPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaPackage = ""; + + /** + * FileOptions javaOuterClassname. + * @member {string} javaOuterClassname + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaOuterClassname = ""; + + /** + * FileOptions javaMultipleFiles. + * @member {boolean} javaMultipleFiles + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaMultipleFiles = false; + + /** + * FileOptions javaGenerateEqualsAndHash. + * @member {boolean} javaGenerateEqualsAndHash + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaGenerateEqualsAndHash = false; + + /** + * FileOptions javaStringCheckUtf8. + * @member {boolean} javaStringCheckUtf8 + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaStringCheckUtf8 = false; + + /** + * FileOptions optimizeFor. + * @member {google.protobuf.FileOptions.OptimizeMode} optimizeFor + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.optimizeFor = 1; + + /** + * FileOptions goPackage. + * @member {string} goPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.goPackage = ""; + + /** + * FileOptions ccGenericServices. + * @member {boolean} ccGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.ccGenericServices = false; + + /** + * FileOptions javaGenericServices. + * @member {boolean} javaGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaGenericServices = false; + + /** + * FileOptions pyGenericServices. + * @member {boolean} pyGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.pyGenericServices = false; + + /** + * FileOptions phpGenericServices. + * @member {boolean} phpGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpGenericServices = false; + + /** + * FileOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.deprecated = false; + + /** + * FileOptions ccEnableArenas. + * @member {boolean} ccEnableArenas + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.ccEnableArenas = true; + + /** + * FileOptions objcClassPrefix. + * @member {string} objcClassPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.objcClassPrefix = ""; + + /** + * FileOptions csharpNamespace. + * @member {string} csharpNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.csharpNamespace = ""; + + /** + * FileOptions swiftPrefix. + * @member {string} swiftPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.swiftPrefix = ""; + + /** + * FileOptions phpClassPrefix. + * @member {string} phpClassPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpClassPrefix = ""; + + /** + * FileOptions phpNamespace. + * @member {string} phpNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpNamespace = ""; + + /** + * FileOptions phpMetadataNamespace. + * @member {string} phpMetadataNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpMetadataNamespace = ""; + + /** + * FileOptions rubyPackage. + * @member {string} rubyPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.rubyPackage = ""; + + /** + * FileOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * FileOptions .google.api.resourceDefinition. + * @member {Array.} .google.api.resourceDefinition + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype[".google.api.resourceDefinition"] = $util.emptyArray; + + /** + * Creates a new FileOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions=} [properties] Properties to set + * @returns {google.protobuf.FileOptions} FileOptions instance + */ + FileOptions.create = function create(properties) { + return new FileOptions(properties); + }; + + /** + * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.javaPackage != null && Object.hasOwnProperty.call(message, "javaPackage")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.javaPackage); + if (message.javaOuterClassname != null && Object.hasOwnProperty.call(message, "javaOuterClassname")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.javaOuterClassname); + if (message.optimizeFor != null && Object.hasOwnProperty.call(message, "optimizeFor")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.optimizeFor); + if (message.javaMultipleFiles != null && Object.hasOwnProperty.call(message, "javaMultipleFiles")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.javaMultipleFiles); + if (message.goPackage != null && Object.hasOwnProperty.call(message, "goPackage")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.goPackage); + if (message.ccGenericServices != null && Object.hasOwnProperty.call(message, "ccGenericServices")) + writer.uint32(/* id 16, wireType 0 =*/128).bool(message.ccGenericServices); + if (message.javaGenericServices != null && Object.hasOwnProperty.call(message, "javaGenericServices")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.javaGenericServices); + if (message.pyGenericServices != null && Object.hasOwnProperty.call(message, "pyGenericServices")) + writer.uint32(/* id 18, wireType 0 =*/144).bool(message.pyGenericServices); + if (message.javaGenerateEqualsAndHash != null && Object.hasOwnProperty.call(message, "javaGenerateEqualsAndHash")) + writer.uint32(/* id 20, wireType 0 =*/160).bool(message.javaGenerateEqualsAndHash); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 23, wireType 0 =*/184).bool(message.deprecated); + if (message.javaStringCheckUtf8 != null && Object.hasOwnProperty.call(message, "javaStringCheckUtf8")) + writer.uint32(/* id 27, wireType 0 =*/216).bool(message.javaStringCheckUtf8); + if (message.ccEnableArenas != null && Object.hasOwnProperty.call(message, "ccEnableArenas")) + writer.uint32(/* id 31, wireType 0 =*/248).bool(message.ccEnableArenas); + if (message.objcClassPrefix != null && Object.hasOwnProperty.call(message, "objcClassPrefix")) + writer.uint32(/* id 36, wireType 2 =*/290).string(message.objcClassPrefix); + if (message.csharpNamespace != null && Object.hasOwnProperty.call(message, "csharpNamespace")) + writer.uint32(/* id 37, wireType 2 =*/298).string(message.csharpNamespace); + if (message.swiftPrefix != null && Object.hasOwnProperty.call(message, "swiftPrefix")) + writer.uint32(/* id 39, wireType 2 =*/314).string(message.swiftPrefix); + if (message.phpClassPrefix != null && Object.hasOwnProperty.call(message, "phpClassPrefix")) + writer.uint32(/* id 40, wireType 2 =*/322).string(message.phpClassPrefix); + if (message.phpNamespace != null && Object.hasOwnProperty.call(message, "phpNamespace")) + writer.uint32(/* id 41, wireType 2 =*/330).string(message.phpNamespace); + if (message.phpGenericServices != null && Object.hasOwnProperty.call(message, "phpGenericServices")) + writer.uint32(/* id 42, wireType 0 =*/336).bool(message.phpGenericServices); + if (message.phpMetadataNamespace != null && Object.hasOwnProperty.call(message, "phpMetadataNamespace")) + writer.uint32(/* id 44, wireType 2 =*/354).string(message.phpMetadataNamespace); + if (message.rubyPackage != null && Object.hasOwnProperty.call(message, "rubyPackage")) + writer.uint32(/* id 45, wireType 2 =*/362).string(message.rubyPackage); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.resourceDefinition"] != null && message[".google.api.resourceDefinition"].length) + for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) + $root.google.api.ResourceDescriptor.encode(message[".google.api.resourceDefinition"][i], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileOptions} FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileOptions.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.protobuf.FileOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.javaPackage = reader.string(); + break; + case 8: + message.javaOuterClassname = reader.string(); + break; + case 10: + message.javaMultipleFiles = reader.bool(); + break; + case 20: + message.javaGenerateEqualsAndHash = reader.bool(); + break; + case 27: + message.javaStringCheckUtf8 = reader.bool(); + break; + case 9: + message.optimizeFor = reader.int32(); + break; + case 11: + message.goPackage = reader.string(); + break; + case 16: + message.ccGenericServices = reader.bool(); + break; + case 17: + message.javaGenericServices = reader.bool(); + break; + case 18: + message.pyGenericServices = reader.bool(); + break; + case 42: + message.phpGenericServices = reader.bool(); + break; + case 23: + message.deprecated = reader.bool(); + break; + case 31: + message.ccEnableArenas = reader.bool(); + break; + case 36: + message.objcClassPrefix = reader.string(); + break; + case 37: + message.csharpNamespace = reader.string(); + break; + case 39: + message.swiftPrefix = reader.string(); + break; + case 40: + message.phpClassPrefix = reader.string(); + break; + case 41: + message.phpNamespace = reader.string(); + break; + case 44: + message.phpMetadataNamespace = reader.string(); + break; + case 45: + message.rubyPackage = reader.string(); + break; + case 999: + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + case 1053: + if (!(message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length)) + message[".google.api.resourceDefinition"] = []; + message[".google.api.resourceDefinition"].push($root.google.api.ResourceDescriptor.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileOptions} FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileOptions message. + * @function verify + * @memberof google.protobuf.FileOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) + if (!$util.isString(message.javaPackage)) + return "javaPackage: string expected"; + if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) + if (!$util.isString(message.javaOuterClassname)) + return "javaOuterClassname: string expected"; + if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) + if (typeof message.javaMultipleFiles !== "boolean") + return "javaMultipleFiles: boolean expected"; + if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) + if (typeof message.javaGenerateEqualsAndHash !== "boolean") + return "javaGenerateEqualsAndHash: boolean expected"; + if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) + if (typeof message.javaStringCheckUtf8 !== "boolean") + return "javaStringCheckUtf8: boolean expected"; + if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) + switch (message.optimizeFor) { + default: + return "optimizeFor: enum value expected"; + case 1: + case 2: + case 3: + break; + } + if (message.goPackage != null && message.hasOwnProperty("goPackage")) + if (!$util.isString(message.goPackage)) + return "goPackage: string expected"; + if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) + if (typeof message.ccGenericServices !== "boolean") + return "ccGenericServices: boolean expected"; + if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) + if (typeof message.javaGenericServices !== "boolean") + return "javaGenericServices: boolean expected"; + if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) + if (typeof message.pyGenericServices !== "boolean") + return "pyGenericServices: boolean expected"; + if (message.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) + if (typeof message.phpGenericServices !== "boolean") + return "phpGenericServices: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) + if (typeof message.ccEnableArenas !== "boolean") + return "ccEnableArenas: boolean expected"; + if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) + if (!$util.isString(message.objcClassPrefix)) + return "objcClassPrefix: string expected"; + if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) + if (!$util.isString(message.csharpNamespace)) + return "csharpNamespace: string expected"; + if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) + if (!$util.isString(message.swiftPrefix)) + return "swiftPrefix: string expected"; + if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) + if (!$util.isString(message.phpClassPrefix)) + return "phpClassPrefix: string expected"; + if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) + if (!$util.isString(message.phpNamespace)) + return "phpNamespace: string expected"; + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + if (!$util.isString(message.phpMetadataNamespace)) + return "phpMetadataNamespace: string expected"; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + if (!$util.isString(message.rubyPackage)) + return "rubyPackage: string expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.resourceDefinition"] != null && message.hasOwnProperty(".google.api.resourceDefinition")) { + if (!Array.isArray(message[".google.api.resourceDefinition"])) + return ".google.api.resourceDefinition: array expected"; + for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) { + var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resourceDefinition"][i]); + if (error) + return ".google.api.resourceDefinition." + error; + } + } + return null; + }; + + /** + * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileOptions} FileOptions + */ + FileOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileOptions) + return object; + var message = new $root.google.protobuf.FileOptions(); + if (object.javaPackage != null) + message.javaPackage = String(object.javaPackage); + if (object.javaOuterClassname != null) + message.javaOuterClassname = String(object.javaOuterClassname); + if (object.javaMultipleFiles != null) + message.javaMultipleFiles = Boolean(object.javaMultipleFiles); + if (object.javaGenerateEqualsAndHash != null) + message.javaGenerateEqualsAndHash = Boolean(object.javaGenerateEqualsAndHash); + if (object.javaStringCheckUtf8 != null) + message.javaStringCheckUtf8 = Boolean(object.javaStringCheckUtf8); + switch (object.optimizeFor) { + case "SPEED": + case 1: + message.optimizeFor = 1; + break; + case "CODE_SIZE": + case 2: + message.optimizeFor = 2; + break; + case "LITE_RUNTIME": + case 3: + message.optimizeFor = 3; + break; + } + if (object.goPackage != null) + message.goPackage = String(object.goPackage); + if (object.ccGenericServices != null) + message.ccGenericServices = Boolean(object.ccGenericServices); + if (object.javaGenericServices != null) + message.javaGenericServices = Boolean(object.javaGenericServices); + if (object.pyGenericServices != null) + message.pyGenericServices = Boolean(object.pyGenericServices); + if (object.phpGenericServices != null) + message.phpGenericServices = Boolean(object.phpGenericServices); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.ccEnableArenas != null) + message.ccEnableArenas = Boolean(object.ccEnableArenas); + if (object.objcClassPrefix != null) + message.objcClassPrefix = String(object.objcClassPrefix); + if (object.csharpNamespace != null) + message.csharpNamespace = String(object.csharpNamespace); + if (object.swiftPrefix != null) + message.swiftPrefix = String(object.swiftPrefix); + if (object.phpClassPrefix != null) + message.phpClassPrefix = String(object.phpClassPrefix); + if (object.phpNamespace != null) + message.phpNamespace = String(object.phpNamespace); + if (object.phpMetadataNamespace != null) + message.phpMetadataNamespace = String(object.phpMetadataNamespace); + if (object.rubyPackage != null) + message.rubyPackage = String(object.rubyPackage); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.resourceDefinition"]) { + if (!Array.isArray(object[".google.api.resourceDefinition"])) + throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: array expected"); + message[".google.api.resourceDefinition"] = []; + for (var i = 0; i < object[".google.api.resourceDefinition"].length; ++i) { + if (typeof object[".google.api.resourceDefinition"][i] !== "object") + throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: object expected"); + message[".google.api.resourceDefinition"][i] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resourceDefinition"][i]); + } + } + return message; + }; + + /** + * Creates a plain object from a FileOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.FileOptions} message FileOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.uninterpretedOption = []; + object[".google.api.resourceDefinition"] = []; + } + if (options.defaults) { + object.javaPackage = ""; + object.javaOuterClassname = ""; + object.optimizeFor = options.enums === String ? "SPEED" : 1; + object.javaMultipleFiles = false; + object.goPackage = ""; + object.ccGenericServices = false; + object.javaGenericServices = false; + object.pyGenericServices = false; + object.javaGenerateEqualsAndHash = false; + object.deprecated = false; + object.javaStringCheckUtf8 = false; + object.ccEnableArenas = true; + object.objcClassPrefix = ""; + object.csharpNamespace = ""; + object.swiftPrefix = ""; + object.phpClassPrefix = ""; + object.phpNamespace = ""; + object.phpGenericServices = false; + object.phpMetadataNamespace = ""; + object.rubyPackage = ""; + } + if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) + object.javaPackage = message.javaPackage; + if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) + object.javaOuterClassname = message.javaOuterClassname; + if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) + object.optimizeFor = options.enums === String ? $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] : message.optimizeFor; + if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) + object.javaMultipleFiles = message.javaMultipleFiles; + if (message.goPackage != null && message.hasOwnProperty("goPackage")) + object.goPackage = message.goPackage; + if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) + object.ccGenericServices = message.ccGenericServices; + if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) + object.javaGenericServices = message.javaGenericServices; + if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) + object.pyGenericServices = message.pyGenericServices; + if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) + object.javaGenerateEqualsAndHash = message.javaGenerateEqualsAndHash; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) + object.javaStringCheckUtf8 = message.javaStringCheckUtf8; + if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) + object.ccEnableArenas = message.ccEnableArenas; + if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) + object.objcClassPrefix = message.objcClassPrefix; + if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) + object.csharpNamespace = message.csharpNamespace; + if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) + object.swiftPrefix = message.swiftPrefix; + if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) + object.phpClassPrefix = message.phpClassPrefix; + if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) + object.phpNamespace = message.phpNamespace; + if (message.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) + object.phpGenericServices = message.phpGenericServices; + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + object.phpMetadataNamespace = message.phpMetadataNamespace; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + object.rubyPackage = message.rubyPackage; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length) { + object[".google.api.resourceDefinition"] = []; + for (var j = 0; j < message[".google.api.resourceDefinition"].length; ++j) + object[".google.api.resourceDefinition"][j] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resourceDefinition"][j], options); + } + return object; + }; + + /** + * Converts this FileOptions to JSON. + * @function toJSON + * @memberof google.protobuf.FileOptions + * @instance + * @returns {Object.} JSON object + */ + FileOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * OptimizeMode enum. + * @name google.protobuf.FileOptions.OptimizeMode + * @enum {number} + * @property {number} SPEED=1 SPEED value + * @property {number} CODE_SIZE=2 CODE_SIZE value + * @property {number} LITE_RUNTIME=3 LITE_RUNTIME value + */ + FileOptions.OptimizeMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "SPEED"] = 1; + values[valuesById[2] = "CODE_SIZE"] = 2; + values[valuesById[3] = "LITE_RUNTIME"] = 3; + return values; + })(); + + return FileOptions; + })(); + + protobuf.MessageOptions = (function() { + + /** + * Properties of a MessageOptions. + * @memberof google.protobuf + * @interface IMessageOptions + * @property {boolean|null} [messageSetWireFormat] MessageOptions messageSetWireFormat + * @property {boolean|null} [noStandardDescriptorAccessor] MessageOptions noStandardDescriptorAccessor + * @property {boolean|null} [deprecated] MessageOptions deprecated + * @property {boolean|null} [mapEntry] MessageOptions mapEntry + * @property {Array.|null} [uninterpretedOption] MessageOptions uninterpretedOption + * @property {google.api.IResourceDescriptor|null} [".google.api.resource"] MessageOptions .google.api.resource + */ + + /** + * Constructs a new MessageOptions. + * @memberof google.protobuf + * @classdesc Represents a MessageOptions. + * @implements IMessageOptions + * @constructor + * @param {google.protobuf.IMessageOptions=} [properties] Properties to set + */ + function MessageOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MessageOptions messageSetWireFormat. + * @member {boolean} messageSetWireFormat + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.messageSetWireFormat = false; + + /** + * MessageOptions noStandardDescriptorAccessor. + * @member {boolean} noStandardDescriptorAccessor + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.noStandardDescriptorAccessor = false; + + /** + * MessageOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.deprecated = false; + + /** + * MessageOptions mapEntry. + * @member {boolean} mapEntry + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.mapEntry = false; + + /** + * MessageOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * MessageOptions .google.api.resource. + * @member {google.api.IResourceDescriptor|null|undefined} .google.api.resource + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype[".google.api.resource"] = null; + + /** + * Creates a new MessageOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions=} [properties] Properties to set + * @returns {google.protobuf.MessageOptions} MessageOptions instance + */ + MessageOptions.create = function create(properties) { + return new MessageOptions(properties); + }; + + /** + * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.messageSetWireFormat != null && Object.hasOwnProperty.call(message, "messageSetWireFormat")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.messageSetWireFormat); + if (message.noStandardDescriptorAccessor != null && Object.hasOwnProperty.call(message, "noStandardDescriptorAccessor")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.noStandardDescriptorAccessor); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.mapEntry != null && Object.hasOwnProperty.call(message, "mapEntry")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.mapEntry); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.resource"] != null && Object.hasOwnProperty.call(message, ".google.api.resource")) + $root.google.api.ResourceDescriptor.encode(message[".google.api.resource"], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MessageOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MessageOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MessageOptions} MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageOptions.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.protobuf.MessageOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.messageSetWireFormat = reader.bool(); + break; + case 2: + message.noStandardDescriptorAccessor = reader.bool(); + break; + case 3: + message.deprecated = reader.bool(); + break; + case 7: + message.mapEntry = reader.bool(); + break; + case 999: + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + case 1053: + message[".google.api.resource"] = $root.google.api.ResourceDescriptor.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MessageOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MessageOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MessageOptions} MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MessageOptions message. + * @function verify + * @memberof google.protobuf.MessageOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MessageOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) + if (typeof message.messageSetWireFormat !== "boolean") + return "messageSetWireFormat: boolean expected"; + if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + if (typeof message.noStandardDescriptorAccessor !== "boolean") + return "noStandardDescriptorAccessor: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) + if (typeof message.mapEntry !== "boolean") + return "mapEntry: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) { + var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resource"]); + if (error) + return ".google.api.resource." + error; + } + return null; + }; + + /** + * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MessageOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MessageOptions} MessageOptions + */ + MessageOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MessageOptions) + return object; + var message = new $root.google.protobuf.MessageOptions(); + if (object.messageSetWireFormat != null) + message.messageSetWireFormat = Boolean(object.messageSetWireFormat); + if (object.noStandardDescriptorAccessor != null) + message.noStandardDescriptorAccessor = Boolean(object.noStandardDescriptorAccessor); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.mapEntry != null) + message.mapEntry = Boolean(object.mapEntry); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.resource"] != null) { + if (typeof object[".google.api.resource"] !== "object") + throw TypeError(".google.protobuf.MessageOptions..google.api.resource: object expected"); + message[".google.api.resource"] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resource"]); + } + return message; + }; + + /** + * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.MessageOptions} message MessageOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MessageOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.messageSetWireFormat = false; + object.noStandardDescriptorAccessor = false; + object.deprecated = false; + object.mapEntry = false; + object[".google.api.resource"] = null; + } + if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) + object.messageSetWireFormat = message.messageSetWireFormat; + if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + object.noStandardDescriptorAccessor = message.noStandardDescriptorAccessor; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) + object.mapEntry = message.mapEntry; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) + object[".google.api.resource"] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resource"], options); + return object; + }; + + /** + * Converts this MessageOptions to JSON. + * @function toJSON + * @memberof google.protobuf.MessageOptions + * @instance + * @returns {Object.} JSON object + */ + MessageOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MessageOptions; + })(); + + protobuf.FieldOptions = (function() { + + /** + * Properties of a FieldOptions. + * @memberof google.protobuf + * @interface IFieldOptions + * @property {google.protobuf.FieldOptions.CType|null} [ctype] FieldOptions ctype + * @property {boolean|null} [packed] FieldOptions packed + * @property {google.protobuf.FieldOptions.JSType|null} [jstype] FieldOptions jstype + * @property {boolean|null} [lazy] FieldOptions lazy + * @property {boolean|null} [deprecated] FieldOptions deprecated + * @property {boolean|null} [weak] FieldOptions weak + * @property {Array.|null} [uninterpretedOption] FieldOptions uninterpretedOption + * @property {Array.|null} [".google.api.fieldBehavior"] FieldOptions .google.api.fieldBehavior + * @property {google.api.IResourceReference|null} [".google.api.resourceReference"] FieldOptions .google.api.resourceReference + */ + + /** + * Constructs a new FieldOptions. + * @memberof google.protobuf + * @classdesc Represents a FieldOptions. + * @implements IFieldOptions + * @constructor + * @param {google.protobuf.IFieldOptions=} [properties] Properties to set + */ + function FieldOptions(properties) { + this.uninterpretedOption = []; + this[".google.api.fieldBehavior"] = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldOptions ctype. + * @member {google.protobuf.FieldOptions.CType} ctype + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.ctype = 0; + + /** + * FieldOptions packed. + * @member {boolean} packed + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.packed = false; + + /** + * FieldOptions jstype. + * @member {google.protobuf.FieldOptions.JSType} jstype + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.jstype = 0; + + /** + * FieldOptions lazy. + * @member {boolean} lazy + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.lazy = false; + + /** + * FieldOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.deprecated = false; + + /** + * FieldOptions weak. + * @member {boolean} weak + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.weak = false; + + /** + * FieldOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * FieldOptions .google.api.fieldBehavior. + * @member {Array.} .google.api.fieldBehavior + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.fieldBehavior"] = $util.emptyArray; + + /** + * FieldOptions .google.api.resourceReference. + * @member {google.api.IResourceReference|null|undefined} .google.api.resourceReference + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.resourceReference"] = null; + + /** + * Creates a new FieldOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions=} [properties] Properties to set + * @returns {google.protobuf.FieldOptions} FieldOptions instance + */ + FieldOptions.create = function create(properties) { + return new FieldOptions(properties); + }; + + /** + * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ctype != null && Object.hasOwnProperty.call(message, "ctype")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ctype); + if (message.packed != null && Object.hasOwnProperty.call(message, "packed")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.packed); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.lazy != null && Object.hasOwnProperty.call(message, "lazy")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.lazy); + if (message.jstype != null && Object.hasOwnProperty.call(message, "jstype")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jstype); + if (message.weak != null && Object.hasOwnProperty.call(message, "weak")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.weak); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.fieldBehavior"] != null && message[".google.api.fieldBehavior"].length) { + writer.uint32(/* id 1052, wireType 2 =*/8418).fork(); + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + writer.int32(message[".google.api.fieldBehavior"][i]); + writer.ldelim(); + } + if (message[".google.api.resourceReference"] != null && Object.hasOwnProperty.call(message, ".google.api.resourceReference")) + $root.google.api.ResourceReference.encode(message[".google.api.resourceReference"], writer.uint32(/* id 1055, wireType 2 =*/8442).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldOptions} FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldOptions.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.protobuf.FieldOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.ctype = reader.int32(); + break; + case 2: + message.packed = reader.bool(); + break; + case 6: + message.jstype = reader.int32(); + break; + case 5: + message.lazy = reader.bool(); + break; + case 3: + message.deprecated = reader.bool(); + break; + case 10: + message.weak = reader.bool(); + break; + case 999: + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + case 1052: + if (!(message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length)) + message[".google.api.fieldBehavior"] = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message[".google.api.fieldBehavior"].push(reader.int32()); + } else + message[".google.api.fieldBehavior"].push(reader.int32()); + break; + case 1055: + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldOptions} FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldOptions message. + * @function verify + * @memberof google.protobuf.FieldOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ctype != null && message.hasOwnProperty("ctype")) + switch (message.ctype) { + default: + return "ctype: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.packed != null && message.hasOwnProperty("packed")) + if (typeof message.packed !== "boolean") + return "packed: boolean expected"; + if (message.jstype != null && message.hasOwnProperty("jstype")) + switch (message.jstype) { + default: + return "jstype: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.lazy != null && message.hasOwnProperty("lazy")) + if (typeof message.lazy !== "boolean") + return "lazy: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.weak != null && message.hasOwnProperty("weak")) + if (typeof message.weak !== "boolean") + return "weak: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.fieldBehavior"] != null && message.hasOwnProperty(".google.api.fieldBehavior")) { + if (!Array.isArray(message[".google.api.fieldBehavior"])) + return ".google.api.fieldBehavior: array expected"; + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + switch (message[".google.api.fieldBehavior"][i]) { + default: + return ".google.api.fieldBehavior: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + } + if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) { + var error = $root.google.api.ResourceReference.verify(message[".google.api.resourceReference"]); + if (error) + return ".google.api.resourceReference." + error; + } + return null; + }; + + /** + * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldOptions} FieldOptions + */ + FieldOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldOptions) + return object; + var message = new $root.google.protobuf.FieldOptions(); + switch (object.ctype) { + case "STRING": + case 0: + message.ctype = 0; + break; + case "CORD": + case 1: + message.ctype = 1; + break; + case "STRING_PIECE": + case 2: + message.ctype = 2; + break; + } + if (object.packed != null) + message.packed = Boolean(object.packed); + switch (object.jstype) { + case "JS_NORMAL": + case 0: + message.jstype = 0; + break; + case "JS_STRING": + case 1: + message.jstype = 1; + break; + case "JS_NUMBER": + case 2: + message.jstype = 2; + break; + } + if (object.lazy != null) + message.lazy = Boolean(object.lazy); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.weak != null) + message.weak = Boolean(object.weak); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.fieldBehavior"]) { + if (!Array.isArray(object[".google.api.fieldBehavior"])) + throw TypeError(".google.protobuf.FieldOptions..google.api.fieldBehavior: array expected"); + message[".google.api.fieldBehavior"] = []; + for (var i = 0; i < object[".google.api.fieldBehavior"].length; ++i) + switch (object[".google.api.fieldBehavior"][i]) { + default: + case "FIELD_BEHAVIOR_UNSPECIFIED": + case 0: + message[".google.api.fieldBehavior"][i] = 0; + break; + case "OPTIONAL": + case 1: + message[".google.api.fieldBehavior"][i] = 1; + break; + case "REQUIRED": + case 2: + message[".google.api.fieldBehavior"][i] = 2; + break; + case "OUTPUT_ONLY": + case 3: + message[".google.api.fieldBehavior"][i] = 3; + break; + case "INPUT_ONLY": + case 4: + message[".google.api.fieldBehavior"][i] = 4; + break; + case "IMMUTABLE": + case 5: + message[".google.api.fieldBehavior"][i] = 5; + break; + case "UNORDERED_LIST": + case 6: + message[".google.api.fieldBehavior"][i] = 6; + break; + } + } + if (object[".google.api.resourceReference"] != null) { + if (typeof object[".google.api.resourceReference"] !== "object") + throw TypeError(".google.protobuf.FieldOptions..google.api.resourceReference: object expected"); + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.fromObject(object[".google.api.resourceReference"]); + } + return message; + }; + + /** + * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.FieldOptions} message FieldOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.uninterpretedOption = []; + object[".google.api.fieldBehavior"] = []; + } + if (options.defaults) { + object.ctype = options.enums === String ? "STRING" : 0; + object.packed = false; + object.deprecated = false; + object.lazy = false; + object.jstype = options.enums === String ? "JS_NORMAL" : 0; + object.weak = false; + object[".google.api.resourceReference"] = null; + } + if (message.ctype != null && message.hasOwnProperty("ctype")) + object.ctype = options.enums === String ? $root.google.protobuf.FieldOptions.CType[message.ctype] : message.ctype; + if (message.packed != null && message.hasOwnProperty("packed")) + object.packed = message.packed; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.lazy != null && message.hasOwnProperty("lazy")) + object.lazy = message.lazy; + if (message.jstype != null && message.hasOwnProperty("jstype")) + object.jstype = options.enums === String ? $root.google.protobuf.FieldOptions.JSType[message.jstype] : message.jstype; + if (message.weak != null && message.hasOwnProperty("weak")) + object.weak = message.weak; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length) { + object[".google.api.fieldBehavior"] = []; + for (var j = 0; j < message[".google.api.fieldBehavior"].length; ++j) + object[".google.api.fieldBehavior"][j] = options.enums === String ? $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] : message[".google.api.fieldBehavior"][j]; + } + if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) + object[".google.api.resourceReference"] = $root.google.api.ResourceReference.toObject(message[".google.api.resourceReference"], options); + return object; + }; + + /** + * Converts this FieldOptions to JSON. + * @function toJSON + * @memberof google.protobuf.FieldOptions + * @instance + * @returns {Object.} JSON object + */ + FieldOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * CType enum. + * @name google.protobuf.FieldOptions.CType + * @enum {number} + * @property {number} STRING=0 STRING value + * @property {number} CORD=1 CORD value + * @property {number} STRING_PIECE=2 STRING_PIECE value + */ + FieldOptions.CType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STRING"] = 0; + values[valuesById[1] = "CORD"] = 1; + values[valuesById[2] = "STRING_PIECE"] = 2; + return values; + })(); + + /** + * JSType enum. + * @name google.protobuf.FieldOptions.JSType + * @enum {number} + * @property {number} JS_NORMAL=0 JS_NORMAL value + * @property {number} JS_STRING=1 JS_STRING value + * @property {number} JS_NUMBER=2 JS_NUMBER value + */ + FieldOptions.JSType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "JS_NORMAL"] = 0; + values[valuesById[1] = "JS_STRING"] = 1; + values[valuesById[2] = "JS_NUMBER"] = 2; + return values; + })(); + + return FieldOptions; + })(); + + protobuf.OneofOptions = (function() { + + /** + * Properties of an OneofOptions. + * @memberof google.protobuf + * @interface IOneofOptions + * @property {Array.|null} [uninterpretedOption] OneofOptions uninterpretedOption + */ + + /** + * Constructs a new OneofOptions. + * @memberof google.protobuf + * @classdesc Represents an OneofOptions. + * @implements IOneofOptions + * @constructor + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + */ + function OneofOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OneofOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.OneofOptions + * @instance + */ + OneofOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new OneofOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + * @returns {google.protobuf.OneofOptions} OneofOptions instance + */ + OneofOptions.create = function create(properties) { + return new OneofOptions(properties); + }; + + /** + * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OneofOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.OneofOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.OneofOptions} OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofOptions.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.protobuf.OneofOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 999: + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OneofOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.OneofOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.OneofOptions} OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OneofOptions message. + * @function verify + * @memberof google.protobuf.OneofOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OneofOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.OneofOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.OneofOptions} OneofOptions + */ + OneofOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.OneofOptions) + return object; + var message = new $root.google.protobuf.OneofOptions(); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.OneofOptions} message OneofOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OneofOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this OneofOptions to JSON. + * @function toJSON + * @memberof google.protobuf.OneofOptions + * @instance + * @returns {Object.} JSON object + */ + OneofOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return OneofOptions; + })(); + + protobuf.EnumOptions = (function() { + + /** + * Properties of an EnumOptions. + * @memberof google.protobuf + * @interface IEnumOptions + * @property {boolean|null} [allowAlias] EnumOptions allowAlias + * @property {boolean|null} [deprecated] EnumOptions deprecated + * @property {Array.|null} [uninterpretedOption] EnumOptions uninterpretedOption + */ + + /** + * Constructs a new EnumOptions. + * @memberof google.protobuf + * @classdesc Represents an EnumOptions. + * @implements IEnumOptions + * @constructor + * @param {google.protobuf.IEnumOptions=} [properties] Properties to set + */ + function EnumOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumOptions allowAlias. + * @member {boolean} allowAlias + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.allowAlias = false; + + /** + * EnumOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.deprecated = false; + + /** + * EnumOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new EnumOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions=} [properties] Properties to set + * @returns {google.protobuf.EnumOptions} EnumOptions instance + */ + EnumOptions.create = function create(properties) { + return new EnumOptions(properties); + }; + + /** + * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.allowAlias != null && Object.hasOwnProperty.call(message, "allowAlias")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAlias); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumOptions} EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumOptions.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.protobuf.EnumOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + message.allowAlias = reader.bool(); + break; + case 3: + message.deprecated = reader.bool(); + break; + case 999: + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumOptions} EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumOptions message. + * @function verify + * @memberof google.protobuf.EnumOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + if (typeof message.allowAlias !== "boolean") + return "allowAlias: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumOptions} EnumOptions + */ + EnumOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumOptions) + return object; + var message = new $root.google.protobuf.EnumOptions(); + if (object.allowAlias != null) + message.allowAlias = Boolean(object.allowAlias); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.EnumOptions} message EnumOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.allowAlias = false; + object.deprecated = false; + } + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + object.allowAlias = message.allowAlias; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this EnumOptions to JSON. + * @function toJSON + * @memberof google.protobuf.EnumOptions + * @instance + * @returns {Object.} JSON object + */ + EnumOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return EnumOptions; + })(); + + protobuf.EnumValueOptions = (function() { + + /** + * Properties of an EnumValueOptions. + * @memberof google.protobuf + * @interface IEnumValueOptions + * @property {boolean|null} [deprecated] EnumValueOptions deprecated + * @property {Array.|null} [uninterpretedOption] EnumValueOptions uninterpretedOption + */ + + /** + * Constructs a new EnumValueOptions. + * @memberof google.protobuf + * @classdesc Represents an EnumValueOptions. + * @implements IEnumValueOptions + * @constructor + * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set + */ + function EnumValueOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumValueOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.deprecated = false; + + /** + * EnumValueOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new EnumValueOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions instance + */ + EnumValueOptions.create = function create(properties) { + return new EnumValueOptions(properties); + }; + + /** + * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.deprecated); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueOptions.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.protobuf.EnumValueOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.deprecated = reader.bool(); + break; + case 999: + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumValueOptions message. + * @function verify + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumValueOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + */ + EnumValueOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumValueOptions) + return object; + var message = new $root.google.protobuf.EnumValueOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.EnumValueOptions} message EnumValueOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumValueOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) + object.deprecated = false; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this EnumValueOptions to JSON. + * @function toJSON + * @memberof google.protobuf.EnumValueOptions + * @instance + * @returns {Object.} JSON object + */ + EnumValueOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return EnumValueOptions; + })(); + + protobuf.ServiceOptions = (function() { + + /** + * Properties of a ServiceOptions. + * @memberof google.protobuf + * @interface IServiceOptions + * @property {boolean|null} [deprecated] ServiceOptions deprecated + * @property {Array.|null} [uninterpretedOption] ServiceOptions uninterpretedOption + * @property {string|null} [".google.api.defaultHost"] ServiceOptions .google.api.defaultHost + * @property {string|null} [".google.api.oauthScopes"] ServiceOptions .google.api.oauthScopes + */ + + /** + * Constructs a new ServiceOptions. + * @memberof google.protobuf + * @classdesc Represents a ServiceOptions. + * @implements IServiceOptions + * @constructor + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + */ + function ServiceOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ServiceOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.deprecated = false; + + /** + * ServiceOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * ServiceOptions .google.api.defaultHost. + * @member {string} .google.api.defaultHost + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.defaultHost"] = ""; + + /** + * ServiceOptions .google.api.oauthScopes. + * @member {string} .google.api.oauthScopes + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.oauthScopes"] = ""; + + /** + * Creates a new ServiceOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + * @returns {google.protobuf.ServiceOptions} ServiceOptions instance + */ + ServiceOptions.create = function create(properties) { + return new ServiceOptions(properties); + }; + + /** + * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.defaultHost"] != null && Object.hasOwnProperty.call(message, ".google.api.defaultHost")) + writer.uint32(/* id 1049, wireType 2 =*/8394).string(message[".google.api.defaultHost"]); + if (message[".google.api.oauthScopes"] != null && Object.hasOwnProperty.call(message, ".google.api.oauthScopes")) + writer.uint32(/* id 1050, wireType 2 =*/8402).string(message[".google.api.oauthScopes"]); + return writer; + }; + + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ServiceOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceOptions.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.protobuf.ServiceOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 33: + message.deprecated = reader.bool(); + break; + case 999: + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + case 1049: + message[".google.api.defaultHost"] = reader.string(); + break; + case 1050: + message[".google.api.oauthScopes"] = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceOptions message. + * @function verify + * @memberof google.protobuf.ServiceOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + if (!$util.isString(message[".google.api.defaultHost"])) + return ".google.api.defaultHost: string expected"; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + if (!$util.isString(message[".google.api.oauthScopes"])) + return ".google.api.oauthScopes: string expected"; + return null; + }; + + /** + * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ServiceOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ServiceOptions} ServiceOptions + */ + ServiceOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ServiceOptions) + return object; + var message = new $root.google.protobuf.ServiceOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.defaultHost"] != null) + message[".google.api.defaultHost"] = String(object[".google.api.defaultHost"]); + if (object[".google.api.oauthScopes"] != null) + message[".google.api.oauthScopes"] = String(object[".google.api.oauthScopes"]); + return message; + }; + + /** + * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.ServiceOptions} message ServiceOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.deprecated = false; + object[".google.api.defaultHost"] = ""; + object[".google.api.oauthScopes"] = ""; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + object[".google.api.defaultHost"] = message[".google.api.defaultHost"]; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + object[".google.api.oauthScopes"] = message[".google.api.oauthScopes"]; + return object; + }; + + /** + * Converts this ServiceOptions to JSON. + * @function toJSON + * @memberof google.protobuf.ServiceOptions + * @instance + * @returns {Object.} JSON object + */ + ServiceOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ServiceOptions; + })(); + + protobuf.MethodOptions = (function() { + + /** + * Properties of a MethodOptions. + * @memberof google.protobuf + * @interface IMethodOptions + * @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 + */ + + /** + * Constructs a new MethodOptions. + * @memberof google.protobuf + * @classdesc Represents a MethodOptions. + * @implements IMethodOptions + * @constructor + * @param {google.protobuf.IMethodOptions=} [properties] Properties to set + */ + function MethodOptions(properties) { + this.uninterpretedOption = []; + this[".google.api.methodSignature"] = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MethodOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.deprecated = false; + + /** + * MethodOptions idempotencyLevel. + * @member {google.protobuf.MethodOptions.IdempotencyLevel} idempotencyLevel + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.idempotencyLevel = 0; + + /** + * MethodOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * MethodOptions .google.api.methodSignature. + * @member {Array.} .google.api.methodSignature + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.api.methodSignature"] = $util.emptyArray; + + /** + * MethodOptions .google.api.http. + * @member {google.api.IHttpRule|null|undefined} .google.api.http + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.api.http"] = null; + + /** + * Creates a new MethodOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions=} [properties] Properties to set + * @returns {google.protobuf.MethodOptions} MethodOptions instance + */ + MethodOptions.create = function create(properties) { + return new MethodOptions(properties); + }; + + /** + * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); + if (message.idempotencyLevel != null && Object.hasOwnProperty.call(message, "idempotencyLevel")) + writer.uint32(/* id 34, wireType 0 =*/272).int32(message.idempotencyLevel); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.methodSignature"] != null && message[".google.api.methodSignature"].length) + for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) + writer.uint32(/* id 1051, wireType 2 =*/8410).string(message[".google.api.methodSignature"][i]); + if (message[".google.api.http"] != null && Object.hasOwnProperty.call(message, ".google.api.http")) + $root.google.api.HttpRule.encode(message[".google.api.http"], writer.uint32(/* id 72295728, wireType 2 =*/578365826).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MethodOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MethodOptions} MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodOptions.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.protobuf.MethodOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 33: + message.deprecated = reader.bool(); + break; + case 34: + message.idempotencyLevel = reader.int32(); + break; + case 999: + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.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; + } + } + return message; + }; + + /** + * Decodes a MethodOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MethodOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MethodOptions} MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodOptions message. + * @function verify + * @memberof google.protobuf.MethodOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) + switch (message.idempotencyLevel) { + default: + return "idempotencyLevel: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + 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"; + for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) + 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; + }; + + /** + * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MethodOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MethodOptions} MethodOptions + */ + MethodOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MethodOptions) + return object; + var message = new $root.google.protobuf.MethodOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + switch (object.idempotencyLevel) { + case "IDEMPOTENCY_UNKNOWN": + case 0: + message.idempotencyLevel = 0; + break; + case "NO_SIDE_EFFECTS": + case 1: + message.idempotencyLevel = 1; + break; + case "IDEMPOTENT": + case 2: + message.idempotencyLevel = 2; + break; + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.methodSignature"]) { + if (!Array.isArray(object[".google.api.methodSignature"])) + throw TypeError(".google.protobuf.MethodOptions..google.api.methodSignature: array expected"); + message[".google.api.methodSignature"] = []; + 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; + }; + + /** + * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.MethodOptions} message MethodOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.uninterpretedOption = []; + object[".google.api.methodSignature"] = []; + } + if (options.defaults) { + object.deprecated = false; + object.idempotencyLevel = options.enums === String ? "IDEMPOTENCY_UNKNOWN" : 0; + object[".google.api.http"] = null; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) + object.idempotencyLevel = options.enums === String ? $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] : message.idempotencyLevel; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length) { + object[".google.api.methodSignature"] = []; + for (var j = 0; j < message[".google.api.methodSignature"].length; ++j) + object[".google.api.methodSignature"][j] = message[".google.api.methodSignature"][j]; + } + if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) + object[".google.api.http"] = $root.google.api.HttpRule.toObject(message[".google.api.http"], options); + return object; + }; + + /** + * Converts this MethodOptions to JSON. + * @function toJSON + * @memberof google.protobuf.MethodOptions + * @instance + * @returns {Object.} JSON object + */ + MethodOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * IdempotencyLevel enum. + * @name google.protobuf.MethodOptions.IdempotencyLevel + * @enum {number} + * @property {number} IDEMPOTENCY_UNKNOWN=0 IDEMPOTENCY_UNKNOWN value + * @property {number} NO_SIDE_EFFECTS=1 NO_SIDE_EFFECTS value + * @property {number} IDEMPOTENT=2 IDEMPOTENT value + */ + MethodOptions.IdempotencyLevel = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "IDEMPOTENCY_UNKNOWN"] = 0; + values[valuesById[1] = "NO_SIDE_EFFECTS"] = 1; + values[valuesById[2] = "IDEMPOTENT"] = 2; + return values; + })(); + + return MethodOptions; + })(); + + protobuf.UninterpretedOption = (function() { + + /** + * Properties of an UninterpretedOption. + * @memberof google.protobuf + * @interface IUninterpretedOption + * @property {Array.|null} [name] UninterpretedOption name + * @property {string|null} [identifierValue] UninterpretedOption identifierValue + * @property {number|Long|null} [positiveIntValue] UninterpretedOption positiveIntValue + * @property {number|Long|null} [negativeIntValue] UninterpretedOption negativeIntValue + * @property {number|null} [doubleValue] UninterpretedOption doubleValue + * @property {Uint8Array|null} [stringValue] UninterpretedOption stringValue + * @property {string|null} [aggregateValue] UninterpretedOption aggregateValue + */ + + /** + * Constructs a new UninterpretedOption. + * @memberof google.protobuf + * @classdesc Represents an UninterpretedOption. + * @implements IUninterpretedOption + * @constructor + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set + */ + function UninterpretedOption(properties) { + this.name = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UninterpretedOption name. + * @member {Array.} name + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.name = $util.emptyArray; + + /** + * UninterpretedOption identifierValue. + * @member {string} identifierValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.identifierValue = ""; + + /** + * UninterpretedOption positiveIntValue. + * @member {number|Long} positiveIntValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.positiveIntValue = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * UninterpretedOption negativeIntValue. + * @member {number|Long} negativeIntValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.negativeIntValue = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * UninterpretedOption doubleValue. + * @member {number} doubleValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.doubleValue = 0; + + /** + * UninterpretedOption stringValue. + * @member {Uint8Array} stringValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.stringValue = $util.newBuffer([]); + + /** + * UninterpretedOption aggregateValue. + * @member {string} aggregateValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.aggregateValue = ""; + + /** + * Creates a new UninterpretedOption instance using the specified properties. + * @function create + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption instance + */ + UninterpretedOption.create = function create(properties) { + return new UninterpretedOption(properties); + }; + + /** + * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UninterpretedOption.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.name.length) + for (var i = 0; i < message.name.length; ++i) + $root.google.protobuf.UninterpretedOption.NamePart.encode(message.name[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.identifierValue != null && Object.hasOwnProperty.call(message, "identifierValue")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.identifierValue); + if (message.positiveIntValue != null && Object.hasOwnProperty.call(message, "positiveIntValue")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.positiveIntValue); + if (message.negativeIntValue != null && Object.hasOwnProperty.call(message, "negativeIntValue")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.negativeIntValue); + if (message.doubleValue != null && Object.hasOwnProperty.call(message, "doubleValue")) + writer.uint32(/* id 6, wireType 1 =*/49).double(message.doubleValue); + if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) + writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.stringValue); + if (message.aggregateValue != null && Object.hasOwnProperty.call(message, "aggregateValue")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.aggregateValue); + return writer; + }; + + /** + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UninterpretedOption.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UninterpretedOption.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.protobuf.UninterpretedOption(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + if (!(message.name && message.name.length)) + message.name = []; + message.name.push($root.google.protobuf.UninterpretedOption.NamePart.decode(reader, reader.uint32())); + break; + case 3: + message.identifierValue = reader.string(); + break; + case 4: + message.positiveIntValue = reader.uint64(); + break; + case 5: + message.negativeIntValue = reader.int64(); + break; + case 6: + message.doubleValue = reader.double(); + break; + case 7: + message.stringValue = reader.bytes(); + break; + case 8: + message.aggregateValue = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UninterpretedOption.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UninterpretedOption message. + * @function verify + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UninterpretedOption.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) { + if (!Array.isArray(message.name)) + return "name: array expected"; + for (var i = 0; i < message.name.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.NamePart.verify(message.name[i]); + if (error) + return "name." + error; + } + } + if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) + if (!$util.isString(message.identifierValue)) + return "identifierValue: string expected"; + if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + if (!$util.isInteger(message.positiveIntValue) && !(message.positiveIntValue && $util.isInteger(message.positiveIntValue.low) && $util.isInteger(message.positiveIntValue.high))) + return "positiveIntValue: integer|Long expected"; + if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + if (!$util.isInteger(message.negativeIntValue) && !(message.negativeIntValue && $util.isInteger(message.negativeIntValue.low) && $util.isInteger(message.negativeIntValue.high))) + return "negativeIntValue: integer|Long expected"; + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + if (typeof message.doubleValue !== "number") + return "doubleValue: number expected"; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) + if (!(message.stringValue && typeof message.stringValue.length === "number" || $util.isString(message.stringValue))) + return "stringValue: buffer expected"; + if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) + if (!$util.isString(message.aggregateValue)) + return "aggregateValue: string expected"; + return null; + }; + + /** + * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + */ + UninterpretedOption.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UninterpretedOption) + return object; + var message = new $root.google.protobuf.UninterpretedOption(); + if (object.name) { + if (!Array.isArray(object.name)) + throw TypeError(".google.protobuf.UninterpretedOption.name: array expected"); + message.name = []; + for (var i = 0; i < object.name.length; ++i) { + if (typeof object.name[i] !== "object") + throw TypeError(".google.protobuf.UninterpretedOption.name: object expected"); + message.name[i] = $root.google.protobuf.UninterpretedOption.NamePart.fromObject(object.name[i]); + } + } + if (object.identifierValue != null) + message.identifierValue = String(object.identifierValue); + if (object.positiveIntValue != null) + if ($util.Long) + (message.positiveIntValue = $util.Long.fromValue(object.positiveIntValue)).unsigned = true; + else if (typeof object.positiveIntValue === "string") + message.positiveIntValue = parseInt(object.positiveIntValue, 10); + else if (typeof object.positiveIntValue === "number") + message.positiveIntValue = object.positiveIntValue; + else if (typeof object.positiveIntValue === "object") + message.positiveIntValue = new $util.LongBits(object.positiveIntValue.low >>> 0, object.positiveIntValue.high >>> 0).toNumber(true); + if (object.negativeIntValue != null) + if ($util.Long) + (message.negativeIntValue = $util.Long.fromValue(object.negativeIntValue)).unsigned = false; + else if (typeof object.negativeIntValue === "string") + message.negativeIntValue = parseInt(object.negativeIntValue, 10); + else if (typeof object.negativeIntValue === "number") + message.negativeIntValue = object.negativeIntValue; + else if (typeof object.negativeIntValue === "object") + message.negativeIntValue = new $util.LongBits(object.negativeIntValue.low >>> 0, object.negativeIntValue.high >>> 0).toNumber(); + if (object.doubleValue != null) + message.doubleValue = Number(object.doubleValue); + if (object.stringValue != null) + if (typeof object.stringValue === "string") + $util.base64.decode(object.stringValue, message.stringValue = $util.newBuffer($util.base64.length(object.stringValue)), 0); + else if (object.stringValue.length) + message.stringValue = object.stringValue; + if (object.aggregateValue != null) + message.aggregateValue = String(object.aggregateValue); + return message; + }; + + /** + * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.UninterpretedOption} message UninterpretedOption + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UninterpretedOption.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.name = []; + if (options.defaults) { + object.identifierValue = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.positiveIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.positiveIntValue = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.negativeIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.negativeIntValue = options.longs === String ? "0" : 0; + object.doubleValue = 0; + if (options.bytes === String) + object.stringValue = ""; + else { + object.stringValue = []; + if (options.bytes !== Array) + object.stringValue = $util.newBuffer(object.stringValue); + } + object.aggregateValue = ""; + } + if (message.name && message.name.length) { + object.name = []; + for (var j = 0; j < message.name.length; ++j) + object.name[j] = $root.google.protobuf.UninterpretedOption.NamePart.toObject(message.name[j], options); + } + if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) + object.identifierValue = message.identifierValue; + if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + if (typeof message.positiveIntValue === "number") + object.positiveIntValue = options.longs === String ? String(message.positiveIntValue) : message.positiveIntValue; + else + object.positiveIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.positiveIntValue) : options.longs === Number ? new $util.LongBits(message.positiveIntValue.low >>> 0, message.positiveIntValue.high >>> 0).toNumber(true) : message.positiveIntValue; + if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + if (typeof message.negativeIntValue === "number") + object.negativeIntValue = options.longs === String ? String(message.negativeIntValue) : message.negativeIntValue; + else + object.negativeIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.negativeIntValue) : options.longs === Number ? new $util.LongBits(message.negativeIntValue.low >>> 0, message.negativeIntValue.high >>> 0).toNumber() : message.negativeIntValue; + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + object.doubleValue = options.json && !isFinite(message.doubleValue) ? String(message.doubleValue) : message.doubleValue; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) + object.stringValue = options.bytes === String ? $util.base64.encode(message.stringValue, 0, message.stringValue.length) : options.bytes === Array ? Array.prototype.slice.call(message.stringValue) : message.stringValue; + if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) + object.aggregateValue = message.aggregateValue; + return object; + }; + + /** + * Converts this UninterpretedOption to JSON. + * @function toJSON + * @memberof google.protobuf.UninterpretedOption + * @instance + * @returns {Object.} JSON object + */ + UninterpretedOption.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + UninterpretedOption.NamePart = (function() { + + /** + * Properties of a NamePart. + * @memberof google.protobuf.UninterpretedOption + * @interface INamePart + * @property {string} namePart NamePart namePart + * @property {boolean} isExtension NamePart isExtension + */ + + /** + * Constructs a new NamePart. + * @memberof google.protobuf.UninterpretedOption + * @classdesc Represents a NamePart. + * @implements INamePart + * @constructor + * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set + */ + function NamePart(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NamePart namePart. + * @member {string} namePart + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + */ + NamePart.prototype.namePart = ""; + + /** + * NamePart isExtension. + * @member {boolean} isExtension + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + */ + NamePart.prototype.isExtension = false; + + /** + * Creates a new NamePart instance using the specified properties. + * @function create + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart instance + */ + NamePart.create = function create(properties) { + return new NamePart(properties); + }; + + /** + * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NamePart.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + writer.uint32(/* id 1, wireType 2 =*/10).string(message.namePart); + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.isExtension); + return writer; + }; + + /** + * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NamePart.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NamePart message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NamePart.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.protobuf.UninterpretedOption.NamePart(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.namePart = reader.string(); + break; + case 2: + message.isExtension = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + if (!message.hasOwnProperty("namePart")) + throw $util.ProtocolError("missing required 'namePart'", { instance: message }); + if (!message.hasOwnProperty("isExtension")) + throw $util.ProtocolError("missing required 'isExtension'", { instance: message }); + return message; + }; + + /** + * Decodes a NamePart message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NamePart.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NamePart message. + * @function verify + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NamePart.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (!$util.isString(message.namePart)) + return "namePart: string expected"; + if (typeof message.isExtension !== "boolean") + return "isExtension: boolean expected"; + return null; + }; + + /** + * Creates a NamePart message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + */ + NamePart.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UninterpretedOption.NamePart) + return object; + var message = new $root.google.protobuf.UninterpretedOption.NamePart(); + if (object.namePart != null) + message.namePart = String(object.namePart); + if (object.isExtension != null) + message.isExtension = Boolean(object.isExtension); + return message; + }; + + /** + * Creates a plain object from a NamePart message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.NamePart} message NamePart + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NamePart.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.namePart = ""; + object.isExtension = false; + } + if (message.namePart != null && message.hasOwnProperty("namePart")) + object.namePart = message.namePart; + if (message.isExtension != null && message.hasOwnProperty("isExtension")) + object.isExtension = message.isExtension; + return object; + }; + + /** + * Converts this NamePart to JSON. + * @function toJSON + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + * @returns {Object.} JSON object + */ + NamePart.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return NamePart; + })(); + + return UninterpretedOption; + })(); + + protobuf.SourceCodeInfo = (function() { + + /** + * Properties of a SourceCodeInfo. + * @memberof google.protobuf + * @interface ISourceCodeInfo + * @property {Array.|null} [location] SourceCodeInfo location + */ + + /** + * Constructs a new SourceCodeInfo. + * @memberof google.protobuf + * @classdesc Represents a SourceCodeInfo. + * @implements ISourceCodeInfo + * @constructor + * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set + */ + function SourceCodeInfo(properties) { + this.location = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SourceCodeInfo location. + * @member {Array.} location + * @memberof google.protobuf.SourceCodeInfo + * @instance + */ + SourceCodeInfo.prototype.location = $util.emptyArray; + + /** + * Creates a new SourceCodeInfo instance using the specified properties. + * @function create + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo instance + */ + SourceCodeInfo.create = function create(properties) { + return new SourceCodeInfo(properties); + }; + + /** + * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @function encode + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SourceCodeInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.location != null && message.location.length) + for (var i = 0; i < message.location.length; ++i) + $root.google.protobuf.SourceCodeInfo.Location.encode(message.location[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SourceCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SourceCodeInfo.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.protobuf.SourceCodeInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.location && message.location.length)) + message.location = []; + message.location.push($root.google.protobuf.SourceCodeInfo.Location.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SourceCodeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SourceCodeInfo message. + * @function verify + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SourceCodeInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.location != null && message.hasOwnProperty("location")) { + if (!Array.isArray(message.location)) + return "location: array expected"; + for (var i = 0; i < message.location.length; ++i) { + var error = $root.google.protobuf.SourceCodeInfo.Location.verify(message.location[i]); + if (error) + return "location." + error; + } + } + return null; + }; + + /** + * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + */ + SourceCodeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.SourceCodeInfo) + return object; + var message = new $root.google.protobuf.SourceCodeInfo(); + if (object.location) { + if (!Array.isArray(object.location)) + throw TypeError(".google.protobuf.SourceCodeInfo.location: array expected"); + message.location = []; + for (var i = 0; i < object.location.length; ++i) { + if (typeof object.location[i] !== "object") + throw TypeError(".google.protobuf.SourceCodeInfo.location: object expected"); + message.location[i] = $root.google.protobuf.SourceCodeInfo.Location.fromObject(object.location[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.SourceCodeInfo} message SourceCodeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SourceCodeInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.location = []; + if (message.location && message.location.length) { + object.location = []; + for (var j = 0; j < message.location.length; ++j) + object.location[j] = $root.google.protobuf.SourceCodeInfo.Location.toObject(message.location[j], options); + } + return object; + }; + + /** + * Converts this SourceCodeInfo to JSON. + * @function toJSON + * @memberof google.protobuf.SourceCodeInfo + * @instance + * @returns {Object.} JSON object + */ + SourceCodeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + SourceCodeInfo.Location = (function() { + + /** + * Properties of a Location. + * @memberof google.protobuf.SourceCodeInfo + * @interface ILocation + * @property {Array.|null} [path] Location path + * @property {Array.|null} [span] Location span + * @property {string|null} [leadingComments] Location leadingComments + * @property {string|null} [trailingComments] Location trailingComments + * @property {Array.|null} [leadingDetachedComments] Location leadingDetachedComments + */ + + /** + * Constructs a new Location. + * @memberof google.protobuf.SourceCodeInfo + * @classdesc Represents a Location. + * @implements ILocation + * @constructor + * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set + */ + function Location(properties) { + this.path = []; + this.span = []; + this.leadingDetachedComments = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Location path. + * @member {Array.} path + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.path = $util.emptyArray; + + /** + * Location span. + * @member {Array.} span + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.span = $util.emptyArray; + + /** + * Location leadingComments. + * @member {string} leadingComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.leadingComments = ""; + + /** + * Location trailingComments. + * @member {string} trailingComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.trailingComments = ""; + + /** + * Location leadingDetachedComments. + * @member {Array.} leadingDetachedComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.leadingDetachedComments = $util.emptyArray; + + /** + * Creates a new Location instance using the specified properties. + * @function create + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set + * @returns {google.protobuf.SourceCodeInfo.Location} Location instance + */ + Location.create = function create(properties) { + return new Location(properties); + }; + + /** + * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @function encode + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && message.path.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.path.length; ++i) + writer.int32(message.path[i]); + writer.ldelim(); + } + if (message.span != null && message.span.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.span.length; ++i) + writer.int32(message.span[i]); + writer.ldelim(); + } + if (message.leadingComments != null && Object.hasOwnProperty.call(message, "leadingComments")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.leadingComments); + if (message.trailingComments != null && Object.hasOwnProperty.call(message, "trailingComments")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.trailingComments); + if (message.leadingDetachedComments != null && message.leadingDetachedComments.length) + for (var i = 0; i < message.leadingDetachedComments.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.leadingDetachedComments[i]); + return writer; + }; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Location message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.SourceCodeInfo.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.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.protobuf.SourceCodeInfo.Location(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.path && message.path.length)) + message.path = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.path.push(reader.int32()); + } else + message.path.push(reader.int32()); + break; + case 2: + if (!(message.span && message.span.length)) + message.span = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.span.push(reader.int32()); + } else + message.span.push(reader.int32()); + break; + case 3: + message.leadingComments = reader.string(); + break; + case 4: + message.trailingComments = reader.string(); + break; + case 6: + if (!(message.leadingDetachedComments && message.leadingDetachedComments.length)) + message.leadingDetachedComments = []; + message.leadingDetachedComments.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.SourceCodeInfo.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Location message. + * @function verify + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Location.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.path != null && message.hasOwnProperty("path")) { + if (!Array.isArray(message.path)) + return "path: array expected"; + for (var i = 0; i < message.path.length; ++i) + if (!$util.isInteger(message.path[i])) + return "path: integer[] expected"; + } + if (message.span != null && message.hasOwnProperty("span")) { + if (!Array.isArray(message.span)) + return "span: array expected"; + for (var i = 0; i < message.span.length; ++i) + if (!$util.isInteger(message.span[i])) + return "span: integer[] expected"; + } + if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) + if (!$util.isString(message.leadingComments)) + return "leadingComments: string expected"; + if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + if (!$util.isString(message.trailingComments)) + return "trailingComments: string expected"; + if (message.leadingDetachedComments != null && message.hasOwnProperty("leadingDetachedComments")) { + if (!Array.isArray(message.leadingDetachedComments)) + return "leadingDetachedComments: array expected"; + for (var i = 0; i < message.leadingDetachedComments.length; ++i) + if (!$util.isString(message.leadingDetachedComments[i])) + return "leadingDetachedComments: string[] expected"; + } + return null; + }; + + /** + * Creates a Location message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.SourceCodeInfo.Location} Location + */ + Location.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.SourceCodeInfo.Location) + return object; + var message = new $root.google.protobuf.SourceCodeInfo.Location(); + if (object.path) { + if (!Array.isArray(object.path)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.path: array expected"); + message.path = []; + for (var i = 0; i < object.path.length; ++i) + message.path[i] = object.path[i] | 0; + } + if (object.span) { + if (!Array.isArray(object.span)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.span: array expected"); + message.span = []; + for (var i = 0; i < object.span.length; ++i) + message.span[i] = object.span[i] | 0; + } + if (object.leadingComments != null) + message.leadingComments = String(object.leadingComments); + if (object.trailingComments != null) + message.trailingComments = String(object.trailingComments); + if (object.leadingDetachedComments) { + if (!Array.isArray(object.leadingDetachedComments)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.leadingDetachedComments: array expected"); + message.leadingDetachedComments = []; + for (var i = 0; i < object.leadingDetachedComments.length; ++i) + message.leadingDetachedComments[i] = String(object.leadingDetachedComments[i]); + } + return message; + }; + + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.Location} message Location + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Location.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.path = []; + object.span = []; + object.leadingDetachedComments = []; + } + if (options.defaults) { + object.leadingComments = ""; + object.trailingComments = ""; + } + if (message.path && message.path.length) { + object.path = []; + for (var j = 0; j < message.path.length; ++j) + object.path[j] = message.path[j]; + } + if (message.span && message.span.length) { + object.span = []; + for (var j = 0; j < message.span.length; ++j) + object.span[j] = message.span[j]; + } + if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) + object.leadingComments = message.leadingComments; + if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + object.trailingComments = message.trailingComments; + if (message.leadingDetachedComments && message.leadingDetachedComments.length) { + object.leadingDetachedComments = []; + for (var j = 0; j < message.leadingDetachedComments.length; ++j) + object.leadingDetachedComments[j] = message.leadingDetachedComments[j]; + } + return object; + }; + + /** + * Converts this Location to JSON. + * @function toJSON + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + * @returns {Object.} JSON object + */ + Location.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Location; + })(); + + return SourceCodeInfo; + })(); + + protobuf.GeneratedCodeInfo = (function() { + + /** + * Properties of a GeneratedCodeInfo. + * @memberof google.protobuf + * @interface IGeneratedCodeInfo + * @property {Array.|null} [annotation] GeneratedCodeInfo annotation + */ + + /** + * Constructs a new GeneratedCodeInfo. + * @memberof google.protobuf + * @classdesc Represents a GeneratedCodeInfo. + * @implements IGeneratedCodeInfo + * @constructor + * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set + */ + function GeneratedCodeInfo(properties) { + this.annotation = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GeneratedCodeInfo annotation. + * @member {Array.} annotation + * @memberof google.protobuf.GeneratedCodeInfo + * @instance + */ + GeneratedCodeInfo.prototype.annotation = $util.emptyArray; + + /** + * Creates a new GeneratedCodeInfo instance using the specified properties. + * @function create + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo instance + */ + GeneratedCodeInfo.create = function create(properties) { + return new GeneratedCodeInfo(properties); + }; + + /** + * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @function encode + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeneratedCodeInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.annotation != null && message.annotation.length) + for (var i = 0; i < message.annotation.length; ++i) + $root.google.protobuf.GeneratedCodeInfo.Annotation.encode(message.annotation[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeneratedCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeneratedCodeInfo.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.protobuf.GeneratedCodeInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.annotation && message.annotation.length)) + message.annotation = []; + message.annotation.push($root.google.protobuf.GeneratedCodeInfo.Annotation.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeneratedCodeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GeneratedCodeInfo message. + * @function verify + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GeneratedCodeInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.annotation != null && message.hasOwnProperty("annotation")) { + if (!Array.isArray(message.annotation)) + return "annotation: array expected"; + for (var i = 0; i < message.annotation.length; ++i) { + var error = $root.google.protobuf.GeneratedCodeInfo.Annotation.verify(message.annotation[i]); + if (error) + return "annotation." + error; + } + } + return null; + }; + + /** + * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + */ + GeneratedCodeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.GeneratedCodeInfo) + return object; + var message = new $root.google.protobuf.GeneratedCodeInfo(); + if (object.annotation) { + if (!Array.isArray(object.annotation)) + throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: array expected"); + message.annotation = []; + for (var i = 0; i < object.annotation.length; ++i) { + if (typeof object.annotation[i] !== "object") + throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: object expected"); + message.annotation[i] = $root.google.protobuf.GeneratedCodeInfo.Annotation.fromObject(object.annotation[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.GeneratedCodeInfo} message GeneratedCodeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GeneratedCodeInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.annotation = []; + if (message.annotation && message.annotation.length) { + object.annotation = []; + for (var j = 0; j < message.annotation.length; ++j) + object.annotation[j] = $root.google.protobuf.GeneratedCodeInfo.Annotation.toObject(message.annotation[j], options); + } + return object; + }; + + /** + * Converts this GeneratedCodeInfo to JSON. + * @function toJSON + * @memberof google.protobuf.GeneratedCodeInfo + * @instance + * @returns {Object.} JSON object + */ + GeneratedCodeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GeneratedCodeInfo.Annotation = (function() { + + /** + * Properties of an Annotation. + * @memberof google.protobuf.GeneratedCodeInfo + * @interface IAnnotation + * @property {Array.|null} [path] Annotation path + * @property {string|null} [sourceFile] Annotation sourceFile + * @property {number|null} [begin] Annotation begin + * @property {number|null} [end] Annotation end + */ + + /** + * Constructs a new Annotation. + * @memberof google.protobuf.GeneratedCodeInfo + * @classdesc Represents an Annotation. + * @implements IAnnotation + * @constructor + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set + */ + function Annotation(properties) { + this.path = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Annotation path. + * @member {Array.} path + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.path = $util.emptyArray; + + /** + * Annotation sourceFile. + * @member {string} sourceFile + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.sourceFile = ""; + + /** + * Annotation begin. + * @member {number} begin + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.begin = 0; + + /** + * Annotation end. + * @member {number} end + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.end = 0; + + /** + * Creates a new Annotation instance using the specified properties. + * @function create + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation instance + */ + Annotation.create = function create(properties) { + return new Annotation(properties); + }; + + /** + * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @function encode + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Annotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && message.path.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.path.length; ++i) + writer.int32(message.path[i]); + writer.ldelim(); + } + if (message.sourceFile != null && Object.hasOwnProperty.call(message, "sourceFile")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceFile); + if (message.begin != null && Object.hasOwnProperty.call(message, "begin")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.begin); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.end); + return writer; + }; + + /** + * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Annotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Annotation message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Annotation.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.protobuf.GeneratedCodeInfo.Annotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.path && message.path.length)) + message.path = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.path.push(reader.int32()); + } else + message.path.push(reader.int32()); + break; + case 2: + message.sourceFile = reader.string(); + break; + case 3: + message.begin = reader.int32(); + break; + case 4: + message.end = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Annotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Annotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Annotation message. + * @function verify + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Annotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.path != null && message.hasOwnProperty("path")) { + if (!Array.isArray(message.path)) + return "path: array expected"; + for (var i = 0; i < message.path.length; ++i) + if (!$util.isInteger(message.path[i])) + return "path: integer[] expected"; + } + if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + if (!$util.isString(message.sourceFile)) + return "sourceFile: string expected"; + if (message.begin != null && message.hasOwnProperty("begin")) + if (!$util.isInteger(message.begin)) + return "begin: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + return null; + }; + + /** + * Creates an Annotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + */ + Annotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.GeneratedCodeInfo.Annotation) + return object; + var message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); + if (object.path) { + if (!Array.isArray(object.path)) + throw TypeError(".google.protobuf.GeneratedCodeInfo.Annotation.path: array expected"); + message.path = []; + for (var i = 0; i < object.path.length; ++i) + message.path[i] = object.path[i] | 0; + } + if (object.sourceFile != null) + message.sourceFile = String(object.sourceFile); + if (object.begin != null) + message.begin = object.begin | 0; + if (object.end != null) + message.end = object.end | 0; + return message; + }; + + /** + * Creates a plain object from an Annotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.Annotation} message Annotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Annotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.path = []; + if (options.defaults) { + object.sourceFile = ""; + object.begin = 0; + object.end = 0; + } + if (message.path && message.path.length) { + object.path = []; + for (var j = 0; j < message.path.length; ++j) + object.path[j] = message.path[j]; + } + if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + object.sourceFile = message.sourceFile; + if (message.begin != null && message.hasOwnProperty("begin")) + object.begin = message.begin; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + return object; + }; + + /** + * Converts this Annotation to JSON. + * @function toJSON + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + * @returns {Object.} JSON object + */ + Annotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Annotation; + })(); + + return GeneratedCodeInfo; + })(); + + protobuf.Timestamp = (function() { + + /** + * Properties of a Timestamp. + * @memberof google.protobuf + * @interface ITimestamp + * @property {number|Long|null} [seconds] Timestamp seconds + * @property {number|null} [nanos] Timestamp nanos + */ + + /** + * Constructs a new Timestamp. + * @memberof google.protobuf + * @classdesc Represents a Timestamp. + * @implements ITimestamp + * @constructor + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + */ + function Timestamp(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Timestamp seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Timestamp nanos. + * @member {number} nanos + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.nanos = 0; + + /** + * Creates a new Timestamp instance using the specified properties. + * @function create + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + * @returns {google.protobuf.Timestamp} Timestamp instance + */ + Timestamp.create = function create(properties) { + return new Timestamp(properties); + }; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.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.protobuf.Timestamp(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.seconds = reader.int64(); + break; + case 2: + message.nanos = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Timestamp message. + * @function verify + * @memberof google.protobuf.Timestamp + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Timestamp.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) + return "seconds: integer|Long expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + return null; + }; + + /** + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Timestamp + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Timestamp} Timestamp + */ + Timestamp.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Timestamp) + return object; + var message = new $root.google.protobuf.Timestamp(); + if (object.seconds != null) + if ($util.Long) + (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; + else if (typeof object.seconds === "string") + message.seconds = parseInt(object.seconds, 10); + else if (typeof object.seconds === "number") + message.seconds = object.seconds; + else if (typeof object.seconds === "object") + message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; + + /** + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.Timestamp} message Timestamp + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Timestamp.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.seconds = options.longs === String ? "0" : 0; + object.nanos = 0; + } + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (typeof message.seconds === "number") + object.seconds = options.longs === String ? String(message.seconds) : message.seconds; + else + object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; + return object; + }; + + /** + * Converts this Timestamp to JSON. + * @function toJSON + * @memberof google.protobuf.Timestamp + * @instance + * @returns {Object.} JSON object + */ + Timestamp.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Timestamp; + })(); + + protobuf.Duration = (function() { + + /** + * Properties of a Duration. + * @memberof google.protobuf + * @interface IDuration + * @property {number|Long|null} [seconds] Duration seconds + * @property {number|null} [nanos] Duration nanos + */ + + /** + * Constructs a new Duration. + * @memberof google.protobuf + * @classdesc Represents a Duration. + * @implements IDuration + * @constructor + * @param {google.protobuf.IDuration=} [properties] Properties to set + */ + function Duration(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Duration seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Duration + * @instance + */ + Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Duration nanos. + * @member {number} nanos + * @memberof google.protobuf.Duration + * @instance + */ + Duration.prototype.nanos = 0; + + /** + * Creates a new Duration instance using the specified properties. + * @function create + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration=} [properties] Properties to set + * @returns {google.protobuf.Duration} Duration instance + */ + Duration.create = function create(properties) { + return new Duration(properties); + }; + + /** + * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration} message Duration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration} message Duration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.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.protobuf.Duration(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.seconds = reader.int64(); + break; + case 2: + message.nanos = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Duration message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Duration message. + * @function verify + * @memberof google.protobuf.Duration + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Duration.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) + return "seconds: integer|Long expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + return null; + }; + + /** + * Creates a Duration message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Duration + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Duration} Duration + */ + Duration.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Duration) + return object; + var message = new $root.google.protobuf.Duration(); + if (object.seconds != null) + if ($util.Long) + (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; + else if (typeof object.seconds === "string") + message.seconds = parseInt(object.seconds, 10); + else if (typeof object.seconds === "number") + message.seconds = object.seconds; + else if (typeof object.seconds === "object") + message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; + + /** + * Creates a plain object from a Duration message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.Duration} message Duration + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Duration.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.seconds = options.longs === String ? "0" : 0; + object.nanos = 0; + } + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (typeof message.seconds === "number") + object.seconds = options.longs === String ? String(message.seconds) : message.seconds; + else + object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; + return object; + }; + + /** + * Converts this Duration to JSON. + * @function toJSON + * @memberof google.protobuf.Duration + * @instance + * @returns {Object.} JSON object + */ + Duration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Duration; + })(); + + protobuf.Empty = (function() { + + /** + * Properties of an Empty. + * @memberof google.protobuf + * @interface IEmpty + */ + + /** + * Constructs a new Empty. + * @memberof google.protobuf + * @classdesc Represents an Empty. + * @implements IEmpty + * @constructor + * @param {google.protobuf.IEmpty=} [properties] Properties to set + */ + function Empty(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new Empty instance using the specified properties. + * @function create + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty=} [properties] Properties to set + * @returns {google.protobuf.Empty} Empty instance + */ + Empty.create = function create(properties) { + return new Empty(properties); + }; + + /** + * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty} message Empty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Empty.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty} message Empty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Empty.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Empty message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Empty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Empty} Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Empty.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.protobuf.Empty(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Empty message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Empty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Empty} Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Empty.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Empty message. + * @function verify + * @memberof google.protobuf.Empty + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Empty.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an Empty message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Empty + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Empty} Empty + */ + Empty.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Empty) + return object; + return new $root.google.protobuf.Empty(); + }; + + /** + * Creates a plain object from an Empty message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.Empty} message Empty + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Empty.toObject = function toObject() { + return {}; + }; + + /** + * Converts this Empty to JSON. + * @function toJSON + * @memberof google.protobuf.Empty + * @instance + * @returns {Object.} JSON object + */ + Empty.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Empty; + })(); + + protobuf.FieldMask = (function() { + + /** + * Properties of a FieldMask. + * @memberof google.protobuf + * @interface IFieldMask + * @property {Array.|null} [paths] FieldMask paths + */ + + /** + * Constructs a new FieldMask. + * @memberof google.protobuf + * @classdesc Represents a FieldMask. + * @implements IFieldMask + * @constructor + * @param {google.protobuf.IFieldMask=} [properties] Properties to set + */ + function FieldMask(properties) { + this.paths = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldMask paths. + * @member {Array.} paths + * @memberof google.protobuf.FieldMask + * @instance + */ + FieldMask.prototype.paths = $util.emptyArray; + + /** + * Creates a new FieldMask instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask=} [properties] Properties to set + * @returns {google.protobuf.FieldMask} FieldMask instance + */ + FieldMask.create = function create(properties) { + return new FieldMask(properties); + }; + + /** + * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldMask.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.paths != null && message.paths.length) + for (var i = 0; i < message.paths.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.paths[i]); + return writer; + }; + + /** + * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldMask.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldMask message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldMask + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldMask} FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldMask.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.protobuf.FieldMask(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.paths && message.paths.length)) + message.paths = []; + message.paths.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldMask message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldMask + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldMask} FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldMask.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldMask message. + * @function verify + * @memberof google.protobuf.FieldMask + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldMask.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.paths != null && message.hasOwnProperty("paths")) { + if (!Array.isArray(message.paths)) + return "paths: array expected"; + for (var i = 0; i < message.paths.length; ++i) + if (!$util.isString(message.paths[i])) + return "paths: string[] expected"; + } + return null; + }; + + /** + * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldMask + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldMask} FieldMask + */ + FieldMask.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldMask) + return object; + var message = new $root.google.protobuf.FieldMask(); + if (object.paths) { + if (!Array.isArray(object.paths)) + throw TypeError(".google.protobuf.FieldMask.paths: array expected"); + message.paths = []; + for (var i = 0; i < object.paths.length; ++i) + message.paths[i] = String(object.paths[i]); + } + return message; + }; + + /** + * Creates a plain object from a FieldMask message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.FieldMask} message FieldMask + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldMask.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.paths = []; + if (message.paths && message.paths.length) { + object.paths = []; + for (var j = 0; j < message.paths.length; ++j) + object.paths[j] = message.paths[j]; + } + return object; + }; + + /** + * Converts this FieldMask to JSON. + * @function toJSON + * @memberof google.protobuf.FieldMask + * @instance + * @returns {Object.} JSON object + */ + FieldMask.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return FieldMask; + })(); + + protobuf.Any = (function() { + + /** + * Properties of an Any. + * @memberof google.protobuf + * @interface IAny + * @property {string|null} [type_url] Any type_url + * @property {Uint8Array|null} [value] Any value + */ + + /** + * Constructs a new Any. + * @memberof google.protobuf + * @classdesc Represents an Any. + * @implements IAny + * @constructor + * @param {google.protobuf.IAny=} [properties] Properties to set + */ + function Any(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Any type_url. + * @member {string} type_url + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.type_url = ""; + + /** + * Any value. + * @member {Uint8Array} value + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.value = $util.newBuffer([]); + + /** + * Creates a new Any instance using the specified properties. + * @function create + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny=} [properties] Properties to set + * @returns {google.protobuf.Any} Any instance + */ + Any.create = function create(properties) { + return new Any(properties); + }; + + /** + * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Any.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type_url != null && Object.hasOwnProperty.call(message, "type_url")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type_url); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value); + return writer; + }; + + /** + * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Any.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Any message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Any + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Any} Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Any.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.protobuf.Any(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.type_url = reader.string(); + break; + case 2: + message.value = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Any message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Any + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Any} Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Any.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Any message. + * @function verify + * @memberof google.protobuf.Any + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Any.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type_url != null && message.hasOwnProperty("type_url")) + if (!$util.isString(message.type_url)) + return "type_url: string expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) + return "value: buffer expected"; + return null; + }; + + /** + * Creates an Any message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Any + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Any} Any + */ + Any.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Any) + return object; + var message = new $root.google.protobuf.Any(); + if (object.type_url != null) + message.type_url = String(object.type_url); + if (object.value != null) + if (typeof object.value === "string") + $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); + else if (object.value.length) + message.value = object.value; + return message; + }; + + /** + * Creates a plain object from an Any message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.Any} message Any + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Any.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type_url = ""; + if (options.bytes === String) + object.value = ""; + else { + object.value = []; + if (options.bytes !== Array) + object.value = $util.newBuffer(object.value); + } + } + if (message.type_url != null && message.hasOwnProperty("type_url")) + object.type_url = message.type_url; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; + return object; + }; + + /** + * Converts this Any to JSON. + * @function toJSON + * @memberof google.protobuf.Any + * @instance + * @returns {Object.} JSON object + */ + Any.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Any; + })(); + + return protobuf; + })(); + + google.rpc = (function() { + + /** + * Namespace rpc. + * @memberof google + * @namespace + */ + var rpc = {}; + + rpc.Status = (function() { + + /** + * Properties of a Status. + * @memberof google.rpc + * @interface IStatus + * @property {number|null} [code] Status code + * @property {string|null} [message] Status message + * @property {Array.|null} [details] Status details + */ + + /** + * Constructs a new Status. + * @memberof google.rpc + * @classdesc Represents a Status. + * @implements IStatus + * @constructor + * @param {google.rpc.IStatus=} [properties] Properties to set + */ + function Status(properties) { + this.details = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Status code. + * @member {number} code + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.code = 0; + + /** + * Status message. + * @member {string} message + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.message = ""; + + /** + * Status details. + * @member {Array.} details + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.details = $util.emptyArray; + + /** + * Creates a new Status instance using the specified properties. + * @function create + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus=} [properties] Properties to set + * @returns {google.rpc.Status} Status instance + */ + Status.create = function create(properties) { + return new Status(properties); + }; + + /** + * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @function encode + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus} message Status message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Status.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.code != null && Object.hasOwnProperty.call(message, "code")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.message); + if (message.details != null && message.details.length) + for (var i = 0; i < message.details.length; ++i) + $root.google.protobuf.Any.encode(message.details[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @function encodeDelimited + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus} message Status message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Status.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Status message from the specified reader or buffer. + * @function decode + * @memberof google.rpc.Status + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.rpc.Status} Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Status.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.rpc.Status(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.code = reader.int32(); + break; + case 2: + message.message = reader.string(); + break; + case 3: + if (!(message.details && message.details.length)) + message.details = []; + message.details.push($root.google.protobuf.Any.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Status message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.rpc.Status + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.rpc.Status} Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Status.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Status message. + * @function verify + * @memberof google.rpc.Status + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Status.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.code != null && message.hasOwnProperty("code")) + if (!$util.isInteger(message.code)) + return "code: integer expected"; + if (message.message != null && message.hasOwnProperty("message")) + if (!$util.isString(message.message)) + return "message: string expected"; + if (message.details != null && message.hasOwnProperty("details")) { + if (!Array.isArray(message.details)) + return "details: array expected"; + for (var i = 0; i < message.details.length; ++i) { + var error = $root.google.protobuf.Any.verify(message.details[i]); + if (error) + return "details." + error; + } + } + return null; + }; + + /** + * Creates a Status message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.rpc.Status + * @static + * @param {Object.} object Plain object + * @returns {google.rpc.Status} Status + */ + Status.fromObject = function fromObject(object) { + if (object instanceof $root.google.rpc.Status) + return object; + var message = new $root.google.rpc.Status(); + if (object.code != null) + message.code = object.code | 0; + if (object.message != null) + message.message = String(object.message); + if (object.details) { + if (!Array.isArray(object.details)) + throw TypeError(".google.rpc.Status.details: array expected"); + message.details = []; + for (var i = 0; i < object.details.length; ++i) { + if (typeof object.details[i] !== "object") + throw TypeError(".google.rpc.Status.details: object expected"); + message.details[i] = $root.google.protobuf.Any.fromObject(object.details[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Status message. Also converts values to other types if specified. + * @function toObject + * @memberof google.rpc.Status + * @static + * @param {google.rpc.Status} message Status + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Status.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.details = []; + if (options.defaults) { + object.code = 0; + object.message = ""; + } + if (message.code != null && message.hasOwnProperty("code")) + object.code = message.code; + if (message.message != null && message.hasOwnProperty("message")) + object.message = message.message; + if (message.details && message.details.length) { + object.details = []; + for (var j = 0; j < message.details.length; ++j) + object.details[j] = $root.google.protobuf.Any.toObject(message.details[j], options); + } + return object; + }; + + /** + * Converts this Status to JSON. + * @function toJSON + * @memberof google.rpc.Status + * @instance + * @returns {Object.} JSON object + */ + Status.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Status; + })(); + + return rpc; + })(); + + google.type = (function() { + + /** + * Namespace type. + * @memberof google + * @namespace + */ + var type = {}; + + type.Date = (function() { + + /** + * Properties of a Date. + * @memberof google.type + * @interface IDate + * @property {number|null} [year] Date year + * @property {number|null} [month] Date month + * @property {number|null} [day] Date day + */ + + /** + * Constructs a new Date. + * @memberof google.type + * @classdesc Represents a Date. + * @implements IDate + * @constructor + * @param {google.type.IDate=} [properties] Properties to set + */ + function Date(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Date year. + * @member {number} year + * @memberof google.type.Date + * @instance + */ + Date.prototype.year = 0; + + /** + * Date month. + * @member {number} month + * @memberof google.type.Date + * @instance + */ + Date.prototype.month = 0; + + /** + * Date day. + * @member {number} day + * @memberof google.type.Date + * @instance + */ + Date.prototype.day = 0; + + /** + * Creates a new Date instance using the specified properties. + * @function create + * @memberof google.type.Date + * @static + * @param {google.type.IDate=} [properties] Properties to set + * @returns {google.type.Date} Date instance + */ + Date.create = function create(properties) { + return new Date(properties); + }; + + /** + * Encodes the specified Date message. Does not implicitly {@link google.type.Date.verify|verify} messages. + * @function encode + * @memberof google.type.Date + * @static + * @param {google.type.IDate} message Date message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Date.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.year != null && Object.hasOwnProperty.call(message, "year")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.year); + if (message.month != null && Object.hasOwnProperty.call(message, "month")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.month); + if (message.day != null && Object.hasOwnProperty.call(message, "day")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.day); + return writer; + }; + + /** + * Encodes the specified Date message, length delimited. Does not implicitly {@link google.type.Date.verify|verify} messages. + * @function encodeDelimited + * @memberof google.type.Date + * @static + * @param {google.type.IDate} message Date message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Date.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Date message from the specified reader or buffer. + * @function decode + * @memberof google.type.Date + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.type.Date} Date + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Date.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.type.Date(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.year = reader.int32(); + break; + case 2: + message.month = reader.int32(); + break; + case 3: + message.day = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Date message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.type.Date + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.type.Date} Date + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Date.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Date message. + * @function verify + * @memberof google.type.Date + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Date.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.year != null && message.hasOwnProperty("year")) + if (!$util.isInteger(message.year)) + return "year: integer expected"; + if (message.month != null && message.hasOwnProperty("month")) + if (!$util.isInteger(message.month)) + return "month: integer expected"; + if (message.day != null && message.hasOwnProperty("day")) + if (!$util.isInteger(message.day)) + return "day: integer expected"; + return null; + }; + + /** + * Creates a Date message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.type.Date + * @static + * @param {Object.} object Plain object + * @returns {google.type.Date} Date + */ + Date.fromObject = function fromObject(object) { + if (object instanceof $root.google.type.Date) + return object; + var message = new $root.google.type.Date(); + if (object.year != null) + message.year = object.year | 0; + if (object.month != null) + message.month = object.month | 0; + if (object.day != null) + message.day = object.day | 0; + return message; + }; + + /** + * Creates a plain object from a Date message. Also converts values to other types if specified. + * @function toObject + * @memberof google.type.Date + * @static + * @param {google.type.Date} message Date + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Date.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.year = 0; + object.month = 0; + object.day = 0; + } + if (message.year != null && message.hasOwnProperty("year")) + object.year = message.year; + if (message.month != null && message.hasOwnProperty("month")) + object.month = message.month; + if (message.day != null && message.hasOwnProperty("day")) + object.day = message.day; + return object; + }; + + /** + * Converts this Date to JSON. + * @function toJSON + * @memberof google.type.Date + * @instance + * @returns {Object.} JSON object + */ + Date.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Date; + })(); + + /** + * DayOfWeek enum. + * @name google.type.DayOfWeek + * @enum {number} + * @property {number} DAY_OF_WEEK_UNSPECIFIED=0 DAY_OF_WEEK_UNSPECIFIED value + * @property {number} MONDAY=1 MONDAY value + * @property {number} TUESDAY=2 TUESDAY value + * @property {number} WEDNESDAY=3 WEDNESDAY value + * @property {number} THURSDAY=4 THURSDAY value + * @property {number} FRIDAY=5 FRIDAY value + * @property {number} SATURDAY=6 SATURDAY value + * @property {number} SUNDAY=7 SUNDAY value + */ + type.DayOfWeek = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DAY_OF_WEEK_UNSPECIFIED"] = 0; + values[valuesById[1] = "MONDAY"] = 1; + values[valuesById[2] = "TUESDAY"] = 2; + values[valuesById[3] = "WEDNESDAY"] = 3; + values[valuesById[4] = "THURSDAY"] = 4; + values[valuesById[5] = "FRIDAY"] = 5; + values[valuesById[6] = "SATURDAY"] = 6; + values[valuesById[7] = "SUNDAY"] = 7; + return values; + })(); + + type.TimeOfDay = (function() { + + /** + * Properties of a TimeOfDay. + * @memberof google.type + * @interface ITimeOfDay + * @property {number|null} [hours] TimeOfDay hours + * @property {number|null} [minutes] TimeOfDay minutes + * @property {number|null} [seconds] TimeOfDay seconds + * @property {number|null} [nanos] TimeOfDay nanos + */ + + /** + * Constructs a new TimeOfDay. + * @memberof google.type + * @classdesc Represents a TimeOfDay. + * @implements ITimeOfDay + * @constructor + * @param {google.type.ITimeOfDay=} [properties] Properties to set + */ + function TimeOfDay(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TimeOfDay hours. + * @member {number} hours + * @memberof google.type.TimeOfDay + * @instance + */ + TimeOfDay.prototype.hours = 0; + + /** + * TimeOfDay minutes. + * @member {number} minutes + * @memberof google.type.TimeOfDay + * @instance + */ + TimeOfDay.prototype.minutes = 0; + + /** + * TimeOfDay seconds. + * @member {number} seconds + * @memberof google.type.TimeOfDay + * @instance + */ + TimeOfDay.prototype.seconds = 0; + + /** + * TimeOfDay nanos. + * @member {number} nanos + * @memberof google.type.TimeOfDay + * @instance + */ + TimeOfDay.prototype.nanos = 0; + + /** + * Creates a new TimeOfDay instance using the specified properties. + * @function create + * @memberof google.type.TimeOfDay + * @static + * @param {google.type.ITimeOfDay=} [properties] Properties to set + * @returns {google.type.TimeOfDay} TimeOfDay instance + */ + TimeOfDay.create = function create(properties) { + return new TimeOfDay(properties); + }; + + /** + * Encodes the specified TimeOfDay message. Does not implicitly {@link google.type.TimeOfDay.verify|verify} messages. + * @function encode + * @memberof google.type.TimeOfDay + * @static + * @param {google.type.ITimeOfDay} message TimeOfDay message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimeOfDay.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.hours != null && Object.hasOwnProperty.call(message, "hours")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.hours); + if (message.minutes != null && Object.hasOwnProperty.call(message, "minutes")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.minutes); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified TimeOfDay message, length delimited. Does not implicitly {@link google.type.TimeOfDay.verify|verify} messages. + * @function encodeDelimited + * @memberof google.type.TimeOfDay + * @static + * @param {google.type.ITimeOfDay} message TimeOfDay message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimeOfDay.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TimeOfDay message from the specified reader or buffer. + * @function decode + * @memberof google.type.TimeOfDay + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.type.TimeOfDay} TimeOfDay + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimeOfDay.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.type.TimeOfDay(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.hours = reader.int32(); + break; + case 2: + message.minutes = reader.int32(); + break; + case 3: + message.seconds = reader.int32(); + break; + case 4: + message.nanos = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TimeOfDay message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.type.TimeOfDay + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.type.TimeOfDay} TimeOfDay + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimeOfDay.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TimeOfDay message. + * @function verify + * @memberof google.type.TimeOfDay + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TimeOfDay.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.hours != null && message.hasOwnProperty("hours")) + if (!$util.isInteger(message.hours)) + return "hours: integer expected"; + if (message.minutes != null && message.hasOwnProperty("minutes")) + if (!$util.isInteger(message.minutes)) + return "minutes: integer expected"; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds)) + return "seconds: integer expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + return null; + }; + + /** + * Creates a TimeOfDay message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.type.TimeOfDay + * @static + * @param {Object.} object Plain object + * @returns {google.type.TimeOfDay} TimeOfDay + */ + TimeOfDay.fromObject = function fromObject(object) { + if (object instanceof $root.google.type.TimeOfDay) + return object; + var message = new $root.google.type.TimeOfDay(); + if (object.hours != null) + message.hours = object.hours | 0; + if (object.minutes != null) + message.minutes = object.minutes | 0; + if (object.seconds != null) + message.seconds = object.seconds | 0; + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; + + /** + * Creates a plain object from a TimeOfDay message. Also converts values to other types if specified. + * @function toObject + * @memberof google.type.TimeOfDay + * @static + * @param {google.type.TimeOfDay} message TimeOfDay + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TimeOfDay.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.hours = 0; + object.minutes = 0; + object.seconds = 0; + object.nanos = 0; + } + if (message.hours != null && message.hasOwnProperty("hours")) + object.hours = message.hours; + if (message.minutes != null && message.hasOwnProperty("minutes")) + object.minutes = message.minutes; + if (message.seconds != null && message.hasOwnProperty("seconds")) + object.seconds = message.seconds; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; + return object; + }; + + /** + * Converts this TimeOfDay to JSON. + * @function toJSON + * @memberof google.type.TimeOfDay + * @instance + * @returns {Object.} JSON object + */ + TimeOfDay.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TimeOfDay; + })(); + + return type; + })(); + + return google; + })(); + + return $root; +}); diff --git a/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/protos/protos.json b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/protos/protos.json new file mode 100644 index 000000000..027ba9b17 --- /dev/null +++ b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/protos/protos.json @@ -0,0 +1,6246 @@ +{ + "nested": { + "google": { + "nested": { + "privacy": { + "nested": { + "dlp": { + "nested": { + "v2": { + "options": { + "csharp_namespace": "Google.Cloud.Dlp.V2", + "go_package": "google.golang.org/genproto/googleapis/privacy/dlp/v2;dlp", + "java_multiple_files": true, + "java_outer_classname": "DlpStorage", + "java_package": "com.google.privacy.dlp.v2", + "php_namespace": "Google\\Cloud\\Dlp\\V2", + "ruby_package": "Google::Cloud::Dlp::V2", + "(google.api.resource_definition).type": "dlp.googleapis.com/OrganizationLocation", + "(google.api.resource_definition).pattern": "organizations/{organization}/locations/{location}" + }, + "nested": { + "DlpService": { + "options": { + "(google.api.default_host)": "dlp.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "InspectContent": { + "requestType": "InspectContentRequest", + "responseType": "InspectContentResponse", + "options": { + "(google.api.http).post": "/v2/{parent=projects/*}/content:inspect", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v2/{parent=projects/*/locations/*}/content:inspect", + "(google.api.http).additional_bindings.body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{parent=projects/*}/content:inspect", + "body": "*", + "additional_bindings": { + "post": "/v2/{parent=projects/*/locations/*}/content:inspect", + "body": "*" + } + } + } + ] + }, + "RedactImage": { + "requestType": "RedactImageRequest", + "responseType": "RedactImageResponse", + "options": { + "(google.api.http).post": "/v2/{parent=projects/*}/image:redact", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v2/{parent=projects/*/locations/*}/image:redact", + "(google.api.http).additional_bindings.body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{parent=projects/*}/image:redact", + "body": "*", + "additional_bindings": { + "post": "/v2/{parent=projects/*/locations/*}/image:redact", + "body": "*" + } + } + } + ] + }, + "DeidentifyContent": { + "requestType": "DeidentifyContentRequest", + "responseType": "DeidentifyContentResponse", + "options": { + "(google.api.http).post": "/v2/{parent=projects/*}/content:deidentify", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v2/{parent=projects/*/locations/*}/content:deidentify", + "(google.api.http).additional_bindings.body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{parent=projects/*}/content:deidentify", + "body": "*", + "additional_bindings": { + "post": "/v2/{parent=projects/*/locations/*}/content:deidentify", + "body": "*" + } + } + } + ] + }, + "ReidentifyContent": { + "requestType": "ReidentifyContentRequest", + "responseType": "ReidentifyContentResponse", + "options": { + "(google.api.http).post": "/v2/{parent=projects/*}/content:reidentify", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v2/{parent=projects/*/locations/*}/content:reidentify", + "(google.api.http).additional_bindings.body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{parent=projects/*}/content:reidentify", + "body": "*", + "additional_bindings": { + "post": "/v2/{parent=projects/*/locations/*}/content:reidentify", + "body": "*" + } + } + } + ] + }, + "ListInfoTypes": { + "requestType": "ListInfoTypesRequest", + "responseType": "ListInfoTypesResponse", + "options": { + "(google.api.http).get": "/v2/infoTypes", + "(google.api.http).additional_bindings.get": "/v2/{parent=locations/*}/infoTypes", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/infoTypes", + "additional_bindings": { + "get": "/v2/{parent=locations/*}/infoTypes" + } + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "CreateInspectTemplate": { + "requestType": "CreateInspectTemplateRequest", + "responseType": "InspectTemplate", + "options": { + "(google.api.http).post": "/v2/{parent=organizations/*}/inspectTemplates", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v2/{parent=projects/*/locations/*}/inspectTemplates", + "(google.api.http).additional_bindings.body": "*", + "(google.api.method_signature)": "parent,inspect_template" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{parent=organizations/*}/inspectTemplates", + "body": "*", + "additional_bindings": [ + { + "post": "/v2/{parent=organizations/*/locations/*}/inspectTemplates", + "body": "*" + }, + { + "post": "/v2/{parent=projects/*}/inspectTemplates", + "body": "*" + }, + { + "post": "/v2/{parent=projects/*/locations/*}/inspectTemplates", + "body": "*" + } + ] + } + }, + { + "(google.api.method_signature)": "parent,inspect_template" + } + ] + }, + "UpdateInspectTemplate": { + "requestType": "UpdateInspectTemplateRequest", + "responseType": "InspectTemplate", + "options": { + "(google.api.http).patch": "/v2/{name=organizations/*/inspectTemplates/*}", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.patch": "/v2/{name=projects/*/locations/*/inspectTemplates/*}", + "(google.api.http).additional_bindings.body": "*", + "(google.api.method_signature)": "name,inspect_template,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v2/{name=organizations/*/inspectTemplates/*}", + "body": "*", + "additional_bindings": [ + { + "patch": "/v2/{name=organizations/*/locations/*/inspectTemplates/*}", + "body": "*" + }, + { + "patch": "/v2/{name=projects/*/inspectTemplates/*}", + "body": "*" + }, + { + "patch": "/v2/{name=projects/*/locations/*/inspectTemplates/*}", + "body": "*" + } + ] + } + }, + { + "(google.api.method_signature)": "name,inspect_template,update_mask" + } + ] + }, + "GetInspectTemplate": { + "requestType": "GetInspectTemplateRequest", + "responseType": "InspectTemplate", + "options": { + "(google.api.http).get": "/v2/{name=organizations/*/inspectTemplates/*}", + "(google.api.http).additional_bindings.get": "/v2/{name=projects/*/locations/*/inspectTemplates/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{name=organizations/*/inspectTemplates/*}", + "additional_bindings": [ + { + "get": "/v2/{name=organizations/*/locations/*/inspectTemplates/*}" + }, + { + "get": "/v2/{name=projects/*/inspectTemplates/*}" + }, + { + "get": "/v2/{name=projects/*/locations/*/inspectTemplates/*}" + } + ] + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListInspectTemplates": { + "requestType": "ListInspectTemplatesRequest", + "responseType": "ListInspectTemplatesResponse", + "options": { + "(google.api.http).get": "/v2/{parent=organizations/*}/inspectTemplates", + "(google.api.http).additional_bindings.get": "/v2/{parent=projects/*/locations/*}/inspectTemplates", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{parent=organizations/*}/inspectTemplates", + "additional_bindings": [ + { + "get": "/v2/{parent=organizations/*/locations/*}/inspectTemplates" + }, + { + "get": "/v2/{parent=projects/*}/inspectTemplates" + }, + { + "get": "/v2/{parent=projects/*/locations/*}/inspectTemplates" + } + ] + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "DeleteInspectTemplate": { + "requestType": "DeleteInspectTemplateRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v2/{name=organizations/*/inspectTemplates/*}", + "(google.api.http).additional_bindings.delete": "/v2/{name=projects/*/locations/*/inspectTemplates/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v2/{name=organizations/*/inspectTemplates/*}", + "additional_bindings": [ + { + "delete": "/v2/{name=organizations/*/locations/*/inspectTemplates/*}" + }, + { + "delete": "/v2/{name=projects/*/inspectTemplates/*}" + }, + { + "delete": "/v2/{name=projects/*/locations/*/inspectTemplates/*}" + } + ] + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateDeidentifyTemplate": { + "requestType": "CreateDeidentifyTemplateRequest", + "responseType": "DeidentifyTemplate", + "options": { + "(google.api.http).post": "/v2/{parent=organizations/*}/deidentifyTemplates", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v2/{parent=projects/*/locations/*}/deidentifyTemplates", + "(google.api.http).additional_bindings.body": "*", + "(google.api.method_signature)": "parent,deidentify_template" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{parent=organizations/*}/deidentifyTemplates", + "body": "*", + "additional_bindings": [ + { + "post": "/v2/{parent=organizations/*/locations/*}/deidentifyTemplates", + "body": "*" + }, + { + "post": "/v2/{parent=projects/*}/deidentifyTemplates", + "body": "*" + }, + { + "post": "/v2/{parent=projects/*/locations/*}/deidentifyTemplates", + "body": "*" + } + ] + } + }, + { + "(google.api.method_signature)": "parent,deidentify_template" + } + ] + }, + "UpdateDeidentifyTemplate": { + "requestType": "UpdateDeidentifyTemplateRequest", + "responseType": "DeidentifyTemplate", + "options": { + "(google.api.http).patch": "/v2/{name=organizations/*/deidentifyTemplates/*}", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.patch": "/v2/{name=projects/*/locations/*/deidentifyTemplates/*}", + "(google.api.http).additional_bindings.body": "*", + "(google.api.method_signature)": "name,deidentify_template,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v2/{name=organizations/*/deidentifyTemplates/*}", + "body": "*", + "additional_bindings": [ + { + "patch": "/v2/{name=organizations/*/locations/*/deidentifyTemplates/*}", + "body": "*" + }, + { + "patch": "/v2/{name=projects/*/deidentifyTemplates/*}", + "body": "*" + }, + { + "patch": "/v2/{name=projects/*/locations/*/deidentifyTemplates/*}", + "body": "*" + } + ] + } + }, + { + "(google.api.method_signature)": "name,deidentify_template,update_mask" + } + ] + }, + "GetDeidentifyTemplate": { + "requestType": "GetDeidentifyTemplateRequest", + "responseType": "DeidentifyTemplate", + "options": { + "(google.api.http).get": "/v2/{name=organizations/*/deidentifyTemplates/*}", + "(google.api.http).additional_bindings.get": "/v2/{name=projects/*/locations/*/deidentifyTemplates/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{name=organizations/*/deidentifyTemplates/*}", + "additional_bindings": [ + { + "get": "/v2/{name=organizations/*/locations/*/deidentifyTemplates/*}" + }, + { + "get": "/v2/{name=projects/*/deidentifyTemplates/*}" + }, + { + "get": "/v2/{name=projects/*/locations/*/deidentifyTemplates/*}" + } + ] + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListDeidentifyTemplates": { + "requestType": "ListDeidentifyTemplatesRequest", + "responseType": "ListDeidentifyTemplatesResponse", + "options": { + "(google.api.http).get": "/v2/{parent=organizations/*}/deidentifyTemplates", + "(google.api.http).additional_bindings.get": "/v2/{parent=projects/*/locations/*}/deidentifyTemplates", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{parent=organizations/*}/deidentifyTemplates", + "additional_bindings": [ + { + "get": "/v2/{parent=organizations/*/locations/*}/deidentifyTemplates" + }, + { + "get": "/v2/{parent=projects/*}/deidentifyTemplates" + }, + { + "get": "/v2/{parent=projects/*/locations/*}/deidentifyTemplates" + } + ] + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "DeleteDeidentifyTemplate": { + "requestType": "DeleteDeidentifyTemplateRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v2/{name=organizations/*/deidentifyTemplates/*}", + "(google.api.http).additional_bindings.delete": "/v2/{name=projects/*/locations/*/deidentifyTemplates/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v2/{name=organizations/*/deidentifyTemplates/*}", + "additional_bindings": [ + { + "delete": "/v2/{name=organizations/*/locations/*/deidentifyTemplates/*}" + }, + { + "delete": "/v2/{name=projects/*/deidentifyTemplates/*}" + }, + { + "delete": "/v2/{name=projects/*/locations/*/deidentifyTemplates/*}" + } + ] + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateJobTrigger": { + "requestType": "CreateJobTriggerRequest", + "responseType": "JobTrigger", + "options": { + "(google.api.http).post": "/v2/{parent=projects/*}/jobTriggers", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v2/{parent=projects/*/locations/*}/jobTriggers", + "(google.api.http).additional_bindings.body": "*", + "(google.api.method_signature)": "parent,job_trigger" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{parent=projects/*}/jobTriggers", + "body": "*", + "additional_bindings": { + "post": "/v2/{parent=projects/*/locations/*}/jobTriggers", + "body": "*" + } + } + }, + { + "(google.api.method_signature)": "parent,job_trigger" + } + ] + }, + "UpdateJobTrigger": { + "requestType": "UpdateJobTriggerRequest", + "responseType": "JobTrigger", + "options": { + "(google.api.http).patch": "/v2/{name=projects/*/jobTriggers/*}", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.patch": "/v2/{name=projects/*/locations/*/jobTriggers/*}", + "(google.api.http).additional_bindings.body": "*", + "(google.api.method_signature)": "name,job_trigger,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v2/{name=projects/*/jobTriggers/*}", + "body": "*", + "additional_bindings": { + "patch": "/v2/{name=projects/*/locations/*/jobTriggers/*}", + "body": "*" + } + } + }, + { + "(google.api.method_signature)": "name,job_trigger,update_mask" + } + ] + }, + "HybridInspectJobTrigger": { + "requestType": "HybridInspectJobTriggerRequest", + "responseType": "HybridInspectResponse", + "options": { + "(google.api.http).post": "/v2/{name=projects/*/locations/*/jobTriggers/*}:hybridInspect", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{name=projects/*/locations/*/jobTriggers/*}:hybridInspect", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "GetJobTrigger": { + "requestType": "GetJobTriggerRequest", + "responseType": "JobTrigger", + "options": { + "(google.api.http).get": "/v2/{name=projects/*/jobTriggers/*}", + "(google.api.http).additional_bindings.get": "/v2/{name=projects/*/locations/*/jobTriggers/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{name=projects/*/jobTriggers/*}", + "additional_bindings": { + "get": "/v2/{name=projects/*/locations/*/jobTriggers/*}" + } + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListJobTriggers": { + "requestType": "ListJobTriggersRequest", + "responseType": "ListJobTriggersResponse", + "options": { + "(google.api.http).get": "/v2/{parent=projects/*}/jobTriggers", + "(google.api.http).additional_bindings.get": "/v2/{parent=projects/*/locations/*}/jobTriggers", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{parent=projects/*}/jobTriggers", + "additional_bindings": { + "get": "/v2/{parent=projects/*/locations/*}/jobTriggers" + } + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "DeleteJobTrigger": { + "requestType": "DeleteJobTriggerRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v2/{name=projects/*/jobTriggers/*}", + "(google.api.http).additional_bindings.delete": "/v2/{name=projects/*/locations/*/jobTriggers/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v2/{name=projects/*/jobTriggers/*}", + "additional_bindings": { + "delete": "/v2/{name=projects/*/locations/*/jobTriggers/*}" + } + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ActivateJobTrigger": { + "requestType": "ActivateJobTriggerRequest", + "responseType": "DlpJob", + "options": { + "(google.api.http).post": "/v2/{name=projects/*/jobTriggers/*}:activate", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v2/{name=projects/*/locations/*/jobTriggers/*}:activate", + "(google.api.http).additional_bindings.body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{name=projects/*/jobTriggers/*}:activate", + "body": "*", + "additional_bindings": { + "post": "/v2/{name=projects/*/locations/*/jobTriggers/*}:activate", + "body": "*" + } + } + } + ] + }, + "CreateDlpJob": { + "requestType": "CreateDlpJobRequest", + "responseType": "DlpJob", + "options": { + "(google.api.http).post": "/v2/{parent=projects/*}/dlpJobs", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v2/{parent=projects/*/locations/*}/dlpJobs", + "(google.api.http).additional_bindings.body": "*", + "(google.api.method_signature)": "parent,risk_job" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{parent=projects/*}/dlpJobs", + "body": "*", + "additional_bindings": { + "post": "/v2/{parent=projects/*/locations/*}/dlpJobs", + "body": "*" + } + } + }, + { + "(google.api.method_signature)": "parent,inspect_job" + }, + { + "(google.api.method_signature)": "parent,risk_job" + } + ] + }, + "ListDlpJobs": { + "requestType": "ListDlpJobsRequest", + "responseType": "ListDlpJobsResponse", + "options": { + "(google.api.http).get": "/v2/{parent=projects/*}/dlpJobs", + "(google.api.http).additional_bindings.get": "/v2/{parent=projects/*/locations/*}/dlpJobs", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{parent=projects/*}/dlpJobs", + "additional_bindings": { + "get": "/v2/{parent=projects/*/locations/*}/dlpJobs" + } + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetDlpJob": { + "requestType": "GetDlpJobRequest", + "responseType": "DlpJob", + "options": { + "(google.api.http).get": "/v2/{name=projects/*/dlpJobs/*}", + "(google.api.http).additional_bindings.get": "/v2/{name=projects/*/locations/*/dlpJobs/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{name=projects/*/dlpJobs/*}", + "additional_bindings": { + "get": "/v2/{name=projects/*/locations/*/dlpJobs/*}" + } + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "DeleteDlpJob": { + "requestType": "DeleteDlpJobRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v2/{name=projects/*/dlpJobs/*}", + "(google.api.http).additional_bindings.delete": "/v2/{name=projects/*/locations/*/dlpJobs/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v2/{name=projects/*/dlpJobs/*}", + "additional_bindings": { + "delete": "/v2/{name=projects/*/locations/*/dlpJobs/*}" + } + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CancelDlpJob": { + "requestType": "CancelDlpJobRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).post": "/v2/{name=projects/*/dlpJobs/*}:cancel", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v2/{name=projects/*/locations/*/dlpJobs/*}:cancel", + "(google.api.http).additional_bindings.body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{name=projects/*/dlpJobs/*}:cancel", + "body": "*", + "additional_bindings": { + "post": "/v2/{name=projects/*/locations/*/dlpJobs/*}:cancel", + "body": "*" + } + } + } + ] + }, + "CreateStoredInfoType": { + "requestType": "CreateStoredInfoTypeRequest", + "responseType": "StoredInfoType", + "options": { + "(google.api.http).post": "/v2/{parent=organizations/*}/storedInfoTypes", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v2/{parent=projects/*/locations/*}/storedInfoTypes", + "(google.api.http).additional_bindings.body": "*", + "(google.api.method_signature)": "parent,config" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{parent=organizations/*}/storedInfoTypes", + "body": "*", + "additional_bindings": [ + { + "post": "/v2/{parent=organizations/*/locations/*}/storedInfoTypes", + "body": "*" + }, + { + "post": "/v2/{parent=projects/*}/storedInfoTypes", + "body": "*" + }, + { + "post": "/v2/{parent=projects/*/locations/*}/storedInfoTypes", + "body": "*" + } + ] + } + }, + { + "(google.api.method_signature)": "parent,config" + } + ] + }, + "UpdateStoredInfoType": { + "requestType": "UpdateStoredInfoTypeRequest", + "responseType": "StoredInfoType", + "options": { + "(google.api.http).patch": "/v2/{name=organizations/*/storedInfoTypes/*}", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.patch": "/v2/{name=projects/*/locations/*/storedInfoTypes/*}", + "(google.api.http).additional_bindings.body": "*", + "(google.api.method_signature)": "name,config,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v2/{name=organizations/*/storedInfoTypes/*}", + "body": "*", + "additional_bindings": [ + { + "patch": "/v2/{name=organizations/*/locations/*/storedInfoTypes/*}", + "body": "*" + }, + { + "patch": "/v2/{name=projects/*/storedInfoTypes/*}", + "body": "*" + }, + { + "patch": "/v2/{name=projects/*/locations/*/storedInfoTypes/*}", + "body": "*" + } + ] + } + }, + { + "(google.api.method_signature)": "name,config,update_mask" + } + ] + }, + "GetStoredInfoType": { + "requestType": "GetStoredInfoTypeRequest", + "responseType": "StoredInfoType", + "options": { + "(google.api.http).get": "/v2/{name=organizations/*/storedInfoTypes/*}", + "(google.api.http).additional_bindings.get": "/v2/{name=projects/*/locations/*/storedInfoTypes/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{name=organizations/*/storedInfoTypes/*}", + "additional_bindings": [ + { + "get": "/v2/{name=organizations/*/locations/*/storedInfoTypes/*}" + }, + { + "get": "/v2/{name=projects/*/storedInfoTypes/*}" + }, + { + "get": "/v2/{name=projects/*/locations/*/storedInfoTypes/*}" + } + ] + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListStoredInfoTypes": { + "requestType": "ListStoredInfoTypesRequest", + "responseType": "ListStoredInfoTypesResponse", + "options": { + "(google.api.http).get": "/v2/{parent=organizations/*}/storedInfoTypes", + "(google.api.http).additional_bindings.get": "/v2/{parent=projects/*/locations/*}/storedInfoTypes", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{parent=organizations/*}/storedInfoTypes", + "additional_bindings": [ + { + "get": "/v2/{parent=organizations/*/locations/*}/storedInfoTypes" + }, + { + "get": "/v2/{parent=projects/*}/storedInfoTypes" + }, + { + "get": "/v2/{parent=projects/*/locations/*}/storedInfoTypes" + } + ] + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "DeleteStoredInfoType": { + "requestType": "DeleteStoredInfoTypeRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v2/{name=organizations/*/storedInfoTypes/*}", + "(google.api.http).additional_bindings.delete": "/v2/{name=projects/*/locations/*/storedInfoTypes/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v2/{name=organizations/*/storedInfoTypes/*}", + "additional_bindings": [ + { + "delete": "/v2/{name=organizations/*/locations/*/storedInfoTypes/*}" + }, + { + "delete": "/v2/{name=projects/*/storedInfoTypes/*}" + }, + { + "delete": "/v2/{name=projects/*/locations/*/storedInfoTypes/*}" + } + ] + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "HybridInspectDlpJob": { + "requestType": "HybridInspectDlpJobRequest", + "responseType": "HybridInspectResponse", + "options": { + "(google.api.http).post": "/v2/{name=projects/*/locations/*/dlpJobs/*}:hybridInspect", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{name=projects/*/locations/*/dlpJobs/*}:hybridInspect", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "FinishDlpJob": { + "requestType": "FinishDlpJobRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).post": "/v2/{name=projects/*/locations/*/dlpJobs/*}:finish", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{name=projects/*/locations/*/dlpJobs/*}:finish", + "body": "*" + } + } + ] + } + } + }, + "ExcludeInfoTypes": { + "fields": { + "infoTypes": { + "rule": "repeated", + "type": "InfoType", + "id": 1 + } + } + }, + "ExclusionRule": { + "oneofs": { + "type": { + "oneof": [ + "dictionary", + "regex", + "excludeInfoTypes" + ] + } + }, + "fields": { + "dictionary": { + "type": "CustomInfoType.Dictionary", + "id": 1 + }, + "regex": { + "type": "CustomInfoType.Regex", + "id": 2 + }, + "excludeInfoTypes": { + "type": "ExcludeInfoTypes", + "id": 3 + }, + "matchingType": { + "type": "MatchingType", + "id": 4 + } + } + }, + "InspectionRule": { + "oneofs": { + "type": { + "oneof": [ + "hotwordRule", + "exclusionRule" + ] + } + }, + "fields": { + "hotwordRule": { + "type": "CustomInfoType.DetectionRule.HotwordRule", + "id": 1 + }, + "exclusionRule": { + "type": "ExclusionRule", + "id": 2 + } + } + }, + "InspectionRuleSet": { + "fields": { + "infoTypes": { + "rule": "repeated", + "type": "InfoType", + "id": 1 + }, + "rules": { + "rule": "repeated", + "type": "InspectionRule", + "id": 2 + } + } + }, + "InspectConfig": { + "fields": { + "infoTypes": { + "rule": "repeated", + "type": "InfoType", + "id": 1 + }, + "minLikelihood": { + "type": "Likelihood", + "id": 2 + }, + "limits": { + "type": "FindingLimits", + "id": 3 + }, + "includeQuote": { + "type": "bool", + "id": 4 + }, + "excludeInfoTypes": { + "type": "bool", + "id": 5 + }, + "customInfoTypes": { + "rule": "repeated", + "type": "CustomInfoType", + "id": 6 + }, + "contentOptions": { + "rule": "repeated", + "type": "ContentOption", + "id": 8 + }, + "ruleSet": { + "rule": "repeated", + "type": "InspectionRuleSet", + "id": 10 + } + }, + "nested": { + "FindingLimits": { + "fields": { + "maxFindingsPerItem": { + "type": "int32", + "id": 1 + }, + "maxFindingsPerRequest": { + "type": "int32", + "id": 2 + }, + "maxFindingsPerInfoType": { + "rule": "repeated", + "type": "InfoTypeLimit", + "id": 3 + } + }, + "nested": { + "InfoTypeLimit": { + "fields": { + "infoType": { + "type": "InfoType", + "id": 1 + }, + "maxFindings": { + "type": "int32", + "id": 2 + } + } + } + } + } + } + }, + "ByteContentItem": { + "fields": { + "type": { + "type": "BytesType", + "id": 1 + }, + "data": { + "type": "bytes", + "id": 2 + } + }, + "nested": { + "BytesType": { + "values": { + "BYTES_TYPE_UNSPECIFIED": 0, + "IMAGE": 6, + "IMAGE_JPEG": 1, + "IMAGE_BMP": 2, + "IMAGE_PNG": 3, + "IMAGE_SVG": 4, + "TEXT_UTF8": 5, + "WORD_DOCUMENT": 7, + "PDF": 8, + "AVRO": 11, + "CSV": 12, + "TSV": 13 + } + } + } + }, + "ContentItem": { + "oneofs": { + "dataItem": { + "oneof": [ + "value", + "table", + "byteItem" + ] + } + }, + "fields": { + "value": { + "type": "string", + "id": 3 + }, + "table": { + "type": "Table", + "id": 4 + }, + "byteItem": { + "type": "ByteContentItem", + "id": 5 + } + } + }, + "Table": { + "fields": { + "headers": { + "rule": "repeated", + "type": "FieldId", + "id": 1 + }, + "rows": { + "rule": "repeated", + "type": "Row", + "id": 2 + } + }, + "nested": { + "Row": { + "fields": { + "values": { + "rule": "repeated", + "type": "Value", + "id": 1 + } + } + } + } + }, + "InspectResult": { + "fields": { + "findings": { + "rule": "repeated", + "type": "Finding", + "id": 1 + }, + "findingsTruncated": { + "type": "bool", + "id": 2 + } + } + }, + "Finding": { + "options": { + "(google.api.resource).type": "dlp.googleapis.com/Finding", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/findings/{finding}" + }, + "fields": { + "name": { + "type": "string", + "id": 14 + }, + "quote": { + "type": "string", + "id": 1 + }, + "infoType": { + "type": "InfoType", + "id": 2 + }, + "likelihood": { + "type": "Likelihood", + "id": 3 + }, + "location": { + "type": "Location", + "id": 4 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 6 + }, + "quoteInfo": { + "type": "QuoteInfo", + "id": 7 + }, + "resourceName": { + "type": "string", + "id": 8, + "options": { + "(google.api.resource_reference).type": "dlp.googleapis.com/DlpJob" + } + }, + "triggerName": { + "type": "string", + "id": 9, + "options": { + "(google.api.resource_reference).type": "dlp.googleapis.com/JobTrigger" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 10 + }, + "jobCreateTime": { + "type": "google.protobuf.Timestamp", + "id": 11 + }, + "jobName": { + "type": "string", + "id": 13, + "options": { + "(google.api.resource_reference).type": "dlp.googleapis.com/DlpJob" + } + } + } + }, + "Location": { + "fields": { + "byteRange": { + "type": "Range", + "id": 1 + }, + "codepointRange": { + "type": "Range", + "id": 2 + }, + "contentLocations": { + "rule": "repeated", + "type": "ContentLocation", + "id": 7 + }, + "container": { + "type": "Container", + "id": 8 + } + } + }, + "ContentLocation": { + "oneofs": { + "location": { + "oneof": [ + "recordLocation", + "imageLocation", + "documentLocation", + "metadataLocation" + ] + } + }, + "fields": { + "containerName": { + "type": "string", + "id": 1 + }, + "recordLocation": { + "type": "RecordLocation", + "id": 2 + }, + "imageLocation": { + "type": "ImageLocation", + "id": 3 + }, + "documentLocation": { + "type": "DocumentLocation", + "id": 5 + }, + "metadataLocation": { + "type": "MetadataLocation", + "id": 8 + }, + "containerTimestamp": { + "type": "google.protobuf.Timestamp", + "id": 6 + }, + "containerVersion": { + "type": "string", + "id": 7 + } + } + }, + "MetadataLocation": { + "oneofs": { + "label": { + "oneof": [ + "storageLabel" + ] + } + }, + "fields": { + "type": { + "type": "MetadataType", + "id": 1 + }, + "storageLabel": { + "type": "StorageMetadataLabel", + "id": 3 + } + } + }, + "StorageMetadataLabel": { + "fields": { + "key": { + "type": "string", + "id": 1 + } + } + }, + "DocumentLocation": { + "fields": { + "fileOffset": { + "type": "int64", + "id": 1 + } + } + }, + "RecordLocation": { + "fields": { + "recordKey": { + "type": "RecordKey", + "id": 1 + }, + "fieldId": { + "type": "FieldId", + "id": 2 + }, + "tableLocation": { + "type": "TableLocation", + "id": 3 + } + } + }, + "TableLocation": { + "fields": { + "rowIndex": { + "type": "int64", + "id": 1 + } + } + }, + "Container": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "projectId": { + "type": "string", + "id": 2 + }, + "fullPath": { + "type": "string", + "id": 3 + }, + "rootPath": { + "type": "string", + "id": 4 + }, + "relativePath": { + "type": "string", + "id": 5 + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 6 + }, + "version": { + "type": "string", + "id": 7 + } + } + }, + "Range": { + "fields": { + "start": { + "type": "int64", + "id": 1 + }, + "end": { + "type": "int64", + "id": 2 + } + } + }, + "ImageLocation": { + "fields": { + "boundingBoxes": { + "rule": "repeated", + "type": "BoundingBox", + "id": 1 + } + } + }, + "BoundingBox": { + "fields": { + "top": { + "type": "int32", + "id": 1 + }, + "left": { + "type": "int32", + "id": 2 + }, + "width": { + "type": "int32", + "id": 3 + }, + "height": { + "type": "int32", + "id": 4 + } + } + }, + "RedactImageRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).child_type": "dlp.googleapis.com/DlpContent" + } + }, + "locationId": { + "type": "string", + "id": 8 + }, + "inspectConfig": { + "type": "InspectConfig", + "id": 2 + }, + "imageRedactionConfigs": { + "rule": "repeated", + "type": "ImageRedactionConfig", + "id": 5 + }, + "includeFindings": { + "type": "bool", + "id": 6 + }, + "byteItem": { + "type": "ByteContentItem", + "id": 7 + } + }, + "nested": { + "ImageRedactionConfig": { + "oneofs": { + "target": { + "oneof": [ + "infoType", + "redactAllText" + ] + } + }, + "fields": { + "infoType": { + "type": "InfoType", + "id": 1 + }, + "redactAllText": { + "type": "bool", + "id": 2 + }, + "redactionColor": { + "type": "Color", + "id": 3 + } + } + } + } + }, + "Color": { + "fields": { + "red": { + "type": "float", + "id": 1 + }, + "green": { + "type": "float", + "id": 2 + }, + "blue": { + "type": "float", + "id": 3 + } + } + }, + "RedactImageResponse": { + "fields": { + "redactedImage": { + "type": "bytes", + "id": 1 + }, + "extractedText": { + "type": "string", + "id": 2 + }, + "inspectResult": { + "type": "InspectResult", + "id": 3 + } + } + }, + "DeidentifyContentRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).child_type": "dlp.googleapis.com/DlpContent" + } + }, + "deidentifyConfig": { + "type": "DeidentifyConfig", + "id": 2 + }, + "inspectConfig": { + "type": "InspectConfig", + "id": 3 + }, + "item": { + "type": "ContentItem", + "id": 4 + }, + "inspectTemplateName": { + "type": "string", + "id": 5 + }, + "deidentifyTemplateName": { + "type": "string", + "id": 6 + }, + "locationId": { + "type": "string", + "id": 7 + } + } + }, + "DeidentifyContentResponse": { + "fields": { + "item": { + "type": "ContentItem", + "id": 1 + }, + "overview": { + "type": "TransformationOverview", + "id": 2 + } + } + }, + "ReidentifyContentRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dlp.googleapis.com/DlpContent" + } + }, + "reidentifyConfig": { + "type": "DeidentifyConfig", + "id": 2 + }, + "inspectConfig": { + "type": "InspectConfig", + "id": 3 + }, + "item": { + "type": "ContentItem", + "id": 4 + }, + "inspectTemplateName": { + "type": "string", + "id": 5 + }, + "reidentifyTemplateName": { + "type": "string", + "id": 6 + }, + "locationId": { + "type": "string", + "id": 7 + } + } + }, + "ReidentifyContentResponse": { + "fields": { + "item": { + "type": "ContentItem", + "id": 1 + }, + "overview": { + "type": "TransformationOverview", + "id": 2 + } + } + }, + "InspectContentRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).child_type": "dlp.googleapis.com/DlpContent" + } + }, + "inspectConfig": { + "type": "InspectConfig", + "id": 2 + }, + "item": { + "type": "ContentItem", + "id": 3 + }, + "inspectTemplateName": { + "type": "string", + "id": 4 + }, + "locationId": { + "type": "string", + "id": 5 + } + } + }, + "InspectContentResponse": { + "fields": { + "result": { + "type": "InspectResult", + "id": 1 + } + } + }, + "OutputStorageConfig": { + "oneofs": { + "type": { + "oneof": [ + "table" + ] + } + }, + "fields": { + "table": { + "type": "BigQueryTable", + "id": 1 + }, + "outputSchema": { + "type": "OutputSchema", + "id": 3 + } + }, + "nested": { + "OutputSchema": { + "values": { + "OUTPUT_SCHEMA_UNSPECIFIED": 0, + "BASIC_COLUMNS": 1, + "GCS_COLUMNS": 2, + "DATASTORE_COLUMNS": 3, + "BIG_QUERY_COLUMNS": 4, + "ALL_COLUMNS": 5 + } + } + } + }, + "InfoTypeStats": { + "fields": { + "infoType": { + "type": "InfoType", + "id": 1 + }, + "count": { + "type": "int64", + "id": 2 + } + } + }, + "InspectDataSourceDetails": { + "fields": { + "requestedOptions": { + "type": "RequestedOptions", + "id": 2 + }, + "result": { + "type": "Result", + "id": 3 + } + }, + "nested": { + "RequestedOptions": { + "fields": { + "snapshotInspectTemplate": { + "type": "InspectTemplate", + "id": 1 + }, + "jobConfig": { + "type": "InspectJobConfig", + "id": 3 + } + } + }, + "Result": { + "fields": { + "processedBytes": { + "type": "int64", + "id": 1 + }, + "totalEstimatedBytes": { + "type": "int64", + "id": 2 + }, + "infoTypeStats": { + "rule": "repeated", + "type": "InfoTypeStats", + "id": 3 + }, + "hybridStats": { + "type": "HybridInspectStatistics", + "id": 7 + } + } + } + } + }, + "HybridInspectStatistics": { + "fields": { + "processedCount": { + "type": "int64", + "id": 1 + }, + "abortedCount": { + "type": "int64", + "id": 2 + }, + "pendingCount": { + "type": "int64", + "id": 3 + } + } + }, + "InfoTypeDescription": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 2 + }, + "supportedBy": { + "rule": "repeated", + "type": "InfoTypeSupportedBy", + "id": 3 + }, + "description": { + "type": "string", + "id": 4 + } + } + }, + "ListInfoTypesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 4 + }, + "languageCode": { + "type": "string", + "id": 1 + }, + "filter": { + "type": "string", + "id": 2 + }, + "locationId": { + "type": "string", + "id": 3 + } + } + }, + "ListInfoTypesResponse": { + "fields": { + "infoTypes": { + "rule": "repeated", + "type": "InfoTypeDescription", + "id": 1 + } + } + }, + "RiskAnalysisJobConfig": { + "fields": { + "privacyMetric": { + "type": "PrivacyMetric", + "id": 1 + }, + "sourceTable": { + "type": "BigQueryTable", + "id": 2 + }, + "actions": { + "rule": "repeated", + "type": "Action", + "id": 3 + } + } + }, + "QuasiId": { + "oneofs": { + "tag": { + "oneof": [ + "infoType", + "customTag", + "inferred" + ] + } + }, + "fields": { + "field": { + "type": "FieldId", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "infoType": { + "type": "InfoType", + "id": 2 + }, + "customTag": { + "type": "string", + "id": 3 + }, + "inferred": { + "type": "google.protobuf.Empty", + "id": 4 + } + } + }, + "StatisticalTable": { + "fields": { + "table": { + "type": "BigQueryTable", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "quasiIds": { + "rule": "repeated", + "type": "QuasiIdentifierField", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "relativeFrequency": { + "type": "FieldId", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + }, + "nested": { + "QuasiIdentifierField": { + "fields": { + "field": { + "type": "FieldId", + "id": 1 + }, + "customTag": { + "type": "string", + "id": 2 + } + } + } + } + }, + "PrivacyMetric": { + "oneofs": { + "type": { + "oneof": [ + "numericalStatsConfig", + "categoricalStatsConfig", + "kAnonymityConfig", + "lDiversityConfig", + "kMapEstimationConfig", + "deltaPresenceEstimationConfig" + ] + } + }, + "fields": { + "numericalStatsConfig": { + "type": "NumericalStatsConfig", + "id": 1 + }, + "categoricalStatsConfig": { + "type": "CategoricalStatsConfig", + "id": 2 + }, + "kAnonymityConfig": { + "type": "KAnonymityConfig", + "id": 3 + }, + "lDiversityConfig": { + "type": "LDiversityConfig", + "id": 4 + }, + "kMapEstimationConfig": { + "type": "KMapEstimationConfig", + "id": 5 + }, + "deltaPresenceEstimationConfig": { + "type": "DeltaPresenceEstimationConfig", + "id": 6 + } + }, + "nested": { + "NumericalStatsConfig": { + "fields": { + "field": { + "type": "FieldId", + "id": 1 + } + } + }, + "CategoricalStatsConfig": { + "fields": { + "field": { + "type": "FieldId", + "id": 1 + } + } + }, + "KAnonymityConfig": { + "fields": { + "quasiIds": { + "rule": "repeated", + "type": "FieldId", + "id": 1 + }, + "entityId": { + "type": "EntityId", + "id": 2 + } + } + }, + "LDiversityConfig": { + "fields": { + "quasiIds": { + "rule": "repeated", + "type": "FieldId", + "id": 1 + }, + "sensitiveAttribute": { + "type": "FieldId", + "id": 2 + } + } + }, + "KMapEstimationConfig": { + "fields": { + "quasiIds": { + "rule": "repeated", + "type": "TaggedField", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "regionCode": { + "type": "string", + "id": 2 + }, + "auxiliaryTables": { + "rule": "repeated", + "type": "AuxiliaryTable", + "id": 3 + } + }, + "nested": { + "TaggedField": { + "oneofs": { + "tag": { + "oneof": [ + "infoType", + "customTag", + "inferred" + ] + } + }, + "fields": { + "field": { + "type": "FieldId", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "infoType": { + "type": "InfoType", + "id": 2 + }, + "customTag": { + "type": "string", + "id": 3 + }, + "inferred": { + "type": "google.protobuf.Empty", + "id": 4 + } + } + }, + "AuxiliaryTable": { + "fields": { + "table": { + "type": "BigQueryTable", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "quasiIds": { + "rule": "repeated", + "type": "QuasiIdField", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "relativeFrequency": { + "type": "FieldId", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + }, + "nested": { + "QuasiIdField": { + "fields": { + "field": { + "type": "FieldId", + "id": 1 + }, + "customTag": { + "type": "string", + "id": 2 + } + } + } + } + } + } + }, + "DeltaPresenceEstimationConfig": { + "fields": { + "quasiIds": { + "rule": "repeated", + "type": "QuasiId", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "regionCode": { + "type": "string", + "id": 2 + }, + "auxiliaryTables": { + "rule": "repeated", + "type": "StatisticalTable", + "id": 3 + } + } + } + } + }, + "AnalyzeDataSourceRiskDetails": { + "oneofs": { + "result": { + "oneof": [ + "numericalStatsResult", + "categoricalStatsResult", + "kAnonymityResult", + "lDiversityResult", + "kMapEstimationResult", + "deltaPresenceEstimationResult" + ] + } + }, + "fields": { + "requestedPrivacyMetric": { + "type": "PrivacyMetric", + "id": 1 + }, + "requestedSourceTable": { + "type": "BigQueryTable", + "id": 2 + }, + "numericalStatsResult": { + "type": "NumericalStatsResult", + "id": 3 + }, + "categoricalStatsResult": { + "type": "CategoricalStatsResult", + "id": 4 + }, + "kAnonymityResult": { + "type": "KAnonymityResult", + "id": 5 + }, + "lDiversityResult": { + "type": "LDiversityResult", + "id": 6 + }, + "kMapEstimationResult": { + "type": "KMapEstimationResult", + "id": 7 + }, + "deltaPresenceEstimationResult": { + "type": "DeltaPresenceEstimationResult", + "id": 9 + }, + "requestedOptions": { + "type": "RequestedRiskAnalysisOptions", + "id": 10 + } + }, + "nested": { + "NumericalStatsResult": { + "fields": { + "minValue": { + "type": "Value", + "id": 1 + }, + "maxValue": { + "type": "Value", + "id": 2 + }, + "quantileValues": { + "rule": "repeated", + "type": "Value", + "id": 4 + } + } + }, + "CategoricalStatsResult": { + "fields": { + "valueFrequencyHistogramBuckets": { + "rule": "repeated", + "type": "CategoricalStatsHistogramBucket", + "id": 5 + } + }, + "nested": { + "CategoricalStatsHistogramBucket": { + "fields": { + "valueFrequencyLowerBound": { + "type": "int64", + "id": 1 + }, + "valueFrequencyUpperBound": { + "type": "int64", + "id": 2 + }, + "bucketSize": { + "type": "int64", + "id": 3 + }, + "bucketValues": { + "rule": "repeated", + "type": "ValueFrequency", + "id": 4 + }, + "bucketValueCount": { + "type": "int64", + "id": 5 + } + } + } + } + }, + "KAnonymityResult": { + "fields": { + "equivalenceClassHistogramBuckets": { + "rule": "repeated", + "type": "KAnonymityHistogramBucket", + "id": 5 + } + }, + "nested": { + "KAnonymityEquivalenceClass": { + "fields": { + "quasiIdsValues": { + "rule": "repeated", + "type": "Value", + "id": 1 + }, + "equivalenceClassSize": { + "type": "int64", + "id": 2 + } + } + }, + "KAnonymityHistogramBucket": { + "fields": { + "equivalenceClassSizeLowerBound": { + "type": "int64", + "id": 1 + }, + "equivalenceClassSizeUpperBound": { + "type": "int64", + "id": 2 + }, + "bucketSize": { + "type": "int64", + "id": 3 + }, + "bucketValues": { + "rule": "repeated", + "type": "KAnonymityEquivalenceClass", + "id": 4 + }, + "bucketValueCount": { + "type": "int64", + "id": 5 + } + } + } + } + }, + "LDiversityResult": { + "fields": { + "sensitiveValueFrequencyHistogramBuckets": { + "rule": "repeated", + "type": "LDiversityHistogramBucket", + "id": 5 + } + }, + "nested": { + "LDiversityEquivalenceClass": { + "fields": { + "quasiIdsValues": { + "rule": "repeated", + "type": "Value", + "id": 1 + }, + "equivalenceClassSize": { + "type": "int64", + "id": 2 + }, + "numDistinctSensitiveValues": { + "type": "int64", + "id": 3 + }, + "topSensitiveValues": { + "rule": "repeated", + "type": "ValueFrequency", + "id": 4 + } + } + }, + "LDiversityHistogramBucket": { + "fields": { + "sensitiveValueFrequencyLowerBound": { + "type": "int64", + "id": 1 + }, + "sensitiveValueFrequencyUpperBound": { + "type": "int64", + "id": 2 + }, + "bucketSize": { + "type": "int64", + "id": 3 + }, + "bucketValues": { + "rule": "repeated", + "type": "LDiversityEquivalenceClass", + "id": 4 + }, + "bucketValueCount": { + "type": "int64", + "id": 5 + } + } + } + } + }, + "KMapEstimationResult": { + "fields": { + "kMapEstimationHistogram": { + "rule": "repeated", + "type": "KMapEstimationHistogramBucket", + "id": 1 + } + }, + "nested": { + "KMapEstimationQuasiIdValues": { + "fields": { + "quasiIdsValues": { + "rule": "repeated", + "type": "Value", + "id": 1 + }, + "estimatedAnonymity": { + "type": "int64", + "id": 2 + } + } + }, + "KMapEstimationHistogramBucket": { + "fields": { + "minAnonymity": { + "type": "int64", + "id": 1 + }, + "maxAnonymity": { + "type": "int64", + "id": 2 + }, + "bucketSize": { + "type": "int64", + "id": 5 + }, + "bucketValues": { + "rule": "repeated", + "type": "KMapEstimationQuasiIdValues", + "id": 6 + }, + "bucketValueCount": { + "type": "int64", + "id": 7 + } + } + } + } + }, + "DeltaPresenceEstimationResult": { + "fields": { + "deltaPresenceEstimationHistogram": { + "rule": "repeated", + "type": "DeltaPresenceEstimationHistogramBucket", + "id": 1 + } + }, + "nested": { + "DeltaPresenceEstimationQuasiIdValues": { + "fields": { + "quasiIdsValues": { + "rule": "repeated", + "type": "Value", + "id": 1 + }, + "estimatedProbability": { + "type": "double", + "id": 2 + } + } + }, + "DeltaPresenceEstimationHistogramBucket": { + "fields": { + "minProbability": { + "type": "double", + "id": 1 + }, + "maxProbability": { + "type": "double", + "id": 2 + }, + "bucketSize": { + "type": "int64", + "id": 5 + }, + "bucketValues": { + "rule": "repeated", + "type": "DeltaPresenceEstimationQuasiIdValues", + "id": 6 + }, + "bucketValueCount": { + "type": "int64", + "id": 7 + } + } + } + } + }, + "RequestedRiskAnalysisOptions": { + "fields": { + "jobConfig": { + "type": "RiskAnalysisJobConfig", + "id": 1 + } + } + } + } + }, + "ValueFrequency": { + "fields": { + "value": { + "type": "Value", + "id": 1 + }, + "count": { + "type": "int64", + "id": 2 + } + } + }, + "Value": { + "oneofs": { + "type": { + "oneof": [ + "integerValue", + "floatValue", + "stringValue", + "booleanValue", + "timestampValue", + "timeValue", + "dateValue", + "dayOfWeekValue" + ] + } + }, + "fields": { + "integerValue": { + "type": "int64", + "id": 1 + }, + "floatValue": { + "type": "double", + "id": 2 + }, + "stringValue": { + "type": "string", + "id": 3 + }, + "booleanValue": { + "type": "bool", + "id": 4 + }, + "timestampValue": { + "type": "google.protobuf.Timestamp", + "id": 5 + }, + "timeValue": { + "type": "google.type.TimeOfDay", + "id": 6 + }, + "dateValue": { + "type": "google.type.Date", + "id": 7 + }, + "dayOfWeekValue": { + "type": "google.type.DayOfWeek", + "id": 8 + } + } + }, + "QuoteInfo": { + "oneofs": { + "parsedQuote": { + "oneof": [ + "dateTime" + ] + } + }, + "fields": { + "dateTime": { + "type": "DateTime", + "id": 2 + } + } + }, + "DateTime": { + "fields": { + "date": { + "type": "google.type.Date", + "id": 1 + }, + "dayOfWeek": { + "type": "google.type.DayOfWeek", + "id": 2 + }, + "time": { + "type": "google.type.TimeOfDay", + "id": 3 + }, + "timeZone": { + "type": "TimeZone", + "id": 4 + } + }, + "nested": { + "TimeZone": { + "fields": { + "offsetMinutes": { + "type": "int32", + "id": 1 + } + } + } + } + }, + "DeidentifyConfig": { + "oneofs": { + "transformation": { + "oneof": [ + "infoTypeTransformations", + "recordTransformations" + ] + } + }, + "fields": { + "infoTypeTransformations": { + "type": "InfoTypeTransformations", + "id": 1 + }, + "recordTransformations": { + "type": "RecordTransformations", + "id": 2 + }, + "transformationErrorHandling": { + "type": "TransformationErrorHandling", + "id": 3 + } + } + }, + "TransformationErrorHandling": { + "oneofs": { + "mode": { + "oneof": [ + "throwError", + "leaveUntransformed" + ] + } + }, + "fields": { + "throwError": { + "type": "ThrowError", + "id": 1 + }, + "leaveUntransformed": { + "type": "LeaveUntransformed", + "id": 2 + } + }, + "nested": { + "ThrowError": { + "fields": {} + }, + "LeaveUntransformed": { + "fields": {} + } + } + }, + "PrimitiveTransformation": { + "oneofs": { + "transformation": { + "oneof": [ + "replaceConfig", + "redactConfig", + "characterMaskConfig", + "cryptoReplaceFfxFpeConfig", + "fixedSizeBucketingConfig", + "bucketingConfig", + "replaceWithInfoTypeConfig", + "timePartConfig", + "cryptoHashConfig", + "dateShiftConfig", + "cryptoDeterministicConfig" + ] + } + }, + "fields": { + "replaceConfig": { + "type": "ReplaceValueConfig", + "id": 1 + }, + "redactConfig": { + "type": "RedactConfig", + "id": 2 + }, + "characterMaskConfig": { + "type": "CharacterMaskConfig", + "id": 3 + }, + "cryptoReplaceFfxFpeConfig": { + "type": "CryptoReplaceFfxFpeConfig", + "id": 4 + }, + "fixedSizeBucketingConfig": { + "type": "FixedSizeBucketingConfig", + "id": 5 + }, + "bucketingConfig": { + "type": "BucketingConfig", + "id": 6 + }, + "replaceWithInfoTypeConfig": { + "type": "ReplaceWithInfoTypeConfig", + "id": 7 + }, + "timePartConfig": { + "type": "TimePartConfig", + "id": 8 + }, + "cryptoHashConfig": { + "type": "CryptoHashConfig", + "id": 9 + }, + "dateShiftConfig": { + "type": "DateShiftConfig", + "id": 11 + }, + "cryptoDeterministicConfig": { + "type": "CryptoDeterministicConfig", + "id": 12 + } + } + }, + "TimePartConfig": { + "fields": { + "partToExtract": { + "type": "TimePart", + "id": 1 + } + }, + "nested": { + "TimePart": { + "values": { + "TIME_PART_UNSPECIFIED": 0, + "YEAR": 1, + "MONTH": 2, + "DAY_OF_MONTH": 3, + "DAY_OF_WEEK": 4, + "WEEK_OF_YEAR": 5, + "HOUR_OF_DAY": 6 + } + } + } + }, + "CryptoHashConfig": { + "fields": { + "cryptoKey": { + "type": "CryptoKey", + "id": 1 + } + } + }, + "CryptoDeterministicConfig": { + "fields": { + "cryptoKey": { + "type": "CryptoKey", + "id": 1 + }, + "surrogateInfoType": { + "type": "InfoType", + "id": 2 + }, + "context": { + "type": "FieldId", + "id": 3 + } + } + }, + "ReplaceValueConfig": { + "fields": { + "newValue": { + "type": "Value", + "id": 1 + } + } + }, + "ReplaceWithInfoTypeConfig": { + "fields": {} + }, + "RedactConfig": { + "fields": {} + }, + "CharsToIgnore": { + "oneofs": { + "characters": { + "oneof": [ + "charactersToSkip", + "commonCharactersToIgnore" + ] + } + }, + "fields": { + "charactersToSkip": { + "type": "string", + "id": 1 + }, + "commonCharactersToIgnore": { + "type": "CommonCharsToIgnore", + "id": 2 + } + }, + "nested": { + "CommonCharsToIgnore": { + "values": { + "COMMON_CHARS_TO_IGNORE_UNSPECIFIED": 0, + "NUMERIC": 1, + "ALPHA_UPPER_CASE": 2, + "ALPHA_LOWER_CASE": 3, + "PUNCTUATION": 4, + "WHITESPACE": 5 + } + } + } + }, + "CharacterMaskConfig": { + "fields": { + "maskingCharacter": { + "type": "string", + "id": 1 + }, + "numberToMask": { + "type": "int32", + "id": 2 + }, + "reverseOrder": { + "type": "bool", + "id": 3 + }, + "charactersToIgnore": { + "rule": "repeated", + "type": "CharsToIgnore", + "id": 4 + } + } + }, + "FixedSizeBucketingConfig": { + "fields": { + "lowerBound": { + "type": "Value", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "upperBound": { + "type": "Value", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "bucketSize": { + "type": "double", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "BucketingConfig": { + "fields": { + "buckets": { + "rule": "repeated", + "type": "Bucket", + "id": 1 + } + }, + "nested": { + "Bucket": { + "fields": { + "min": { + "type": "Value", + "id": 1 + }, + "max": { + "type": "Value", + "id": 2 + }, + "replacementValue": { + "type": "Value", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + } + } + }, + "CryptoReplaceFfxFpeConfig": { + "oneofs": { + "alphabet": { + "oneof": [ + "commonAlphabet", + "customAlphabet", + "radix" + ] + } + }, + "fields": { + "cryptoKey": { + "type": "CryptoKey", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "context": { + "type": "FieldId", + "id": 2 + }, + "commonAlphabet": { + "type": "FfxCommonNativeAlphabet", + "id": 4 + }, + "customAlphabet": { + "type": "string", + "id": 5 + }, + "radix": { + "type": "int32", + "id": 6 + }, + "surrogateInfoType": { + "type": "InfoType", + "id": 8 + } + }, + "nested": { + "FfxCommonNativeAlphabet": { + "values": { + "FFX_COMMON_NATIVE_ALPHABET_UNSPECIFIED": 0, + "NUMERIC": 1, + "HEXADECIMAL": 2, + "UPPER_CASE_ALPHA_NUMERIC": 3, + "ALPHA_NUMERIC": 4 + } + } + } + }, + "CryptoKey": { + "oneofs": { + "source": { + "oneof": [ + "transient", + "unwrapped", + "kmsWrapped" + ] + } + }, + "fields": { + "transient": { + "type": "TransientCryptoKey", + "id": 1 + }, + "unwrapped": { + "type": "UnwrappedCryptoKey", + "id": 2 + }, + "kmsWrapped": { + "type": "KmsWrappedCryptoKey", + "id": 3 + } + } + }, + "TransientCryptoKey": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UnwrappedCryptoKey": { + "fields": { + "key": { + "type": "bytes", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "KmsWrappedCryptoKey": { + "fields": { + "wrappedKey": { + "type": "bytes", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "cryptoKeyName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DateShiftConfig": { + "oneofs": { + "method": { + "oneof": [ + "cryptoKey" + ] + } + }, + "fields": { + "upperBoundDays": { + "type": "int32", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "lowerBoundDays": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "context": { + "type": "FieldId", + "id": 3 + }, + "cryptoKey": { + "type": "CryptoKey", + "id": 4 + } + } + }, + "InfoTypeTransformations": { + "fields": { + "transformations": { + "rule": "repeated", + "type": "InfoTypeTransformation", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + }, + "nested": { + "InfoTypeTransformation": { + "fields": { + "infoTypes": { + "rule": "repeated", + "type": "InfoType", + "id": 1 + }, + "primitiveTransformation": { + "type": "PrimitiveTransformation", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + } + } + }, + "FieldTransformation": { + "oneofs": { + "transformation": { + "oneof": [ + "primitiveTransformation", + "infoTypeTransformations" + ] + } + }, + "fields": { + "fields": { + "rule": "repeated", + "type": "FieldId", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "condition": { + "type": "RecordCondition", + "id": 3 + }, + "primitiveTransformation": { + "type": "PrimitiveTransformation", + "id": 4 + }, + "infoTypeTransformations": { + "type": "InfoTypeTransformations", + "id": 5 + } + } + }, + "RecordTransformations": { + "fields": { + "fieldTransformations": { + "rule": "repeated", + "type": "FieldTransformation", + "id": 1 + }, + "recordSuppressions": { + "rule": "repeated", + "type": "RecordSuppression", + "id": 2 + } + } + }, + "RecordSuppression": { + "fields": { + "condition": { + "type": "RecordCondition", + "id": 1 + } + } + }, + "RecordCondition": { + "fields": { + "expressions": { + "type": "Expressions", + "id": 3 + } + }, + "nested": { + "Condition": { + "fields": { + "field": { + "type": "FieldId", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "operator": { + "type": "RelationalOperator", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "value": { + "type": "Value", + "id": 4 + } + } + }, + "Conditions": { + "fields": { + "conditions": { + "rule": "repeated", + "type": "Condition", + "id": 1 + } + } + }, + "Expressions": { + "oneofs": { + "type": { + "oneof": [ + "conditions" + ] + } + }, + "fields": { + "logicalOperator": { + "type": "LogicalOperator", + "id": 1 + }, + "conditions": { + "type": "Conditions", + "id": 3 + } + }, + "nested": { + "LogicalOperator": { + "values": { + "LOGICAL_OPERATOR_UNSPECIFIED": 0, + "AND": 1 + } + } + } + } + } + }, + "TransformationOverview": { + "fields": { + "transformedBytes": { + "type": "int64", + "id": 2 + }, + "transformationSummaries": { + "rule": "repeated", + "type": "TransformationSummary", + "id": 3 + } + } + }, + "TransformationSummary": { + "fields": { + "infoType": { + "type": "InfoType", + "id": 1 + }, + "field": { + "type": "FieldId", + "id": 2 + }, + "transformation": { + "type": "PrimitiveTransformation", + "id": 3 + }, + "fieldTransformations": { + "rule": "repeated", + "type": "FieldTransformation", + "id": 5 + }, + "recordSuppress": { + "type": "RecordSuppression", + "id": 6 + }, + "results": { + "rule": "repeated", + "type": "SummaryResult", + "id": 4 + }, + "transformedBytes": { + "type": "int64", + "id": 7 + } + }, + "nested": { + "SummaryResult": { + "fields": { + "count": { + "type": "int64", + "id": 1 + }, + "code": { + "type": "TransformationResultCode", + "id": 2 + }, + "details": { + "type": "string", + "id": 3 + } + } + }, + "TransformationResultCode": { + "values": { + "TRANSFORMATION_RESULT_CODE_UNSPECIFIED": 0, + "SUCCESS": 1, + "ERROR": 2 + } + } + } + }, + "Schedule": { + "oneofs": { + "option": { + "oneof": [ + "recurrencePeriodDuration" + ] + } + }, + "fields": { + "recurrencePeriodDuration": { + "type": "google.protobuf.Duration", + "id": 1 + } + } + }, + "Manual": { + "fields": {} + }, + "InspectTemplate": { + "options": { + "(google.api.resource).type": "dlp.googleapis.com/InspectTemplate", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/inspectTemplates/{inspect_template}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "displayName": { + "type": "string", + "id": 2 + }, + "description": { + "type": "string", + "id": 3 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "inspectConfig": { + "type": "InspectConfig", + "id": 6 + } + } + }, + "DeidentifyTemplate": { + "options": { + "(google.api.resource).type": "dlp.googleapis.com/DeidentifyTemplate", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/deidentifyTemplates/{deidentify_template}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "displayName": { + "type": "string", + "id": 2 + }, + "description": { + "type": "string", + "id": 3 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "deidentifyConfig": { + "type": "DeidentifyConfig", + "id": 6 + } + } + }, + "Error": { + "fields": { + "details": { + "type": "google.rpc.Status", + "id": 1 + }, + "timestamps": { + "rule": "repeated", + "type": "google.protobuf.Timestamp", + "id": 2 + } + } + }, + "JobTrigger": { + "options": { + "(google.api.resource).type": "dlp.googleapis.com/JobTrigger", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/jobTriggers/{job_trigger}" + }, + "oneofs": { + "job": { + "oneof": [ + "inspectJob" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 2 + }, + "description": { + "type": "string", + "id": 3 + }, + "inspectJob": { + "type": "InspectJobConfig", + "id": 4 + }, + "triggers": { + "rule": "repeated", + "type": "Trigger", + "id": 5 + }, + "errors": { + "rule": "repeated", + "type": "Error", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "lastRunTime": { + "type": "google.protobuf.Timestamp", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "status": { + "type": "Status", + "id": 10, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + }, + "nested": { + "Trigger": { + "oneofs": { + "trigger": { + "oneof": [ + "schedule", + "manual" + ] + } + }, + "fields": { + "schedule": { + "type": "Schedule", + "id": 1 + }, + "manual": { + "type": "Manual", + "id": 2 + } + } + }, + "Status": { + "values": { + "STATUS_UNSPECIFIED": 0, + "HEALTHY": 1, + "PAUSED": 2, + "CANCELLED": 3 + } + } + } + }, + "Action": { + "oneofs": { + "action": { + "oneof": [ + "saveFindings", + "pubSub", + "publishSummaryToCscc", + "publishFindingsToCloudDataCatalog", + "jobNotificationEmails", + "publishToStackdriver" + ] + } + }, + "fields": { + "saveFindings": { + "type": "SaveFindings", + "id": 1 + }, + "pubSub": { + "type": "PublishToPubSub", + "id": 2 + }, + "publishSummaryToCscc": { + "type": "PublishSummaryToCscc", + "id": 3 + }, + "publishFindingsToCloudDataCatalog": { + "type": "PublishFindingsToCloudDataCatalog", + "id": 5 + }, + "jobNotificationEmails": { + "type": "JobNotificationEmails", + "id": 8 + }, + "publishToStackdriver": { + "type": "PublishToStackdriver", + "id": 9 + } + }, + "nested": { + "SaveFindings": { + "fields": { + "outputConfig": { + "type": "OutputStorageConfig", + "id": 1 + } + } + }, + "PublishToPubSub": { + "fields": { + "topic": { + "type": "string", + "id": 1 + } + } + }, + "PublishSummaryToCscc": { + "fields": {} + }, + "PublishFindingsToCloudDataCatalog": { + "fields": {} + }, + "JobNotificationEmails": { + "fields": {} + }, + "PublishToStackdriver": { + "fields": {} + } + } + }, + "CreateInspectTemplateRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dlp.googleapis.com/InspectTemplate" + } + }, + "inspectTemplate": { + "type": "InspectTemplate", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "templateId": { + "type": "string", + "id": 3 + }, + "locationId": { + "type": "string", + "id": 4 + } + } + }, + "UpdateInspectTemplateRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dlp.googleapis.com/InspectTemplate" + } + }, + "inspectTemplate": { + "type": "InspectTemplate", + "id": 2 + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 3 + } + } + }, + "GetInspectTemplateRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dlp.googleapis.com/InspectTemplate" + } + } + } + }, + "ListInspectTemplatesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dlp.googleapis.com/InspectTemplate" + } + }, + "pageToken": { + "type": "string", + "id": 2 + }, + "pageSize": { + "type": "int32", + "id": 3 + }, + "orderBy": { + "type": "string", + "id": 4 + }, + "locationId": { + "type": "string", + "id": 5 + } + } + }, + "ListInspectTemplatesResponse": { + "fields": { + "inspectTemplates": { + "rule": "repeated", + "type": "InspectTemplate", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "DeleteInspectTemplateRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dlp.googleapis.com/InspectTemplate" + } + } + } + }, + "CreateJobTriggerRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dlp.googleapis.com/JobTrigger" + } + }, + "jobTrigger": { + "type": "JobTrigger", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "triggerId": { + "type": "string", + "id": 3 + }, + "locationId": { + "type": "string", + "id": 4 + } + } + }, + "ActivateJobTriggerRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dlp.googleapis.com/JobTrigger" + } + } + } + }, + "UpdateJobTriggerRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dlp.googleapis.com/JobTrigger" + } + }, + "jobTrigger": { + "type": "JobTrigger", + "id": 2 + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 3 + } + } + }, + "GetJobTriggerRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dlp.googleapis.com/JobTrigger" + } + } + } + }, + "CreateDlpJobRequest": { + "oneofs": { + "job": { + "oneof": [ + "inspectJob", + "riskJob" + ] + } + }, + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dlp.googleapis.com/DlpJob" + } + }, + "inspectJob": { + "type": "InspectJobConfig", + "id": 2 + }, + "riskJob": { + "type": "RiskAnalysisJobConfig", + "id": 3 + }, + "jobId": { + "type": "string", + "id": 4 + }, + "locationId": { + "type": "string", + "id": 5 + } + } + }, + "ListJobTriggersRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dlp.googleapis.com/JobTrigger" + } + }, + "pageToken": { + "type": "string", + "id": 2 + }, + "pageSize": { + "type": "int32", + "id": 3 + }, + "orderBy": { + "type": "string", + "id": 4 + }, + "filter": { + "type": "string", + "id": 5 + }, + "locationId": { + "type": "string", + "id": 7 + } + } + }, + "ListJobTriggersResponse": { + "fields": { + "jobTriggers": { + "rule": "repeated", + "type": "JobTrigger", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "DeleteJobTriggerRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dlp.googleapis.com/JobTrigger" + } + } + } + }, + "InspectJobConfig": { + "fields": { + "storageConfig": { + "type": "StorageConfig", + "id": 1 + }, + "inspectConfig": { + "type": "InspectConfig", + "id": 2 + }, + "inspectTemplateName": { + "type": "string", + "id": 3 + }, + "actions": { + "rule": "repeated", + "type": "Action", + "id": 4 + } + } + }, + "DlpJob": { + "options": { + "(google.api.resource).type": "dlp.googleapis.com/DlpJob", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/dlpJobs/{dlp_job}" + }, + "oneofs": { + "details": { + "oneof": [ + "riskDetails", + "inspectDetails" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "type": { + "type": "DlpJobType", + "id": 2 + }, + "state": { + "type": "JobState", + "id": 3 + }, + "riskDetails": { + "type": "AnalyzeDataSourceRiskDetails", + "id": 4 + }, + "inspectDetails": { + "type": "InspectDataSourceDetails", + "id": 5 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 6 + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 7 + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 8 + }, + "jobTriggerName": { + "type": "string", + "id": 10 + }, + "errors": { + "rule": "repeated", + "type": "Error", + "id": 11 + } + }, + "nested": { + "JobState": { + "values": { + "JOB_STATE_UNSPECIFIED": 0, + "PENDING": 1, + "RUNNING": 2, + "DONE": 3, + "CANCELED": 4, + "FAILED": 5, + "ACTIVE": 6 + } + } + } + }, + "GetDlpJobRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dlp.googleapis.com/DlpJob" + } + } + } + }, + "ListDlpJobsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dlp.googleapis.com/DlpJob" + } + }, + "filter": { + "type": "string", + "id": 1 + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "type": { + "type": "DlpJobType", + "id": 5 + }, + "orderBy": { + "type": "string", + "id": 6 + }, + "locationId": { + "type": "string", + "id": 7 + } + } + }, + "ListDlpJobsResponse": { + "fields": { + "jobs": { + "rule": "repeated", + "type": "DlpJob", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "CancelDlpJobRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dlp.googleapis.com/DlpJob" + } + } + } + }, + "FinishDlpJobRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dlp.googleapis.com/DlpJob" + } + } + } + }, + "DeleteDlpJobRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dlp.googleapis.com/DlpJob" + } + } + } + }, + "CreateDeidentifyTemplateRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dlp.googleapis.com/DeidentifyTemplate" + } + }, + "deidentifyTemplate": { + "type": "DeidentifyTemplate", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "templateId": { + "type": "string", + "id": 3 + }, + "locationId": { + "type": "string", + "id": 4 + } + } + }, + "UpdateDeidentifyTemplateRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dlp.googleapis.com/DeidentifyTemplate" + } + }, + "deidentifyTemplate": { + "type": "DeidentifyTemplate", + "id": 2 + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 3 + } + } + }, + "GetDeidentifyTemplateRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dlp.googleapis.com/DeidentifyTemplate" + } + } + } + }, + "ListDeidentifyTemplatesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dlp.googleapis.com/DeidentifyTemplate" + } + }, + "pageToken": { + "type": "string", + "id": 2 + }, + "pageSize": { + "type": "int32", + "id": 3 + }, + "orderBy": { + "type": "string", + "id": 4 + }, + "locationId": { + "type": "string", + "id": 5 + } + } + }, + "ListDeidentifyTemplatesResponse": { + "fields": { + "deidentifyTemplates": { + "rule": "repeated", + "type": "DeidentifyTemplate", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "DeleteDeidentifyTemplateRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dlp.googleapis.com/DeidentifyTemplate" + } + } + } + }, + "LargeCustomDictionaryConfig": { + "oneofs": { + "source": { + "oneof": [ + "cloudStorageFileSet", + "bigQueryField" + ] + } + }, + "fields": { + "outputPath": { + "type": "CloudStoragePath", + "id": 1 + }, + "cloudStorageFileSet": { + "type": "CloudStorageFileSet", + "id": 2 + }, + "bigQueryField": { + "type": "BigQueryField", + "id": 3 + } + } + }, + "LargeCustomDictionaryStats": { + "fields": { + "approxNumPhrases": { + "type": "int64", + "id": 1 + } + } + }, + "StoredInfoTypeConfig": { + "oneofs": { + "type": { + "oneof": [ + "largeCustomDictionary", + "dictionary", + "regex" + ] + } + }, + "fields": { + "displayName": { + "type": "string", + "id": 1 + }, + "description": { + "type": "string", + "id": 2 + }, + "largeCustomDictionary": { + "type": "LargeCustomDictionaryConfig", + "id": 3 + }, + "dictionary": { + "type": "CustomInfoType.Dictionary", + "id": 4 + }, + "regex": { + "type": "CustomInfoType.Regex", + "id": 5 + } + } + }, + "StoredInfoTypeStats": { + "oneofs": { + "type": { + "oneof": [ + "largeCustomDictionary" + ] + } + }, + "fields": { + "largeCustomDictionary": { + "type": "LargeCustomDictionaryStats", + "id": 1 + } + } + }, + "StoredInfoTypeVersion": { + "fields": { + "config": { + "type": "StoredInfoTypeConfig", + "id": 1 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "state": { + "type": "StoredInfoTypeState", + "id": 3 + }, + "errors": { + "rule": "repeated", + "type": "Error", + "id": 4 + }, + "stats": { + "type": "StoredInfoTypeStats", + "id": 5 + } + } + }, + "StoredInfoType": { + "options": { + "(google.api.resource).type": "dlp.googleapis.com/StoredInfoType", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/storedInfoTypes/{stored_info_type}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "currentVersion": { + "type": "StoredInfoTypeVersion", + "id": 2 + }, + "pendingVersions": { + "rule": "repeated", + "type": "StoredInfoTypeVersion", + "id": 3 + } + } + }, + "CreateStoredInfoTypeRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dlp.googleapis.com/StoredInfoType" + } + }, + "config": { + "type": "StoredInfoTypeConfig", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "storedInfoTypeId": { + "type": "string", + "id": 3 + }, + "locationId": { + "type": "string", + "id": 4 + } + } + }, + "UpdateStoredInfoTypeRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dlp.googleapis.com/StoredInfoType" + } + }, + "config": { + "type": "StoredInfoTypeConfig", + "id": 2 + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 3 + } + } + }, + "GetStoredInfoTypeRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dlp.googleapis.com/StoredInfoType" + } + } + } + }, + "ListStoredInfoTypesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dlp.googleapis.com/StoredInfoType" + } + }, + "pageToken": { + "type": "string", + "id": 2 + }, + "pageSize": { + "type": "int32", + "id": 3 + }, + "orderBy": { + "type": "string", + "id": 4 + }, + "locationId": { + "type": "string", + "id": 5 + } + } + }, + "ListStoredInfoTypesResponse": { + "fields": { + "storedInfoTypes": { + "rule": "repeated", + "type": "StoredInfoType", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "DeleteStoredInfoTypeRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dlp.googleapis.com/StoredInfoType" + } + } + } + }, + "HybridInspectJobTriggerRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dlp.googleapis.com/JobTrigger" + } + }, + "hybridItem": { + "type": "HybridContentItem", + "id": 3 + } + } + }, + "HybridInspectDlpJobRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dlp.googleapis.com/DlpJob" + } + }, + "hybridItem": { + "type": "HybridContentItem", + "id": 3 + } + } + }, + "HybridContentItem": { + "fields": { + "item": { + "type": "ContentItem", + "id": 1 + }, + "findingDetails": { + "type": "HybridFindingDetails", + "id": 2 + } + } + }, + "HybridFindingDetails": { + "fields": { + "containerDetails": { + "type": "Container", + "id": 1 + }, + "fileOffset": { + "type": "int64", + "id": 2 + }, + "rowOffset": { + "type": "int64", + "id": 3 + }, + "tableOptions": { + "type": "TableOptions", + "id": 4 + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 5 + } + } + }, + "HybridInspectResponse": { + "fields": {} + }, + "RelationalOperator": { + "values": { + "RELATIONAL_OPERATOR_UNSPECIFIED": 0, + "EQUAL_TO": 1, + "NOT_EQUAL_TO": 2, + "GREATER_THAN": 3, + "LESS_THAN": 4, + "GREATER_THAN_OR_EQUALS": 5, + "LESS_THAN_OR_EQUALS": 6, + "EXISTS": 7 + } + }, + "MatchingType": { + "values": { + "MATCHING_TYPE_UNSPECIFIED": 0, + "MATCHING_TYPE_FULL_MATCH": 1, + "MATCHING_TYPE_PARTIAL_MATCH": 2, + "MATCHING_TYPE_INVERSE_MATCH": 3 + } + }, + "ContentOption": { + "values": { + "CONTENT_UNSPECIFIED": 0, + "CONTENT_TEXT": 1, + "CONTENT_IMAGE": 2 + } + }, + "MetadataType": { + "values": { + "METADATATYPE_UNSPECIFIED": 0, + "STORAGE_METADATA": 2 + } + }, + "InfoTypeSupportedBy": { + "values": { + "ENUM_TYPE_UNSPECIFIED": 0, + "INSPECT": 1, + "RISK_ANALYSIS": 2 + } + }, + "DlpJobType": { + "values": { + "DLP_JOB_TYPE_UNSPECIFIED": 0, + "INSPECT_JOB": 1, + "RISK_ANALYSIS_JOB": 2 + } + }, + "StoredInfoTypeState": { + "values": { + "STORED_INFO_TYPE_STATE_UNSPECIFIED": 0, + "PENDING": 1, + "READY": 2, + "FAILED": 3, + "INVALID": 4 + } + }, + "InfoType": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "StoredType": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + } + } + }, + "Likelihood": { + "values": { + "LIKELIHOOD_UNSPECIFIED": 0, + "VERY_UNLIKELY": 1, + "UNLIKELY": 2, + "POSSIBLE": 3, + "LIKELY": 4, + "VERY_LIKELY": 5 + } + }, + "CustomInfoType": { + "oneofs": { + "type": { + "oneof": [ + "dictionary", + "regex", + "surrogateType", + "storedType" + ] + } + }, + "fields": { + "infoType": { + "type": "InfoType", + "id": 1 + }, + "likelihood": { + "type": "Likelihood", + "id": 6 + }, + "dictionary": { + "type": "Dictionary", + "id": 2 + }, + "regex": { + "type": "Regex", + "id": 3 + }, + "surrogateType": { + "type": "SurrogateType", + "id": 4 + }, + "storedType": { + "type": "StoredType", + "id": 5 + }, + "detectionRules": { + "rule": "repeated", + "type": "DetectionRule", + "id": 7 + }, + "exclusionType": { + "type": "ExclusionType", + "id": 8 + } + }, + "nested": { + "Dictionary": { + "oneofs": { + "source": { + "oneof": [ + "wordList", + "cloudStoragePath" + ] + } + }, + "fields": { + "wordList": { + "type": "WordList", + "id": 1 + }, + "cloudStoragePath": { + "type": "CloudStoragePath", + "id": 3 + } + }, + "nested": { + "WordList": { + "fields": { + "words": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + } + } + }, + "Regex": { + "fields": { + "pattern": { + "type": "string", + "id": 1 + }, + "groupIndexes": { + "rule": "repeated", + "type": "int32", + "id": 2 + } + } + }, + "SurrogateType": { + "fields": {} + }, + "DetectionRule": { + "oneofs": { + "type": { + "oneof": [ + "hotwordRule" + ] + } + }, + "fields": { + "hotwordRule": { + "type": "HotwordRule", + "id": 1 + } + }, + "nested": { + "Proximity": { + "fields": { + "windowBefore": { + "type": "int32", + "id": 1 + }, + "windowAfter": { + "type": "int32", + "id": 2 + } + } + }, + "LikelihoodAdjustment": { + "oneofs": { + "adjustment": { + "oneof": [ + "fixedLikelihood", + "relativeLikelihood" + ] + } + }, + "fields": { + "fixedLikelihood": { + "type": "Likelihood", + "id": 1 + }, + "relativeLikelihood": { + "type": "int32", + "id": 2 + } + } + }, + "HotwordRule": { + "fields": { + "hotwordRegex": { + "type": "Regex", + "id": 1 + }, + "proximity": { + "type": "Proximity", + "id": 2 + }, + "likelihoodAdjustment": { + "type": "LikelihoodAdjustment", + "id": 3 + } + } + } + } + }, + "ExclusionType": { + "values": { + "EXCLUSION_TYPE_UNSPECIFIED": 0, + "EXCLUSION_TYPE_EXCLUDE": 1 + } + } + } + }, + "FieldId": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "PartitionId": { + "fields": { + "projectId": { + "type": "string", + "id": 2 + }, + "namespaceId": { + "type": "string", + "id": 4 + } + } + }, + "KindExpression": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "DatastoreOptions": { + "fields": { + "partitionId": { + "type": "PartitionId", + "id": 1 + }, + "kind": { + "type": "KindExpression", + "id": 2 + } + } + }, + "CloudStorageRegexFileSet": { + "fields": { + "bucketName": { + "type": "string", + "id": 1 + }, + "includeRegex": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "excludeRegex": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "CloudStorageOptions": { + "fields": { + "fileSet": { + "type": "FileSet", + "id": 1 + }, + "bytesLimitPerFile": { + "type": "int64", + "id": 4 + }, + "bytesLimitPerFilePercent": { + "type": "int32", + "id": 8 + }, + "fileTypes": { + "rule": "repeated", + "type": "FileType", + "id": 5 + }, + "sampleMethod": { + "type": "SampleMethod", + "id": 6 + }, + "filesLimitPercent": { + "type": "int32", + "id": 7 + } + }, + "nested": { + "FileSet": { + "fields": { + "url": { + "type": "string", + "id": 1 + }, + "regexFileSet": { + "type": "CloudStorageRegexFileSet", + "id": 2 + } + } + }, + "SampleMethod": { + "values": { + "SAMPLE_METHOD_UNSPECIFIED": 0, + "TOP": 1, + "RANDOM_START": 2 + } + } + } + }, + "CloudStorageFileSet": { + "fields": { + "url": { + "type": "string", + "id": 1 + } + } + }, + "CloudStoragePath": { + "fields": { + "path": { + "type": "string", + "id": 1 + } + } + }, + "BigQueryOptions": { + "fields": { + "tableReference": { + "type": "BigQueryTable", + "id": 1 + }, + "identifyingFields": { + "rule": "repeated", + "type": "FieldId", + "id": 2 + }, + "rowsLimit": { + "type": "int64", + "id": 3 + }, + "rowsLimitPercent": { + "type": "int32", + "id": 6 + }, + "sampleMethod": { + "type": "SampleMethod", + "id": 4 + }, + "excludedFields": { + "rule": "repeated", + "type": "FieldId", + "id": 5 + } + }, + "nested": { + "SampleMethod": { + "values": { + "SAMPLE_METHOD_UNSPECIFIED": 0, + "TOP": 1, + "RANDOM_START": 2 + } + } + } + }, + "StorageConfig": { + "oneofs": { + "type": { + "oneof": [ + "datastoreOptions", + "cloudStorageOptions", + "bigQueryOptions", + "hybridOptions" + ] + } + }, + "fields": { + "datastoreOptions": { + "type": "DatastoreOptions", + "id": 2 + }, + "cloudStorageOptions": { + "type": "CloudStorageOptions", + "id": 3 + }, + "bigQueryOptions": { + "type": "BigQueryOptions", + "id": 4 + }, + "hybridOptions": { + "type": "HybridOptions", + "id": 9 + }, + "timespanConfig": { + "type": "TimespanConfig", + "id": 6 + } + }, + "nested": { + "TimespanConfig": { + "fields": { + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 1 + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "timestampField": { + "type": "FieldId", + "id": 3 + }, + "enableAutoPopulationOfTimespanConfig": { + "type": "bool", + "id": 4 + } + } + } + } + }, + "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": { + "type": "string", + "id": 1 + }, + "requiredFindingLabelKeys": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 3 + }, + "tableOptions": { + "type": "TableOptions", + "id": 4 + } + } + }, + "BigQueryKey": { + "fields": { + "tableReference": { + "type": "BigQueryTable", + "id": 1 + }, + "rowNumber": { + "type": "int64", + "id": 2 + } + } + }, + "DatastoreKey": { + "fields": { + "entityKey": { + "type": "Key", + "id": 1 + } + } + }, + "Key": { + "fields": { + "partitionId": { + "type": "PartitionId", + "id": 1 + }, + "path": { + "rule": "repeated", + "type": "PathElement", + "id": 2 + } + }, + "nested": { + "PathElement": { + "oneofs": { + "idType": { + "oneof": [ + "id", + "name" + ] + } + }, + "fields": { + "kind": { + "type": "string", + "id": 1 + }, + "id": { + "type": "int64", + "id": 2 + }, + "name": { + "type": "string", + "id": 3 + } + } + } + } + }, + "RecordKey": { + "oneofs": { + "type": { + "oneof": [ + "datastoreKey", + "bigQueryKey" + ] + } + }, + "fields": { + "datastoreKey": { + "type": "DatastoreKey", + "id": 2 + }, + "bigQueryKey": { + "type": "BigQueryKey", + "id": 3 + }, + "idValues": { + "rule": "repeated", + "type": "string", + "id": 5 + } + } + }, + "BigQueryTable": { + "fields": { + "projectId": { + "type": "string", + "id": 1 + }, + "datasetId": { + "type": "string", + "id": 2 + }, + "tableId": { + "type": "string", + "id": 3 + } + } + }, + "BigQueryField": { + "fields": { + "table": { + "type": "BigQueryTable", + "id": 1 + }, + "field": { + "type": "FieldId", + "id": 2 + } + } + }, + "EntityId": { + "fields": { + "field": { + "type": "FieldId", + "id": 1 + } + } + }, + "TableOptions": { + "fields": { + "identifyingFields": { + "rule": "repeated", + "type": "FieldId", + "id": 1 + } + } + } + } + } + } + } + } + }, + "api": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/api/annotations;annotations", + "java_multiple_files": true, + "java_outer_classname": "HttpProto", + "java_package": "com.google.api", + "objc_class_prefix": "GAPI", + "cc_enable_arenas": true + }, + "nested": { + "methodSignature": { + "rule": "repeated", + "type": "string", + "id": 1051, + "extend": "google.protobuf.MethodOptions" + }, + "defaultHost": { + "type": "string", + "id": 1049, + "extend": "google.protobuf.ServiceOptions" + }, + "oauthScopes": { + "type": "string", + "id": 1050, + "extend": "google.protobuf.ServiceOptions" + }, + "fieldBehavior": { + "rule": "repeated", + "type": "google.api.FieldBehavior", + "id": 1052, + "extend": "google.protobuf.FieldOptions" + }, + "FieldBehavior": { + "values": { + "FIELD_BEHAVIOR_UNSPECIFIED": 0, + "OPTIONAL": 1, + "REQUIRED": 2, + "OUTPUT_ONLY": 3, + "INPUT_ONLY": 4, + "IMMUTABLE": 5, + "UNORDERED_LIST": 6 + } + }, + "resourceReference": { + "type": "google.api.ResourceReference", + "id": 1055, + "extend": "google.protobuf.FieldOptions" + }, + "resourceDefinition": { + "rule": "repeated", + "type": "google.api.ResourceDescriptor", + "id": 1053, + "extend": "google.protobuf.FileOptions" + }, + "resource": { + "type": "google.api.ResourceDescriptor", + "id": 1053, + "extend": "google.protobuf.MessageOptions" + }, + "ResourceDescriptor": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "pattern": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "nameField": { + "type": "string", + "id": 3 + }, + "history": { + "type": "History", + "id": 4 + }, + "plural": { + "type": "string", + "id": 5 + }, + "singular": { + "type": "string", + "id": 6 + }, + "style": { + "rule": "repeated", + "type": "Style", + "id": 10 + } + }, + "nested": { + "History": { + "values": { + "HISTORY_UNSPECIFIED": 0, + "ORIGINALLY_SINGLE_PATTERN": 1, + "FUTURE_MULTI_PATTERN": 2 + } + }, + "Style": { + "values": { + "STYLE_UNSPECIFIED": 0, + "DECLARATIVE_FRIENDLY": 1 + } + } + } + }, + "ResourceReference": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "childType": { + "type": "string", + "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 + } + } + } + } + }, + "protobuf": { + "options": { + "go_package": "google.golang.org/protobuf/types/descriptorpb", + "java_package": "com.google.protobuf", + "java_outer_classname": "DescriptorProtos", + "csharp_namespace": "Google.Protobuf.Reflection", + "objc_class_prefix": "GPB", + "cc_enable_arenas": true, + "optimize_for": "SPEED" + }, + "nested": { + "FileDescriptorSet": { + "fields": { + "file": { + "rule": "repeated", + "type": "FileDescriptorProto", + "id": 1 + } + } + }, + "FileDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "package": { + "type": "string", + "id": 2 + }, + "dependency": { + "rule": "repeated", + "type": "string", + "id": 3 + }, + "publicDependency": { + "rule": "repeated", + "type": "int32", + "id": 10, + "options": { + "packed": false + } + }, + "weakDependency": { + "rule": "repeated", + "type": "int32", + "id": 11, + "options": { + "packed": false + } + }, + "messageType": { + "rule": "repeated", + "type": "DescriptorProto", + "id": 4 + }, + "enumType": { + "rule": "repeated", + "type": "EnumDescriptorProto", + "id": 5 + }, + "service": { + "rule": "repeated", + "type": "ServiceDescriptorProto", + "id": 6 + }, + "extension": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 7 + }, + "options": { + "type": "FileOptions", + "id": 8 + }, + "sourceCodeInfo": { + "type": "SourceCodeInfo", + "id": 9 + }, + "syntax": { + "type": "string", + "id": 12 + } + } + }, + "DescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "field": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 2 + }, + "extension": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 6 + }, + "nestedType": { + "rule": "repeated", + "type": "DescriptorProto", + "id": 3 + }, + "enumType": { + "rule": "repeated", + "type": "EnumDescriptorProto", + "id": 4 + }, + "extensionRange": { + "rule": "repeated", + "type": "ExtensionRange", + "id": 5 + }, + "oneofDecl": { + "rule": "repeated", + "type": "OneofDescriptorProto", + "id": 8 + }, + "options": { + "type": "MessageOptions", + "id": 7 + }, + "reservedRange": { + "rule": "repeated", + "type": "ReservedRange", + "id": 9 + }, + "reservedName": { + "rule": "repeated", + "type": "string", + "id": 10 + } + }, + "nested": { + "ExtensionRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + }, + "options": { + "type": "ExtensionRangeOptions", + "id": 3 + } + } + }, + "ReservedRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "ExtensionRangeOptions": { + "fields": { + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "FieldDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 3 + }, + "label": { + "type": "Label", + "id": 4 + }, + "type": { + "type": "Type", + "id": 5 + }, + "typeName": { + "type": "string", + "id": 6 + }, + "extendee": { + "type": "string", + "id": 2 + }, + "defaultValue": { + "type": "string", + "id": 7 + }, + "oneofIndex": { + "type": "int32", + "id": 9 + }, + "jsonName": { + "type": "string", + "id": 10 + }, + "options": { + "type": "FieldOptions", + "id": 8 + }, + "proto3Optional": { + "type": "bool", + "id": 17 + } + }, + "nested": { + "Type": { + "values": { + "TYPE_DOUBLE": 1, + "TYPE_FLOAT": 2, + "TYPE_INT64": 3, + "TYPE_UINT64": 4, + "TYPE_INT32": 5, + "TYPE_FIXED64": 6, + "TYPE_FIXED32": 7, + "TYPE_BOOL": 8, + "TYPE_STRING": 9, + "TYPE_GROUP": 10, + "TYPE_MESSAGE": 11, + "TYPE_BYTES": 12, + "TYPE_UINT32": 13, + "TYPE_ENUM": 14, + "TYPE_SFIXED32": 15, + "TYPE_SFIXED64": 16, + "TYPE_SINT32": 17, + "TYPE_SINT64": 18 + } + }, + "Label": { + "values": { + "LABEL_OPTIONAL": 1, + "LABEL_REQUIRED": 2, + "LABEL_REPEATED": 3 + } + } + } + }, + "OneofDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "options": { + "type": "OneofOptions", + "id": 2 + } + } + }, + "EnumDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "value": { + "rule": "repeated", + "type": "EnumValueDescriptorProto", + "id": 2 + }, + "options": { + "type": "EnumOptions", + "id": 3 + }, + "reservedRange": { + "rule": "repeated", + "type": "EnumReservedRange", + "id": 4 + }, + "reservedName": { + "rule": "repeated", + "type": "string", + "id": 5 + } + }, + "nested": { + "EnumReservedRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "EnumValueDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 2 + }, + "options": { + "type": "EnumValueOptions", + "id": 3 + } + } + }, + "ServiceDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "method": { + "rule": "repeated", + "type": "MethodDescriptorProto", + "id": 2 + }, + "options": { + "type": "ServiceOptions", + "id": 3 + } + } + }, + "MethodDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "inputType": { + "type": "string", + "id": 2 + }, + "outputType": { + "type": "string", + "id": 3 + }, + "options": { + "type": "MethodOptions", + "id": 4 + }, + "clientStreaming": { + "type": "bool", + "id": 5, + "options": { + "default": false + } + }, + "serverStreaming": { + "type": "bool", + "id": 6, + "options": { + "default": false + } + } + } + }, + "FileOptions": { + "fields": { + "javaPackage": { + "type": "string", + "id": 1 + }, + "javaOuterClassname": { + "type": "string", + "id": 8 + }, + "javaMultipleFiles": { + "type": "bool", + "id": 10, + "options": { + "default": false + } + }, + "javaGenerateEqualsAndHash": { + "type": "bool", + "id": 20, + "options": { + "deprecated": true + } + }, + "javaStringCheckUtf8": { + "type": "bool", + "id": 27, + "options": { + "default": false + } + }, + "optimizeFor": { + "type": "OptimizeMode", + "id": 9, + "options": { + "default": "SPEED" + } + }, + "goPackage": { + "type": "string", + "id": 11 + }, + "ccGenericServices": { + "type": "bool", + "id": 16, + "options": { + "default": false + } + }, + "javaGenericServices": { + "type": "bool", + "id": 17, + "options": { + "default": false + } + }, + "pyGenericServices": { + "type": "bool", + "id": 18, + "options": { + "default": false + } + }, + "phpGenericServices": { + "type": "bool", + "id": 42, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 23, + "options": { + "default": false + } + }, + "ccEnableArenas": { + "type": "bool", + "id": 31, + "options": { + "default": true + } + }, + "objcClassPrefix": { + "type": "string", + "id": 36 + }, + "csharpNamespace": { + "type": "string", + "id": 37 + }, + "swiftPrefix": { + "type": "string", + "id": 39 + }, + "phpClassPrefix": { + "type": "string", + "id": 40 + }, + "phpNamespace": { + "type": "string", + "id": 41 + }, + "phpMetadataNamespace": { + "type": "string", + "id": 44 + }, + "rubyPackage": { + "type": "string", + "id": 45 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 38, + 38 + ] + ], + "nested": { + "OptimizeMode": { + "values": { + "SPEED": 1, + "CODE_SIZE": 2, + "LITE_RUNTIME": 3 + } + } + } + }, + "MessageOptions": { + "fields": { + "messageSetWireFormat": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "noStandardDescriptorAccessor": { + "type": "bool", + "id": 2, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "mapEntry": { + "type": "bool", + "id": 7 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 8, + 8 + ], + [ + 9, + 9 + ] + ] + }, + "FieldOptions": { + "fields": { + "ctype": { + "type": "CType", + "id": 1, + "options": { + "default": "STRING" + } + }, + "packed": { + "type": "bool", + "id": 2 + }, + "jstype": { + "type": "JSType", + "id": 6, + "options": { + "default": "JS_NORMAL" + } + }, + "lazy": { + "type": "bool", + "id": 5, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "weak": { + "type": "bool", + "id": 10, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ] + ], + "nested": { + "CType": { + "values": { + "STRING": 0, + "CORD": 1, + "STRING_PIECE": 2 + } + }, + "JSType": { + "values": { + "JS_NORMAL": 0, + "JS_STRING": 1, + "JS_NUMBER": 2 + } + } + } + }, + "OneofOptions": { + "fields": { + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "EnumOptions": { + "fields": { + "allowAlias": { + "type": "bool", + "id": 2 + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 5, + 5 + ] + ] + }, + "EnumValueOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "ServiceOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "MethodOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "idempotencyLevel": { + "type": "IdempotencyLevel", + "id": 34, + "options": { + "default": "IDEMPOTENCY_UNKNOWN" + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "nested": { + "IdempotencyLevel": { + "values": { + "IDEMPOTENCY_UNKNOWN": 0, + "NO_SIDE_EFFECTS": 1, + "IDEMPOTENT": 2 + } + } + } + }, + "UninterpretedOption": { + "fields": { + "name": { + "rule": "repeated", + "type": "NamePart", + "id": 2 + }, + "identifierValue": { + "type": "string", + "id": 3 + }, + "positiveIntValue": { + "type": "uint64", + "id": 4 + }, + "negativeIntValue": { + "type": "int64", + "id": 5 + }, + "doubleValue": { + "type": "double", + "id": 6 + }, + "stringValue": { + "type": "bytes", + "id": 7 + }, + "aggregateValue": { + "type": "string", + "id": 8 + } + }, + "nested": { + "NamePart": { + "fields": { + "namePart": { + "rule": "required", + "type": "string", + "id": 1 + }, + "isExtension": { + "rule": "required", + "type": "bool", + "id": 2 + } + } + } + } + }, + "SourceCodeInfo": { + "fields": { + "location": { + "rule": "repeated", + "type": "Location", + "id": 1 + } + }, + "nested": { + "Location": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1 + }, + "span": { + "rule": "repeated", + "type": "int32", + "id": 2 + }, + "leadingComments": { + "type": "string", + "id": 3 + }, + "trailingComments": { + "type": "string", + "id": 4 + }, + "leadingDetachedComments": { + "rule": "repeated", + "type": "string", + "id": 6 + } + } + } + } + }, + "GeneratedCodeInfo": { + "fields": { + "annotation": { + "rule": "repeated", + "type": "Annotation", + "id": 1 + } + }, + "nested": { + "Annotation": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1 + }, + "sourceFile": { + "type": "string", + "id": 2 + }, + "begin": { + "type": "int32", + "id": 3 + }, + "end": { + "type": "int32", + "id": 4 + } + } + } + } + }, + "Timestamp": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, + "Duration": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, + "Empty": { + "fields": {} + }, + "FieldMask": { + "fields": { + "paths": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + }, + "Any": { + "fields": { + "type_url": { + "type": "string", + "id": 1 + }, + "value": { + "type": "bytes", + "id": 2 + } + } + } + } + }, + "rpc": { + "options": { + "cc_enable_arenas": true, + "go_package": "google.golang.org/genproto/googleapis/rpc/status;status", + "java_multiple_files": true, + "java_outer_classname": "StatusProto", + "java_package": "com.google.rpc", + "objc_class_prefix": "RPC" + }, + "nested": { + "Status": { + "fields": { + "code": { + "type": "int32", + "id": 1 + }, + "message": { + "type": "string", + "id": 2 + }, + "details": { + "rule": "repeated", + "type": "google.protobuf.Any", + "id": 3 + } + } + } + } + }, + "type": { + "options": { + "cc_enable_arenas": true, + "go_package": "google.golang.org/genproto/googleapis/type/timeofday;timeofday", + "java_multiple_files": true, + "java_outer_classname": "TimeOfDayProto", + "java_package": "com.google.type", + "objc_class_prefix": "GTP" + }, + "nested": { + "Date": { + "fields": { + "year": { + "type": "int32", + "id": 1 + }, + "month": { + "type": "int32", + "id": 2 + }, + "day": { + "type": "int32", + "id": 3 + } + } + }, + "DayOfWeek": { + "values": { + "DAY_OF_WEEK_UNSPECIFIED": 0, + "MONDAY": 1, + "TUESDAY": 2, + "WEDNESDAY": 3, + "THURSDAY": 4, + "FRIDAY": 5, + "SATURDAY": 6, + "SUNDAY": 7 + } + }, + "TimeOfDay": { + "fields": { + "hours": { + "type": "int32", + "id": 1 + }, + "minutes": { + "type": "int32", + "id": 2 + }, + "seconds": { + "type": "int32", + "id": 3 + }, + "nanos": { + "type": "int32", + "id": 4 + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/renovate.json b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/renovate.json new file mode 100644 index 000000000..9518bf36f --- /dev/null +++ b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/renovate.json @@ -0,0 +1,19 @@ +{ + "extends": [ + "config:base", + "docker:disable" + ], + "pinVersions": false, + "rebaseStalePrs": true, + "schedule": [ + "after 9am and before 3pm" + ], + "gitAuthor": null, + "packageRules": [ + { + "extends": "packages:linters", + "groupName": "linters" + } + ], + "ignoreDeps": ["typescript"] +} diff --git a/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/.eslintrc.yml b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/.eslintrc.yml new file mode 100644 index 000000000..b9e0cca8b --- /dev/null +++ b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/.eslintrc.yml @@ -0,0 +1,5 @@ +--- +rules: + no-console: off + no-warning-comments: off + node/no-missing-require: off diff --git a/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/.gitignore b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/.gitignore new file mode 100644 index 000000000..df1525596 --- /dev/null +++ b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/.gitignore @@ -0,0 +1,3 @@ +# Test outputs +*.actual.png +*.actual.csv diff --git a/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/README.md b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/README.md new file mode 100644 index 000000000..4a08fe0d3 --- /dev/null +++ b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/README.md @@ -0,0 +1,574 @@ +[//]: # "This README.md file is auto-generated, all changes to this file will be lost." +[//]: # "To regenerate it, use `python -m synthtool`." +Google Cloud Platform logo + +# [Cloud Data Loss Prevention: Node.js Samples](https://github.com/googleapis/nodejs-dlp) + +[![Open in Cloud Shell][shell_img]][shell_link] + +The [Data Loss Prevention API](https://cloud.google.com/dlp/docs/) provides programmatic access to a +powerful detection engine for personally identifiable information and other privacy-sensitive +data in unstructured data streams. + +## Table of Contents + +* [Before you begin](#before-you-begin) +* [Samples](#samples) + * [Categorical Risk Analysis](#categorical-risk-analysis) + * [Inspect Templates](#inspect-templates) + * [Job Triggers](#job-triggers) + * [Deidentify with Date Shift](#deidentify-with-date-shift) + * [Deidentify with FPE](#deidentify-with-fpe) + * [Deidentify with Mask](#deidentify-with-mask) + * [Deidentify with Replacement](#deidentify-with-replacement) + * [Delete Inspect Templates](#delete-inspect-templates) + * [Delete Job](#delete-job) + * [Delete Trigger](#delete-trigger) + * [Inspect Bigquery](#inspect-bigquery) + * [Inspect Datastore](#inspect-datastore) + * [Inspect File](#inspect-file) + * [Inspect GCS File](#inspect-gcs-file) + * [Inspects strings](#inspects-strings) + * [kAnonymity Analysis](#kanonymity-analysis) + * [kMap Estimation Analysis](#kmap-estimation-analysis) + * [l Diversity Analysis](#l-diversity-analysis) + * [List Inspect Templates](#list-inspect-templates) + * [List jobs](#list-jobs) + * [List Triggers](#list-triggers) + * [Metadata](#metadata) + * [Numerical Risk Analysis](#numerical-risk-analysis) + * [Quickstart](#quickstart) + * [Redact Image](#redact-image) + * [Redact Text](#redact-text) + * [Reidentify with FPE](#reidentify-with-fpe) + +## Before you begin + +Before running the samples, make sure you've followed the steps outlined in +[Using the client library](https://github.com/googleapis/nodejs-dlp#using-the-client-library). + +`cd samples` + +`npm install` + +`cd ..` + +## Samples + + + +### Categorical Risk Analysis + +Computes risk metrics of a column of data in a Google BigQuery table. + +View the [source code](https://github.com/googleapis/nodejs-dlp/blob/master/samples/categoricalRiskAnalysis.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-dlp&page=editor&open_in_editor=samples/categoricalRiskAnalysis.js,samples/README.md) + +__Usage:__ + + +`node categoricalRiskAnalysis.js my-project nhtsa_traffic_fatalities accident_2015 state_name my-topic my-subscription bigquery-public-data` + + +----- + + + + +### Inspect Templates + +Create a new DLP inspection configuration template. + +View the [source code](https://github.com/googleapis/nodejs-dlp/blob/master/samples/createInspectTemplate.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-dlp&page=editor&open_in_editor=samples/createInspectTemplate.js,samples/README.md) + +__Usage:__ + + +`node createInspectTemplate.js my-project VERY_LIKELY PERSON_NAME 5 false my-template-id` + + +----- + + + + +### Job Triggers + +Create a Data Loss Prevention API job trigger. + +View the [source code](https://github.com/googleapis/nodejs-dlp/blob/master/samples/createTrigger.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-dlp&page=editor&open_in_editor=samples/createTrigger.js,samples/README.md) + +__Usage:__ + + +`node createTrigger.js my-project triggerId displayName description bucketName autoPopulateTimespan scanPeriod infoTypes minLikelihood maxFindings` + + +----- + + + + +### Deidentify with Date Shift + +Deidentify dates in a CSV file by pseudorandomly shifting them. + +View the [source code](https://github.com/googleapis/nodejs-dlp/blob/master/samples/deidentifyWithDateShift.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-dlp&page=editor&open_in_editor=samples/deidentifyWithDateShift.js,samples/README.md) + +__Usage:__ + + +`node deidentifyWithDateShift.js my-project dates.csv dates-shifted.csv 30 30 birth_date register_date [ projects/my-project/locations/global/keyrings/my-keyring]` + + +----- + + + + +### Deidentify with FPE + +Deidentify sensitive data in a string using Format Preserving Encryption (FPE). + +View the [source code](https://github.com/googleapis/nodejs-dlp/blob/master/samples/deidentifyWithFpe.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-dlp&page=editor&open_in_editor=samples/deidentifyWithFpe.js,samples/README.md) + +__Usage:__ + + +`node deidentifyWithFpe.js my-project "My SSN is 372819127" projects/my-project/locations/global/keyrings/my-keyring SSN_TOKEN` + + +----- + + + + +### Deidentify with Mask + +Deidentify sensitive data in a string by masking it with a character. + +View the [source code](https://github.com/googleapis/nodejs-dlp/blob/master/samples/deidentifyWithMask.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-dlp&page=editor&open_in_editor=samples/deidentifyWithMask.js,samples/README.md) + +__Usage:__ + + +`node deidentifyWithMask.js my-project string maskingCharacter numberToMask` + + +----- + + + + +### Deidentify with Replacement + +Deidentify sensitive data in a string by replacing it with a given replacement string. + +View the [source code](https://github.com/googleapis/nodejs-dlp/blob/master/samples/deidentifyWithReplacement.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-dlp&page=editor&open_in_editor=samples/deidentifyWithReplacement.js,samples/README.md) + +__Usage:__ + + +`node deidentifyWithMask.js my-project string replacement` + + +----- + + + + +### Delete Inspect Templates + +Delete the DLP inspection configuration template with the specified name. + +View the [source code](https://github.com/googleapis/nodejs-dlp/blob/master/samples/deleteInspectTemplate.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-dlp&page=editor&open_in_editor=samples/deleteInspectTemplate.js,samples/README.md) + +__Usage:__ + + +`node deleteInspectTemplates.js my-project projects/my-project/inspectTemplates/` + + +----- + + + + +### Delete Job + +Delete results of a Data Loss Prevention API job. + +View the [source code](https://github.com/googleapis/nodejs-dlp/blob/master/samples/deleteJob.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-dlp&page=editor&open_in_editor=samples/deleteJob.js,samples/README.md) + +__Usage:__ + + +`node deleteJob.js my-project projects/YOUR_GCLOUD_PROJECT/dlpJobs/X-` + + +----- + + + + +### Delete Trigger + +Delete results of a Data Loss Prevention API job. + +View the [source code](https://github.com/googleapis/nodejs-dlp/blob/master/samples/deleteTrigger.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-dlp&page=editor&open_in_editor=samples/deleteTrigger.js,samples/README.md) + +__Usage:__ + + +`node deleteTrigger.js my-rpoject projects/my-project/jobTriggers/my-trigger` + + +----- + + + + +### Inspect Bigquery + +Inspects a BigQuery table using the Data Loss Prevention API using Pub/Sub for job notifications. + +View the [source code](https://github.com/googleapis/nodejs-dlp/blob/master/samples/inspectBigQuery.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-dlp&page=editor&open_in_editor=samples/inspectBigQuery.js,samples/README.md) + +__Usage:__ + + +`node inspectBigQuery.js my-project dataProjectId datasetId tableId topicId subscriptionId minLikelihood maxFindings infoTypes customInfoTypes` + + +----- + + + + +### Inspect Datastore + +Inspect a Datastore instance using the Data Loss Prevention API using Pub/Sub for job notifications. + +View the [source code](https://github.com/googleapis/nodejs-dlp/blob/master/samples/inspectDatastore.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-dlp&page=editor&open_in_editor=samples/inspectDatastore.js,samples/README.md) + +__Usage:__ + + +`node inspectDatastore.js my-project dataProjectId namespaceId kind topicId subscriptionId minLikelihood maxFindings infoTypes customInfoTypes` + + +----- + + + + +### Inspect File + +Inspects a local text, PNG, or JPEG file using the Data Loss Prevention API. + +View the [source code](https://github.com/googleapis/nodejs-dlp/blob/master/samples/inspectFile.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-dlp&page=editor&open_in_editor=samples/inspectFile.js,samples/README.md) + +__Usage:__ + + +`node inspectFile.js my-project filepath minLikelihood maxFindings infoTypes customInfoTypes includeQuote` + + +----- + + + + +### Inspect GCS File + +Inspects a text file stored on Google Cloud Storage with the Data Loss Prevention API, using Pub/Sub for job notifications. + +View the [source code](https://github.com/googleapis/nodejs-dlp/blob/master/samples/inspectGCSFile.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-dlp&page=editor&open_in_editor=samples/inspectGCSFile.js,samples/README.md) + +__Usage:__ + + +`node inspectGCSFile.js my-project filepath minLikelihood maxFindings infoTypes customInfoTypes includeQuote` + + +----- + + + + +### Inspects strings + +Inspect a string using the Data Loss Prevention API. + +View the [source code](https://github.com/googleapis/nodejs-dlp/blob/master/samples/inspectString.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-dlp&page=editor&open_in_editor=samples/inspectString.js,samples/README.md) + +__Usage:__ + + +`node inspectString.js my-project string minLikelihood maxFindings infoTypes customInfoTypes includeQuote` + + +----- + + + + +### kAnonymity Analysis + +Computes the k-anonymity of a column set in a Google BigQuery table + +View the [source code](https://github.com/googleapis/nodejs-dlp/blob/master/samples/kAnonymityAnalysis.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-dlp&page=editor&open_in_editor=samples/kAnonymityAnalysis.js,samples/README.md) + +__Usage:__ + + +`node kAnonymityAnalysis.js my-project tableProjectId datasetId tableId topicId subscriptionId quasiIds` + + +----- + + + + +### kMap Estimation Analysis + +Computes the k-map risk estimation of a column set in a Google BigQuery table. + +View the [source code](https://github.com/googleapis/nodejs-dlp/blob/master/samples/kMapEstimationAnalysis.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-dlp&page=editor&open_in_editor=samples/kMapEstimationAnalysis.js,samples/README.md) + +__Usage:__ + + +`node kMapEstimationAnalysis.js my-project tableProjectId datasetId tableId topicId subscriptionId regionCode quasiIds` + + +----- + + + + +### l Diversity Analysis + +Computes the l-diversity of a column set in a Google BigQuery table. + +View the [source code](https://github.com/googleapis/nodejs-dlp/blob/master/samples/lDiversityAnalysis.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-dlp&page=editor&open_in_editor=samples/lDiversityAnalysis.js,samples/README.md) + +__Usage:__ + + +`node lDiversityAnalysis.js my-project tableProjectId datasetId tableId topicId subscriptionId sensitiveAttribute quasiIds` + + +----- + + + + +### List Inspect Templates + +List DLP inspection configuration templates. + +View the [source code](https://github.com/googleapis/nodejs-dlp/blob/master/samples/listInspectTemplates.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-dlp&page=editor&open_in_editor=samples/listInspectTemplates.js,samples/README.md) + +__Usage:__ + + +`node listInspectTemplates.js my-project` + + +----- + + + + +### List jobs + +List Data Loss Prevention API jobs corresponding to a given filter. + +View the [source code](https://github.com/googleapis/nodejs-dlp/blob/master/samples/listJobs.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-dlp&page=editor&open_in_editor=samples/listJobs.js,samples/README.md) + +__Usage:__ + + +`node listJobs.js my-project filter jobType` + + +----- + + + + +### List Triggers + +List Data Loss Prevention API job triggers. + +View the [source code](https://github.com/googleapis/nodejs-dlp/blob/master/samples/listTriggers.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-dlp&page=editor&open_in_editor=samples/listTriggers.js,samples/README.md) + +__Usage:__ + + +`node listTriggers.js my-project` + + +----- + + + + +### Metadata + +List the types of sensitive information the DLP API supports + +View the [source code](https://github.com/googleapis/nodejs-dlp/blob/master/samples/metadata.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-dlp&page=editor&open_in_editor=samples/metadata.js,samples/README.md) + +__Usage:__ + + +`node metadata.js my-project langaugeCode filter` + + +----- + + + + +### Numerical Risk Analysis + +Computes risk metrics of a column of numbers in a Google BigQuery table. + +View the [source code](https://github.com/googleapis/nodejs-dlp/blob/master/samples/numericalRiskAnalysis.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-dlp&page=editor&open_in_editor=samples/numericalRiskAnalysis.js,samples/README.md) + +__Usage:__ + + +`node numericalRiskAnalysis.js my-project tableProjectId datasetId tableId columnName topicId subscriptionId` + + +----- + + + + +### Quickstart + +Inspects and assesses a string. + +View the [source code](https://github.com/googleapis/nodejs-dlp/blob/master/samples/quickstart.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-dlp&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) + +__Usage:__ + + +`node quickstart.js my-project` + + +----- + + + + +### Redact Image + +Redact sensitive data from an image using the Data Loss Prevention API. + +View the [source code](https://github.com/googleapis/nodejs-dlp/blob/master/samples/redactImage.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-dlp&page=editor&open_in_editor=samples/redactImage.js,samples/README.md) + +__Usage:__ + + +`node redactImage.js my-project filepath minLikelihood infoTypes outputPath` + + +----- + + + + +### Redact Text + +Redact sensitive data from text using the Data Loss Prevention API. + +View the [source code](https://github.com/googleapis/nodejs-dlp/blob/master/samples/redactText.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-dlp&page=editor&open_in_editor=samples/redactText.js,samples/README.md) + +__Usage:__ + + +`node redactText.js my-project string minLikelihood infoTypes` + + +----- + + + + +### Reidentify with FPE + +Reidentify sensitive data in a string using Format Preserving Encryption (FPE). + +View the [source code](https://github.com/googleapis/nodejs-dlp/blob/master/samples/reidentifyWithFpe.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-dlp&page=editor&open_in_editor=samples/reidentifyWithFpe.js,samples/README.md) + +__Usage:__ + + +`node reidentifyWithFpe.js my-project string alphabet surrogateType keyName wrappedKey` + + + + + + +[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png +[shell_link]: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-dlp&page=editor&open_in_editor=samples/README.md +[product-docs]: https://cloud.google.com/dlp/docs/ diff --git a/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/categoricalRiskAnalysis.js b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/categoricalRiskAnalysis.js new file mode 100644 index 000000000..01243ca1c --- /dev/null +++ b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/categoricalRiskAnalysis.js @@ -0,0 +1,160 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// 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. + +'use strict'; + +// sample-metadata: +// title: Categorical Risk Analysis +// description: Computes risk metrics of a column of data in a Google BigQuery table. +// usage: node categoricalRiskAnalysis.js my-project nhtsa_traffic_fatalities accident_2015 state_name my-topic my-subscription bigquery-public-data + +function main( + projectId, + tableProjectId, + datasetId, + tableId, + columnName, + topicId, + subscriptionId +) { + // [START dlp_categorical_stats] + // Import the Google Cloud client libraries + const DLP = require('@google-cloud/dlp'); + const {PubSub} = require('@google-cloud/pubsub'); + + // Instantiates clients + const dlp = new DLP.DlpServiceClient(); + const pubsub = new PubSub(); + + // The project ID to run the API call under + // const projectId = 'my-project'; + + // The project ID the table is stored under + // This may or (for public datasets) may not equal the calling project ID + // const tableProjectId = 'my-project'; + + // The ID of the dataset to inspect, e.g. 'my_dataset' + // const datasetId = 'my_dataset'; + + // The ID of the table to inspect, e.g. 'my_table' + // const tableId = 'my_table'; + + // The name of the Pub/Sub topic to notify once the job completes + // TODO(developer): create a Pub/Sub topic to use for this + // const topicId = 'MY-PUBSUB-TOPIC' + + // The name of the Pub/Sub subscription to use when listening for job + // completion notifications + // TODO(developer): create a Pub/Sub subscription to use for this + // const subscriptionId = 'MY-PUBSUB-SUBSCRIPTION' + + // The name of the column to compute risk metrics for, e.g. 'firstName' + // const columnName = 'firstName'; + async function categoricalRiskAnalysis() { + const sourceTable = { + projectId: tableProjectId, + datasetId: datasetId, + tableId: tableId, + }; + + // Construct request for creating a risk analysis job + const request = { + parent: `projects/${projectId}/locations/global`, + riskJob: { + privacyMetric: { + categoricalStatsConfig: { + field: { + name: columnName, + }, + }, + }, + sourceTable: sourceTable, + actions: [ + { + pubSub: { + topic: `projects/${projectId}/topics/${topicId}`, + }, + }, + ], + }, + }; + + // Create helper function for unpacking values + const getValue = obj => obj[Object.keys(obj)[0]]; + + // Run risk analysis job + const [topicResponse] = await pubsub.topic(topicId).get(); + const subscription = await topicResponse.subscription(subscriptionId); + const [jobsResponse] = await dlp.createDlpJob(request); + const jobName = jobsResponse.name; + // Watch the Pub/Sub topic until the DLP job finishes + await new Promise((resolve, reject) => { + const messageHandler = message => { + if (message.attributes && message.attributes.DlpJobName === jobName) { + message.ack(); + subscription.removeListener('message', messageHandler); + subscription.removeListener('error', errorHandler); + resolve(jobName); + } else { + message.nack(); + } + }; + + const errorHandler = err => { + subscription.removeListener('message', messageHandler); + subscription.removeListener('error', errorHandler); + reject(err); + }; + + subscription.on('message', messageHandler); + subscription.on('error', errorHandler); + }); + setTimeout(() => { + console.log(' Waiting for DLP job to fully complete'); + }, 500); + const [job] = await dlp.getDlpJob({name: jobName}); + const histogramBuckets = + job.riskDetails.categoricalStatsResult.valueFrequencyHistogramBuckets; + histogramBuckets.forEach((histogramBucket, histogramBucketIdx) => { + console.log(`Bucket ${histogramBucketIdx}:`); + + // Print bucket stats + console.log( + ` Most common value occurs ${histogramBucket.valueFrequencyUpperBound} time(s)` + ); + console.log( + ` Least common value occurs ${histogramBucket.valueFrequencyLowerBound} time(s)` + ); + + // Print bucket values + console.log(`${histogramBucket.bucketSize} unique values total.`); + histogramBucket.bucketValues.forEach(valueBucket => { + console.log( + ` Value ${getValue(valueBucket.value)} occurs ${ + valueBucket.count + } time(s).` + ); + }); + }); + } + + categoricalRiskAnalysis(); + // [END dlp_categorical_stats] +} + +main(...process.argv.slice(2)); +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); diff --git a/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/createInspectTemplate.js b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/createInspectTemplate.js new file mode 100644 index 000000000..5e13e694c --- /dev/null +++ b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/createInspectTemplate.js @@ -0,0 +1,102 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// 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. + +'use strict'; + +// sample-metadata: +// title: Inspect Templates +// description: Create a new DLP inspection configuration template. +// usage: node createInspectTemplate.js my-project VERY_LIKELY PERSON_NAME 5 false my-template-id + +function main( + projectId, + templateId, + displayName, + infoTypes, + includeQuote, + minLikelihood, + maxFindings +) { + infoTypes = transformCLI(infoTypes); + // [START dlp_create_inspect_template] + // Imports the Google Cloud Data Loss Prevention library + const DLP = require('@google-cloud/dlp'); + + // Instantiates a client + const dlp = new DLP.DlpServiceClient(); + + // The project ID to run the API call under + // const projectId = 'my-project'; + + // The minimum likelihood required before returning a match + // const minLikelihood = 'LIKELIHOOD_UNSPECIFIED'; + + // The maximum number of findings to report per request (0 = server maximum) + // const maxFindings = 0; + + // The infoTypes of information to match + // const infoTypes = [{ name: 'PHONE_NUMBER' }, { name: 'EMAIL_ADDRESS' }, { name: 'CREDIT_CARD_NUMBER' }]; + + // Whether to include the matching string + // const includeQuote = true; + + // (Optional) The name of the template to be created. + // const templateId = 'my-template'; + + // (Optional) The human-readable name to give the template + // const displayName = 'My template'; + + async function createInspectTemplate() { + // Construct the inspection configuration for the template + const inspectConfig = { + infoTypes: infoTypes, + minLikelihood: minLikelihood, + includeQuote: includeQuote, + limits: { + maxFindingsPerRequest: maxFindings, + }, + }; + + // Construct template-creation request + const request = { + parent: `projects/${projectId}/locations/global`, + inspectTemplate: { + inspectConfig: inspectConfig, + displayName: displayName, + }, + templateId: templateId, + }; + + const [response] = await dlp.createInspectTemplate(request); + const templateName = response.name; + console.log(`Successfully created template ${templateName}.`); + } + createInspectTemplate(); + // [END dlp_create_inspect_template] +} + +main(...process.argv.slice(2)); +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); + +function transformCLI(infoTypes) { + infoTypes = infoTypes + ? infoTypes.split(',').map(type => { + return {name: type}; + }) + : undefined; + return infoTypes; +} diff --git a/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/createTrigger.js b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/createTrigger.js new file mode 100644 index 000000000..f4f338d4f --- /dev/null +++ b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/createTrigger.js @@ -0,0 +1,138 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// 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. + +'use strict'; + +// sample-metadata: +// title: Job Triggers +// description: Create a Data Loss Prevention API job trigger. +// usage: node createTrigger.js my-project triggerId displayName description bucketName autoPopulateTimespan scanPeriod infoTypes minLikelihood maxFindings + +function main( + projectId, + triggerId, + displayName, + description, + bucketName, + autoPopulateTimespan, + scanPeriod, + infoTypes, + minLikelihood, + maxFindings +) { + infoTypes = transformCLI(infoTypes); + // [START dlp_create_trigger] + // Imports the Google Cloud Data Loss Prevention library + const DLP = require('@google-cloud/dlp'); + + // Instantiates a client + const dlp = new DLP.DlpServiceClient(); + + // The project ID to run the API call under + // const projectId = 'my-project'; + + // (Optional) The name of the trigger to be created. + // const triggerId = 'my-trigger'; + + // (Optional) A display name for the trigger to be created + // const displayName = 'My Trigger'; + + // (Optional) A description for the trigger to be created + // const description = "This is a sample trigger."; + + // The name of the bucket to scan. + // const bucketName = 'YOUR-BUCKET'; + + // Limit scan to new content only. + // const autoPopulateTimespan = true; + + // How often to wait between scans, in days (minimum = 1 day) + // const scanPeriod = 1; + + // The infoTypes of information to match + // const infoTypes = [{ name: 'PHONE_NUMBER' }, { name: 'EMAIL_ADDRESS' }, { name: 'CREDIT_CARD_NUMBER' }]; + + // The minimum likelihood required before returning a match + // const minLikelihood = 'LIKELIHOOD_UNSPECIFIED'; + + // The maximum number of findings to report per request (0 = server maximum) + // const maxFindings = 0; + + async function createTrigger() { + // Get reference to the bucket to be inspected + const storageItem = { + cloudStorageOptions: { + fileSet: {url: `gs://${bucketName}/*`}, + }, + timeSpanConfig: { + enableAutoPopulationOfTimespanConfig: autoPopulateTimespan, + }, + }; + + // Construct job to be triggered + const job = { + inspectConfig: { + infoTypes: infoTypes, + minLikelihood: minLikelihood, + limits: { + maxFindingsPerRequest: maxFindings, + }, + }, + storageConfig: storageItem, + }; + + // Construct trigger creation request + const request = { + parent: `projects/${projectId}/locations/global`, + jobTrigger: { + inspectJob: job, + displayName: displayName, + description: description, + triggers: [ + { + schedule: { + recurrencePeriodDuration: { + seconds: scanPeriod * 60 * 60 * 24, // Trigger the scan daily + }, + }, + }, + ], + status: 'HEALTHY', + }, + triggerId: triggerId, + }; + + // Run trigger creation request + const [trigger] = await dlp.createJobTrigger(request); + console.log(`Successfully created trigger ${trigger.name}.`); + } + + createTrigger(); + // [END dlp_create_trigger] +} + +main(...process.argv.slice(2)); +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); + +function transformCLI(infoTypes) { + infoTypes = infoTypes + ? infoTypes.split(',').map(type => { + return {name: type}; + }) + : undefined; + return infoTypes; +} diff --git a/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/deidentifyWithDateShift.js b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/deidentifyWithDateShift.js new file mode 100644 index 000000000..e13d96425 --- /dev/null +++ b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/deidentifyWithDateShift.js @@ -0,0 +1,191 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// 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. + +'use strict'; + +// sample-metadata: +// title: Deidentify with Date Shift +// description: Deidentify dates in a CSV file by pseudorandomly shifting them. +// usage: node deidentifyWithDateShift.js my-project dates.csv dates-shifted.csv 30 30 birth_date register_date [ projects/my-project/locations/global/keyrings/my-keyring] + +function main( + projectId, + inputCsvFile, + outputCsvFile, + dateFields, + lowerBoundDays, + upperBoundDays, + contextFieldId, + wrappedKey, + keyName +) { + dateFields = transformCLI(dateFields); + // [START dlp_deidentify_date_shift] + // Imports the Google Cloud Data Loss Prevention library + const DLP = require('@google-cloud/dlp'); + + // Instantiates a client + const dlp = new DLP.DlpServiceClient(); + + // Import other required libraries + const fs = require('fs'); + + // The project ID to run the API call under + // const projectId = 'my-project'; + + // The path to the CSV file to deidentify + // The first row of the file must specify column names, and all other rows + // must contain valid values + // const inputCsvFile = '/path/to/input/file.csv'; + + // The path to save the date-shifted CSV file to + // const outputCsvFile = '/path/to/output/file.csv'; + + // The list of (date) fields in the CSV file to date shift + // const dateFields = [{ name: 'birth_date'}, { name: 'register_date' }]; + + // The maximum number of days to shift a date backward + // const lowerBoundDays = 1; + + // The maximum number of days to shift a date forward + // const upperBoundDays = 1; + + // (Optional) The column to determine date shift amount based on + // If this is not specified, a random shift amount will be used for every row + // If this is specified, then 'wrappedKey' and 'keyName' must also be set + // const contextFieldId = [{ name: 'user_id' }]; + + // (Optional) The name of the Cloud KMS key used to encrypt ('wrap') the AES-256 key + // If this is specified, then 'wrappedKey' and 'contextFieldId' must also be set + // const keyName = 'projects/YOUR_GCLOUD_PROJECT/locations/YOUR_LOCATION/keyRings/YOUR_KEYRING_NAME/cryptoKeys/YOUR_KEY_NAME'; + + // (Optional) The encrypted ('wrapped') AES-256 key to use when shifting dates + // This key should be encrypted using the Cloud KMS key specified above + // If this is specified, then 'keyName' and 'contextFieldId' must also be set + // const wrappedKey = 'YOUR_ENCRYPTED_AES_256_KEY' + + // Helper function for converting CSV rows to Protobuf types + const rowToProto = row => { + const values = row.split(','); + const convertedValues = values.map(value => { + if (Date.parse(value)) { + const date = new Date(value); + return { + dateValue: { + year: date.getFullYear(), + month: date.getMonth() + 1, + day: date.getDate(), + }, + }; + } else { + // Convert all non-date values to strings + return {stringValue: value.toString()}; + } + }); + return {values: convertedValues}; + }; + + async function deidentifyWithDateShift() { + // Read and parse a CSV file + const csvLines = fs + .readFileSync(inputCsvFile) + .toString() + .split('\n') + .filter(line => line.includes(',')); + const csvHeaders = csvLines[0].split(','); + const csvRows = csvLines.slice(1); + + // Construct the table object + const tableItem = { + table: { + headers: csvHeaders.map(header => { + return {name: header}; + }), + rows: csvRows.map(row => rowToProto(row)), + }, + }; + + // Construct DateShiftConfig + const dateShiftConfig = { + lowerBoundDays: lowerBoundDays, + upperBoundDays: upperBoundDays, + }; + + if (contextFieldId && keyName && wrappedKey) { + dateShiftConfig.context = {name: contextFieldId}; + dateShiftConfig.cryptoKey = { + kmsWrapped: { + wrappedKey: wrappedKey, + cryptoKeyName: keyName, + }, + }; + } else if (contextFieldId || keyName || wrappedKey) { + throw new Error( + 'You must set either ALL or NONE of {contextFieldId, keyName, wrappedKey}!' + ); + } + + // Construct deidentification request + const request = { + parent: `projects/${projectId}/locations/global`, + deidentifyConfig: { + recordTransformations: { + fieldTransformations: [ + { + fields: dateFields, + primitiveTransformation: { + dateShiftConfig: dateShiftConfig, + }, + }, + ], + }, + }, + item: tableItem, + }; + + // Run deidentification request + const [response] = await dlp.deidentifyContent(request); + const tableRows = response.item.table.rows; + + // Write results to a CSV file + tableRows.forEach((row, rowIndex) => { + const rowValues = row.values.map( + value => + value.stringValue || + `${value.dateValue.month}/${value.dateValue.day}/${value.dateValue.year}` + ); + csvLines[rowIndex + 1] = rowValues.join(','); + }); + csvLines.push(''); + fs.writeFileSync(outputCsvFile, csvLines.join('\n')); + + // Print status + console.log(`Successfully saved date-shift output to ${outputCsvFile}`); + } + + deidentifyWithDateShift(); + // [END dlp_deidentify_date_shift] +} + +main(...process.argv.slice(2)); +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); + +function transformCLI(dateFields) { + return (dateFields = dateFields.split(',').map(type => { + return {name: type}; + })); +} diff --git a/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/deidentifyWithFpe.js b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/deidentifyWithFpe.js new file mode 100644 index 000000000..015b24d7a --- /dev/null +++ b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/deidentifyWithFpe.js @@ -0,0 +1,101 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// 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. + +'use strict'; + +// sample-metadata: +// title: Deidentify with FPE +// description: Deidentify sensitive data in a string using Format Preserving Encryption (FPE). +// usage: node deidentifyWithFpe.js my-project "My SSN is 372819127" projects/my-project/locations/global/keyrings/my-keyring SSN_TOKEN + +function main(projectId, string, alphabet, keyName, wrappedKey, surrogateType) { + // [START dlp_deidentify_fpe] + // Imports the Google Cloud Data Loss Prevention library + const DLP = require('@google-cloud/dlp'); + + // Instantiates a client + const dlp = new DLP.DlpServiceClient(); + + // The project ID to run the API call under + // const projectId = 'my-project'; + + // The string to deidentify + // const string = 'My SSN is 372819127'; + + // The set of characters to replace sensitive ones with + // For more information, see https://cloud.google.com/dlp/docs/reference/rest/v2/organizations.deidentifyTemplates#ffxcommonnativealphabet + // const alphabet = 'ALPHA_NUMERIC'; + + // The name of the Cloud KMS key used to encrypt ('wrap') the AES-256 key + // const keyName = 'projects/YOUR_GCLOUD_PROJECT/locations/YOUR_LOCATION/keyRings/YOUR_KEYRING_NAME/cryptoKeys/YOUR_KEY_NAME'; + + // The encrypted ('wrapped') AES-256 key to use + // This key should be encrypted using the Cloud KMS key specified above + // const wrappedKey = 'YOUR_ENCRYPTED_AES_256_KEY' + + // (Optional) The name of the surrogate custom info type to use + // Only necessary if you want to reverse the deidentification process + // Can be essentially any arbitrary string, as long as it doesn't appear + // in your dataset otherwise. + // const surrogateType = 'SOME_INFO_TYPE_DEID'; + + async function deidentifyWithFpe() { + // Construct FPE config + const cryptoReplaceFfxFpeConfig = { + cryptoKey: { + kmsWrapped: { + wrappedKey: wrappedKey, + cryptoKeyName: keyName, + }, + }, + commonAlphabet: alphabet, + }; + if (surrogateType) { + cryptoReplaceFfxFpeConfig.surrogateInfoType = { + name: surrogateType, + }; + } + + // Construct deidentification request + const item = {value: string}; + const request = { + parent: `projects/${projectId}/locations/global`, + deidentifyConfig: { + infoTypeTransformations: { + transformations: [ + { + primitiveTransformation: { + cryptoReplaceFfxFpeConfig: cryptoReplaceFfxFpeConfig, + }, + }, + ], + }, + }, + item: item, + }; + + // Run deidentification request + const [response] = await dlp.deidentifyContent(request); + const deidentifiedItem = response.item; + console.log(deidentifiedItem.value); + } + deidentifyWithFpe(); + // [END dlp_deidentify_fpe] +} + +main(...process.argv.slice(2)); +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); diff --git a/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/deidentifyWithMask.js b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/deidentifyWithMask.js new file mode 100644 index 000000000..6e6df7e7e --- /dev/null +++ b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/deidentifyWithMask.js @@ -0,0 +1,80 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// 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. + +'use strict'; + +// sample-metadata: +// title: Deidentify with Mask +// description: Deidentify sensitive data in a string by masking it with a character. +// usage: node deidentifyWithMask.js my-project string maskingCharacter numberToMask + +function main(projectId, string, maskingCharacter, numberToMask) { + // [START dlp_deidentify_masking] + // Imports the Google Cloud Data Loss Prevention library + const DLP = require('@google-cloud/dlp'); + + // Instantiates a client + const dlp = new DLP.DlpServiceClient(); + + // The project ID to run the API call under + // const projectId = 'my-project-id'; + + // The string to deidentify + // const string = 'My SSN is 372819127'; + + // (Optional) The maximum number of sensitive characters to mask in a match + // If omitted from the request or set to 0, the API will mask any matching characters + // const numberToMask = 5; + + // (Optional) The character to mask matching sensitive data with + // const maskingCharacter = 'x'; + + // Construct deidentification request + const item = {value: string}; + + async function deidentifyWithMask() { + const request = { + parent: `projects/${projectId}/locations/global`, + deidentifyConfig: { + infoTypeTransformations: { + transformations: [ + { + primitiveTransformation: { + characterMaskConfig: { + maskingCharacter: maskingCharacter, + numberToMask: numberToMask, + }, + }, + }, + ], + }, + }, + item: item, + }; + + // Run deidentification request + const [response] = await dlp.deidentifyContent(request); + const deidentifiedItem = response.item; + console.log(deidentifiedItem.value); + } + + deidentifyWithMask(); + // [END dlp_deidentify_masking] +} + +main(...process.argv.slice(2)); +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); diff --git a/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/deidentifyWithReplacement.js b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/deidentifyWithReplacement.js new file mode 100644 index 000000000..c3e5f0de7 --- /dev/null +++ b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/deidentifyWithReplacement.js @@ -0,0 +1,76 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// 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. + +'use strict'; + +// sample-metadata: +// title: Deidentify with Replacement +// description: Deidentify sensitive data in a string by replacing it with a given replacement string. +// usage: node deidentifyWithMask.js my-project string replacement + +function main(projectId, string, replacement) { + // [START dlp_deidentify_replacement] + // Imports the Google Cloud Data Loss Prevention library + const DLP = require('@google-cloud/dlp'); + + // Instantiates a client + const dlp = new DLP.DlpServiceClient(); + + // The project ID to run the API call under + // const projectId = 'my-project'; + + // The string to deidentify + // const string = 'My SSN is 372819127'; + + // The string to replace sensitive information with + // const replacement = "[REDACTED]" + + async function deidentifyWithReplacement() { + // Construct deidentification request + const item = {value: string}; + const request = { + parent: `projects/${projectId}/locations/global`, + deidentifyConfig: { + infoTypeTransformations: { + transformations: [ + { + primitiveTransformation: { + replaceConfig: { + newValue: { + stringValue: replacement, + }, + }, + }, + }, + ], + }, + }, + item: item, + }; + + // Run deidentification request + const [response] = await dlp.deidentifyContent(request); + const deidentifiedItem = response.item; + console.log(deidentifiedItem.value); + } + + deidentifyWithReplacement(); + // [END dlp_deidentify_replacement] +} + +main(...process.argv.slice(2)); +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); diff --git a/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/deleteInspectTemplate.js b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/deleteInspectTemplate.js new file mode 100644 index 000000000..61a802115 --- /dev/null +++ b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/deleteInspectTemplate.js @@ -0,0 +1,55 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// 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. + +'use strict'; + +// sample-metadata: +// title: Delete Inspect Templates +// description: Delete the DLP inspection configuration template with the specified name. +// usage: node deleteInspectTemplates.js my-project projects/my-project/inspectTemplates/##### + +function main(projectId, templateName) { + // [START dlp_delete_inspect_template] + // Imports the Google Cloud Data Loss Prevention library + const DLP = require('@google-cloud/dlp'); + + // Instantiates a client + const dlp = new DLP.DlpServiceClient(); + + // The project ID to run the API call under + // const projectId = 'my-project'; + + // The name of the template to delete + // Parent project ID is automatically extracted from this parameter + // const templateName = 'projects/YOUR_PROJECT_ID/inspectTemplates/#####' + async function deleteInspectTemplate() { + // Construct template-deletion request + const request = { + name: templateName, + }; + + // Run template-deletion request + await dlp.deleteInspectTemplate(request); + console.log(`Successfully deleted template ${templateName}.`); + } + + deleteInspectTemplate(); + // [END dlp_delete_inspect_template] +} + +main(...process.argv.slice(2)); +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); diff --git a/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/deleteJob.js b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/deleteJob.js new file mode 100644 index 000000000..78202468e --- /dev/null +++ b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/deleteJob.js @@ -0,0 +1,59 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// 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. + +// sample-metadata: +// title: Delete Job +// description: Delete results of a Data Loss Prevention API job. +// usage: node deleteJob.js my-project projects/YOUR_GCLOUD_PROJECT/dlpJobs/X-##### + +function main(projectId, jobName) { + // [START dlp_delete_job] + // Imports the Google Cloud Data Loss Prevention library + const DLP = require('@google-cloud/dlp'); + + // Instantiates a client + const dlp = new DLP.DlpServiceClient(); + + // The project ID to run the API call under + // const projectId = 'my-project'; + + // The name of the job whose results should be deleted + // Parent project ID is automatically extracted from this parameter + // const jobName = 'projects/my-project/dlpJobs/X-#####' + + function deleteJob() { + // Construct job deletion request + const request = { + name: jobName, + }; + + // Run job deletion request + dlp + .deleteDlpJob(request) + .then(() => { + console.log(`Successfully deleted job ${jobName}.`); + }) + .catch(err => { + console.log(`Error in deleteJob: ${err.message || err}`); + }); + } + + deleteJob(); + // [END dlp_delete_job] +} +main(...process.argv.slice(2)); +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); diff --git a/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/deleteTrigger.js b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/deleteTrigger.js new file mode 100644 index 000000000..9fca52f79 --- /dev/null +++ b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/deleteTrigger.js @@ -0,0 +1,54 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// 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. + +// sample-metadata: +// title: Delete Trigger +// description: Delete results of a Data Loss Prevention API job. +// usage: node deleteTrigger.js my-rpoject projects/my-project/jobTriggers/my-trigger + +function main(projectId, triggerId) { + // [START dlp_delete_trigger] + // Imports the Google Cloud Data Loss Prevention library + const DLP = require('@google-cloud/dlp'); + + // Instantiates a client + const dlp = new DLP.DlpServiceClient(); + + // The project ID to run the API call under + // const projectId = 'my-project' + + // The name of the trigger to be deleted + // Parent project ID is automatically extracted from this parameter + // const triggerId = 'projects/my-project/triggers/my-trigger'; + + async function deleteTrigger() { + // Construct trigger deletion request + const request = { + name: triggerId, + }; + + // Run trigger deletion request + await dlp.deleteJobTrigger(request); + console.log(`Successfully deleted trigger ${triggerId}.`); + } + + deleteTrigger(); + // [END dlp_delete_trigger] +} + +main(...process.argv.slice(2)); +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); diff --git a/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/inspectBigQuery.js b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/inspectBigQuery.js new file mode 100644 index 000000000..32d2950af --- /dev/null +++ b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/inspectBigQuery.js @@ -0,0 +1,195 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// 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. + +// sample-metadata: +// title: Inspect Bigquery +// description: Inspects a BigQuery table using the Data Loss Prevention API using Pub/Sub for job notifications. +// usage: node inspectBigQuery.js my-project dataProjectId datasetId tableId topicId subscriptionId minLikelihood maxFindings infoTypes customInfoTypes + +function main( + projectId, + dataProjectId, + datasetId, + tableId, + topicId, + subscriptionId, + minLikelihood, + maxFindings, + infoTypes, + customInfoTypes +) { + [infoTypes, customInfoTypes] = transformCLI(infoTypes, customInfoTypes); + + // [START dlp_inspect_bigquery] + // Import the Google Cloud client libraries + const DLP = require('@google-cloud/dlp'); + const {PubSub} = require('@google-cloud/pubsub'); + + // Instantiates clients + const dlp = new DLP.DlpServiceClient(); + const pubsub = new PubSub(); + + // The project ID to run the API call under + // const projectId = 'my-project'; + + // The project ID the table is stored under + // This may or (for public datasets) may not equal the calling project ID + // const dataProjectId = 'my-project'; + + // The ID of the dataset to inspect, e.g. 'my_dataset' + // const datasetId = 'my_dataset'; + + // The ID of the table to inspect, e.g. 'my_table' + // const tableId = 'my_table'; + + // The minimum likelihood required before returning a match + // const minLikelihood = 'LIKELIHOOD_UNSPECIFIED'; + + // The maximum number of findings to report per request (0 = server maximum) + // const maxFindings = 0; + + // The infoTypes of information to match + // const infoTypes = [{ name: 'PHONE_NUMBER' }, { name: 'EMAIL_ADDRESS' }, { name: 'CREDIT_CARD_NUMBER' }]; + + // The customInfoTypes of information to match + // const customInfoTypes = [{ infoType: { name: 'DICT_TYPE' }, dictionary: { wordList: { words: ['foo', 'bar', 'baz']}}}, + // { infoType: { name: 'REGEX_TYPE' }, regex: {pattern: '\\(\\d{3}\\) \\d{3}-\\d{4}'}}]; + + // The name of the Pub/Sub topic to notify once the job completes + // TODO(developer): create a Pub/Sub topic to use for this + // const topicId = 'MY-PUBSUB-TOPIC' + + // The name of the Pub/Sub subscription to use when listening for job + // completion notifications + // TODO(developer): create a Pub/Sub subscription to use for this + // const subscriptionId = 'MY-PUBSUB-SUBSCRIPTION' + + async function inspectBigquery() { + // Construct item to be inspected + const storageItem = { + bigQueryOptions: { + tableReference: { + projectId: dataProjectId, + datasetId: datasetId, + tableId: tableId, + }, + }, + }; + + // Construct request for creating an inspect job + const request = { + parent: `projects/${projectId}/locations/global`, + inspectJob: { + inspectConfig: { + infoTypes: infoTypes, + customInfoTypes: customInfoTypes, + minLikelihood: minLikelihood, + limits: { + maxFindingsPerRequest: maxFindings, + }, + }, + storageConfig: storageItem, + actions: [ + { + pubSub: { + topic: `projects/${projectId}/topics/${topicId}`, + }, + }, + ], + }, + }; + + // Run inspect-job creation request + const [topicResponse] = await pubsub.topic(topicId).get(); + // Verify the Pub/Sub topic and listen for job notifications via an + // existing subscription. + const subscription = await topicResponse.subscription(subscriptionId); + const [jobsResponse] = await dlp.createDlpJob(request); + const jobName = jobsResponse.name; + // Watch the Pub/Sub topic until the DLP job finishes + await new Promise((resolve, reject) => { + const messageHandler = message => { + if (message.attributes && message.attributes.DlpJobName === jobName) { + message.ack(); + subscription.removeListener('message', messageHandler); + subscription.removeListener('error', errorHandler); + resolve(jobName); + } else { + message.nack(); + } + }; + + const errorHandler = err => { + subscription.removeListener('message', messageHandler); + subscription.removeListener('error', errorHandler); + reject(err); + }; + + subscription.on('message', messageHandler); + subscription.on('error', errorHandler); + }); + // Wait for DLP job to fully complete + setTimeout(() => { + console.log('Waiting for DLP job to fully complete'); + }, 500); + const [job] = await dlp.getDlpJob({name: jobName}); + console.log(`Job ${job.name} status: ${job.state}`); + + const infoTypeStats = job.inspectDetails.result.infoTypeStats; + if (infoTypeStats.length > 0) { + infoTypeStats.forEach(infoTypeStat => { + console.log( + ` Found ${infoTypeStat.count} instance(s) of infoType ${infoTypeStat.infoType.name}.` + ); + }); + } else { + console.log('No findings.'); + } + } + + inspectBigquery(); + // [END dlp_inspect_bigquery] +} + +main(...process.argv.slice(2)); +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); + +function transformCLI(infoTypes, customInfoTypes) { + infoTypes = infoTypes + ? infoTypes.split(',').map(type => { + return {name: type}; + }) + : undefined; + + if (customInfoTypes) { + customInfoTypes = customInfoTypes.includes(',') + ? customInfoTypes.split(',').map((dict, idx) => { + return { + infoType: {name: 'CUSTOM_DICT_'.concat(idx.toString())}, + dictionary: {wordList: {words: dict.split(',')}}, + }; + }) + : customInfoTypes.split(',').map((rgx, idx) => { + return { + infoType: {name: 'CUSTOM_REGEX_'.concat(idx.toString())}, + regex: {pattern: rgx}, + }; + }); + } + + return [infoTypes, customInfoTypes]; +} diff --git a/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/inspectDatastore.js b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/inspectDatastore.js new file mode 100644 index 000000000..e6674332d --- /dev/null +++ b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/inspectDatastore.js @@ -0,0 +1,198 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// 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. + +'use strict'; + +// sample-metadata: +// title: Inspect Datastore +// description: Inspect a Datastore instance using the Data Loss Prevention API using Pub/Sub for job notifications. +// usage: node inspectDatastore.js my-project dataProjectId namespaceId kind topicId subscriptionId minLikelihood maxFindings infoTypes customInfoTypes + +function main( + projectId, + dataProjectId, + namespaceId, + kind, + topicId, + subscriptionId, + minLikelihood, + maxFindings, + infoTypes, + customInfoTypes +) { + [infoTypes, customInfoTypes] = transformCLI(infoTypes, customInfoTypes); + + // [START dlp_inspect_datastore] + // Import the Google Cloud client libraries + const DLP = require('@google-cloud/dlp'); + const {PubSub} = require('@google-cloud/pubsub'); + + // Instantiates clients + const dlp = new DLP.DlpServiceClient(); + const pubsub = new PubSub(); + + // The project ID to run the API call under + // const projectId = 'my-project'; + + // The project ID the target Datastore is stored under + // This may or may not equal the calling project ID + // const dataProjectId = 'my-project'; + + // (Optional) The ID namespace of the Datastore document to inspect. + // To ignore Datastore namespaces, set this to an empty string ('') + // const namespaceId = ''; + + // The kind of the Datastore entity to inspect. + // const kind = 'Person'; + + // The minimum likelihood required before returning a match + // const minLikelihood = 'LIKELIHOOD_UNSPECIFIED'; + + // The maximum number of findings to report per request (0 = server maximum) + // const maxFindings = 0; + + // The infoTypes of information to match + // const infoTypes = [{ name: 'PHONE_NUMBER' }, { name: 'EMAIL_ADDRESS' }, { name: 'CREDIT_CARD_NUMBER' }]; + + // The customInfoTypes of information to match + // const customInfoTypes = [{ infoType: { name: 'DICT_TYPE' }, dictionary: { wordList: { words: ['foo', 'bar', 'baz']}}}, + // { infoType: { name: 'REGEX_TYPE' }, regex: {pattern: '\\(\\d{3}\\) \\d{3}-\\d{4}'}}]; + + // The name of the Pub/Sub topic to notify once the job completes + // TODO(developer): create a Pub/Sub topic to use for this + // const topicId = 'MY-PUBSUB-TOPIC' + + // The name of the Pub/Sub subscription to use when listening for job + // completion notifications + // TODO(developer): create a Pub/Sub subscription to use for this + // const subscriptionId = 'MY-PUBSUB-SUBSCRIPTION' + + async function inspectDatastore() { + // Construct items to be inspected + const storageItems = { + datastoreOptions: { + partitionId: { + projectId: dataProjectId, + namespaceId: namespaceId, + }, + kind: { + name: kind, + }, + }, + }; + + // Construct request for creating an inspect job + const request = { + parent: `projects/${projectId}/locations/global`, + inspectJob: { + inspectConfig: { + infoTypes: infoTypes, + customInfoTypes: customInfoTypes, + minLikelihood: minLikelihood, + limits: { + maxFindingsPerRequest: maxFindings, + }, + }, + storageConfig: storageItems, + actions: [ + { + pubSub: { + topic: `projects/${projectId}/topics/${topicId}`, + }, + }, + ], + }, + }; + // Run inspect-job creation request + const [topicResponse] = await pubsub.topic(topicId).get(); + // Verify the Pub/Sub topic and listen for job notifications via an + // existing subscription. + const subscription = await topicResponse.subscription(subscriptionId); + const [jobsResponse] = await dlp.createDlpJob(request); + const jobName = jobsResponse.name; + // Watch the Pub/Sub topic until the DLP job finishes + await new Promise((resolve, reject) => { + const messageHandler = message => { + if (message.attributes && message.attributes.DlpJobName === jobName) { + message.ack(); + subscription.removeListener('message', messageHandler); + subscription.removeListener('error', errorHandler); + resolve(jobName); + } else { + message.nack(); + } + }; + + const errorHandler = err => { + subscription.removeListener('message', messageHandler); + subscription.removeListener('error', errorHandler); + reject(err); + }; + + subscription.on('message', messageHandler); + subscription.on('error', errorHandler); + }); + // Wait for DLP job to fully complete + setTimeout(() => { + console.log('Waiting for DLP job to fully complete'); + }, 500); + const [job] = await dlp.getDlpJob({name: jobName}); + console.log(`Job ${job.name} status: ${job.state}`); + + const infoTypeStats = job.inspectDetails.result.infoTypeStats; + if (infoTypeStats.length > 0) { + infoTypeStats.forEach(infoTypeStat => { + console.log( + ` Found ${infoTypeStat.count} instance(s) of infoType ${infoTypeStat.infoType.name}.` + ); + }); + } else { + console.log('No findings.'); + } + } + inspectDatastore(); + // [END dlp_inspect_datastore] +} + +main(...process.argv.slice(2)); +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); + +function transformCLI(infoTypes, customInfoTypes) { + infoTypes = infoTypes + ? infoTypes.split(',').map(type => { + return {name: type}; + }) + : undefined; + + if (customInfoTypes) { + customInfoTypes = customInfoTypes.includes(',') + ? customInfoTypes.split(',').map((dict, idx) => { + return { + infoType: {name: 'CUSTOM_DICT_'.concat(idx.toString())}, + dictionary: {wordList: {words: dict.split(',')}}, + }; + }) + : customInfoTypes.split(',').map((rgx, idx) => { + return { + infoType: {name: 'CUSTOM_REGEX_'.concat(idx.toString())}, + regex: {pattern: rgx}, + }; + }); + } + + return [infoTypes, customInfoTypes]; +} diff --git a/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/inspectFile.js b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/inspectFile.js new file mode 100644 index 000000000..26da96e5a --- /dev/null +++ b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/inspectFile.js @@ -0,0 +1,143 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// 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. + +// sample-metadata: +// title: Inspect File +// description: Inspects a local text, PNG, or JPEG file using the Data Loss Prevention API. +// usage: node inspectFile.js my-project filepath minLikelihood maxFindings infoTypes customInfoTypes includeQuote + +function main( + projectId, + filepath, + minLikelihood, + maxFindings, + infoTypes, + customInfoTypes, + includeQuote +) { + [infoTypes, customInfoTypes] = transformCLI(infoTypes, customInfoTypes); + + // [START dlp_inspect_file] + // Imports the Google Cloud Data Loss Prevention library + const DLP = require('@google-cloud/dlp'); + + // Import other required libraries + const fs = require('fs'); + const mime = require('mime'); + + // Instantiates a client + const dlp = new DLP.DlpServiceClient(); + + // The project ID to run the API call under + // const projectId = 'my-project'; + + // The path to a local file to inspect. Can be a text, JPG, or PNG file. + // const filepath = 'path/to/image.png'; + + // The minimum likelihood required before returning a match + // const minLikelihood = 'LIKELIHOOD_UNSPECIFIED'; + + // The maximum number of findings to report per request (0 = server maximum) + // const maxFindings = 0; + + // The infoTypes of information to match + // const infoTypes = [{ name: 'PHONE_NUMBER' }, { name: 'EMAIL_ADDRESS' }, { name: 'CREDIT_CARD_NUMBER' }]; + + // The customInfoTypes of information to match + // const customInfoTypes = [{ infoType: { name: 'DICT_TYPE' }, dictionary: { wordList: { words: ['foo', 'bar', 'baz']}}}, + // { infoType: { name: 'REGEX_TYPE' }, regex: {pattern: '\\(\\d{3}\\) \\d{3}-\\d{4}'}}]; + + // Whether to include the matching string + // const includeQuote = true; + + async function inspectFile() { + // Construct file data to inspect + const fileTypeConstant = + ['image/jpeg', 'image/bmp', 'image/png', 'image/svg'].indexOf( + mime.getType(filepath) + ) + 1; + const fileBytes = Buffer.from(fs.readFileSync(filepath)).toString('base64'); + const item = { + byteItem: { + type: fileTypeConstant, + data: fileBytes, + }, + }; + + // Construct request + const request = { + parent: `projects/${projectId}/locations/global`, + inspectConfig: { + infoTypes: infoTypes, + customInfoTypes: customInfoTypes, + minLikelihood: minLikelihood, + includeQuote: includeQuote, + limits: { + maxFindingsPerRequest: maxFindings, + }, + }, + item: item, + }; + + // Run request + const [response] = await dlp.inspectContent(request); + const findings = response.result.findings; + if (findings.length > 0) { + console.log('Findings:'); + findings.forEach(finding => { + if (includeQuote) { + console.log(`\tQuote: ${finding.quote}`); + } + console.log(`\tInfo type: ${finding.infoType.name}`); + console.log(`\tLikelihood: ${finding.likelihood}`); + }); + } else { + console.log('No findings.'); + } + } + // [END dlp_inspect_file] + inspectFile(); +} + +main(...process.argv.slice(2)); +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); + +function transformCLI(infoTypes, customInfoTypes) { + infoTypes = infoTypes + ? infoTypes.split(',').map(type => { + return {name: type}; + }) + : undefined; + + if (customInfoTypes) { + customInfoTypes = customInfoTypes.includes(',') + ? customInfoTypes.split(',').map((dict, idx) => { + return { + infoType: {name: 'CUSTOM_DICT_'.concat(idx.toString())}, + dictionary: {wordList: {words: dict.split(',')}}, + }; + }) + : customInfoTypes.split(',').map((rgx, idx) => { + return { + infoType: {name: 'CUSTOM_REGEX_'.concat(idx.toString())}, + regex: {pattern: rgx}, + }; + }); + } + + return [infoTypes, customInfoTypes]; +} diff --git a/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/inspectGCSFile.js b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/inspectGCSFile.js new file mode 100644 index 000000000..19e6eff17 --- /dev/null +++ b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/inspectGCSFile.js @@ -0,0 +1,187 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// 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. + +// sample-metadata: +// title: Inspect GCS File +// description: Inspects a text file stored on Google Cloud Storage with the Data Loss Prevention API, using Pub/Sub for job notifications. +// usage: node inspectGCSFile.js my-project filepath minLikelihood maxFindings infoTypes customInfoTypes includeQuote + +function main( + projectId, + bucketName, + fileName, + topicId, + subscriptionId, + minLikelihood, + maxFindings, + infoTypes, + customInfoTypes +) { + [infoTypes, customInfoTypes] = transformCLI(infoTypes, customInfoTypes); + + // [START dlp_inspect_gcs] + // Import the Google Cloud client libraries + const DLP = require('@google-cloud/dlp'); + const {PubSub} = require('@google-cloud/pubsub'); + + // Instantiates clients + const dlp = new DLP.DlpServiceClient(); + const pubsub = new PubSub(); + + // The project ID to run the API call under + // const projectId = 'my-project'; + + // The name of the bucket where the file resides. + // const bucketName = 'YOUR-BUCKET'; + + // The path to the file within the bucket to inspect. + // Can contain wildcards, e.g. "my-image.*" + // const fileName = 'my-image.png'; + + // The minimum likelihood required before returning a match + // const minLikelihood = 'LIKELIHOOD_UNSPECIFIED'; + + // The maximum number of findings to report per request (0 = server maximum) + // const maxFindings = 0; + + // The infoTypes of information to match + // const infoTypes = [{ name: 'PHONE_NUMBER' }, { name: 'EMAIL_ADDRESS' }, { name: 'CREDIT_CARD_NUMBER' }]; + + // The customInfoTypes of information to match + // const customInfoTypes = [{ infoType: { name: 'DICT_TYPE' }, dictionary: { wordList: { words: ['foo', 'bar', 'baz']}}}, + // { infoType: { name: 'REGEX_TYPE' }, regex: {pattern: '\\(\\d{3}\\) \\d{3}-\\d{4}'}}]; + + // The name of the Pub/Sub topic to notify once the job completes + // TODO(developer): create a Pub/Sub topic to use for this + // const topicId = 'MY-PUBSUB-TOPIC' + + // The name of the Pub/Sub subscription to use when listening for job + // completion notifications + // TODO(developer): create a Pub/Sub subscription to use for this + // const subscriptionId = 'MY-PUBSUB-SUBSCRIPTION' + + async function inspectGCSFile() { + // Get reference to the file to be inspected + const storageItem = { + cloudStorageOptions: { + fileSet: {url: `gs://${bucketName}/${fileName}`}, + }, + }; + + // Construct request for creating an inspect job + const request = { + parent: `projects/${projectId}/locations/global`, + inspectJob: { + inspectConfig: { + infoTypes: infoTypes, + customInfoTypes: customInfoTypes, + minLikelihood: minLikelihood, + limits: { + maxFindingsPerRequest: maxFindings, + }, + }, + storageConfig: storageItem, + actions: [ + { + pubSub: { + topic: `projects/${projectId}/topics/${topicId}`, + }, + }, + ], + }, + }; + + // Create a GCS File inspection job and wait for it to complete + const [topicResponse] = await pubsub.topic(topicId).get(); + // Verify the Pub/Sub topic and listen for job notifications via an + // existing subscription. + const subscription = await topicResponse.subscription(subscriptionId); + const [jobsResponse] = await dlp.createDlpJob(request); + // Get the job's ID + const jobName = jobsResponse.name; + // Watch the Pub/Sub topic until the DLP job finishes + await new Promise((resolve, reject) => { + const messageHandler = message => { + if (message.attributes && message.attributes.DlpJobName === jobName) { + message.ack(); + subscription.removeListener('message', messageHandler); + subscription.removeListener('error', errorHandler); + resolve(jobName); + } else { + message.nack(); + } + }; + + const errorHandler = err => { + subscription.removeListener('message', messageHandler); + subscription.removeListener('error', errorHandler); + reject(err); + }; + + subscription.on('message', messageHandler); + subscription.on('error', errorHandler); + }); + + setTimeout(() => { + console.log('Waiting for DLP job to fully complete'); + }, 500); + const [job] = await dlp.getDlpJob({name: jobName}); + console.log(`Job ${job.name} status: ${job.state}`); + + const infoTypeStats = job.inspectDetails.result.infoTypeStats; + if (infoTypeStats.length > 0) { + infoTypeStats.forEach(infoTypeStat => { + console.log( + ` Found ${infoTypeStat.count} instance(s) of infoType ${infoTypeStat.infoType.name}.` + ); + }); + } else { + console.log('No findings.'); + } + } + inspectGCSFile(); + // [END dlp_inspect_gcs] +} + +main(...process.argv.slice(2)); +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); + +function transformCLI(infoTypes, customInfoTypes) { + infoTypes = infoTypes + ? infoTypes.split(',').map(type => { + return {name: type}; + }) + : undefined; + + if (customInfoTypes) { + customInfoTypes = customInfoTypes.includes(',') + ? customInfoTypes.split(',').map((dict, idx) => { + return { + infoType: {name: 'CUSTOM_DICT_'.concat(idx.toString())}, + dictionary: {wordList: {words: dict.split(',')}}, + }; + }) + : customInfoTypes.split(',').map((rgx, idx) => { + return { + infoType: {name: 'CUSTOM_REGEX_'.concat(idx.toString())}, + regex: {pattern: rgx}, + }; + }); + } + + return [infoTypes, customInfoTypes]; +} diff --git a/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/inspectString.js b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/inspectString.js new file mode 100644 index 000000000..081cb57bf --- /dev/null +++ b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/inspectString.js @@ -0,0 +1,134 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// 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. + +'use strict'; + +// sample-metadata: +// title: Inspects strings +// description: Inspect a string using the Data Loss Prevention API. +// usage: node inspectString.js my-project string minLikelihood maxFindings infoTypes customInfoTypes includeQuote + +function main( + projectId, + string, + minLikelihood, + maxFindings, + infoTypes, + customInfoTypes, + includeQuote +) { + [infoTypes, customInfoTypes] = transformCLI(infoTypes, customInfoTypes); + + // [START dlp_inspect_string] + // Imports the Google Cloud Data Loss Prevention library + const DLP = require('@google-cloud/dlp'); + + // Instantiates a client + const dlp = new DLP.DlpServiceClient(); + + // The project ID to run the API call under + // const projectId = 'my-project'; + + // The string to inspect + // const string = 'My name is Gary and my email is gary@example.com'; + + // The minimum likelihood required before returning a match + // const minLikelihood = 'LIKELIHOOD_UNSPECIFIED'; + + // The maximum number of findings to report per request (0 = server maximum) + // const maxFindings = 0; + + // The infoTypes of information to match + // const infoTypes = [{ name: 'PHONE_NUMBER' }, { name: 'EMAIL_ADDRESS' }, { name: 'CREDIT_CARD_NUMBER' }]; + + // The customInfoTypes of information to match + // const customInfoTypes = [{ infoType: { name: 'DICT_TYPE' }, dictionary: { wordList: { words: ['foo', 'bar', 'baz']}}}, + // { infoType: { name: 'REGEX_TYPE' }, regex: {pattern: '\\(\\d{3}\\) \\d{3}-\\d{4}'}}]; + + // Whether to include the matching string + // const includeQuote = true; + + async function inspectString() { + // Construct item to inspect + const item = {value: string}; + + // Construct request + const request = { + parent: `projects/${projectId}/locations/global`, + inspectConfig: { + infoTypes: infoTypes, + customInfoTypes: customInfoTypes, + minLikelihood: minLikelihood, + includeQuote: includeQuote, + limits: { + maxFindingsPerRequest: maxFindings, + }, + }, + item: item, + }; + + console.log(request.inspectConfig.infoTypes); + console.log(Array.isArray(request.inspectConfig.infoTypes)); + + // Run request + const [response] = await dlp.inspectContent(request); + const findings = response.result.findings; + if (findings.length > 0) { + console.log('Findings:'); + findings.forEach(finding => { + if (includeQuote) { + console.log(`\tQuote: ${finding.quote}`); + } + console.log(`\tInfo type: ${finding.infoType.name}`); + console.log(`\tLikelihood: ${finding.likelihood}`); + }); + } else { + console.log('No findings.'); + } + } + inspectString(); + // [END dlp_inspect_string] +} + +main(...process.argv.slice(2)); +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); + +function transformCLI(infoTypes, customInfoTypes) { + infoTypes = infoTypes + ? infoTypes.split(',').map(type => { + return {name: type}; + }) + : undefined; + + if (customInfoTypes) { + customInfoTypes = customInfoTypes.includes(',') + ? customInfoTypes.split(',').map((dict, idx) => { + return { + infoType: {name: 'CUSTOM_DICT_'.concat(idx.toString())}, + dictionary: {wordList: {words: dict.split(',')}}, + }; + }) + : customInfoTypes.split(',').map((rgx, idx) => { + return { + infoType: {name: 'CUSTOM_REGEX_'.concat(idx.toString())}, + regex: {pattern: rgx}, + }; + }); + } + + return [infoTypes, customInfoTypes]; +} diff --git a/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/kAnonymityAnalysis.js b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/kAnonymityAnalysis.js new file mode 100644 index 000000000..b604c0499 --- /dev/null +++ b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/kAnonymityAnalysis.js @@ -0,0 +1,165 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// 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. + +// sample-metadata: +// title: kAnonymity Analysis +// description: Computes the k-anonymity of a column set in a Google BigQuery table +// usage: node kAnonymityAnalysis.js my-project tableProjectId datasetId tableId topicId subscriptionId quasiIds + +function main( + projectId, + tableProjectId, + datasetId, + tableId, + topicId, + subscriptionId, + quasiIds +) { + quasiIds = transformCLI(quasiIds); + + // [START dlp_k_anonymity] + // Import the Google Cloud client libraries + const DLP = require('@google-cloud/dlp'); + const {PubSub} = require('@google-cloud/pubsub'); + + // Instantiates clients + const dlp = new DLP.DlpServiceClient(); + const pubsub = new PubSub(); + + // The project ID to run the API call under + // const projectId = 'my-project'; + + // The project ID the table is stored under + // This may or (for public datasets) may not equal the calling project ID + // const tableProjectId = 'my-project'; + + // The ID of the dataset to inspect, e.g. 'my_dataset' + // const datasetId = 'my_dataset'; + + // The ID of the table to inspect, e.g. 'my_table' + // const tableId = 'my_table'; + + // The name of the Pub/Sub topic to notify once the job completes + // TODO(developer): create a Pub/Sub topic to use for this + // const topicId = 'MY-PUBSUB-TOPIC' + + // The name of the Pub/Sub subscription to use when listening for job + // completion notifications + // TODO(developer): create a Pub/Sub subscription to use for this + // const subscriptionId = 'MY-PUBSUB-SUBSCRIPTION' + + // A set of columns that form a composite key ('quasi-identifiers') + // const quasiIds = [{ name: 'age' }, { name: 'city' }]; + async function kAnonymityAnalysis() { + const sourceTable = { + projectId: tableProjectId, + datasetId: datasetId, + tableId: tableId, + }; + // Construct request for creating a risk analysis job + + const request = { + parent: `projects/${projectId}/locations/global`, + riskJob: { + privacyMetric: { + kAnonymityConfig: { + quasiIds: quasiIds, + }, + }, + sourceTable: sourceTable, + actions: [ + { + pubSub: { + topic: `projects/${projectId}/topics/${topicId}`, + }, + }, + ], + }, + }; + + // Create helper function for unpacking values + const getValue = obj => obj[Object.keys(obj)[0]]; + + // Run risk analysis job + const [topicResponse] = await pubsub.topic(topicId).get(); + const subscription = await topicResponse.subscription(subscriptionId); + const [jobsResponse] = await dlp.createDlpJob(request); + const jobName = jobsResponse.name; + // Watch the Pub/Sub topic until the DLP job finishes + await new Promise((resolve, reject) => { + const messageHandler = message => { + if (message.attributes && message.attributes.DlpJobName === jobName) { + message.ack(); + subscription.removeListener('message', messageHandler); + subscription.removeListener('error', errorHandler); + resolve(jobName); + } else { + message.nack(); + } + }; + + const errorHandler = err => { + subscription.removeListener('message', messageHandler); + subscription.removeListener('error', errorHandler); + reject(err); + }; + + subscription.on('message', messageHandler); + subscription.on('error', errorHandler); + }); + setTimeout(() => { + console.log(' Waiting for DLP job to fully complete'); + }, 500); + const [job] = await dlp.getDlpJob({name: jobName}); + const histogramBuckets = + job.riskDetails.kAnonymityResult.equivalenceClassHistogramBuckets; + + histogramBuckets.forEach((histogramBucket, histogramBucketIdx) => { + console.log(`Bucket ${histogramBucketIdx}:`); + console.log( + ` Bucket size range: [${histogramBucket.equivalenceClassSizeLowerBound}, ${histogramBucket.equivalenceClassSizeUpperBound}]` + ); + + histogramBucket.bucketValues.forEach(valueBucket => { + const quasiIdValues = valueBucket.quasiIdsValues + .map(getValue) + .join(', '); + console.log(` Quasi-ID values: {${quasiIdValues}}`); + console.log(` Class size: ${valueBucket.equivalenceClassSize}`); + }); + }); + } + kAnonymityAnalysis(); + // [END dlp_k_anonymity] +} + +main(...process.argv.slice(2)); +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); + +function transformCLI(quasiIds) { + quasiIds = quasiIds + ? quasiIds.split(',').map((name, idx) => { + return { + name: name, + infoType: { + name: idx, + }, + }; + }) + : undefined; + return quasiIds; +} diff --git a/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/kMapEstimationAnalysis.js b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/kMapEstimationAnalysis.js new file mode 100644 index 000000000..204350d27 --- /dev/null +++ b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/kMapEstimationAnalysis.js @@ -0,0 +1,179 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// 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. + +// sample-metadata: +// title: kMap Estimation Analysis +// description: Computes the k-map risk estimation of a column set in a Google BigQuery table. +// usage: node kMapEstimationAnalysis.js my-project tableProjectId datasetId tableId topicId subscriptionId regionCode quasiIds + +function main( + projectId, + tableProjectId, + datasetId, + tableId, + topicId, + subscriptionId, + regionCode, + quasiIds, + infoTypes +) { + quasiIds = transformCLI(quasiIds, infoTypes); + + // [START dlp_k_map] + // Import the Google Cloud client libraries + const DLP = require('@google-cloud/dlp'); + const {PubSub} = require('@google-cloud/pubsub'); + + // Instantiates clients + const dlp = new DLP.DlpServiceClient(); + const pubsub = new PubSub(); + + // The project ID to run the API call under + // const projectId = 'my-project'; + + // The project ID the table is stored under + // This may or (for public datasets) may not equal the calling project ID + // const tableProjectId = 'my-project'; + + // The ID of the dataset to inspect, e.g. 'my_dataset' + // const datasetId = 'my_dataset'; + + // The ID of the table to inspect, e.g. 'my_table' + // const tableId = 'my_table'; + + // The name of the Pub/Sub topic to notify once the job completes + // TODO(developer): create a Pub/Sub topic to use for this + // const topicId = 'MY-PUBSUB-TOPIC' + + // The name of the Pub/Sub subscription to use when listening for job + // completion notifications + // TODO(developer): create a Pub/Sub subscription to use for this + // const subscriptionId = 'MY-PUBSUB-SUBSCRIPTION' + + // The ISO 3166-1 region code that the data is representative of + // Can be omitted if using a region-specific infoType (such as US_ZIP_5) + // const regionCode = 'USA'; + + // A set of columns that form a composite key ('quasi-identifiers'), and + // optionally their reidentification distributions + // const quasiIds = [{ field: { name: 'age' }, infoType: { name: 'AGE' }}]; + async function kMapEstimationAnalysis() { + const sourceTable = { + projectId: tableProjectId, + datasetId: datasetId, + tableId: tableId, + }; + + // Construct request for creating a risk analysis job + const request = { + parent: `projects/${projectId}/locations/global`, + riskJob: { + privacyMetric: { + kMapEstimationConfig: { + quasiIds: quasiIds, + regionCode: regionCode, + }, + }, + sourceTable: sourceTable, + actions: [ + { + pubSub: { + topic: `projects/${projectId}/topics/${topicId}`, + }, + }, + ], + }, + }; + // Create helper function for unpacking values + const getValue = obj => obj[Object.keys(obj)[0]]; + + // Run risk analysis job + const [topicResponse] = await pubsub.topic(topicId).get(); + const subscription = await topicResponse.subscription(subscriptionId); + const [jobsResponse] = await dlp.createDlpJob(request); + const jobName = jobsResponse.name; + + // Watch the Pub/Sub topic until the DLP job finishes + await new Promise((resolve, reject) => { + const messageHandler = message => { + if (message.attributes && message.attributes.DlpJobName === jobName) { + message.ack(); + subscription.removeListener('message', messageHandler); + subscription.removeListener('error', errorHandler); + resolve(jobName); + } else { + message.nack(); + } + }; + + const errorHandler = err => { + subscription.removeListener('message', messageHandler); + subscription.removeListener('error', errorHandler); + reject(err); + }; + + subscription.on('message', messageHandler); + subscription.on('error', errorHandler); + }); + setTimeout(() => { + console.log(' Waiting for DLP job to fully complete'); + }, 500); + const [job] = await dlp.getDlpJob({name: jobName}); + + const histogramBuckets = + job.riskDetails.kMapEstimationResult.kMapEstimationHistogram; + + histogramBuckets.forEach((histogramBucket, histogramBucketIdx) => { + console.log(`Bucket ${histogramBucketIdx}:`); + console.log( + ` Anonymity range: [${histogramBucket.minAnonymity}, ${histogramBucket.maxAnonymity}]` + ); + console.log(` Size: ${histogramBucket.bucketSize}`); + histogramBucket.bucketValues.forEach(valueBucket => { + const values = valueBucket.quasiIdsValues.map(value => getValue(value)); + console.log(` Values: ${values.join(' ')}`); + console.log( + ` Estimated k-map anonymity: ${valueBucket.estimatedAnonymity}` + ); + }); + }); + } + + kMapEstimationAnalysis(); + // [END dlp_k_map] +} +main(...process.argv.slice(2)); +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); + +function transformCLI(quasiIds, infoTypes) { + infoTypes = infoTypes ? infoTypes.split(',') : null; + + quasiIds = quasiIds + ? quasiIds.split(',').map((name, index) => { + return { + field: { + name: name, + }, + infoType: { + name: infoTypes[index], + }, + }; + }) + : undefined; + + return quasiIds; +} diff --git a/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/lDiversityAnalysis.js b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/lDiversityAnalysis.js new file mode 100644 index 000000000..7ca245d2d --- /dev/null +++ b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/lDiversityAnalysis.js @@ -0,0 +1,180 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// 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. + +// sample-metadata: +// title: l Diversity Analysis +// description: Computes the l-diversity of a column set in a Google BigQuery table. +// usage: node lDiversityAnalysis.js my-project tableProjectId datasetId tableId topicId subscriptionId sensitiveAttribute quasiIds + +function main( + projectId, + tableProjectId, + datasetId, + tableId, + topicId, + subscriptionId, + sensitiveAttribute, + quasiIds +) { + quasiIds = transformCLI(quasiIds); + // [START dlp_l_diversity] + // Import the Google Cloud client libraries + const DLP = require('@google-cloud/dlp'); + const {PubSub} = require('@google-cloud/pubsub'); + + // Instantiates clients + const dlp = new DLP.DlpServiceClient(); + const pubsub = new PubSub(); + + // The project ID to run the API call under + // const projectId = 'my-project'; + + // The project ID the table is stored under + // This may or (for public datasets) may not equal the calling project ID + // const tableProjectId = 'my-project'; + + // The ID of the dataset to inspect, e.g. 'my_dataset' + // const datasetId = 'my_dataset'; + + // The ID of the table to inspect, e.g. 'my_table' + // const tableId = 'my_table'; + + // The name of the Pub/Sub topic to notify once the job completes + // TODO(developer): create a Pub/Sub topic to use for this + // const topicId = 'MY-PUBSUB-TOPIC' + + // The name of the Pub/Sub subscription to use when listening for job + // completion notifications + // TODO(developer): create a Pub/Sub subscription to use for this + // const subscriptionId = 'MY-PUBSUB-SUBSCRIPTION' + + // The column to measure l-diversity relative to, e.g. 'firstName' + // const sensitiveAttribute = 'name'; + + // A set of columns that form a composite key ('quasi-identifiers') + // const quasiIds = [{ name: 'age' }, { name: 'city' }]; + + async function lDiversityAnalysis() { + const sourceTable = { + projectId: tableProjectId, + datasetId: datasetId, + tableId: tableId, + }; + + // Construct request for creating a risk analysis job + const request = { + parent: `projects/${projectId}/locations/global`, + riskJob: { + privacyMetric: { + lDiversityConfig: { + quasiIds: quasiIds, + sensitiveAttribute: { + name: sensitiveAttribute, + }, + }, + }, + sourceTable: sourceTable, + actions: [ + { + pubSub: { + topic: `projects/${projectId}/topics/${topicId}`, + }, + }, + ], + }, + }; + + // Create helper function for unpacking values + const getValue = obj => obj[Object.keys(obj)[0]]; + + // Run risk analysis job + const [topicResponse] = await pubsub.topic(topicId).get(); + const subscription = await topicResponse.subscription(subscriptionId); + const [jobsResponse] = await dlp.createDlpJob(request); + const jobName = jobsResponse.name; + // Watch the Pub/Sub topic until the DLP job finishes + await new Promise((resolve, reject) => { + const messageHandler = message => { + if (message.attributes && message.attributes.DlpJobName === jobName) { + message.ack(); + subscription.removeListener('message', messageHandler); + subscription.removeListener('error', errorHandler); + resolve(jobName); + } else { + message.nack(); + } + }; + + const errorHandler = err => { + subscription.removeListener('message', messageHandler); + subscription.removeListener('error', errorHandler); + reject(err); + }; + + subscription.on('message', messageHandler); + subscription.on('error', errorHandler); + }); + setTimeout(() => { + console.log(' Waiting for DLP job to fully complete'); + }, 500); + const [job] = await dlp.getDlpJob({name: jobName}); + const histogramBuckets = + job.riskDetails.lDiversityResult.sensitiveValueFrequencyHistogramBuckets; + + histogramBuckets.forEach((histogramBucket, histogramBucketIdx) => { + console.log(`Bucket ${histogramBucketIdx}:`); + + console.log( + `Bucket size range: [${histogramBucket.sensitiveValueFrequencyLowerBound}, ${histogramBucket.sensitiveValueFrequencyUpperBound}]` + ); + histogramBucket.bucketValues.forEach(valueBucket => { + const quasiIdValues = valueBucket.quasiIdsValues + .map(getValue) + .join(', '); + console.log(` Quasi-ID values: {${quasiIdValues}}`); + console.log(` Class size: ${valueBucket.equivalenceClassSize}`); + valueBucket.topSensitiveValues.forEach(valueObj => { + console.log( + ` Sensitive value ${getValue(valueObj.value)} occurs ${ + valueObj.count + } time(s).` + ); + }); + }); + }); + } + + lDiversityAnalysis(); + // [END dlp_l_diversity] +} + +main(...process.argv.slice(2)); +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); + +function transformCLI(quasiIds) { + quasiIds = quasiIds + ? quasiIds.split(',').map((name, idx) => { + return { + name: name, + infoType: { + name: idx, + }, + }; + }) + : undefined; + return quasiIds; +} diff --git a/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/listInspectTemplates.js b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/listInspectTemplates.js new file mode 100644 index 000000000..73e41aaeb --- /dev/null +++ b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/listInspectTemplates.js @@ -0,0 +1,74 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// 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. + +// sample-metadata: +// title: List Inspect Templates +// description: List DLP inspection configuration templates. +// usage: node listInspectTemplates.js my-project + +function main(projectId) { + // [START dlp_list_inspect_templates] + // Imports the Google Cloud Data Loss Prevention library + const DLP = require('@google-cloud/dlp'); + + // Instantiates a client + const dlp = new DLP.DlpServiceClient(); + + // The project ID to run the API call under + // const projectId = 'my-project'; + + // Helper function to pretty-print dates + const formatDate = date => { + const msSinceEpoch = parseInt(date.seconds, 10) * 1000; + return new Date(msSinceEpoch).toLocaleString('en-US'); + }; + + async function listInspectTemplates() { + // Construct template-listing request + const request = { + parent: `projects/${projectId}/locations/global`, + }; + + // Run template-deletion request + const [templates] = await dlp.listInspectTemplates(request); + + templates.forEach(template => { + console.log(`Template ${template.name}`); + if (template.displayName) { + console.log(` Display name: ${template.displayName}`); + } + + console.log(` Created: ${formatDate(template.createTime)}`); + console.log(` Updated: ${formatDate(template.updateTime)}`); + + const inspectConfig = template.inspectConfig; + const infoTypes = inspectConfig.infoTypes.map(x => x.name); + console.log(' InfoTypes:', infoTypes.join(' ')); + console.log(' Minimum likelihood:', inspectConfig.minLikelihood); + console.log(' Include quotes:', inspectConfig.includeQuote); + + const limits = inspectConfig.limits; + console.log(' Max findings per request:', limits.maxFindingsPerRequest); + }); + } + + listInspectTemplates(); + // [END dlp_list_inspect_templates] +} + +main(...process.argv.slice(2)); +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); diff --git a/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/listJobs.js b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/listJobs.js new file mode 100644 index 000000000..41469ed25 --- /dev/null +++ b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/listJobs.js @@ -0,0 +1,62 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// 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. + +'use strict'; + +// sample-metadata: +// title: List jobs +// description: List Data Loss Prevention API jobs corresponding to a given filter. +// usage: node listJobs.js my-project filter jobType + +function main(projectId, filter, jobType) { + // [START dlp_list_jobs] + // Imports the Google Cloud Data Loss Prevention library + const DLP = require('@google-cloud/dlp'); + + // Instantiates a client + const dlp = new DLP.DlpServiceClient(); + + // The project ID to run the API call under + // const projectId = 'my-project'; + + // The filter expression to use + // For more information and filter syntax, see https://cloud.google.com/dlp/docs/reference/rest/v2/projects.dlpJobs/list + // const filter = `state=DONE`; + + // The type of job to list (either 'INSPECT_JOB' or 'RISK_ANALYSIS_JOB') + // const jobType = 'INSPECT_JOB'; + async function listJobs() { + // Construct request for listing DLP scan jobs + const request = { + parent: `projects/${projectId}/locations/global`, + filter: filter, + type: jobType, + }; + + // Run job-listing request + const [jobs] = await dlp.listDlpJobs(request); + jobs.forEach(job => { + console.log(`Job ${job.name} status: ${job.state}`); + }); + } + + listJobs(); + // [END dlp_list_jobs] +} + +main(...process.argv.slice(2)); +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); diff --git a/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/listTriggers.js b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/listTriggers.js new file mode 100644 index 000000000..9d09c7772 --- /dev/null +++ b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/listTriggers.js @@ -0,0 +1,69 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// 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. + +'use strict'; + +// sample-metadata: +// title: List Triggers +// description: List Data Loss Prevention API job triggers. +// usage: node listTriggers.js my-project + +function main(projectId) { + // Imports the Google Cloud Data Loss Prevention library + const DLP = require('@google-cloud/dlp'); + + // Instantiates a client + const dlp = new DLP.DlpServiceClient(); + + // The project ID to run the API call under + // const projectId = 'my-project' + + async function listTriggers() { + // Construct trigger listing request + const request = { + parent: `projects/${projectId}/locations/global`, + }; + + // Helper function to pretty-print dates + const formatDate = date => { + const msSinceEpoch = parseInt(date.seconds, 10) * 1000; + return new Date(msSinceEpoch).toLocaleString('en-US'); + }; + + // Run trigger listing request + const [triggers] = await dlp.listJobTriggers(request); + triggers.forEach(trigger => { + // Log trigger details + console.log(`Trigger ${trigger.name}:`); + console.log(` Created: ${formatDate(trigger.createTime)}`); + console.log(` Updated: ${formatDate(trigger.updateTime)}`); + if (trigger.displayName) { + console.log(` Display Name: ${trigger.displayName}`); + } + if (trigger.description) { + console.log(` Description: ${trigger.description}`); + } + console.log(` Status: ${trigger.status}`); + console.log(` Error count: ${trigger.errors.length}`); + }); + } + + listTriggers(); +} + +main(...process.argv.slice(2)); +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); diff --git a/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/metadata.js b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/metadata.js new file mode 100644 index 000000000..02cf40466 --- /dev/null +++ b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/metadata.js @@ -0,0 +1,60 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// 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. + +'use strict'; +// sample-metadata: +// title: Metadata +// description: List the types of sensitive information the DLP API supports +// usage: node metadata.js my-project langaugeCode filter + +function main(projectId, languageCode, filter) { + // [START dlp_list_info_types] + // Imports the Google Cloud Data Loss Prevention library + const DLP = require('@google-cloud/dlp'); + + // Instantiates a client + const dlp = new DLP.DlpServiceClient(); + + // The project ID to run the API call under + // const projectId = 'my-project'; + + // The BCP-47 language code to use, e.g. 'en-US' + // const languageCode = 'en-US'; + + // The filter to use + // const filter = 'supported_by=INSPECT' + + async function listInfoTypes() { + const [response] = await dlp.listInfoTypes({ + languageCode: languageCode, + filter: filter, + }); + const infoTypes = response.infoTypes; + console.log('Info types:'); + infoTypes.forEach(infoType => { + console.log(`\t${infoType.name} (${infoType.displayName})`); + }); + } + + listInfoTypes(); + // [END dlp_list_info_types] +} + +module.exports.main = main; + +main(...process.argv.slice(2)); +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); diff --git a/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/numericalRiskAnalysis.js b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/numericalRiskAnalysis.js new file mode 100644 index 000000000..2e404c7ea --- /dev/null +++ b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/numericalRiskAnalysis.js @@ -0,0 +1,161 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// 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. + +'use strict'; + +// sample-metadata: +// title: Numerical Risk Analysis +// description: Computes risk metrics of a column of numbers in a Google BigQuery table. +// usage: node numericalRiskAnalysis.js my-project tableProjectId datasetId tableId columnName topicId subscriptionId + +function main( + projectId, + tableProjectId, + datasetId, + tableId, + columnName, + topicId, + subscriptionId +) { + // [START dlp_numerical_stats] + // Import the Google Cloud client libraries + const DLP = require('@google-cloud/dlp'); + const {PubSub} = require('@google-cloud/pubsub'); + + // Instantiates clients + const dlp = new DLP.DlpServiceClient(); + const pubsub = new PubSub(); + + // The project ID to run the API call under + // const projectId = 'my-project'; + + // The project ID the table is stored under + // This may or (for public datasets) may not equal the calling project ID + // const tableProjectId = 'my-project'; + + // The ID of the dataset to inspect, e.g. 'my_dataset' + // const datasetId = 'my_dataset'; + + // The ID of the table to inspect, e.g. 'my_table' + // const tableId = 'my_table'; + + // The name of the column to compute risk metrics for, e.g. 'age' + // Note that this column must be a numeric data type + // const columnName = 'firstName'; + + // The name of the Pub/Sub topic to notify once the job completes + // TODO(developer): create a Pub/Sub topic to use for this + // const topicId = 'MY-PUBSUB-TOPIC' + + // The name of the Pub/Sub subscription to use when listening for job + // completion notifications + // TODO(developer): create a Pub/Sub subscription to use for this + // const subscriptionId = 'MY-PUBSUB-SUBSCRIPTION' + + async function numericalRiskAnalysis() { + const sourceTable = { + projectId: tableProjectId, + datasetId: datasetId, + tableId: tableId, + }; + + // Construct request for creating a risk analysis job + const request = { + parent: `projects/${projectId}/locations/global`, + riskJob: { + privacyMetric: { + numericalStatsConfig: { + field: { + name: columnName, + }, + }, + }, + sourceTable: sourceTable, + actions: [ + { + pubSub: { + topic: `projects/${projectId}/topics/${topicId}`, + }, + }, + ], + }, + }; + + // Create helper function for unpacking values + const getValue = obj => obj[Object.keys(obj)[0]]; + + // Run risk analysis job + const [topicResponse] = await pubsub.topic(topicId).get(); + const subscription = await topicResponse.subscription(subscriptionId); + const [jobsResponse] = await dlp.createDlpJob(request); + const jobName = jobsResponse.name; + // Watch the Pub/Sub topic until the DLP job finishes + await new Promise((resolve, reject) => { + const messageHandler = message => { + if (message.attributes && message.attributes.DlpJobName === jobName) { + message.ack(); + subscription.removeListener('message', messageHandler); + subscription.removeListener('error', errorHandler); + resolve(jobName); + } else { + message.nack(); + } + }; + + const errorHandler = err => { + subscription.removeListener('message', messageHandler); + subscription.removeListener('error', errorHandler); + reject(err); + }; + + subscription.on('message', messageHandler); + subscription.on('error', errorHandler); + }); + setTimeout(() => { + console.log(' Waiting for DLP job to fully complete'); + }, 500); + const [job] = await dlp.getDlpJob({name: jobName}); + const results = job.riskDetails.numericalStatsResult; + + console.log( + `Value Range: [${getValue(results.minValue)}, ${getValue( + results.maxValue + )}]` + ); + + // Print unique quantile values + let tempValue = null; + results.quantileValues.forEach((result, percent) => { + const value = getValue(result); + + // Only print new values + if ( + tempValue !== value && + !(tempValue && tempValue.equals && tempValue.equals(value)) + ) { + console.log(`Value at ${percent}% quantile: ${value}`); + tempValue = value; + } + }); + } + + numericalRiskAnalysis(); + // [END dlp_numerical_stats] +} + +main(...process.argv.slice(2)); +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); diff --git a/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/package.json b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/package.json new file mode 100644 index 000000000..415a33c6b --- /dev/null +++ b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/package.json @@ -0,0 +1,30 @@ +{ + "name": "dlp-samples", + "description": "Code samples for Google Cloud Platform's Data Loss Prevention API", + "private": true, + "license": "Apache-2.0", + "author": "Google Inc.", + "repository": "googleapis/nodejs-dlp", + "files": [ + "*.js" + ], + "engines": { + "node": ">=8" + }, + "scripts": { + "test": "mocha system-test/*.test.js --timeout=600000" + }, + "dependencies": { + "@google-cloud/dlp": "^3.1.0", + "@google-cloud/pubsub": "^2.0.0", + "mime": "^2.3.1", + "yargs": "^16.0.0" + }, + "devDependencies": { + "chai": "^4.2.0", + "mocha": "^8.0.0", + "pixelmatch": "^5.0.0", + "pngjs": "^6.0.0", + "uuid": "^8.0.0" + } +} diff --git a/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/quickstart.js b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/quickstart.js new file mode 100644 index 000000000..0d60c0e43 --- /dev/null +++ b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/quickstart.js @@ -0,0 +1,91 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// 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. + +'use strict'; + +// sample-metadata: +// title: Quickstart +// description: Inspects and assesses a string. +// usage: node quickstart.js my-project + +function main(projectId) { + // Imports the Google Cloud Data Loss Prevention library + const DLP = require('@google-cloud/dlp'); + + // [START dlp_quickstart] + + // Instantiates a client + const dlp = new DLP.DlpServiceClient(); + + // The string to inspect + const string = 'Robert Frost'; + + // The project ID to run the API call under + // const projectId = 'my-project'; + + async function quickStart() { + // The minimum likelihood required before returning a match + const minLikelihood = 'LIKELIHOOD_UNSPECIFIED'; + + // The maximum number of findings to report (0 = server maximum) + const maxFindings = 0; + + // The infoTypes of information to match + const infoTypes = [{name: 'PERSON_NAME'}, {name: 'US_STATE'}]; + + // Whether to include the matching string + const includeQuote = true; + + // Construct item to inspect + const item = {value: string}; + + // Construct request + const request = { + parent: `projects/${projectId}/locations/global`, + inspectConfig: { + infoTypes: infoTypes, + minLikelihood: minLikelihood, + limits: { + maxFindingsPerRequest: maxFindings, + }, + includeQuote: includeQuote, + }, + item: item, + }; + + // Run request + const [response] = await dlp.inspectContent(request); + const findings = response.result.findings; + if (findings.length > 0) { + console.log('Findings:'); + findings.forEach(finding => { + if (includeQuote) { + console.log(`\tQuote: ${finding.quote}`); + } + console.log(`\tInfo type: ${finding.infoType.name}`); + console.log(`\tLikelihood: ${finding.likelihood}`); + }); + } else { + console.log('No findings.'); + } + } + quickStart(); + // [END dlp_quickstart] +} + +main(...process.argv.slice(2)); +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); diff --git a/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/redactImage.js b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/redactImage.js new file mode 100644 index 000000000..da893c2e8 --- /dev/null +++ b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/redactImage.js @@ -0,0 +1,96 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// 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. + +// sample-metadata: +// title: Redact Image +// description: Redact sensitive data from an image using the Data Loss Prevention API. +// usage: node redactImage.js my-project filepath minLikelihood infoTypes outputPath + +function main(projectId, filepath, minLikelihood, infoTypes, outputPath) { + infoTypes = transformCLI(infoTypes); + // [START dlp_redact_image] + // Imports the Google Cloud Data Loss Prevention library + const DLP = require('@google-cloud/dlp'); + + // Imports required Node.js libraries + const mime = require('mime'); + const fs = require('fs'); + + // Instantiates a client + const dlp = new DLP.DlpServiceClient(); + + // The project ID to run the API call under + // const projectId = 'my-project'; + + // The path to a local file to inspect. Can be a JPG or PNG image file. + // const filepath = 'path/to/image.png'; + + // The minimum likelihood required before redacting a match + // const minLikelihood = 'LIKELIHOOD_UNSPECIFIED'; + + // The infoTypes of information to redact + // const infoTypes = [{ name: 'EMAIL_ADDRESS' }, { name: 'PHONE_NUMBER' }]; + + // The local path to save the resulting image to. + // const outputPath = 'result.png'; + async function redactImage() { + const imageRedactionConfigs = infoTypes.map(infoType => { + return {infoType: infoType}; + }); + + // Load image + const fileTypeConstant = + ['image/jpeg', 'image/bmp', 'image/png', 'image/svg'].indexOf( + mime.getType(filepath) + ) + 1; + const fileBytes = Buffer.from(fs.readFileSync(filepath)).toString('base64'); + + // Construct image redaction request + const request = { + parent: `projects/${projectId}/locations/global`, + byteItem: { + type: fileTypeConstant, + data: fileBytes, + }, + inspectConfig: { + minLikelihood: minLikelihood, + infoTypes: infoTypes, + }, + imageRedactionConfigs: imageRedactionConfigs, + }; + + // Run image redaction request + const [response] = await dlp.redactImage(request); + const image = response.redactedImage; + fs.writeFileSync(outputPath, image); + console.log(`Saved image redaction results to path: ${outputPath}`); + } + redactImage(); + // [END dlp_redact_image] +} + +main(...process.argv.slice(2)); +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); + +function transformCLI(infoTypes) { + infoTypes = infoTypes + ? infoTypes.split(',').map(type => { + return {name: type}; + }) + : undefined; + return infoTypes; +} diff --git a/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/redactText.js b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/redactText.js new file mode 100644 index 000000000..305dcd44b --- /dev/null +++ b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/redactText.js @@ -0,0 +1,80 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// 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. + +// sample-metadata: +// title: Redact Text +// description: Redact sensitive data from text using the Data Loss Prevention API. +// usage: node redactText.js my-project string minLikelihood infoTypes + +function main(projectId, string, minLikelihood, infoTypes) { + infoTypes = transformCLI(infoTypes); + // [START dlp_redact_text] + // Imports the Google Cloud Data Loss Prevention library + const DLP = require('@google-cloud/dlp'); + + // Instantiates a client + const dlp = new DLP.DlpServiceClient(); + + // The project ID to run the API call under + // const projectId = 'my-project'; + + // Construct transformation config which replaces sensitive info with its info type. + // E.g., "Her email is xxx@example.com" => "Her email is [EMAIL_ADDRESS]" + const replaceWithInfoTypeTransformation = { + primitiveTransformation: { + replaceWithInfoTypeConfig: {}, + }, + }; + + async function redactText() { + // Construct redaction request + const request = { + parent: `projects/${projectId}/locations/global`, + item: { + value: string, + }, + deidentifyConfig: { + infoTypeTransformations: { + transformations: [replaceWithInfoTypeTransformation], + }, + }, + inspectConfig: { + minLikelihood: minLikelihood, + infoTypes: infoTypes, + }, + }; + + // Run string redaction + const [response] = await dlp.deidentifyContent(request); + const resultString = response.item.value; + console.log(`Redacted text: ${resultString}`); + } + redactText(); + // [END dlp_redact_text] +} + +main(...process.argv.slice(2)); +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); + +function transformCLI(infoTypes) { + infoTypes = infoTypes + ? infoTypes.split(',').map(type => { + return {name: type}; + }) + : undefined; + return infoTypes; +} diff --git a/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/reidentifyWithFpe.js b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/reidentifyWithFpe.js new file mode 100644 index 000000000..0fe8e1413 --- /dev/null +++ b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/reidentifyWithFpe.js @@ -0,0 +1,103 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// 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. + +'use strict'; + +// sample-metadata: +// title: Reidentify with FPE +// description: Reidentify sensitive data in a string using Format Preserving Encryption (FPE). +// usage: node reidentifyWithFpe.js my-project string alphabet surrogateType keyName wrappedKey + +function main(projectId, string, alphabet, surrogateType, keyName, wrappedKey) { + // [START dlp_reidentify_fpe] + // Imports the Google Cloud Data Loss Prevention library + const DLP = require('@google-cloud/dlp'); + + // Instantiates a client + const dlp = new DLP.DlpServiceClient(); + + // The project ID to run the API call under + // const projectId = 'my-project'; + + // The string to reidentify + // const string = 'My SSN is PHONE_TOKEN(9):#########'; + + // The set of characters to replace sensitive ones with + // For more information, see https://cloud.google.com/dlp/docs/reference/rest/v2/organizations.deidentifyTemplates#ffxcommonnativealphabet + // const alphabet = 'ALPHA_NUMERIC'; + + // The name of the Cloud KMS key used to encrypt ('wrap') the AES-256 key + // const keyName = 'projects/YOUR_GCLOUD_PROJECT/locations/YOUR_LOCATION/keyRings/YOUR_KEYRING_NAME/cryptoKeys/YOUR_KEY_NAME'; + + // The encrypted ('wrapped') AES-256 key to use + // This key should be encrypted using the Cloud KMS key specified above + // const wrappedKey = 'YOUR_ENCRYPTED_AES_256_KEY' + + // The name of the surrogate custom info type to use when reidentifying data + // const surrogateType = 'SOME_INFO_TYPE_DEID'; + + async function reidentifyWithFpe() { + // Construct deidentification request + const item = {value: string}; + const request = { + parent: `projects/${projectId}/locations/global`, + reidentifyConfig: { + infoTypeTransformations: { + transformations: [ + { + primitiveTransformation: { + cryptoReplaceFfxFpeConfig: { + cryptoKey: { + kmsWrapped: { + wrappedKey: wrappedKey, + cryptoKeyName: keyName, + }, + }, + commonAlphabet: alphabet, + surrogateInfoType: { + name: surrogateType, + }, + }, + }, + }, + ], + }, + }, + inspectConfig: { + customInfoTypes: [ + { + infoType: { + name: surrogateType, + }, + surrogateType: {}, + }, + ], + }, + item: item, + }; + + // Run reidentification request + const [response] = await dlp.reidentifyContent(request); + const reidentifiedItem = response.item; + console.log(reidentifiedItem.value); + } + reidentifyWithFpe(); + // [END dlp_reidentify_fpe] +} + +main(...process.argv.slice(2)); +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); diff --git a/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/resources/accounts.txt b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/resources/accounts.txt new file mode 100644 index 000000000..2763cd0ab --- /dev/null +++ b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/resources/accounts.txt @@ -0,0 +1 @@ +My credit card number is 1234 5678 9012 3456, and my CVV is 789. \ No newline at end of file diff --git a/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/resources/dates.csv b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/resources/dates.csv new file mode 100644 index 000000000..6a80d40a4 --- /dev/null +++ b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/resources/dates.csv @@ -0,0 +1,5 @@ +name,birth_date,register_date,credit_card +Ann,01/01/1980,07/21/1996,4532908762519852 +James,03/06/1988,04/09/2001,4301261899725540 +Dan,08/14/1945,11/15/2011,4620761856015295 +Laura,11/03/1992,01/04/2017,4564981067258901 diff --git a/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/resources/harmless.txt b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/resources/harmless.txt new file mode 100644 index 000000000..5666de37a --- /dev/null +++ b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/resources/harmless.txt @@ -0,0 +1 @@ +This file is mostly harmless. diff --git a/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/resources/test.png b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/resources/test.png new file mode 100644 index 0000000000000000000000000000000000000000..137e14cd2c25e9642f9f8747abb1061bf34f2167 GIT binary patch literal 31282 zcmd42cT`isxA;pBHFW7k>56obUIarYASxiegLD!g^d=y^H|ZTzIw(>Tkt$U{IwXMf z5;{c6i{E?Sy}!5KdjG$ym1NGGGc%ce&g|Lyvv*?jbk!(GnMrYQa40m?RbODgx3TXW zVj}G45Ix%i930Y*PAV#T8Y(KBdS34KPA+yhIO;JOnShsRgZKJ3|8|`|(|RA8J|5tX zTQ;LtW~fi15vpgcPW({vtq-674mYZQjAt!O*2rJAYmJB+`WvdY z7J1btiKfS!9s>KQvex_3g642=LI&9zh zvE3~+ij|88Y?VZ$@&eyy=kXmrw$V?Hj~s-kI2gfmV+&U$oRm(AWq}ri*ur5J3CT$wN_V;q=`n#iXJb%Ad zrbRjvZ``H>=I3?lqWauC>uE!f1q*L`Ayn6LmK!@6NTIMdx)( zSAsBG0U4FJ;|D)7Vj-15*@GN{^K-|cz?WgXn5g*BtCy}qaQw?~B`VSqB{?IUR!$0A zTu~$P%!uhCD!K?AOO`5v0Jwr4Sz@S75n&$QCY;BE0vch0#N7g@APE@>4-rxX%CPsO z6P&Nq$$mv^-)DJG_)WP>PlOJ)S4BhbA@{qoaWBWmFUd2MGxVOk1l*A4zZ+FHEMnhc zm%vF-axWSa!85Rw`Haf~&lDj$e;0w|hbiQdI`sH?;C4{ghB_mAJj4TmT|_J4e^Cr* zMm#F9?@G^u$6iI1TTeGs7&!>Cute+h3iaKy{@DPi*O`r*HJQD? z7r+Yahcm6Rdg8XiOl91dY6-rQ&AfN+KSL6E+Q8(@>D^;}d!tvSFIfZc2LoeeSk}dCzIxacH#Zg_bNX; zQy&Z_uWQCWC{KHx_E4RoEUqlN?5nMqarB-lkdJKOYMu00|Jd#r=Zf}ujP&lDs6O$)vxqg55GqGfbOI>lPpRm2`A< zR9@p<$z6F}tsOsIw|GcJPfpiCFGc!@{v)04!$o~YgEE0PkD?yh3uN-Mzvw8D`uxsN zOz-&BssKIzzJW}ggu04jn}j=a)|bpLg+3{gs{Iob+b;exo!Ps@JsobAD3+t(t(B5Ezu zE%?pl^V9QY^J_9uG7~b+P-buT?Nq37n?Re1w=7ictoiiWY3ADOJ~ zoe&WbiT6*8+{dj&T&k=GB!|U6KMizLed6_WNb;lTj(8taQ@nV*FOzRBocEm9iT4%n zQ*A2)fI--{&?LL~=bW^h@y~sGiPF7`lX5d1%YpE4D{7a9zLMV6jPe4z@IUrHb$`0Q zK7XC_`fm-p(IaEPo4N+KreGTz>z*4@ip zJ-44CN+V{A5mrC+$3zD`E7#cW<>|{jD9^mb*!lqdjEaX}tV(Q4qh6z4s`W7ekc51W=Gde5))cjvsYf*gT%y774~q!O z?qzwH!i-?AE+>h1-~XY`PiY>AOo@K5qUQHJ10?@mGBy+B`(vP=yKkyD@cmiLU&8b#Cgo58|NF|F%j`=Qs@l%O8kBN-=y2&zXA$B)}*Fu;>rYoFoF<=an zBgv)9h4OEc@ueH|FlpKI9cr`x@rQhcSfJ%#CVpIjhQUmC#<9+t#zP(-op&;)QY0># zkDIgb+?C6b-u_CMf>TPSVkUq%ub7QEOB1oNhB05H=67;bbfaU)H^Q&0Du;RNns4a$2t|BzXVrubuem?%IYo246Oo=4V@6 z37HA62qSi{XQmm3=wrzaKl>VYZvuuX!#Ua{XWeESP$txMTW=d)dHNk?(YOsxbJT=< zzVx)V8S1Nj5&df^*CY2`uA95him6G3QKq3}E03+#$?J{ZB{hd%9xwWoFV+T*`TX+P zKEI7c#{OpWmzCVVe3A3o@6*tykDis7Q3_ebz197lrTvC>tE9eyRr$gT((~n-^E$U$ z(JFzJ=!LBI!|mJbn|#HF;E%FJK1G-CnTYQZH!ajH3_Gm5JHTp=hc(f=)?B=+QAxx7MbtyzH2{PiNpx>`6wNp|PP!t+c6gms?2Zw&7ok+&0#>5AIUSj{814 zZo4^?kcyeki$$Hn+$_v&(2Uzi=QKnXbG{@SE+559*0z%eRi9*znpr%qJDAW zHx_OF-aNir@LJ_4DZeh>JpXcXZEUyHvs9(7w~lW)z2j9-06KrEJ+Yy_q5rUHIVpr6 zQ-x_br`thH(gj8R?y>8hz8UGqhYfMY~ATe8T7CTt|z$# zzDQ1fn0NFpThJ%Bf@AT3LYNVqrW8>~BWM%7aZ6^eC^}t%SI5=`J8Enzj4r;{- zb9Hfp$iUDfdVNfC#Rg3t-Z_( zRnUJo#~#T)aD+lVWQ2u%eSL*|#f99x9E3%srKN>M#DvAf9%HX~4DoY=TEQN>LAd^_ zlmELPRXd1{my-w7$=!|fU%yt??%q)O2M_)Y^gplv`ki(#r~e(v4f5a9!cI{5-x*<1 zArayK=^NWr?q98po)gT@#Yol3)y@rq9YaA(TwLxy*Z;rH{O^eWM@!@XZ7KTX|IzaQ zIP>2v<%IuD;QyG=e@W{sV!ErNT=DGt9>2752>l8bTW{`OF)3UjypZ>ZLQlFoN zc=?sx{^sTY`O(+>w}bIg2Y3e3dUe*ZbY|+%A}zct?ygua5-_=$K5m-iF3;h?-=5|y z!M+}nNwod7>#Sxw&f@?EB-xrift-39RV53u$frtVH= z9lz8(pdRz_??uSn#kRJC%%r;c&h47wt<4tViJaz5$aQ~6;AtTr{XTMP8^1f^v#oEw zTOK{stginP<=m&}v}L4a5{8^RPH|`Lsm#3T+H(sBAE`B_F)7TLU;f%};r4B?FsvHM z(}f;%9|)_{l#}YI8D2n@skF`#x$hB}hut;5)cs0zeRoZ8ay1qb?0?==C@;TjJjR^( zJO$LxnjJpsmD!|i^2H_Ri`$Zn*&6dq_U(4zt&{&`?y`jZX)$HKn`fMfHl^Qy3Mh0Y z`n#Dpda=sGDok{Iz$lN~sLx&^(DCkT$ltGK^&TGqyHx5Z6+obzh!3m>z|cQsh;Sej zTx3;Frc#gW}!Pj7{w55 z#fk|<7oP2A#eCsblk%mI&eCM z?S#bh_gx%VG&5b9?&J^s#!fLa-NA51GhrBl49NGlz58#w)q1?j5xMFST^{7)-6r-y zz|FlsWk)a*8_?%7dVi7ZEs@Vw5>Y?A$?~ZT3Q@cwNAhFgI^KK~H~Nd;FZfp<*YHen z*|l;S$|G^g1ILj+vAoMjA*E6k`_=)%4Kj<%@29i<3O;R@y}}Ahx949u1Q0%OiaFf7Y`oCJ4tX4v>Avmz*`QZBwWGl0G7izT3b@CnqPN)`s1ByK-^;#P;eNy zxnRdiYA_mn-UL4MpJ@k$2JhK$gRqHkKeMo~C8C^MXr#{N^~TTdwmc!JW0W`?OqGM>uF(t8&-;qHS{QdU%XH zc%LQkIIWP?zk;EyDB_XD)sW3SRS*o~Rq z&ZrCgBhtJL&N1l}$Z*P~W>G+lTrFdt|D~h zhQcT4Tv?Ujftblc_BkENmr|h$ji1F?$!+j8sfMocqI8tRIf- z{N)%$(QjWqr>skY{oo=J^tXMPB@TBklR~|tB`PH3c98f;N`w)W6X=w~WPTJ|yb@=&XFd6CEa;%Y zPvroTx5mmPTIBEs^U<*Lt$z>8vWVGnYF1vYZ|80T0aoI-Cj}QB6JQS9^DxRlOMk3T zW${QTvs!=f^!@t5j^C+~ZE~-P43joYFkltUCW#7Dm^FV^Rv4@5D0#vca?FQcNd0SA z`9Vd1vk6Ib0y0YNyVWC!_;aX`mBO|Ln7Q=P-?X`5GIyxp72Nrr@0*8O5$UB~!K2>= zOvMwONbJ0XfauB)Ol1#@?gPZxLAAc(MP2aOC$)v&H707mUyeD|LGpLC3o%obAe@z* z*I$`O;fS$-u2pagQhCN=9?|+SSf4m3oQ9zLGOk++M8j1F$J0`jOq=afhhXoC ze;!#y52a!tL4lI=PE{!=c@ zy(>&KJ)r~?5O(D|XoM}rHwM0UMLzN0DK!%-6+iyfu#S6+T>>+36$L_9f4*o{-idD-z_thU-YW4daYYSa&s?_A)+FFfr@@s#!wFL6< zYjMMpQ95_phaVK~$!(FmD5YUcwBs6SBLjM1)>N#&f1(bDxSDbEaAo1(#C6%)t4fMf z@oUO-ZtJ+qpnp*;G1Jf7n>0m?%?+w`pQOf8e;&e0F*Piuhj`m@?3!TzPRVxiPVwFoDb+|B`f1{Ra( zWBMDOR|fWyaLNvQwmlq%dGxq)V5@IUtAY_$JUmqq_&MiBt>PWujT$@K9+_=x_Oyys zX=|WJ*FwdQJxu3*y?onmEu*!aN8SP8WmMv9|2kMyS8c#T&Z=cuU3!@=+)nD{EWnl7 zRbfXH_2hw?gUhavMlS{o|8U^RoQOikvl`2?mmn^Y1Bk&RWqW01-Aly$@N8rDcY*bY zIs#Dix^gsRUXWUw^%tVLMS8M@CP+p|v{wz+-8OPY85D>Dhu3dF5-2ggQ7q>Ebf;S= z>_+|kXCrPxDs91Fky*%D?Q~j0NrLWH-^-UKjSN(AI;1m zevz`>5`66mk_q!QuiLj2(29^K9WbwO{cRbqK6sM)fDv)u2th(B^_fqq*ttEQl|7zX zTWO%8LJg#-Y5$%UEayqUZv!Xn<9GJwPi7=ka4zGMLy?qr3lwn%V|Pb!Nnfef>S?S+ zxFU){PHqWV+BpRN5btkv7GU}_Jby~f>R4QzltOKR8MXtIg1xrY*c%y!2|ott#&CqK zBI9WY`6dm+z%iq(SEKT>>v^NXeuG*Sn{u1dHc-iVQo1i`_3?|aFttYII6>fPdY%c3 z6q;0Fo945mhi$J-p!6q5pW$^hg!9d{mAhCqp#RHOm5N%vGsceVOJ?Xmf8lIYUABIa zVHiO7bTE3x50B(PNg>32DoBlns8}$zJg=hRLyI(j_A@$Cuc}Hthv%Hz&TLjQj1<^< z2(6UW@onv41A!Q9r2*HLj4T$G^ntGiNJmc>1~_h5U!!}J4Z{;7a(q(rd$uT_^3e=f z#$T^zb)dg9pmbD?l%XOTcscT;S(a2zimtijzLf&jvEqbQW)^8V(b7Rrix0ZcV7h+T|Si#3bXP2A4y$hN`i*R;z z*#Up8fQ-UQ!T!$;!WcqMRUJ-ok{*a4;j-*#ZbsJwb=BV^c%WzX2N`rzo{qcLa;Q06 zplhp6#D3F;ubnNQoy<#Fc3)wEG00DEFjF4A0T8e_BOHCe_l}a1+C!aWVF1Xia&8=;^3yxRr1w!{Cxp+)*Y!>9FgbkYix&7ppf0&ze|U~Yn$)bQ$qo)o8P|zn5EiR z<9TmMHPN<8xxhT>Z~8N-VT&dV?fpP;O0J5~CfP^Qs5lqsgZm!P^O68r1PIhEYx06| zVorrEJ6e9v$|fl^aYCH!=}kJp=aV@{x4Zj4Rw)D4a#=Cq_Zjk2aTD;SjoUF8Ji8ues&jXd^i``a6pobD(Cu)PdQJ647oYcs7C^;|EfLIlJ$^b>#lfx2RV9%3^ z329BYMC?0CC|+}%R8hNHTaXP6f+u4L+TBv|FiD)B-Q_F zUgm{ZkQHW~iR>P3*0XrCQ9{f=E%37gK{8OO83CrrPmmdw`vJ|rC(S~-sXJT<63Uf# zAUC)4IK@o7<(Dg*^D@nLQVw@3T$ejfpAk39phGS0Sa{j5O$g=chN@?9*hcSaIG272 zm|a+0>dK!REYmIp(kePSID9#@Fv|0a&*eD&dz%|Ww|bW}tfg$SbRFU?l6QB9s2Xh{ zY*!q+jO}u6Ub;|JKj+(@#B-DJ9_L%3q6@U)y1O97;H9|!RTPITt!Wq^HbJuS_x-ok zHHnAx#FV(wk&~~{)la{_CWvfI!Hu;K6fOFDX<$*2&_C^WD4`Sr^cm~A{;pVmymBt- zb!u&Rw-sY{WX+u*EO*>)hiLbuaTnUc!l^AkPU~-b8lsT$%Q4fNIAvD>{?-I42KV@W zV>E5ukr~{LKp4Q4aH>|f_wzQ~!0E?}ulj_Ffk4GQwvemOn274@m5{z~$)k5=r*%s= zih87IusNmK^~sx@w?R~n7l-3Fl}FvMGJc*7hyk!lC%Z!Jtofj_r(Ai>NvT`CmS3zwEN;E%m;Rn^)RkcP0Z2IJCXT(baX5f0!4H1uh}i?Y?)NCPfdC zlHXysVfza!x98jc00uO7VbPvIKt*%|Bs1P6Icopi(1TG~@w_2P2MhZQ`tLrS75-$= zc^bPC2!4>6S9tc>A>mHsppfKm^eD?8Ul!g&v1h+?K>d_KTPl-$idTcE>)R6_+?lo{ zvFn-bi_XKKNi~JzlZbZUJYW zL7hA4JwGhWGiyZ^%F-7MoRkX(Ih_h01z|nmykT3UJeK9jn_aIma5SH_uz$U0h}JPb zLuXSP%YL^Zv2Mn79@1p+`LjLSS^Z!c32*nuSUJb|ySlm}N1qZQdO6y@tl!_v8HHBh z0@QM2j_~;AK~`Rld}JLkee|R49zg#;xP>c>BMdDjOQ_z%F})7U>YB}68mK_yUQ#@? zMV1~QihL*H%%KCSik6h`8nIwW$;v|+dOXMnt_xV&<=sunQAEukRopr z4w(BHg&3!YK5d^Hsn|6;^j~|!5t$;LkdScEu_zgXbW3~BdeX{=g zYuog!sST`EnjyavOGDW-v^aCDibB>{R$$}&Bt<5_AUZw)xW8vWB+B4>xSHVC~$MT5_I#tC|Op~qNO z8~DrwNhav(0_HHpg0QIC?z0+q3NsUhqZ}-Tqv)YDz1yj~-5KY=T>mgGVj&OS^bK|( z=Y?6A5Ok_yVhua2{jpwX$Ze%7 zNMTcVtIJp_DsmljM^^| z8D?(7M>&Fsk-el8~^3`*NL6(U0J>KCwKaXJVVmO_?Vp z1G@ELZL&o_TVc2@K0CEO->3A<+5F@~3U~YfO)d9N->uw)!GND8%U%Q&90u+rJSoTt zV*aY5&&cP$xG1l-^IWgue{iKJV9{7^ZP31RlI3Pya8OZ*NRr>MO`nS`r!3B`AjPlX zHcN7YY?Bqt@5z6tT{N8WhF_IMEmb)|E>B4@vQ(sT-^1ANr*(6&qvnPlAq9X)Yfd_= z>A^Tk;*IFu8pquwHTf0_rJv+Kb(;CL!>({Q*4Be22*{h(IUUijk5q8#fG zX$pOQw@&*RI$Ny!f(E%IhYq7;l_cOJ8PD*MV^jaLK;4jNqdDxyI3%G{KLiIoiluP@ za&brJKGLxOy2(HKxo@idcv_kfA+bG#T>t}JJB+xxQV;3Is%;IFD-yhptmeH@WEQY^ zm`}zLw~8ivo}(*jk-Q`+GzwqH8!xtaz>eHd7NF!Si?+xY}vz@|k0l#qZr9mwKh z6vL0|322;PV;|=vW0Ds8c2)^S@NF~UKBgsbaCQsg0s8+|D}Ge^39nMsWk{PZHNy^I zHkni{6@()B{6NEeQ)Y%qDgl~FWzPjm=jI0azivi_bv1wTt*MGmTf`K(pW9fXSOP&b zenSQYVnh^8e1WX|*sb~DiHK08NGA%1HGM5JQd>p3LV#^eFa4Q5-H_E6L6F|$8)XeA z@+j#AxB0 zW{7!dJ%Me_hIvS?BVL7)B~$_x8PS!ebGFqhbF>W(!ED7*ij_L6rgjiim#wM;)~t`B z%?DzHp~yb`PUK{ekAA=M(Lvrp-Zqh|KLnX?^Y=0JA!^c4>4T4^mt_mn!huGqC70T5+*jv`aYPtf`mhBBv632(8w}vr z1+yK{A0uTQw1GjaEryhJZ9u7UKCUGa9|sNfkTxpYL9Jk~5)EFtU!E}p3eK;?bfPgO zk4YMEyG1^hP*QeSwp1IW_R0r8s@(>d&urz+&r^J16;o1={}+(!f4MC7<1}|AO58N} ztV2Rwygpv1n2r<4KMleo{4m6b(q4H;H_-ad*Hu+)zeUTTfAY;!PoE6F%!D#s5pP;*w9@z~)T_Z9m6?WPt` z;K_y@hkwQE3cj>rb>?!W&$+h}uAAF4TFVB?75m+I`J&mA=(^1($}k|zYCRo6NN0p8 z7I)SHgKIFz>ExAk69-(i;PtPHro8=NxnOyaoSNfKf@jkKs< zZt<@_LVYl2d5lP&^QUDaRPf&Wu0YdDoeJEV0p8486Y+X{w&8h8GNTYp!5vo9jnfmi zY91zQHn!0CB>U7-!`^0OgCW4kR|_bq=ngGqp^%;}PynX?Gv30(y+D1|+Hrn4PW{$e z=16^*F{9ktQ#QzcJ&`4A5+jBw;>bny)r+nG=)<$G_I`ch1)?AYL=VXq;oxx5pfBfC z1dg)k{cKq#KsDT*PW(H`>-Kt@L{-kv&xID);9)$Dz3Hxg5VD8ToQ-~FerSUxA+h*?MWM*mGZ(d6&X6a!U?d@eOx=v&wV@v53ugNo4 zdW5OqlR}Ty!aUftJHo2VY&?K+no@xXQ1)4Sp(VGqg4Ko{-DA%E$7^hm2~SU^=@LoK#@KOu6NJQ-ck35Ui^=Gu}?BHz|l%~36#p$?+BNhI|RoyLQe>v zCBs!vow-5~4_Cee#6Wq#Ms906VtiyHGvpL}coFO_^|aqwH5y0W`iK^1F^^Oc9U0A4 z-P7$X#>m9OAJfxA5&Y@IAbEsJ<_N!i;>UYZUtJOhLIr<*&gs%pU@(sY`qN0Wp|uD; z8XiNfVV%n8@-l~d3!m>2x=t?qVPbsjiCHfLBLF6a)a*~CW+NpHO887uQ0O&KmBf<- zAm)CfF|;*$8{YqU*m0Lna**ZFMb%u{Cm_e`g%A5KyE#yCO z?T>bCc(KqTvdQmmSj;)%I}JCjVCTzm?pkx|Is4D1M1!yS028Z8id z=H2=_dUUi`f+@*zF!g#K<={SpPN86v;&wa3G%6Zh5Xvm4)vOeto~a#|(RMUYe%Mo< zIXD7ve1H*bE_*)@4^8UYvcOgGQ69FKIL`IELDPa!bD#gE31R&MViFzB*h)PjC^!t6 zCm;$ab3Cg#lXJ6QLIGTJ$mJM`YKv&if(W-g``MnRMy|}-n(c3u2wUmFG^6A#h z7B@*qW^{r;#R8#9DVOc>$uLW&r#N^N5?D>f7o6_V=DTGQ5{RM?23$j=g03=}CPtXZ zmm>@S7IGydpdgI5#e|_r;LfHwE`VVXplRI3%Oj;stfhnig@tPpd2bY@gB>UNG;t0K z@II%=5!uTNsO0|6-e8*M2WNhsGVI<-z-#2dzc+kT&hf#~sSaMF08myF-G4VDzd07l z6e~D?Y5-q1vU6x&9r3QW-DvgrBT^e7z=@pZ`_S@f%+E}VS2{x+CNVHbWG{7Do^~ew z&SUhCVP#Sm8bQd%TFX{@6cZwKR-AOYX&#n!fL_gUb@pj1=ei~UWU^ip#p?ruTen5z zMoHTS1vLyofp)Zo2||GH0>c%q-JDJrWRsGdEf z8x^4wecB~SD&ha3&4}+!+?y!}bxp0o^xpe#X*nHpWJK!)sIPYj?=PE{9*#!=CLc*L zKlwBRpm1d(kz=-$!oiHj1Bm1py)l34ZP!kvd0JTkVBn-e&`~u<5TbOn#UEN)Iw~)> zUV|LNO7)6eHGXef$=OTh9)KAny%|G@;&O?lp83+=4Yw(3LveJ@Fk&7Q= zxY73sC{%xfGZoc8+9KPtsl=i!btJMWy#&XNB0tjys9}iJF1_e3YIVL18g|~!%d`V6 zL_AVQjB`s8$al8c6z9{(6fIfj+kAe5)OLCzYq@U8jLsvv{n3sOdGK!F4FRo_0I8r| zj>4Uz68B#DHbgp7E0Iv#l=KoE1<)ojC_#NXOB%J84_V+(3Y0w)Winba zokRBMD}|21kkh;3hYY%|2_GysI|wMdo$KR~tfsD`n$1jkP1R$#C_S0A6f1-P<}KH! zrY=Lj|+PTj@ zP5@_m`6mawhv}-x>2-<48&UdM%BB&U9-24&$uHneWWq*g9u+U^1;F{Gw;thjp=7Vk zX14e-#hbywKNv3aQW1m?q;B%06C$kE5Z}Z$$DVXx5OLs(i5*i555mMQ!m4wRZ&5!x z@uCCd1Yn+rdU=TE6H?uLeP%&9$Jcd0xo?}#3)c-P`+_D%&t$5EuYosgP^!bFezl;* zXv&1xuA^dw;3+~d@XT_$p;%_-EJ286HL?@&=wPsdLk?;X<9>m91<>_;-A(?m_;)}51*3lhj{5m1&@JX;qM{#j0pj3x* z6<3H5=y7I4=7R%1M0wO~eWHXlI#DJbux@!fs*su8q$+m?MAIma0#E6oXoG-r1c33( z5{;6XJA1{Tc!r-=*f80#)Z%k9E6P?C#{pX!qdcX*VMVMG=FtEp!Z|4Z9*zAvIW(}2@xs`l#;Wsp;@|5l+hQAx!#|;f_sh$ z(h}a&m5iC{AC}mzdocc!LcY74=&KEoO09tnj z%N6)^SI%+@+ldVB&ibmPi-N=CzTqO3mXaz|Ey~1m5o_j6u%*O}pz6wDJC@ z>9*5Jb@ce9o{G1|%w^eUwwf!AuJ3*@0$NOVYodG(`F}->blGzj5ym7uz+D|=1M~Tf zW{rEm_rHOYE~v93^b%(>g157Row&ovl{A>%r7rfAmg!x~5Ty3sliusW=4~E*QK`rH z=>W~Re50`WVMqcjo><^X!#TnG8jTK+prSym$1sEUJiK7zNZU(;MF?@7hO32~1G%F4 z+ENQ%A^b%89(c)dreC}}Ja-wT29T$G9}o|G+@4WTc0UQ+MEn}_WpHDg1$?VsMS6pZ z>AJZUOeyXi9Dw{-rB*;69QE-^^Rf??cVlQ0Z_y9ua4mMyz=}7IAUCbLzO`o*NeX9c zT3xt0;Nbgc3F=m)ne2FP=_>O9nomn&O*DA54&t#STM2LlN<9527$i7u@W_1E51aii zT~Kvolr@n?>j6#tVQgy^b!<`vxJS@Jt-WzEY%hExR@;9RuL=@#mk+JPvfN=$IU@C9 zkVRrn1ApO*MF*S~kn9?puitK0_TC3l+PUxMT=M`>;xaiB!}2fUZZC$pv8Yxli%w;Qzl(dj@r zkXq7)08IkJPx&ID`>-3$U+Yumu*~`?jZm04v!AXp%fhM0`}Lg``6gnpK)IoW7sj@P z0r*kDVLDSM4^ei4yrQ`D_}v}gP%j-U0iQ_AqQ5M2NIxnN9zH@h9H2;jVMi4lAqf^} zQYO}knf^|Q)S6<4?dQYR*`$!n#Ik~>Gk%WE;|bm|{h`LZIegMCDNZgjksKorzgEn@ z49U~?YI4>yYwqE5os{|{i!HrSo^puC3N1}C!FldS;RO;r%GQg$N@}iXWW1$-c)2LB z{~{^@(7NPYY8mYudyf&1Nggau5~|sEY{bc2@y?zwHNK7^xDjk59>oAx3lL8u((O?*w@mJ8bYL3W|wzmf4s>M^}s3{QQ> zk3DZe+)jvSoF&J3nyLJnU{L}HN`8P%libXnQ_qHOIG=iyM$epvZ9;YW!V`3*WzBe+ zWSXcQl&Q$S4IuaQkiW)og>GK05L0yH3AHoCL-KzE*(n0yf8K9m!t7Xh0+L0SS4}Lu zLVXkXL~5tQCcEM6#21r=*x01sOQ3D69rS)x3Vg1TJ|Q~~@gat@HbD}bt!WlLNleUz z%P0C+@&QCUvWHP$$N6lKq$9^NR&@OBmhTibiFM31Npa*lxCMx0p{OsccfD- zsgvgerN?FR*tg%Cg0!0G2;D)H&M!&}s3!zLtEGJBoZ?HUrTEB^z}l%{L}|7M2F-jM zKQI3hudZmR!KU9aD_JYnF~ShN0Vh)wS=~Gxg^nzuh%5h9X|y;TnWj->u4xhsKF-@xCb)2jLKHOTYci8f11 zNxg9t3C|%YaJ3bEz~n_h^yGyoRq&BAQGcG={`{15#H$X&x6MB|f@`MfM|)%P5@s*q z2AIKWFBc6pGxzNA;;yZ6MKy6}R5EEG4Q+0CB!k@Mlhj9)apT-^f}!d9|q3eTG>6Y4;i zWLEa^?;L^XlSq4OYillSh~vodpzSJfTa5@zmj<^dwEBvh}q?XFEhA38DeVMbUhxsY^i}vJo@( zIhJn^0=|Nr28r3xnPkgh5@!;>h*$H*_TU$;b5`u9P*qT%DmasmEV`VlgN#bNG&KdA zPUk55IVIqxo^v{peVIp5j*PJopOCBJ@}3AFiqiEb&aq~mx!lamZWP|AIe@LIr<5rJ z*<|RE6tHNsC$VxEe8D14(nR>B9G@f#jO-1wh#cMK5Dw3E`@aH|H*3h@#RI$2uj%}~ z?|tu)K)~9l!zY^b%~yQ1%xunV1`amn-z5aNEiw3uWgh*(4bT2Ahfr)r$B=6U;|$C( zdlr?_w=XggJhj3lT{<0KDC)y`P@f#(Raoj!P%Jq0FsS>H6w+R{!iJ_Ro)#tX;ccoL0-Wyato zWiUGy(?j2j<#hO~ppBNodGLr2!K2@6{op;keDfe1&1#*3rE~cmq zC~$n2##)Aw1OQwDT_4V11Qe7usAToNs4j>&3Op1J){#NUf#=@#XFxc?G6Ei~Sxong zn)=d#Kr!WHEVyJ^BdH)WQlab9Ar1~lK04s^Mn3)FLZ1^#LY#tL1gJKBa(F-a2r?f7 zm)O86ewUWKY>r82)_?RbXv|iOG^T~3~NPCNm#kPq-BJ)vieVc%ggtN=N#rSI|i= ze7c9*%#V!j!Ah{;ntiATFHtzqVhh)Huo7L1dlh=ae#Q4nWZWy{`YxL0$p0nVE<62KzLoqa`7Gw%O$m+~6Moi9OGYMY|38+GGZ=-=jFbZe12$!7&CBAV-b%Zy%THGtzD3_B_f}nL!ihrD>-60SJh+qN7fP%${%lYuZ znJ8Ss5I`Im4`?bzN+S&?$3LF*RTx4&ycrQ)GJ;_+xEmQbgHg_?kKg2k!@5UFM>cP) zfdx_1uW-ZZFol=x$yl2+StSd6m@boF_9u5gCy^VRphS!8`jFkUPVloSIDA(mG@B)4 zGg6{~XT^2J&nY(0Bns<)>ri?U*x>98;~#E%fWx&QpgTM#Q+UD96~4*uUSIwAgM0kZ zE!!xr@d}3nPDMXQL8otY(085OuC=Roz)>69S|=Nv%&gGcxk#=?Pzf5JVBx^yMwDGt zFzrx`NQ~i!ZUJigW!=Yl5+{5M4*1O=o>3bB=K$4@r4i>E(FLffW; zKr}_;_!Pq#C_Y7kr!>m6meH27@NNAfaIIxHoq(ihnbAmT3WK)_rJG`M2J~cpXE2;s zP;hcafd}7$&Dwg= z0^PD@%SaUJ6}(x~8hJSz-3VNxJN@FHv*l<4SAr!kUDGoel&`P|bt+U#k+qs=sM4#~kRp}}E29ylEHQe8N*gR?>|FwPz1ASXT~ zUP;z+fxg&}o$~`Y^oM^vZEgFy91@`nLU{toTF}{A5yLh$2*Mcpa5N4_a9PKcPv$;i zF;$brDOVwcex_WUP@o$DWM!Kta5F4r*ac)HQ$_U*j4uVvfawvZ9u_^?*TgLRR@4&ZEj!6#9G6)=7(F%7k@MS~9L zV*6re-cLDfK?n2#hk!SQ7RYev6K|c>H;U0S{>(z?LIPwz{1p)NfFH7PeDc9XPjG2- z&o}4=|9Ihd_73!uXw1wcUAh2U5`a&ELvioO4%Lmu#UJ&OTyXlq1t+=OAkF~5(Oh&R^)yMX_V1mzjM^dmcqE66IhBkQ6hChdZiMK39C_%|-^jljvi5UaF1+ySE;>QEpcvUzm`kYg}QHXv7 zs8LNJ8<+|{=@Tz@j*W)skbymnf@Ba(VChl7;>XNHVnmmGl7i%FZN)K7HEnj$FL{l& z`s2&&$H>Y)>DQUg*)2ZV!`c)6CqD6sLw>l~+6V|v&>Hnzrx!B1SJIKXWLGC)+B*;s zPk6!;22QgM`wMtRN68n$ImdxUbO!L^58Mv=QuKG~5`@_y-Q-P0O zb7pYXk9LpIPH7xP;K1#ga#A$>ITT(Q!}`W_)rd)n@VR<8761S(j!8s8R5}}-1-geZ zjFLH)5yj6e9-lK3fW?m=yp1e)WUS~*B7UzVM}|T}G6I7JKJXuZcog`i-x7v)eFcIu zdSo=s0*godaZtrt-S3O^W?BmdylJPtmL}U5qa)$H@9BWf z>_#eqihIhzW5gi*a2i5Up~P5b>*WA`?&*jRtb$Oy#F74>Ks$t4E*g_|rA zir=JdM{H;oW284NW`FqU8SnET(YCfoq?RB89NrF_K@tqz!K>(tuE7Sc@M#Mw}Z`{r)cKmK^4^@RnXUvTHgl*yenec*r}KDfl_; zoW}ZVedlzwM{kaIeZNzCk3UEJkprFXPc7bgKR6xX6of`_(`|bXrta3EHa9I%qVF6( z*eKHW3jVyQ*i0K7w*Ez>}9f5ZQ z6I}9;BOGAh1}`A?RF=^S*Piwz4$mD=u(y?T){Ib3lm_|_> zW(wQWSG>^MMwK7xnv{@)R@OU#`r7uTaVR%MqwBr^ji&Q5n(KMge}9(bMaqGeQBT^ES&D=4vnAgh4CUElgRf4>s^dS2=?$5q{_J>vzvc}bq?8)@e-dwVS~(ONc(DlnZ}8wVeq z_}r83g8xCzn<7XPfWUL1GtM$ctIw%DXYlCl?!J0-f<3h~_qN}9dU%=Fx$eF*n0T&T z5GmcS$FnEC^vecw-1Uog_xs{J=h5{tx<3dVJX`-dw?QWmOE}@yUR`p|>w?>#=cPe9 zSIBw>W2X8PC?nNRTiH%sLb+z_&TxUPF5FE&s&_xfXBW;BIDQWBBQqs?j@Oem9#Hr5 zMGB2ixYbpUhj>G$dhnI%z(rr1sgU0b@nCx7=_>0MCA{H`z6}Y#P5PbHZ?nPa12#A` zU8_^#aoo)A=_J1Nnd1xB9EWy=9LwtGbl20=MqWDhvxJ8-{7eE@uygw8#1meWx&B7Q z9{%X>Q0C{Z_t1Th&2*4X0LMT4ex?$@{r;Pb+PY51dnB|E0KRwLH$#XSj5x|L-6v3I z^{#Uq_Z+$U`8^WdckO8%N^!v9&|je#_ewZzk$d;j<8uPjkMlbgFGc(IkjLqQ*T*&9 zx~>ggd^i*^_|UGdKF-0p#se77uX-BEn?kPVFwp=X9#7GDWYTMR)$0S+J=#im)X$G# zofU2ABYeRp+W=hr;gC64F!1Q-zH8^MYm0`&=-FzIhS6LdQ5vO3xWLWnZEv3ac129y=7I+v} z50AsOKH7tqrHzKQTlY~?u&&|P2Yw@xtnTR$#`koH#}NgnpvAAE&zw)N))_gAHZ&DH z!K)4ZdA;j&fCv2G*>kKOepjdHn?9VQqs=3JzMbQFS#s4D9KEVT2Vb?j29E~*!8_xj zXBYYM3;K%{vDg5fm3NCr#0W2Qy3kSZ8-Z?3m^mn+nmG5^p z{qcqG_=ii;H(kIBMjf5$7k}aH9={%GG-cMGtmFijZPY7phATPA0gj&3rThALL{cC4 z=K8X%@DRKg3-nRo@pDCX4u^iO9iHx@ua*O&>QFK8aegxz_cJJ=)rh` z2(26@Ex@nf7mgen??wg=@0v4tW>X0Ve94Kn!>H|H`JO9=&j1$YhY=RGJ;_9UZT$-dICd+pe+kgQ% zn|C+8cI7P#4x>)i_Blsye0WQS<9Pqm+Q?&D-uSR_lOv@9yz1}J#_M}s8Bm}wgh2DvK%X`7I+SeApaRRQMqUZ> zN|nNZ9I?+edYRX#$XUE7?thaUe)!?TfqVtR_mMc0K=C-1Ab{69lN^RKY3B$=G)}?r zO`8kKvOm5muJzloNEXK*fBbm->#mCrnt8d`2xM*PMRfm5#_lj)Z3vM8yhPw@eG-q4 zg8Ba>*1`I7LbwI!F^kvO%oGGBo!Qle*V*hrU~pUoUC)U6w55O|uYl#yl8ASD1*0zm zN(^)%vEbFWZp~Dzb^Y55n>oJXXq1-_z_Jzlv6T^2qLDzoT<%pY$pz0|tTs}UNge$u zpq zt>K~zvI=0c3Gd!|AzaY3LO7od%W$sQ@x16r4sc*_e?S&2&q~ z^}QQ!&Vvyc0>_u|1TN!)wZX%w))rGEFV4#R98|WqRx^!eaQHcx;56luk#lBF!|~AI zWTsLauWX;#XsW9o{jS3WcFUG6BhlChapZ__;+336X`>m(r3Zbyl*}=;8&$oz?^CA= z{DPBCIHS*i!Y$B^o)V8F1EwT`Uk5l}te^ur#D|ecz|f~JNN|2h$21nK>9n6iOu6AB z16xQaMoF^}Yj#szeaR&Wkx8QS^*hNx@YA=1q8%(8_^0Plq;+6HaGs-Rr|KIgim?Fh~-D(sa?N zWJ9Hm5F1z=TOhS2M;p8^610Phe^X<;3R0uJ5-&z#iHA(_DzNZF7aW^jwb3g*&@DZf zKEj{8+Kp&C7bBP?V7hI6Yiew{U&RI!?sUGATn=#WdjYYwXqm=aKQ1iNXbz{L}swV}&l%~0r& z91e8g28&Mx{(=BL8*_?wedxrpL83uNVEFWlAoM%2X}7>(AAt(i^cEeTgkd8aOlAoZ z09ul(rHnPYe(2!cnck8E@9~Ns3Btc~uv9TZ)2)PIbIB|KZ8Huy(*F=<^=Gd%urx?1 zloL|4cj_32p`1CE5rOk^0vVFQI6EiKsGORS1z7>h!0vNk?cg}3jgTFSDWR-xJ;mt+ zC!D5s)@b^<$A>b{_~FDKdIg_)hhhY@VdZ1mMt4(p!O7uG`%EJ_IU1amW8+cMfCD}9 zI^&z%uIUCWJn95&`iMRmwb2ipuIrDt;OJFf>w43FYdmmdQUs|DEBxC`g4f8swip%3 zXGHUTB(o2jLi8qB1gD@j^|sq?y)95p(IrM3J#>IxdM!Bdj6X8tPka2DUK_2A{*r{5 zkY#`o-R!~!mBh6wr(Od~gOr0>2bxw{KXN_>bI9&Syn=xN8P1`d12Uj%&IV55WSmXC zcJ&3cwVIL5+Q~<;I0_iS!tkco`ZYoc2=q*c@l!yeqmRByytsD=K+{}wjV?B2;B{|` z50@Y;5G4vUjS_eVCwbYG6%63fP%oj_nZ>IBu^~f7{Y+iSL7(YKANP$;_~88T3qZWO zHf1HB0>;e7ri|qS+GZF=F!ThA#A!`vgUp)LtYPP3YHahy6c>;74UBN;ndX}U`v+9o z?Lpu%xzKg3fTv%)JNs$MmlS=$&~#Z+C$Gdz_Gz|tVKZZoCj z06P|=o2d{-k+o%KyNfct-|HAho6&|57?MM9FqyaP>mD3qaZHAHNC*s>BccJ9KoJb4 zZfI5nyO9bG^z=iM;|N6Ut`*m4aBhz09$x(vL9PvtWHoI=(>?sAf!0>q?A+3W1c6_> zwUUdqv?8F*0yw&#Z5pBRYR#q(y$DP+9Y#e-fKJFQN#WCG5j@tJg06r^&rHBiDT2#R zyOGjQEdox+8oC63}G~ib6oMX7>wAOHb zI^fvqIFeD$$G!0;Q1sEpk?o+G8v0_KulP$|c(jJbKUu(Ez?_ev3?cMbR&5DOe1kv zJK`0-eiJq2C96@`gD6H8_1A0J{ZSup{7e5%V=ax!zoQujl%lN zrZWG|#Z=2^z~R9&n7}q&PihI0C9Conn>XOxFm_TPY!H-Xg z+zz)Vjy%-DHe{M7%zjNW#zx1156;5bz!-t?p}%_5RD5zC^%b!32+lQHrlC#CIU~Fr z9sl~1)3t&&{N!-m)Ll}*o1m5i;MPw)8LU|aIS18-zH5E(0GE2YK^qTX8ojj9F*rrL zHZsGZ#B|jr@_#;;~r9;>80`HtB{o!RhFl0p!U*t_cYzI$$!O>GX zg?Cj>nFf{yDTQ}%U=HZ$+L^K$3LK*;t{F_bvp(QBnmTam6!+k@&ii!jtju9X#o`Zq${dE% zaY#iw8aXECQwNuN*TIBibX@lbj53E=#t#^TH(YZXVCMJn9ISSA^JL^c{b^UiQNQlL-MZ($;glTUP8PO-;if;z`$DJ9qJ7vK0J3%)lKzZ;>q zZ!fwwg3^AbvEJEaUmG~@EjV3g@cEQ(KeM^v=;=U7)<&n2n)7BUc!}TawfvQ>RAReaX{i!A0KmGhfG&d9J6;z%O32 zA^zB`y3Pl)t#)UFgJvWpAg5!*Mn*yCVC;gl5vBY3<;c5J)PY)0-t^);m$Ol7Gs!kj zob!N;Z}Obh%0UyPIbi1u>0Uqo{*4M*=t}*a)R>Bn?hqF!~MD zLm%|uF~(%>ypeqEjuyMHmtsfS103vwU%&m%+jocKV5>hUg4Az-o`&(*oM(MKlIDpf z#qW=Pdhj5Iw`)AHrqb_oqY1i<8j5Kjymdl9*Wp3vg21` zkwAAYo`&*i7(wcLNuI(wm~FK?8|*Pin||yL!A8~Zj*pzrCtU=l$NoIxch|+ckw#3$ z_V}JRGkm+@T8A%XZ**E8eD#~Iglmt%ECA0AZOWcxA3z7epF;>OJI$3zN$O>=9#`|Uihyvg zq*Q&ohHH+~XeB%9N7aKGg&0g3$BB zo{E9PqkOLQ_tioV)}MIdiQ@|fjPFYZXc%piA78G^=-Rt?jj#0ukK}SDgEM}O()y&| zVBk~do(!B$AN4(SfIeL)+QHGKDW4~$oP(#2bb=n(bc;?U`f%$DZhe_QMU?FNInZ!U z9(~=z6-@N-s*e8WC3t-l_vqkBAGWA?>4J^mv`o>*!AAL}eq>dTcd+W{(|LWF+rzc8 z3~t^pJ;3Qe+Zi8hLk1<;wdv!W&e&3-RLH4cI#>@&4zSwcKKXVXvTPflEAWNzZI$o$TJs1`YZ{moD^&TmOnW1q@!i$~aHR>hUr!bVHBn$F)K? zzEI%}EB;F-WK-a#OMUU@9bIw2HjK@8y4GWq=DumaC( zY-H%|9z05_W)&QP6R`uF?C73O6*$mM!B;7XpqS(7!^?ZQHi(dWDXjOu2neSa6l>@$DUDFXCG-OA=ntXA^p~CY4^gtx)y2EYER0$lhIpyGsI(VsVme3#nG^}V-@9vjoAH_l2v>J@a@XVLJNFB!eLEE zIT%>4b5W>+;5m^OmIbC!)K?IE0)-=aU5eoao@pkd9=dpyjRWEV-xM!s;ip&uNqO)I z0N)3;i-;GmZP^9Ir^MrZOH*nIMWR5TQ=w169LcL^J{>|g;01%1!|97d87U+y{UixS z)WGRqul#v!P@qXPMo|fZp6CD{l8yIM zy|ZfeW35hhxXA3CS&kzC@C`v_c|j+F%i5n0xF5NKrEchi8zQh)S41Tf* zDDS{(lT^sAFTdi4W=hUr=wE-IdLg?+h+pyu9`Z^2=+j+}zCK7LJjn)cV0~G_JJf>0 zYks|sr=MiU)^uzsg&zBniNDen{b*-v`jouLzGacP@Bx+&keNS{kAF!NA8efMu;>msv%8&%eM|o&F z8)-P6pcf=%MM+41LB{}+0X(uk{^0{_q?aTZi}S(3nK|x}M;p^E>6x5=#8G}K*Gz}^CkGulI(UYmOI`P zHuAy&)>M{!WH##I$IJABQUZfh;?6IOih^B|Fp{Pl-%#GVb?ZoA>Lgmc32Glwpi6S_ zAqfjz`k}K%Q}Q;tk02#90Tf8BGh`}XWZ1IE1_aO!iF!&%fieb#%i>0qlx{s?gmU(g zDuEatbifS7 z03T)$Wao^@Wyay9Z~;tiwx9<(5y12#5b@8L0*Ql}-g9!nMtAxNX!-$54mdeUYbv(j z7^aJ+k!Buj39n$1WK1oM$VODb$7!@1JiAbSWdXqHFngq4JzVl0d zK|*)rW*xDqf2%4#h=JmaKhzYflETBBlc?_gB*D9p9k;Nped$ik1!QnbSfo*%eoJ9zM~=wm?RgM13C1K-IE=dK{t z34kmwQwT0Xt5Xo6Ac$iYGJ+Xt1q(+pd~+}dC)l|NYH$<`2jU9Hv8m%84oZWEA!SmI zNm;U)pHBn|rNDs>z6i+ajWkA9nMoD{!`SFDJjGFvYxD@NO#n$G3Z)7xSyZ5+ZNx%% zZISH-7I@Q3dNBG*G-W>cz^KQMX&cAJC!^9Cou&&spp7r}iaJFfBOP9iMEK#jrc&_2 zkqnjxk`q1AwNVORbQLaVj$tOFO@GCRshn--xNstiip^$kEX!A4j!@Ff!q- z5sovUjeiGNys38&E{B(d=#1_Z{NYWz`tI5_%!RH(C>%O`uPt#u`INQMEpd%gr+_0*{j*UChHU&EpZcUHI>HNGrVlXib?C>QB@*}gNMicK zg|7Z{KGcZ?eCk7=aJyFU;a-2o;9mm(6&fLM0B+iWh(aj!Mm?|&0b|p}_kUy|S=kiM zh|6(oIthrFV~qO3i8eYEjt4)9m{KyP(a}^(a0!yZ@IpuhPYFSpctclxMgS-1ID?-Y zWLo?SKs1cJModLN({EExv`t~GZ>)87EF3Lx!_gy#0NaC z$?2?3AN-LiM^^8ivylr_KS8OGT|J$k4+oy(T^k%|!x0{J z;1sZM>WhE(^&1*Qq{5L+IRS810mLy0MhT{~j7`bv4E3#RY$i}Pc*M=Moe@qU@T!BW z67!fe8d__aGTPJ-;DV_QB7&i8p{^y22=nCu=S1Mn9J@2A*tK z!EK#la0W84j3*T@^1~!%$%f?m4$cSJRc(u&~g*@tV>H)a; zBS=l3%qj${=`=WUI+KTdbS_EJ6}he3tsB`0T|9zKXB+`O?Uon%H08yYz-51YnUXhZ zfJYlX`cRy6D)kOF4u8O;Qnf@T08{Jyr0_&hV0lPVq+9iaG~; z4y9|e8hzowlcdjY(L^Wz*Cwgk5b}@8BtC-#AH-Wr1$?s^6I+s}I(kLJ zQJr%!QXh4$6}tZR)wuocA5%c{aBCoIFd3S0IfL!!o!?n!LO@Z7UhHT$W=cv%8_)x+o+*qQuxu02=z6+Z=n zynajAdoIc7xjY@{#KF#z#e+XxtNN0Mu4Y9A%(Jv2$A;pR$y=he1#AXI=0lq z51!{Ys{pq58j3IIXH1ZJ-C~AUI3yi-K`t32nE-_&(8z~A{tAkOR*WR6O{Egpm?f!x zvmAZ!BfEp`$<80n>4W_0IClmAu|$!63Xl+ zA?=L$qJVKhBgqJmx9m}<=<2lsL)$Fy)1Q7A+G`6tt{iG+ z_1=xVUIDeahMxd{OLmD!M>OdT&eFJ+eG~~elHCq7nY`kWaO^{WD-A`|D!~c>Jlzx< zGl3mjvI=Hj3h+!Tnc{2a?H}Lx+sx*1MRNKp4!-fU{ORubDE0f9zN$%mJ}`6 zL~wad{#fs?I6<={H2c!Us{u2MT}KY&Fhxm~^e)Xi(E`EDLO;5wsH&`M2_kV74my#U zE%5gIC9ybweXRi4k^QU`H1L8?B?rsi>;&I3m#zvIyC{Ne?)QHsn5DOIHYBqmLw>V> zSygfIEgh=?uwIkkfxaSV_C#AyOMLqa0#E=e(DY$*Gdg>-7kLF2Ty_%&Y;0viHaKP- z@niNfD|=j!n0P2MW_SLS4EOu}prbJHB|Dh~6*B%*0QpxzW-~I9fzEu#$>+gEaXSO#1_!ipp`8@23Cja9vcG-t5 zG&CfnBFl&TAdbk}?9IMn#$!cE&URq5mp??t5f~DbK{3%7Q(&vo4CEiV1sP*-hRRsA zqZp+%hI1`IR7DDNfB<1+IC$uDPhpi`rSnhGW=H)5*IfHTh1rliHmAI778vAESvA3k zF2~|a1_o)f%S_B6l8Z6T`eehOOpGK!I1`>eMr2$wuu5%LS-;t&S1pQyKJu~&SPsw+ z-=T0BV^a>*$BuL(FI@J*UsZK4IOu1IOc(mX@n(rw`kx=4iV|mp&d# z=tBnZp5GnhBOBWMC{YywW0J3B9=XuNCt1i>0!un_!eL)Jpr^4L8`IUyCU(fD;fKF* z_M;E`;4f*(m9O-piJozIY|lsT(V#22G%`ELq&R{hzq1BE8f?!#;)tC2hO8Pn#1%Tm z$Pm7`QVhsT2K@QKkYVgcQkNowcQ->j>A65$JY3GHv!RY2b@{aCY7&L!y2A2HB>BCO=YvhaO(Xl>^ zO}pvW7c5$mTni2jFnGCkt{wEdnP*i%Gn1(TrfJQTZ7nV#EH`@15K)3qqJW#m4JJVd zNNGZ6Os{dQ_bm}sL`i4q0|#yJDXhepJns!U+$qMDkuB&iugVX>_7 ztr`iMECm%_IfX9hfJsg=BnuuE`Xg19*MtbIgVwI%v?% zk$u6s))%exf4OnwnM)8$Lcwnd!q5b^iC{f$V~0W*YZ<`Vfhh%I6pXVm#>*gPUcy^? zc;3>y7nP*=YExm?6qSgcEi9YK>G_hZ4#kDiW*odU$!P<@bFya~%lT|KF;~Om8WOE%o^zrQ;y;@_*gErXY2A6!! z(Vy^SioS6)9B7$&37XM$28WjMcx#SbExE!5r~~#31J; zT$LfE7&bvTfKkwpP-X|aijoaYv$dT-@HKS8#{+J((ewOcHtl&&@`Ld#V+m~e?l8MX zCppL#t@zC|ctwhA^n?c?C~`Pi#511uiVGlk~zcyL(&UT`aJZ^j$o$<=7Uu au)u#F=Z}++E;=6o0000 cp.execSync(cmd, {encoding: 'utf-8'}); + +const harmfulString = 'My SSN is 372819127'; +const harmlessString = 'My favorite color is blue'; +const surrogateType = 'SSN_TOKEN'; +const csvFile = 'resources/dates.csv'; +const tempOutputFile = path.join(__dirname, 'temp.result.csv'); +const dateShiftAmount = 30; +const dateFields = 'birth_date,register_date'; + +const client = new DLP.DlpServiceClient(); +describe('deid', () => { + let projectId; + + before(async () => { + projectId = await client.getProjectId(); + }); + // deidentify_masking + it('should mask sensitive data in a string', () => { + const output = execSync( + `node deidentifyWithMask.js ${projectId} "${harmfulString}" x 5` + ); + assert.include(output, 'My SSN is xxxxx9127'); + }); + + it('should ignore insensitive data when masking a string', () => { + const output = execSync( + `node deidentifyWithMask.js ${projectId} "${harmlessString}"` + ); + assert.include(output, harmlessString); + }); + + it('should handle masking errors', () => { + let output; + try { + output = cp.execSync( + `node deidentifyWithMask.js ${projectId} "${harmfulString}" 'a' '-1'` + ); + } catch (err) { + output = err.message; + } + assert.include(output, 'INVALID_ARGUMENT'); + }); + + // deidentify_fpe + it('should handle FPE encryption errors', () => { + let output; + try { + output = execSync( + `node deidentifyWithFpe.js ${projectId} "${harmfulString}" '[0-9A-Za-z]' 'BAD_KEY_NAME' 'BAD_KEY_NAME'` + ); + } catch (err) { + output = err.message; + } + assert.include(output, 'invalid encoding'); + }); + + // reidentify_fpe + it('should handle FPE decryption errors', () => { + let output; + try { + output = execSync( + `node reidentifyWithFpe.js ${projectId} "${harmfulString}" '[0-9A-Za-z]' ${surrogateType} 'BAD_KEY_NAME' 'BAD_KEY_NAME NUMERIC'` + ); + } catch (err) { + output = err.message; + } + assert.include(output, 'invalid encoding'); + }); + + // deidentify_date_shift + it('should date-shift a CSV file', () => { + const outputCsvFile = 'dates.actual.csv'; + const output = execSync( + `node deidentifyWithDateShift.js ${projectId} "${csvFile}" "${outputCsvFile}" ${dateFields} ${dateShiftAmount} ${dateShiftAmount}` + ); + assert.include( + output, + `Successfully saved date-shift output to ${outputCsvFile}` + ); + assert.notInclude( + fs.readFileSync(outputCsvFile).toString(), + fs.readFileSync(csvFile).toString() + ); + }); + + it('should handle date-shift errors', () => { + let output; + try { + output = execSync( + `node deidentifyWithDateShift.js ${projectId} "${csvFile}" "${tempOutputFile}" ${dateShiftAmount} ${dateShiftAmount}` + ); + } catch (err) { + output = err.message; + } + assert.include(output, 'INVALID_ARGUMENT'); + }); +}); diff --git a/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/system-test/inspect.test.js b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/system-test/inspect.test.js new file mode 100644 index 000000000..608169e0a --- /dev/null +++ b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/system-test/inspect.test.js @@ -0,0 +1,282 @@ +// Copyright 2018 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// 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. + +'use strict'; + +const {assert} = require('chai'); +const {describe, it, before, after} = require('mocha'); +const cp = require('child_process'); +const {PubSub} = require('@google-cloud/pubsub'); +const pubsub = new PubSub(); +const uuid = require('uuid'); +const DLP = require('@google-cloud/dlp'); + +const bucket = 'nodejs-docs-samples-dlp'; +const dataProject = 'nodejs-docs-samples'; + +const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'}); + +const client = new DLP.DlpServiceClient(); +describe('inspect', () => { + let projectId; + + before(async () => { + projectId = await client.getProjectId(); + }); + let topic, subscription; + const topicName = `dlp-inspect-topic-${uuid.v4()}`; + const subscriptionName = `dlp-inspect-subscription-${uuid.v4()}`; + before(async () => { + [topic] = await pubsub.createTopic(topicName); + [subscription] = await topic.createSubscription(subscriptionName); + }); + + // Delete custom topic/subscription + after(async () => { + await subscription.delete(); + await topic.delete(); + }); + + // inspect_string + it('should inspect a string', () => { + const output = execSync( + `node inspectString.js ${projectId} "I'm Gary and my email is gary@example.com"` + ); + assert.match(output, /Info type: EMAIL_ADDRESS/); + }); + + it('should inspect a string with custom dictionary', () => { + const output = execSync( + `node inspectString.js ${projectId} "I'm Gary and my email is gary@example.com" 'LIKELIHOOD_UNSPECIFIED' '0' 'PHONE_NUMBER' "Gary,email"` + ); + assert.match(output, /Info type: CUSTOM_DICT_0/); + }); + + it('should inspect a string with custom regex', () => { + const output = execSync( + `node inspectString.js ${projectId} "I'm Gary and my email is gary@example.com" 'LIKELIHOOD_UNSPECIFIED' '0' 'PHONE_NUMBER' "gary@example\\.com"` + ); + assert.match(output, /Info type: CUSTOM_REGEX_0/); + }); + + it('should handle a string with no sensitive data', () => { + const output = execSync(`node inspectString.js ${projectId} string "foo"`); + assert.include(output, 'No findings.'); + }); + + it('should report string inspection handling errors', () => { + let output; + try { + output = execSync( + `node inspectString.js ${projectId} "I'm Gary and my email is gary@example.com" 'LIKELIHOOD_UNSPECIFIED' '0' BAD_TYPE` + ); + } catch (err) { + output = err.message; + } + assert.include(output, 'BAD_TYPE'); + }); + + // inspect_file + it('should inspect a local text file', () => { + const output = execSync( + `node inspectFile.js ${projectId} resources/test.txt` + ); + assert.match(output, /Info type: PHONE_NUMBER/); + assert.match(output, /Info type: EMAIL_ADDRESS/); + }); + + it('should inspect a local text file with custom dictionary', () => { + const output = execSync( + `node inspectFile.js ${projectId} resources/test.txt 'LIKELIHOOD_UNSPECIFIED' '0' 'PHONE_NUMBER' "Gary,email"` + ); + assert.match(output, /Info type: CUSTOM_DICT_0/); + }); + + it('should inspect a local text file with custom regex', () => { + const output = execSync( + `node inspectFile.js ${projectId} resources/test.txt 'LIKELIHOOD_UNSPECIFIED' '0' 'PHONE_NUMBER' "\\(\\d{3}\\) \\d{3}-\\d{4}"` + ); + assert.match(output, /Info type: CUSTOM_REGEX_0/); + }); + + it('should inspect a local image file', () => { + const output = execSync( + `node inspectFile.js ${projectId} resources/test.png` + ); + assert.match(output, /Info type: EMAIL_ADDRESS/); + }); + + it('should handle a local file with no sensitive data', () => { + const output = execSync( + `node inspectFile.js ${projectId} resources/harmless.txt` + ); + assert.match(output, /No findings/); + }); + + it('should report local file handling errors', () => { + let output; + try { + output = execSync( + `node inspectFile.js ${projectId} resources/harmless.txt 'LIKELIHOOD_UNSPECIFIED' '0' 'BAD_TYPE'` + ); + } catch (err) { + output = err.message; + } + assert.include(output, 'INVALID_ARGUMENT'); + }); + + // inspect_gcs_file_promise + it.skip('should inspect a GCS text file', () => { + const output = execSync( + `node inspectGCSFile.js ${projectId} ${bucket} test.txt ${topicName} ${subscriptionName}` + ); + assert.match(output, /Found \d instance\(s\) of infoType PHONE_NUMBER/); + assert.match(output, /Found \d instance\(s\) of infoType EMAIL_ADDRESS/); + }); + + it.skip('should inspect multiple GCS text files', () => { + const output = execSync( + `node inspectGCSFile.js ${projectId} ${bucket} "*.txt" ${topicName} ${subscriptionName}` + ); + assert.match(output, /Found \d instance\(s\) of infoType PHONE_NUMBER/); + assert.match(output, /Found \d instance\(s\) of infoType EMAIL_ADDRESS/); + }); + + it.skip('should handle a GCS file with no sensitive data', () => { + const output = execSync( + `node inspectGCSFile.js ${projectId} ${bucket} harmless.txt ${topicName} ${subscriptionName}` + ); + assert.match(output, /No findings/); + }); + + it('should report GCS file handling errors', () => { + let output; + try { + output = execSync( + `node inspectGCSFile.js ${projectId} ${bucket} harmless.txt ${topicName} ${subscriptionName} 'LIKELIHOOD_UNSPECIFIED' '0' 'BAD_TYPE'` + ); + } catch (err) { + output = err.message; + } + assert.include(output, 'INVALID_ARGUMENT'); + }); + + // inspect_datastore + it.skip('should inspect Datastore', () => { + const output = execSync( + `node inspectDatastore.js ${projectId} Person ${topicName} ${subscriptionName} --namespaceId DLP -p ${dataProject}` + ); + assert.match(output, /Found \d instance\(s\) of infoType EMAIL_ADDRESS/); + }); + + it.skip('should handle Datastore with no sensitive data', () => { + const output = execSync( + `node inspectDatastore.js ${projectId} Harmless ${topicName} ${subscriptionName} --namespaceId DLP -p ${dataProject}` + ); + assert.match(output, /No findings/); + }); + + it('should report Datastore errors', () => { + let output; + try { + output = execSync( + `node inspectDatastore.js ${projectId} ${projectId} 'DLP' 'Person' ${topicName} ${subscriptionName} 'LIKELIHOOD_UNSPECIFIED' '0' 'BAD_TYPE'` + ); + } catch (err) { + output = err.message; + } + assert.include(output, 'INVALID_ARGUMENT'); + }); + + // inspect_bigquery + it.skip('should inspect a Bigquery table', () => { + const output = execSync( + `node inspectBigQuery.js ${projectId} integration_tests_dlp harmful ${topicName} ${subscriptionName} -p ${dataProject}` + ); + assert.match(output, /Found \d instance\(s\) of infoType PHONE_NUMBER/); + }); + + it.skip('should handle a Bigquery table with no sensitive data', () => { + const output = execSync( + `node inspectBigQuery.js ${projectId} integration_tests_dlp harmless ${topicName} ${subscriptionName} -p ${dataProject}` + ); + assert.match(output, /No findings/); + }); + + it('should report Bigquery table handling errors', () => { + let output; + try { + output = execSync( + `node inspectBigQuery.js ${projectId} ${dataProject} integration_tests_dlp harmless ${topicName} ${subscriptionName} 'LIKELIHOOD_UNSPECIFIED' '0' 'BAD_TYPE'` + ); + } catch (err) { + output = err.message; + } + assert.include(output, 'INVALID_ARGUMENT'); + }); + + // CLI options + // This test is potentially flaky, possibly because of model changes. + it('should have a minLikelihood option', () => { + const outputA = execSync( + `node inspectString.js ${projectId} "My phone number is (123) 456-7890." VERY_LIKELY` + ); + const outputB = execSync( + `node inspectString.js ${projectId} "My phone number is (123) 456-7890." UNLIKELY` + ); + assert.ok(outputA); + assert.notMatch(outputA, /PHONE_NUMBER/); + assert.match(outputB, /PHONE_NUMBER/); + }); + + it('should have a maxFindings option', () => { + const outputA = execSync( + `node inspectString.js ${projectId} "My email is gary@example.com and my phone number is (223) 456-7890." LIKELIHOOD_UNSPECIFIED 2` + ); + const outputB = execSync( + `node inspectString.js ${projectId} "My email is gary@example.com and my phone number is (223) 456-7890." LIKELIHOOD_UNSPECIFIED 3` + ); + assert.notStrictEqual( + outputA.includes('PHONE_NUMBER'), + outputA.includes('EMAIL_ADDRESS') + ); // Exactly one of these should be included + assert.match(outputB, /PHONE_NUMBER/); + assert.match(outputB, /EMAIL_ADDRESS/); + }); + + it('should have an option to include quotes', () => { + const outputA = execSync( + `node inspectString.js ${projectId} "My phone number is (223) 456-7890." '' '' '' '' false` + ); + const outputB = execSync( + `node inspectString.js ${projectId} "My phone number is (223) 456-7890." '' '' '' '' ` + ); + assert.ok(outputA); + assert.notMatch(outputB, /\(223\) 456-7890/); + assert.match(outputA, /\(223\) 456-7890/); + }); + + it('should have an option to filter results by infoType', () => { + const outputA = execSync( + `node inspectString.js ${projectId} "My email is gary@example.com and my phone number is (223) 456-7890."` + ); + const outputB = execSync( + `node inspectString.js ${projectId} "My email is gary@example.com and my phone number is (223) 456-7890." LIKELIHOOD_UNSPECIFIED 0 PHONE_NUMBER` + ); + assert.match(outputA, /EMAIL_ADDRESS/); + assert.match(outputA, /PHONE_NUMBER/); + assert.notMatch(outputB, /EMAIL_ADDRESS/); + assert.match(outputB, /PHONE_NUMBER/); + }); +}); diff --git a/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/system-test/jobs.test.js b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/system-test/jobs.test.js new file mode 100644 index 000000000..c3f38a531 --- /dev/null +++ b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/system-test/jobs.test.js @@ -0,0 +1,158 @@ +// Copyright 2018 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// 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. + +'use strict'; + +const {assert} = require('chai'); +const {describe, it, before} = require('mocha'); +const cp = require('child_process'); +const DLP = require('@google-cloud/dlp'); + +const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'}); + +const badJobName = 'projects/not-a-project/dlpJobs/i-123456789'; + +const testTableProjectId = 'bigquery-public-data'; +const testDatasetId = 'san_francisco'; +const testTableId = 'bikeshare_trips'; +const testColumnName = 'zip_code'; + +const client = new DLP.DlpServiceClient(); + +// createTestJob needs time to finish creating a DLP job, before listing +// tests will succeed. +const delay = async test => { + const retries = test.currentRetry(); + if (retries === 0) return; // no retry on the first failure. + // see: https://cloud.google.com/storage/docs/exponential-backoff: + const ms = Math.pow(2, retries) * 1000 + Math.random() * 2000; + return new Promise(done => { + console.info(`retrying "${test.title}" in ${ms}ms`); + setTimeout(done, ms); + }); +}; + +describe('test', () => { + let projectId; + + before(async () => { + projectId = await client.getProjectId(); + }); + // Helper function for creating test jobs + const createTestJob = async () => { + // Initialize client library + const DLP = require('@google-cloud/dlp').v2; + const dlp = new DLP.DlpServiceClient(); + + // Construct job request + const request = { + parent: `projects/${projectId}/locations/global`, + riskJob: { + privacyMetric: { + categoricalStatsConfig: { + field: { + name: testColumnName, + }, + }, + }, + sourceTable: { + projectId: testTableProjectId, + datasetId: testDatasetId, + tableId: testTableId, + }, + }, + }; + + // Create job + return dlp.createDlpJob(request).then(response => { + return response[0].name; + }); + }; + + // Create a test job + let testJobName; + before(async () => { + testJobName = await createTestJob(); + await deleteStaleJobs(); + }); + + async function deleteStaleJobs() { + const dlp = new DLP.DlpServiceClient(); + const request = { + parent: `projects/${projectId}/locations/global`, + filter: 'state=DONE', + type: 'RISK_ANALYSIS_JOB', + }; + const [jobs] = await dlp.listDlpJobs(request); + for (const job of jobs) { + const TEN_HOURS_MS = 1000 * 60 * 60 * 10; + const created = Number(job.createTime.seconds) * 1000; + const now = Date.now(); + if (now - created > TEN_HOURS_MS) { + console.info(`delete ${job.name}`); + await dlp.deleteDlpJob({name: job.name}); + } + } + } + + // dlp_list_jobs + it('should list jobs', async function () { + this.retries(5); + await delay(this.test); + const output = execSync(`node listJobs.js ${projectId} 'state=DONE'`); + assert.match( + output, + /Job projects\/(\w|-)+\/locations\/global\/dlpJobs\/\w-\d+ status: DONE/ + ); + }); + + it('should list jobs of a given type', async function () { + this.retries(5); + await delay(this.test); + const output = execSync( + `node listJobs.js ${projectId} 'state=DONE' RISK_ANALYSIS_JOB` + ); + assert.match( + output, + /Job projects\/(\w|-)+\/locations\/global\/dlpJobs\/r-\d+ status: DONE/ + ); + }); + + it('should handle job listing errors', () => { + let output; + try { + output = execSync(`node listJobs.js ${projectId} 'state=NOPE'`); + } catch (err) { + output = err.message; + } + assert.include(output, 'INVALID_ARGUMENT'); + }); + + // dlp_delete_job + it('should delete job', () => { + const output = execSync(`node deleteJob.js ${projectId} ${testJobName}`); + assert.include(output, `Successfully deleted job ${testJobName}.`); + }); + + it('should handle job deletion errors', () => { + let output; + try { + output = execSync(`node deleteJob.js ${projectId} ${badJobName}`); + } catch (err) { + output = err.message; + } + console.log(output); + assert.match(output, /Error in deleteJob/); + }); +}); diff --git a/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/system-test/metadata.test.js b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/system-test/metadata.test.js new file mode 100644 index 000000000..c8ec161ea --- /dev/null +++ b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/system-test/metadata.test.js @@ -0,0 +1,42 @@ +// Copyright 2018 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// 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. + +'use strict'; + +const {assert} = require('chai'); +const {describe, it, before} = require('mocha'); +const cp = require('child_process'); +const DLP = require('@google-cloud/dlp'); + +const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'}); + +const client = new DLP.DlpServiceClient(); +describe('metadata', () => { + let projectId; + + before(async () => { + projectId = await client.getProjectId(); + }); + it('should list info types', () => { + const output = execSync(`node metadata.js ${projectId} infoTypes`); + assert.match(output, /US_DRIVERS_LICENSE_NUMBER/); + }); + + it('should filter listed info types', () => { + const output = execSync( + `node metadata.js ${projectId} infoTypes "supported_by=RISK_ANALYSIS"` + ); + assert.notMatch(output, /US_DRIVERS_LICENSE_NUMBER/); + }); +}); diff --git a/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/system-test/quickstart.test.js b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/system-test/quickstart.test.js new file mode 100644 index 000000000..2e000674b --- /dev/null +++ b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/system-test/quickstart.test.js @@ -0,0 +1,35 @@ +// Copyright 2018 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// 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. + +'use strict'; + +const {assert} = require('chai'); +const {describe, it, before} = require('mocha'); +const cp = require('child_process'); +const DLP = require('@google-cloud/dlp'); + +const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'}); + +const client = new DLP.DlpServiceClient(); +describe('quickstart', () => { + let projectId; + + before(async () => { + projectId = await client.getProjectId(); + }); + it('should run', () => { + const output = execSync(`node quickstart.js ${projectId}`); + assert.match(output, /Info type: PERSON_NAME/); + }); +}); diff --git a/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/system-test/redact.test.js b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/system-test/redact.test.js new file mode 100644 index 000000000..5590a26ed --- /dev/null +++ b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/system-test/redact.test.js @@ -0,0 +1,135 @@ +// Copyright 2018 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// 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. + +'use strict'; + +const {assert} = require('chai'); +const {describe, it, before} = require('mocha'); +const fs = require('fs'); +const cp = require('child_process'); +const {PNG} = require('pngjs'); +const pixelmatch = require('pixelmatch'); +const DLP = require('@google-cloud/dlp'); + +const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'}); + +const testImage = 'resources/test.png'; +const testResourcePath = 'system-test/resources'; + +const client = new DLP.DlpServiceClient(); + +async function readImage(filePath) { + return new Promise((resolve, reject) => { + fs.createReadStream(filePath) + .pipe(new PNG()) + .on('error', reject) + .on('parsed', function () { + resolve(this); + }); + }); +} + +async function getImageDiffPercentage(image1Path, image2Path) { + const image1 = await readImage(image1Path); + const image2 = await readImage(image2Path); + const diff = new PNG({width: image1.width, height: image1.height}); + + const diffPixels = pixelmatch( + image1.data, + image2.data, + diff.data, + image1.width, + image1.height + ); + return diffPixels / (diff.width * diff.height); +} +describe('redact', () => { + let projectId; + + before(async () => { + projectId = await client.getProjectId(); + }); + // redact_text + it('should redact a single sensitive data type from a string', () => { + const output = execSync( + `node redactText.js ${projectId} "My email is jenny@example.com" -t EMAIL_ADDRESS` + ); + assert.match(output, /My email is \[EMAIL_ADDRESS\]/); + }); + + it('should redact multiple sensitive data types from a string', () => { + const output = execSync( + `node redactText.js ${projectId} "I am 29 years old and my email is jenny@example.com" LIKELIHOOD_UNSPECIFIED 'EMAIL_ADDRESS,AGE'` + ); + assert.match(output, /I am \[AGE\] and my email is \[EMAIL_ADDRESS\]/); + }); + + it('should handle string with no sensitive data', () => { + const output = execSync( + `node redactText.js ${projectId} "No sensitive data to redact here" LIKELIHOOD_UNSPECIFIED 'EMAIL_ADDRESS,AGE'` + ); + assert.match(output, /No sensitive data to redact here/); + }); + + // redact_image + it('should redact a single sensitive data type from an image', async () => { + const testName = 'redact-single-type'; + const output = execSync( + `node redactImage.js ${projectId} ${testImage} 'LIKELIHOOD_UNSPECIFIED' 'PHONE_NUMBER' ${testName}.actual.png` + ); + assert.match(output, /Saved image redaction results to path/); + const difference = await getImageDiffPercentage( + `${testName}.actual.png`, + `${testResourcePath}/${testName}.expected.png` + ); + assert.isBelow(difference, 0.1); + }); + + it('should redact multiple sensitive data types from an image', async () => { + const testName = 'redact-multiple-types'; + const output = execSync( + `node redactImage.js ${projectId} ${testImage} LIKELIHOOD_UNSPECIFIED 'PHONE_NUMBER,EMAIL_ADDRESS' ${testName}.actual.png` + ); + assert.match(output, /Saved image redaction results to path/); + const difference = await getImageDiffPercentage( + `${testName}.actual.png`, + `${testResourcePath}/${testName}.expected.png` + ); + assert.isBelow(difference, 0.1); + }); + + it('should report info type errors', () => { + let output; + try { + output = execSync( + `node redactText.js ${projectId} "My email is jenny@example.com" LIKELIHOOD_UNSPECIFIED 'NONEXISTENT'` + ); + } catch (err) { + output = err.message; + } + assert.include(output, 'INVALID_ARGUMENT'); + }); + + it('should report image redaction handling errors', () => { + let output; + try { + output = execSync( + `node redactImage.js ${projectId} ${testImage} output.png BAD_TYPE` + ); + } catch (err) { + output = err.message; + } + assert.include(output, 'INVALID_ARGUMENT'); + }); +}); diff --git a/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/system-test/resources/date-shift-context.expected.csv b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/system-test/resources/date-shift-context.expected.csv new file mode 100644 index 000000000..2329cb63c --- /dev/null +++ b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/system-test/resources/date-shift-context.expected.csv @@ -0,0 +1,5 @@ +name,birth_date,register_date,credit_card +Ann,1/31/1980,8/20/1996,4532908762519852 +James,4/5/1988,5/9/2001,4301261899725540 +Dan,9/13/1945,12/15/2011,4620761856015295 +Laura,12/3/1992,2/3/2017,4564981067258901 diff --git a/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/system-test/resources/redact-multiple-types.expected.png b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/system-test/resources/redact-multiple-types.expected.png new file mode 100644 index 0000000000000000000000000000000000000000..5f0ef54c3822441792ec192bdafd987ab4ad8e99 GIT binary patch literal 15869 zcmai*XHb((^ym`^O*#RkN(Yf5C4f?cQl*3RE*+#u?}Q?XRH*@^#~{)nfb=T8hi2#^ zARxW>8{hxEGk4~GxF3?t?9A@-?AcTH{LV?VmWC4PJ^Fh90Dx3QSzZVGyNUf|5aMIM z2WXhs008N36?wT=ewdvFqFL9ebJ=~0k4gBSj5t#t*`$%saArK_v}V(J;z{9o z@kuDDfzEb>+P07H%h1t~+gN9bBlYb!`)uYQiwTT<>@++EJ>&$QiopI?lI$^@NvF+UV&{8Mn6O~GO}bdlb6{UuDg{cOQ4hjP`z-1^9jh`;&pRjj#TqMhH8HuW$ z-j>``y)wPbYHMNd96a-%Ilss6)P~9zw!>^`WDn#k4ZIVpZ5j9`JDQLov!fn-A&K*| zNM_yWWJ*Zej!!Uk>UMIYeCP5g_pW()Pk~6OEiTl+e$na;Dp&#kuY6+2Uf>b~nbdy! zO2AChV&y5unS2JjpZD9Q8xmca&gDOEeV6{)i8DMrg7=cxXM5`huKTuKEx30Qag#8- zsqEPQYcJb$W0CPF)Ec3Zgtmx)5|a6DHm6y6~pdzT?xb*W$@LX zg8GtaEwY*=!&!%NOtPdb@D$(^BL2RMC)lG3kz>j?xLm%#9fO@qX}yb9 zA;)dsO3rUrfOH2Tky73{eq8kngYCanr1)2ks|TcHuorqBS(S#E_6e3 ziSBgPI>BnM5zm<#wOKW!s(YKm)G~mC;q*4 zSIE_l`24T?^|XtZ)AeMsw+9LDnQ#6m4aeSWYKCHNW!6%3qp-5S?doB0lVbFq)K(v0 z4*Xly^{u2_qWOC5i5t>wD)zvhveD_g)5piwmO@6NlI$nE5xvyFLUVieo}ff!ttOmK_=k5 zPf4a4x()i%h84p5CqXO3U2l7t#2I~Nt-2_c7=?oNBbXUmuNL+MY}TXXF3@g%T?|p_ zt;b)=n6B;V`H;qVPS-{n8I%}2&pM$}3V{eSO|CxoDgDjf2q25tR%B^QMlL(W&a zcr7jlRu=X`&fGij9`IRO2H#*k&3Mp_X3#J2P7`_1GH%zP`Dyhux!pR}#oZ{{>ko*x z9>gi`m0@~ z|C9f|PK@6EEuo9SUe?m}x>XE+9qn$&S(A7^)_;Zgghj=WThy*^$lhHbH%|^Gbv0em z(p#6K9fI1JJcoo_N@MAAzPf7k+*cpdZ!*WaI`K=>fXy$&4g9=P%9KYun*J}*2zYBI zY|5+SuiCHo(toYgpW`fwmcNZ#p&Rv6L?Z@R1T6nHAB}YR%(;k5op+GC(w}SiHtOOo zlZT#n;UU>~U>B41tMQU`9+H16yDCqnO~}uhH>BsTCW}aE4O+;9|GY5CAdp%H?qs;s z{X||2(3)n`{{9v7#8oYy6z+<3)K0e2^>?>d_0^(=lpXmuw1n)G43CxV;GX zRD|Mas1Vnb>jJvdu%4p+IIU}H68EF5rDhdZTm|7Hl^ab}78%(SGT-kntObXz>*`y| zfCogHex2@x3=3a{9`FMQX=j&Tzw#bK4iLW{-`Xy#H%9{&-Q2O>Xs&1IJ)?&*F9E7) zul1^Ow{g2}PY@AsgD;40%7BWF48d-AX5gWFJCIl*!I}-Z1jVDMZ@bxfFS&RSPpXBY zF2gfy?UIiKx~KyP^Q4b5M&D#c=m%gUsMP#nTKyZAf`j9*(}sl|*BNM$3oR4vF6 z4t}Id?!}Nj{Rcw1J!><=~XVmY`znF*P}kc5j!| z4825WCF+ZpsXn4Lz)XLydJIc#2l@m}$zA3SE++>-k3Vln6)CtZos|2M?uFi6Wyu$5 zpU!)ZD%x~&^=H(>DZxO(p7pk*T@%*^+dwX4M%dbnYweUiDaX*m*bfKiP}*V3?gSf+ ziN6L-n5oPZ@vr#wU~4V4q)mXXA_q!rY#kwDw-9tRY|;{aDLj6hZ1bSjPOR6WBuwB; zGvqM&^x>Ldtpu8UC;vjI+Sgh@0HA0~*L{gKoRBdn@BS*dC8fw^450PPev1I?Ul=Dw z|L|(Ix9)aR9v92m9SV)Lc<^< zXRQ#cN}q4nBUlHbGY_76p;!~J80bhMBa}#QW4yppeDv6$;U&5pA;2?ekHN;Sxuv1! zb`tn2@85+@;I9!f>^*2X6_BB}qxt*V?wycRyP|X{zHy4yScUxCRN(#PF~y@kTBhOV z!pk3UNlY%+kt?L#j}L^y+4@b>){!$WdJh@m^5xU(Vt^oPzx|Y0`wJ1s?bv&nNfa$V zqRo^T$AFPfC&6xSRU@}sZ_D-U0D-Q>F#aB|F zzLPar~|!p4rVKIg4Zzdy5eesW2^Ut$CV$X%VbL4`j_~ zO$a$IoKvr6r}d;f;&@JEgHNcO@eIP#Q$$LUQ_+c9!JUxUvcEiVbackW`-?d5=gysn z#N^?NXg|a0v?T5U@KhEj`+H&UC2bjc7^E33b%f=Ie-S}FFA)Qws0?iLk=j(zbXu

Z!Z-kTnfgeW_s245NH%^shrfSp0k6DSK zSq^xF#5($O5#HdAX#?ByU`VA*0iGb$n{h-gRv$1;zz83;CT{iMgQ^zhVE7tO`XiSX z!jI>FdIY?py}N&Neb}CFXr(yBydG+h2!9Rw_O|oIWk>iyacNagptrGr_7Xj9R_(>4 zf}$^F1d`2YyAu{L6YWI*4q3eq1dvd)QCT^%VsN`Y4c#hw<%xgC%5@uagb;5dX1P#; zoSN+g%$%yVcdK>g8L_?yM3Y4Vb)!{YZXYoS;c4LxM=`k0qTpvj9l-$_3$5b8)NLp- zlxC8dtROYNZc)T*39vp2?c(a0wLYj2h>TrwG>~J1PP<|v>N@9Fiy6a#%FQ+5DO_u+ zg$4zGVX&U<(i#o4*gP?+XL-naFAtml93xJen>36RvU;8abiCwzJ2@=-aFQhm)B*!@ zg{FD{^kq0YGSzoo;ttC;6n+scG~0WpoH&(Xa;fBQ@Bk5)cZ!vd`UxrPPofX zGj09xSh7fB4DaXWEV=kAZ^p4WL_xl3H}c`r7kEdu)P) zKudYaFdiJjM>U6!2UrIMMNYsXvU|m<5Chs=>O6TV+=;67QeJm9JyJr?7%uR;!XJV- zo@CaReT`CyOUk?xHjv6{cqf#&=T*(U8X=dklxfjf{A?DX@4(DG;3xm`(np-j@Lfv8 zOA8MxMXqP0ERVpX(qg_slbNC07K4mN_VhtWb`(m4792IT(SjumFGO@xxu3@JtZP!lxmg%o=4A`nPm9D{ z9G4Cks!7LaQ>>ZU|2_8nf8*p2Fk#0ScnZC#S2>nLyg>ZT* z=XuE!3G>YF&(%A|qSVO8=U>J)c7C~p3_ZzPO`fpJxCL--$ISZ|8hPGVUSDIQ%0&b$It+%L8*1ZypGG~m2jOqlsd(anu6>|TF+)zGItRn zAhWVVyF=rYfklhDBoXLhB!y@O;6BdkY@W(#I2McKG98N>9gwxpISi~ZlKcH|$B1~b zR}&;6xL3NlUaTZ6D4%i7?ajRlUljDCoyNgapeYC3e9KxHm1# z-`ZV}jMQ?UBETMvSb=jTqMsp%o0eFyY>6bgv9b?w0}SSiYFS5e640ZJ_chiht|~K$Fc+2l@*}@ z6~2BNSFr>lDeicWj%obu1c7NRl^HFJEe+QyOR(j?+8DAGLfRCRupx6P& z7B{FbLbk08?5p2g)_)SYdHdxUCEN!Q8`}!q@@2MwzAGr!mk zJ(&=Y1Cxx50u?_QCncX2suKbxq+`}DI{&E&samyh=_s|HxZwC-M2VP{hvn}hocyoc z{ohEOSq6tupOD>?Y7#?5Auu6sf_;G5%%FZ;rWyNUFTrF8r7}Gxh(E4a-HIAYQF$n! z_SFnTkt@Ak?ExrLFAd+4@Do=@lHDh$5!%jlbdup2?52+KwbEH{Yj6qgo=khki7LKr zS;l+f;BAAEXBeX^8zbchVc_TQh>X^$IE2epb}i31CeaJ&iR0^O z+`uT>Z3u>+hMU!Q*%FXPlUKrWLneQ0SZSg9GWBni^B&)5bMqrCrd~!P+4xSxO-9)G z1bJ8JI+lIC9n#P8m3mYq;qjXmIObS?ffj3r#_)ZtFu|#vdm5?l-3(6GdiZ@o^m02J zRCzkh^z^{!#O$u8$z=aw@*KRNX2bfi0dtC2nHQ5%usuCO^l3_4@73ep(3u<9>W-2% zvLfrlgIeM?8I$xsQ_EAwEzFWe~j(_fo}f|cqjT$9b@ST0{f&k3FWK*{iOeQ zz!QH$#oj5lCPH(-PRdJ7ZtTx7ETsX(V_udy=`ebiww_jonw8 z`l)@R8vU59|5PD`N2{8Kx96I2M~K-iF==*#j$=+Cn+M~%X`HtodYtKChg_at7o+?e=U|8tApjX=2Zz+bFge` zhr-xCM6o1_BK6V82QQY&>JgS~=iHR#ee?IElAbkAw+9FQH;u2C^Ew#EuBYo;YqJCC zB}UU#SJhq>#Ymosy;rTEV7a-RXEqS1`pe?vn*qO9h^@52#7g-;Zc(|GW+M z;_&u8m+ZepoI6$0Ht7DlL-|CB8-Hx($58H(T0(-o|BSd}kzYlaP}E#?{@l5v3LD8CKrncLTPuDR|gPL5qh&d=hueCRB!G^XWorsZ>Me$ z^M7b(QG-4A2fCFze3J4HdEjhU6gCb8&%Tb~kIGv3YZpiRc4GU}U*?NGrOY}!t@rlZm^bS^qPl*r zERr)U4EPUyswcBDx(rcYtUU?!&v=KIb0ldcxOwhp`yUI$(i#KfXRSR&GAG3=h-3|V znd5x&+5jO{fO4|T-NmR|<}sF8d!u(Fd#@JHT31kL4QHGl$!(SzeApE__tuMdFjwa0 z82$bqo^z3T3KRlT*`@eW$zZzAZk7pTX9up->1?|gx9q}m-}cZATj<;liHyE!4Q5+O zec0d>+KM%6vEk)u-;+Og4_f!%VPWWbSNNHK{cVGYjHttDzh;QX)3bTcEZfxyd|NER zX0C6|2|DcOKXsorvKI}_ac}uk5M!*?c{PR)(5bHy>;dvvXfX{GC~eUaeBKYM`!~hS zn$U3mTdXRkM16pc!3ElcJ@A;Fi!D1_4bvtWEG(+qm`q*fYTRt{ZMnPIW7d#9nZ)~O z=MSF8MzlxJ#-DasqQ(B$wA<2eEaKrLZN*5!7K8$gc;eSVOt0*yqt=K;G~{z`ZNb*% z1KlCG8X?`f*zDrnI_lf0$ax@^$5o;=BuW2+YA*E)br*83>t`m5hiNNCvNw*r2`jMU zC@e?W@8*_y>xV(-h|OD!JFpWqCe6@Mqg>*CTyJ zMKeIhnq}x~**~3+dO`LKL6n~m{MWjy++<-({~rXMFC_^ESbAHN0SwOmakrJz`nKQ_ z-K=_yQ_1>=Rim>- zxfoz1<@W)mp#6?6GReP!&A(_W93bMz1ixb%kTfObr%w` z1uyhUyl=C034sOh^bp~~9sWv*B#A7k`X6O`zm3hb)Y;9l5LJLt-!?dh2?K!l|Zhb8jsQJU{ojic=7$-XIF!YNF3pAUuo|TxXnPAL< z3u5utu#w`@9h?0G&bl`3&@01;buG>sXIz#={b+YgmM*6&|G_TjiWVPU)pkIO@7MG( zBHg6Zgn-GyC_MwS+FD%x}joi!Lkjvj(5!5z}kTyn0}t{ zd8JcC6(-!SY#9|tpSI>!5oqRSqYy}Rx~S?TN)ggIGi{yrKoX!XEl5iG2gFk}>O z=vOyhBA311U*UY>uYx=Bk1y#b_{wY>jXJ@&)LJwx2>IHT=A6y8jsMZ>=^XHTXq)uu zY~exw4HgSc%LD_ru+XwR_{sMV(;(SQ|Ad2QSXiI6ESwgJI9oXH5qI6`!5s}+7s+Cg z=M5ei;64fc1mfLU^Uj|~l) z_-D?EKDOq``bLX&8DLT`yg&IZIm>S2=NW0tG_Q+hRa$n&FNE~2U^b~SWG2Xo`^B-Kpn*WqSZ zsvg(Q!CAJf$VjiT{6R6!DEtvDCcje(pZ=Uu)R+V5&P1X1qL9@IpBSo}hP3zj2%#rY zlk*g@N>wo$b*v9qycqEnv%oWi$HVy}Tv(<`EFfTX+>@?=F(uAfmY$ru>$XBLmV57M{&6$*w!XlrW2BP>}sh!k)>#K>LY@FZuj045CO0V61Rus6LM zedcohTJ@VzNg@xV#Eksk_9pn)W$%yTPu3^g?sO8HZkG)Qc}gOS_nj1nA~^@)Kw2&irxc!UG84aKCVE$5w&N5R;?OlOuX%hR8>VhauXH1%4|RHDcrRn1 zge8vaRGfF%uo%pbqI1~~f6F3BL>q3Dz1qIuv6IZk6|F366+j-Q7YVm zHY^v~995%yOdQ@**6o51xI&h3nP=6wb$lkeJx^3J3Wqko*;3gRJ7*f%%q>Xrvze>NR}<(fa;o zOMCPIo(f=k2{V*Ze(NCWPb91sRW&9N934%nhRRqX)Rq(7JGdpJIOe7fd*%MAf%Q?4z zt1+nX-bX>l=cZg1&_-+(K#ZS4cCZL|-*jJchxnY($$iyc4Rb|=XpifIbLuP=-DQMB zghjHJUWk17E}V=bT02vewC!9UrIRFq70Y-1OYb-$CU&?H}_7E4^T`O`32wQZ9c25ld{{RCjao2H-HO zNyr@DIR)~Gh49&E7TDMcM2T?XkBskx5+WMJdH}TfY1{KaK=f!kUa0Q67kxxN)r#x z9?L8h|9uk*iWgaHAvuuP0r?Nqy@Uv1Qn|ox6iCPTJ&(QMx0C|M`o(~4r1nKaj^=OF zNQ`0u0g5oD;anFk)j{+?B|*s1NGFQXbHM680!s( zJO{0AGPB?h!IT~Wm0tt5?8FNA?Uaa-WnZ0Xb53v&Ta>fHArMnq=CWfvWk-&iAwLk} zH8CIYoxKpQLlFdxhB!|QA_Reo`ZVcLwx4{* z+k*nQ4rmcoFWH8It2GEA;VDxu497+=9pRSzl*0d2ue2!tg8r`YM0CB1NNJE9CW*7k zK-PeCFy;91hP2S0bUeafJGpUv)T1$5`j3joQZ=$2UGRFgu5kT%j#kzsGt;m-YkXWb z^?Q~X>~ZU*9fb$GTwDUGG0dak`&pW4*2j_h1%2g`bne1{n6Q@tmF$D!Gw<-pH? zVvVeBDZJl&n}eRBC584i&-pT|r_+66BVt8&wd5pobjx%DSARy5P4N01`64s&Yqo5$ z@5TuHMGK&L6}=_=e*0M2%vP`HS+zAcOEIQa;BzkI0X=ES2w~jct$rF-;SozZ_rSE! z&mMzdts;5^TO7Jvh4hp!3^KTJ?gEsbik!+l@@;2y@8&4)-{ksYn1P5BiAydP$@Ab& zVo0vX3DEIqhFSRU_W9Y)d9?j<$fS)L71@#5EOnf4qMvTqZsdA8chj@!^^06T8FDlS zv{I+l%B{#VN#RmAUw9kUNtpar;LpJ#dQvYP?vrTV!O&5}gsAzGJpK8HH+!HDK<}>H zsR~w6PW_Ex%vv#FNgMb%V9RTe7A4xNJzxNCRD|_riakdX#HSTJdp1nMgoKMGPAgnm zoeTP!!IGAB02FchHy!s5Rp=N??lVP{XO6GpJw6C@HZzhjEF5rD6$_qR)?Jtu*8o|_ znMRmdhx)!F*hJy77+a=6jc3f1RzVy_u7oul&H2BUsB$nLk5x!C9< z2K&l#FHb~0>Cjp$E`hx`JP)VYiSLg18oq%VNr&}Gx!`GGBpg>>hF#>%#tu%}T&3?rb+LSv}+qK81wuC(J@s8OvWsm71b<;K%4(&e=y(~nJ@ z;EwPER#Tv#*~_Ons_M(dnFq;GHC8=cQk`zBK97K|OD_?tX56$j!U1ZX z5)bG|!8^va=-J;)5s?~&&p0CnL{Ez9=k-Mqf8yWt%f z&W-8`*I<>qtwq2VvHa0?Xwa*crUHMHee~SUXd+Gt>Om_R^ISO(DC|2OFdxq&3 zG5?TgKaoTK{oCyULV*P6mEBt0fs_K58F}j1YWHHBcpS+GIGQ?3FA(0DoGhw2T+V)u zsNdk~cVm}^F^4q;N=C#?NfhnIrhporIg#7?>AK9Ke$^jmD0TH`qpAt7^PAuC|1mS5 zjN8zbP8aQ--okhkKMdvOt~lu&cvRBb7&80NBKY8$xp%5*Yfi0zKckDem7K&5;6n=5 z4&!I~r=hVwIDKknwO>cHMcTOrzO&t|JbP+9wWwp#_4lTBd?CbiQ`6-`y|v=wtT#cU zbRwr$nAcoc`2lPBNxR+m#k01FBFCC98-K!{geIFk3o=~Wu}U@8>mg&9-ifdB9$qwD znmcm_H^==tUBiUid$z@(5;XtDtQS$bWF*@U-s*&RulolYwCvH(d{>-nb3#Y$A#|(g7VtgWkvxv( z;oV{qnD6)rY*2^e&wjbo&_PDT>LgRJP}iMZ{3wQ6jVk8H#>cvsw^np4fW-T1`aQpI z@uW7*q>4z!%COgf9V4#S_ZM($sEbjhjbFAuO@qI~Ck7^LQ0zMj&Z@uC-ozzCUxLv& z!cUa9JFk%!E``Y&oGP7;@=GG2KuvstO?!CNkWn}=FQeG)sQ6{SO zO(re=Tdcbi8ZXUg>L-SbJfjJ%TF?5(2{iP0Zsk|(D8-vi!mlvM^&zFtX`-ud9Y6?E zpPO))nmjF*v8(WsX*aK+k0w=~8hoQJtzsy!rgq5pBi%L!-CEEaq}>@-XOPxUJoJo{ zg`tl#J%&Nc;89uSdU-PxJv0UZB)guPk>5yjaw^!ATkYzQXyAziMo$y10FAyN;4wuKGdc+Zj5S-$pdboXnQUbV)M|f1zJH4Pzxb3s%Ec@E5 zq4Isl*I4h80f+17E?x$QQ{hiXs~yW}biqVlclYpm*fYFMNO{huI_pe2;|X3zNjoCM zvq>kZo$v;xJ=R*HB{FMnPnl%uKO8d=5B)-{e8$TI8j0Sx%fqr z2lT}6qrC>yINd=V+(nz>Xy>q=L=sVR|LHd)5cuiq_1ESyNWLf!u#oPF1q$qdr|%#% zdZ6NHfDs!!f89Cp8TuFwf(R48tnF7SJ4zYAB~OO1lo79$xMj9ujk7ejnOym1l$+-B zVe9eexsbI&mg6SJ#r=+H%}g`qF9)BLcpSAiJXpJ)vt;)$F`*wm?S!IRmwz301AAn6 zk~JS|7Xijz^?#?Rfh$r$eo4M|9~}hp{V1t1cS=<7Z}3<5erg@H_h?QEoUHk5B#uM1 z6_yaxe%~3VeOntl}8i#zyBC4+A z+x`kHA>)WwyyRfFE|B;wnM<8H3=&rO*(_@b@r2V4^cjBktlO#i)DL^?>QRnp)4?vO zO+MF44f*pEOELf$k4_bOzLIrml)G_Ft(1k5qOAs_yuZBO4SeY-ya@Ve92Z5M1IR0jI;C!jM z=LHmJ?Y6g7nB))g%pNO^Kt*^(LnWg7x1+Yc_)i5Xug3jSJ)+lKvnkGPts*?{Tvs0M zm@ac2EZ~cGJz$%!-Lq_TU!`n2Y%1Dv~4A*KcBWa^%o%9Q>fKKU?^DeNUc9<;UYO0aqNW>>>ltr8ME zQRQx^f4lUQAZbcJT;;yQSRT^(m#;yb%##>8Bn<+M_491b6SjDt-*#62s9pV-+1x*p z*tBb)u6XnI`JRN!&*25vT@5^CXH25XPy=dsu?nB5h{nv=7?q=-dxS#(&mgFHe}6_T zJQ(degV25O)HsE?5hXhB_tOmT&xCN5Gg+a;j}#Ui?1iS*z;bl6x}9udFw|s^XI9Xe zCA&KaDStc_9>u4_Okly~*gjZz)01bR?`)fVQ<>Q+x_XQFJuBKdC)dabo5XoLxNOI7 zvh4S*xJ=RoIbNOS%~0FI9fb#HY>(kt^rLn4zg$50Y))X zST_6SAN|BUKjS+nc`v+{;lzaxPrKoFdw-_EuUx`o>G(<-UHI^mxk!qV@%q!|x6_Bp zcC5RMXXY7sIZ2{vef=LEa=HIJU{MQMdG`R@ikE11L}g=?Yh>^v7R)qL9Fh4fxRkOd z)5dgKjN8*un0%HdNf^WX#v*wE1gMCkC`0!8!=-qVFO^eH%)aNn>qoz;tO{}2Cat;rG zOM}1c^7@Pzf%bbzkO9m0KTEF@J!#IbnJieHpRp5O z=l<5$|2SKl*b=#^WLwwhhiQVTd?eYaieVcv!^I=&wSLOQZ0uKb0pZm_d`@9?W1OBj z`y0vu|EroZJ<+rJvI3^pqS8(i7Or?Ldy~w5f5&P1{M*TOnQW4y(b>21gKxC9<3<*# zHJn3!ww*F8*%MIkkgY!jfG~ zd3auun|rjd&#E(>kX9TRZXQfXB3NgbrJR#20z) zzDfLzs+1MdX!-rB8oh(XlP)ooJ&DMwaIc^sbLq&m^;MH%3zKHmC3pp-s+F4~A)m9T z`c6A{tm7kfgH7;6Vv_EUq^CziB6AvKwrlYU#FFyI9px06)L`DC3aU3h?|o^W8=-)3 z=KcO%#m?a(Pdr!u3ygFVGYl-MMfSTiU94x-OMik=>*}`cP>(+dHYmDDnuwsF`pLm0 z!Cm<)uyd$Y+oXf%$TB53!~sg;uC@S9UfOZ>o`1K$Jk zs40B4+&3GMvC=7*rRs-k%6@D9#mpH^rT8Zzc(oSNFoJ!Za0lLYDmG9?HFV1iYMcF4 z;$*x@L7RwWZ%p5d`_U=3f}}4lr{e6$z6@;K``eY`mAU7jN@r#N*TJSfNS;b@j{MuG zFb&|*KDH~4^Tp!R*TjfA?-ime!MJzQd1@gzx(wqR?YQJ`T&lz;bI=#?YYSHBz*4pN zm_F08jq6V$m}8hqCl8gGIW3@r5JE}x(JHlQL68*57F@Hsc!r-Ig+B?;I6eMZ_=tx_ zcj)SRosR;Okz)56hgnhoe$DsLZ>W6G z=2@5!qyXLeLjak&zxo{J_kLqM<$mpt7`;U4Y$k*%9fE_+u8ZUCZPziau|Nh#cIRgZ zbDU$P^Q(k397Y``k?zpyu7}AY^$ws|IY9t(RIJ+;7yt;^t-*(JW1@EsCKxC^r*ak7}Qh3-{rY%O@zd1tX|4;Yxi@pWG~(cYZ{7(vq4kmwv)l~l9_ zFlcdc@{qz@qrU*)(KZ!K_#mAN%X4ngJW555FrilnVatin@ZqIT7<@Wdv&Hn=^+y&l zKYK?HO?>uC9*9_rg;CK*G??hx$JR?uF_xhar)Uqjy5)PQkxT7VX2VyD_YVUcwhe^K z>~9m6J7Msg20}vkt1NgE&>lxm1@H)gCceZ#794w;<(IO7s7XysT9K@ zULN0yB-W}CFk~9i!N6&#tcr#&za;$W))5vky@wRnnyD)3V9#wI8}&rm zz{gbXD>hMChTBCyY%0jVs!f4@^v~Y0f?hlh>J6GGkh#bSdI7MS#&J~_`84z!Aw}`% zLE@pC1NS=HK29+Y4Q{NzV3Duo)4hCA5EuM2?NXp4X9z=?socxJ8SB%nC08~6#KI6u zORAUhG!zF+LIT8c*_WK}l#t;LU*J{3zkkfH;R8NOuyZ(Fsz3lvGKFH45FEWr{b5x* z_N5enwO!%+EVplEJz+i5=3cKJ2vTvJ%6U8k5Cy|OUu*14`9N2>sa!GP=I!O?m{i5l zeg`5HXXS>`GC?2Kj|KwyIUcQ!I)ho)d_%rf9hk%^`X&n4sy{CHK#6evy_A@fBsXZr zUPQ{(#o>zNf)cP~=&vvfZzSb%;o`v|#SUC9?WmOAs2&@7T)djGz?Osx0;$Epl%t1g z$|bmtI7&mB7oOFVC3Y#QT9LUnk0V3ZrJ<{IE(Hx2{nxKCY3o2K8DAugU{%|RNvBO` z6mvYQqhcn6U~`&%hcglXWmqAiih~;7k%8=k+++PQ#HBXIyfZ4XUFsvkZbS^rfKeO? zqhDa;9M&t@T|cyLN?IYMGK;(3l83861ea!O)D}@+1RmQz`xD_q2Zl^*dOZ(aI#9^y z2GLYjhYQ=!%QdFReVm0SU%b98d5GgofhVixP5YGUJ~+7mnh_>C24QvqAo`E*-}S&m zHXX!(VES~B9oq(!@q}Z69V$}cz)h0Veh+CYEb;?3DG9zDom9QgIp%lGy#{*kG)Z|5 zkAsNq3zGvs?jMk>YZyIOkQAy1WS(ZF<@Jw+>1m0K0x1QZYT~*x#8wQf|1dT)#BBwG zh;kuEL*uTdIQQSflBy`W^Z8e~k$jE7Z=UKSPgi5b(g%C-kN2QS+l)_j(?6TwS< zJLFR8sJ1g9yL52Z!f+F(S{F>mOrJfrwx>vVLZhTgiGaX)!0Qx(^vYD=h{Sf*9)H@Ygz&mzhhIlKTz^jPkCeA&Ig?cHr%ty^a{I=FYPl6u80XbC z!K4FN35f)zal-m_SS@26@5jOIbmIH7d^r55)gS*Fxh9bEk~a{*%{2@3JTK46>Y^Xp zV7#8I{iB1=lc;`lsS`W+3PeHAMuPgj0eJ65cwB>8tXrzd`0G-|8;`spxzFpz7oSJu z0J57&;+rjUfyZPUT`tHq#wOc|Y**ik_kT*a*`DLe8Clq)p+KNp6KWLSfThinM2xoL zKacR;>}Gn=x#2Str*Z<#*;3JqZ6R38Ib&&Q#AGE7zbZyAqLS6Pt-q2(Q+8|edBLnt#SY5P+njymw}=TG5uk5^UgBJZjBaGR1QPj8m)^Zy*n0MqI1D9Fo3*aNb(I?% z)gSD9HHlqJ#i)_y%0v>oSgWfEt!;f}+>`zvz0rLSbl}Nk^BJeBOy_y0pD>eeUVJAV zQ>A*EBnp7r!vA2me9>roTuCr%?tB%V92)RBi&q7}Mc?NGSG)4(6w4eWx9Jkzt6<|^I5A<}>nI~P;O39qP9AbMVfCD|s1x`58sBN6QQ zc2uP*Y4yK7wz^(a*>HS%rjtq6%*UxNEn9r~m6wxTGvs%@%DB*Qc8aS)o#dtrVmpyg zEu`RwG`GFhA-A{P=2_4}{|nBzL?~C><8&`kf9LXFslsueEMui)&^ZmzMNTSZ;XgLy zDeoQLj*iz2oYgknhLhI;EJ(`r%a)7&6MPMo0jrf0y%sL z8bq{y->{h;+NRnh66_sBPO6ne-HRwp|v@0YJ?27NO*s^h4RR17i z-2Wln+dSsq@aCVWWs>h}#X@*IA1He|S*Dcc{_Q@q3Gir{r#dFxlio7hHd@h4;AnRuN+;l@7r&QFj+YACM7)eUbs+-t-yWQO z@eXb=xY7dCxTR0hT9o0rqJjqeYr8b=QC6 z+0$!_c|Z25V(|uyqEy*F2^B>MnGJ^u^gm`x?n9O9DgC$hH80F@q1;-zG;Od$-`caD ze>@wcLvXFu#KGn$-yK=`^LS+6blwxTBlws*`oELg`!!INbP*fX600XkguwQijZ9W7 zOz{|PXA`gPb2nMtKbyy^_lS1A`0cTT%l6C*uZ=pWjV zaO#YwMGM6QYP2i+;1|XIxBBA@`j$Ac;muHQp)QZ?3|3x*2Y-KoKdT$@-zy>TO-|I! z*eXx@H|g!137W^xP7f#ALe7qPc;Db(Vf#OQ6MYg-o3Iv+ZPwgn*_vb_Jf^-21QUVB41BeI&L8`tM7+>Yp(1A?2LJ$6s!$~@-1j=}lSWF6 zd-gKi=L7&=QK>2^XnSL}=g1m7C(h*eBIzSZKhi`*zeFcMpYzqcz{W$<6m1hgV#&GD zY2E$lFRa5A)4Hws4xb**1ZI0&x9@s<+e#ew(Hy#L@im)r&vehKImI~6ZQjg}8J@Q4 z-Yar!Dsn8U(gD%JrryFiGAq~9E6EDRBuwa_#s8X8AQyqRr-5DaH~Vo*u7Q^`d#CNU z{%4zJx0ryTg`3l=!0S!wbE^|hN_#_#4Z8z^_RL`|K2_JcQ+ zPUEq~6vP3J2Z`IH}2|0-kk{gaU8Ry0>MR%t^-O z8r$)QE)O!Z194rk{wDBSxW1TbzlpP}-43j4^-EO;9?lcwUAM*qMitUTR z%Tf8%eXQ4R_}+p4{DfKV^ZTiC+Gv=W|7g+WFxTk^$-4HPiGZx#G`VZI@3}1gw5C;m z4W`U}Im^_%N$++nOLKcF`{trcbqC_lCpd-ag*{K{q4be!cA)=GAtX*`>_t z41Rk2S<^XC57fKMjDWpKj}|cizhUM`WXv@`IBd=ajd5m7vY(m}Jx7g-`*_VCH!obf7_jE*p%>51ZVpnrW)^NvmTZK54Oq== z9EOx3Yf+bTbbvo|>+ToVmkYN6)1Ml;7uLJ%3&2e0|f=_fl^l-uv{WP*+srl#6X>Xt_00^Sm=$nLz3Tk;w5HMNRYSwkr6$ES{%Ltcb<@eRLH@&(|Uc6XrK% zMBRGM2v3*Ob_>xsH_8Z^XKLH~u!NRs+jncfoU1Zmw79_Nb}Wo>aD1NB%p!w6jZ(h3 z!AiADZ&mjRb>*`kmn@CH(sUlu31ZkbzSRGa)EJRd35Eq;$$zi*O7-K^7pT}c6p)3s z@5i`O`tCHYy3K8xdU@j>QlEUVX z;=jciWG4?t$40>g*TTDL{4{NYnpt9slpV^(|u_!c9;TiuW0z<{Zi%41ee!M8g{)0 zUM+$a6*G`r>GFZaak*b_S7mm0y0z;jnA*>NF5U5Jct-H>fiZlebX`D%OJ98VYp9r6 zK%UQiJBEi7f~O|vl*@-Dyzw`z1#$jcR$(~DzZd{giEAqpL>9|muXo`b@!aCuoTnp) zf1lC3Sa~Bhy{jhsdh5gs8Paj3k1UQcyBJNCta+qF{lyP?)Q2-WxAB)MRKnh!6zPnC zKLt!h{r27ijf*_+kIb%?nY#Y1{SuX{cb8iS9tovzzxn^?=*b77YGllpH|3m22$QbfOey}^YO*S4E(TrfD9^If={U+N&Bc3LsF4LEIH zaDHoB_$lCGJ!amq{Hrp-&|MX_kq|q-!&fO4HRXKLLZhh7>ace5m(xY- zG5aX1SVT(d*To2Xzgyn{N7FHE@291R4Xm}x2%+=wW^$FEP5zMd>L+)hZ#IP_{FXa) zQ>O4l%L@m5-7%sX@d)4^k_1df=AGI!UKq+Nf8GO6Y$AD$w=#d)cKYS|WQO{*WmPtV zxNV}sWdd+^y&D*qwhomsm)o8@uJm#~ojV`&Vy~Znx4HChl6|vJj__6-yjC;4Tux`V zUA!EJoSL`m2XH|H^MeD|xhBi2HG-lUoZn(vvwW{sfD1bnospz>uDc=35qligJMP(+ zwO(!n$e*aJ+pAS6XS(eWRfNoS+gRq#`20#5iQHaL*Cp=1O)?td|KtLm|H6vpd=Pcx za`E3ZqMmW8fgf(4e+YiN`);b)a6!+^|Co_l#HD}BA6)Jmv%BNfe(9FlJZsZ1x9u{8 z@fm*44)*&iV1~f|!AvHJ4~RJ;iy7(CN7Y{tez~aYBxa>#b!o8Jyj3?nNRaHlYp>&b zag#RWXUhtdB6DsDtQnAWJXFqE%9lO)ZPl=HfA_J|*Po2r&l>V|I_y4m#MsK6Hchn} zwzp&tKWOQ;WD($jo^$n^6qS?3XeLrC?!OZ0K(o5ea(|29Ogk^QDdM5Y&VCnVG@B>N zY#Xq`y6_v>aJkb=t=Ej1U~wP8M9X7^*IvVZM6;FvmT>{= z+zsb>)p(I9d3At3FI2clP6ZhNuh#!$x)^cCaQ$_h@2uN<*4dn(aI`ov#_n)H$~9+9 zD*6s3X4FhEfpP5HznzszDJ19gs}SMamcs~5KTAhex7N5xZ19=ygpQu`cdD46qkjuk zEk{=r!qkMv{9<(SLWN>}FI39un(qDLJPoP;5gW7)?rm~hs^_ez-VDz55kC!%B@C0E zVzT07+Z#;GIw}Aa)WJ7t$+5}x60YUs<~(l5`(|*C>rX|$9~oHYueNXrNjf!gp!pdWu$5~n|V)o$Rr8o(_3_ThD#H|QR<}`DE)Q9R^DVk z_RLXY`0rsC@a9Wvw?E1-<6hX!@D=lPvnUf2AitW@(%)~_cfm1-;cTC-byjmG2QTNx z5cm%0z@ySVb7_e>(3>?|RD4L-J*^Lnp@Zz$=;l)mbPH03M}O#8?4kwij8z7#69fSk z_r1vEA^4K+UA%<@gr8AOBc2}oyf-E177y;i)?($-zO|mt`|3N_O&9`e*G(?MV+oNb zBl!OPM1~@l{!ABv8?Uk*w&~_mh;YI9a(V25&@Jr};%k}N^#;5q;rCS2WL@Z{$?m(D z5@f_4L^-&7)+ROqgNo<=(`-TCVXkHIqQBQK-#~V^6-=DX426qTxFpp2e2p?GN9bv# zCjAxP{?c`4+spQW`2F{LUEd+=?=MMNcbQsGgyiUL8MZ8KKZrVXD9e-+8z#LFsZ@GB zM6Cue|<;vRd z*wb_OamR|AqM!B;R{k1_I3o~p0Wqcou_p$k7*Sge9^_F?Wel1+1{jAuZQb?H@U$)b z<7;Jk<BexPBLSO>WhHwimie)^j{*R8`mMuoS$=WMxsg((P!x!qO$4wI6+}uUGkU z!N*u#Rx>+E83HZZea3zefAV1ZZggX~4{a`?7#(3jKU+He$`~=}ke&r*4-avFTm1U0 zwze(;-&5-nYE|sTojox)4w+l*K5C+fak(lzm38#G4Jlu?~e?atkG_U_rPhU>fEg!{5k&l$=!qSC#m*fNLciHqLpIb z0g3stzBdsUlO4ZXDvE`e=blrhM_N~~5^NL;X^-)NlVhj>=D}ylr0NtS?98#&Co*{i ztv#|=dtEb!1yb!49Oo+FlN2MD=`1o7N|hNbV{Pw>2@)}XD5{F^58x^SIOH^*)K$&Z zqE1CSua7>}`@5d=1t2o*(NmR4FD5<+m>cZSO0TB=k03em@hzh&$}!FaL=+1*NY-I1cN zG)Q`r;Y<-S=IYLZO1!c8c{`0`QKWJiGAV9rcaJKa1&9YT%Dex-iG3jEc0aLoLAH&K zKzi#-*B}q1O!xVUk8#mGBL1-mGZMjYy($r7ka)IWXMAXitL2SY90Cs0;xYI9VJ|=% zpOVXuOidX~2<`d1IZVzi&wlY)s*{Bxamoeev^q2HaE;VByI;I-Yh#;E$1L_gJ8@CQc0Xj}UNsi|N?g}ry zJ{|sX9YTS`m)m^*Ji$ZLA7Ff)D@|r5N~kz`S!2pZwa&gcQQub0M#|tm;`$3xQ|?2X zjvU$`hnn0_Yh#0T=)Jx-lTs=Im`60sBLVomTP=}qeo6KVUjOJH^4(w@NJjG#@!cIl z)=qu$Akio&C9`lDvCea=WmYyHw4kIk_(pQTig=zLP3$RLBr*~#I#K@J31-Am=mD=+ z<%PmrkXT=cbyl-p60MuyDXEr?V510E;wNI7q=?X+0TURZ2y>PI&A>h6=uJUuILMaa zFTH)AHvwb;k6!tRtxuudzO8BdWplle;X9h6JVf4SQ8B7#z9SAWFU+fPaR0{p+_cX- zypQ|&v6?h7u4Y~rIhoRSlj2e5xq^3A9*8W5*%Bz#aTAh~0k5C$BF%u$?GR8G67~qU zDUd~>eA}tqB)I@zpOelrvD7*BJw3D9h4cokN1el=FzS(6wdkgb zfLon1_&(UAoHt1Cbsb_>6?2bm<;z|%IjG9o3j&H0rKn!_wY75ai#LAMv~7xMU5iyROB9bjV|3~ z<~&qE^dD6{Aa1~z4r|Lv3jj8zr}Hrw*(0vH!-P1NT{PE7lgMrsrQXsNwC{b=d!|mP3E|VaERI$ku%# z{=76nT6!yO;G<3B5ip)(eY$8nw3!et@>rgP`MHCt1}0AO0RVdHl(I?@MKk6N7U^-Q zk$a^*)1g$8Sa}iB6ZCP2A|x-1yUbUgVA`c94$Mky6p3QD70z_rDfLc*x$u}>gQ0i2j$D193*?~v2N(MX!{|?vz-a+^M_#w zan1u)L&nB~kd{;^-xR7Wa}00rcGs0>`)ajf4ji8WuK#8&6dgkTL|;8di{rO5>$v>K zo6>1L@_0^5NvjxeR^@2fM$&wd_g*PqqSD)G zL2AuA-8e4-wF@PVhkvdYExD|vCdGq^*wsUxVrAhTbO53E|esQs0ty8_L5 zxH1BIWNkd57E#107$e1Rcb5^Byccc07wEi}dYY?(RhLJ_-ZR5D6(qSHlj?v(IYn0S z2VFR`E0#T3h){0;HuyUnP05g%Usv3Fyl)UQcXqMG*wXz+vUqLl9MwBPQV16?xh&Z= zeqT!*cHo<>H+^e*haj&J6Eh;Qh#^*k`{ZP z)o94vN}>L1DY;d|l2v+(=CeM3t3!ztcWFkL>H(zHPH;~v)eyZlxjI}_vGMT8inTB6 zp8D$MtL=A~30xLY3H~o$HYO4D7RSr**Wbeb4@iSNG5NnB?LQ5Kqd2^_p8j7Apm+`3 z&!_&=@E`8>zx!$WUk(5D0y-$~|A*22zwcBh9{nmVaj~&z#jq*7;aFaM{xpmF&C6kr z+;g)Haec;jyJ{YcFj>#mlnbvm=-|w+Vs`RR;wEU&TOZS7zK~DCiLd62rM29egw8&M z4jO+3552rAeaHPX_DRe7TH-sv+rh5}pZn)-!kbMkV^phQy0V+@{5(#9Xjq_b-`hvA zlG~b4vtGGBi=RJ)^e_(%Ry49A(mKN+$7}CKqm;@5h3g{j4FJ)f4c+JC9LyZl3mr;7 zVd}LFYfpHKzx{l(L7kfJ8?P%aMHipHv+;2^S)@@4$t+{z?Bh6$s?%9sjUHV$WTRr) zH5r?k zk>l8?z#eteH-+ac3OzX8QGjz@Eczy#3 zavG!>ejk#7jEvLuHqy5ImDyK+c)Q%Q4nIu}b={HK zlK1;VRuDy^o%0lTNDR}_H7GO?ZofIM5*7;_zalrr@gX294&Mn=;Rdoh$iS557@zf~ zm%qy&mq9H#;8NhdaFwTdLC3$i;-02TdORQ}^K9KTac$_jzawJ2AF1b*PPt@nRrKp0 z^tt`5zbJjnONow+^BVdGi2noQPWL6`aHrxsxDGEvaU}Y>!la)TFj_F=hZWBN;V7{g zrdDQYztXGK@i8u+&p_@EKItjPTf7-BmYdl5s|oa)ecgp4fHC##pO7d3nRu@Z8PI?E zlHLDkWIN#2J`(rs&1VOx?X!Zcsd5dc{o+GTR@XTChq0vQ&GNQ9TqT?O$EhEI zmi+Ar0Eii5)Cw|5xPtx<{*S!Lvvu$?(Jo$oi zkL}vAy;8kahu<#E+v&hRT~`6yj%G4f|48Pk)nkr1^Y>JtD)JX2U3551zoh%EY2wRL zDC-?uYQ4UfLn2!eq$JPjKlFGd8f1PpvLibAsQ$O5cfS?;7&EE(#wLzQwOX`apExS6 z;j(Tw$4zBiLiD8vlmQm#Vg~5Xpa?qZ{1<~r?)<}cMj00^6S_tc^1u}yF~j#960`%| zr&<5F*}zm2j@JCf{I<`JF$_EpL2d-(_~OPqb%FQWW17;+wSL;xITk=|@{cM~Q{#k& zjKBLKyiY9}2Ao~QjW01%?Dey6`YftiPaNDKc>H$zs?);O=~<5~rF_e{1>s$Vldl{EHs9vkbWwfv74m zw0EcFaIg!<`~HGH*08TXdxf{V)4V$$PF^7Fw?r}X14W{*c1M_un~k54y|2H zR0Y(DI-|7P?Q>Xu)14dRAO{N|=w3x#=W+vDqH+Ws@asVsQrPzPlW&5XdC<#~%4)SgX;yl20W#6Ti#M|F2@cNjQ z?|JUR8Cpt`B`x)(%4_5L3^YG1vez5;BmGkXrm zL1M^>Y|K5n-dm*R0`j*OLHsBqikM&|$$(dh6;g-*#D$<~FzAvH9e`D|rY~kJoyPlO zEV~WnI9cKYnoa||^8sWBN}%)g)PKqOyT%Piw$g>h^Y2Tw>NGgwk!a5lH5 zey$mZE+rK1TGT7Pr;mqG4s-&aTyE85&|3!M+-1Rm5X6rl0{+NdB8;^kNAZN?H!wf! zx5^6wzRZ7aNj^o^2?n#|*;WI#C8H9BOl+q=FzSsJ}?DZ`b(FjQfym2BD2w!eYMy zT|SUmcm@ps6>vtq=#+_D9cHv7mQ(aqVPI_+w95;u`U_+`F`XX_*osz+V>(5LmSg``jV>_e}i+L8=`z z{g^ERFM(RkNEA0`Psln#FyLnfP70KK>BkDn?1+!}qw?`bfbAy7=d$~Bp^YN@bGrej zwog7*TTu*6@Y=+R6_=%`qB618x(UOgUaHy{(E#@jmBe&De6WkV_|D?EpG8yd1w1uiSBu%K{H}rO~l! z*PP0#Wf)9LOi^^5*67} zA~D%#%~6~yFN?qw6ubB}J^*atylcyBUNa1M(u_C4$*l7tM3rt?>>Phoz+_zwPVr;t zV2qGL=uCc_;*8Yc&5B+0-vE4mH!d;Ti1E|01(*U$TH3&F?mZ>rG*!H;dV34pE`V|j zCJu)BX-DV6X=S!8{a`=FyOTg!2$wD9#vN-~LHs6}xpfWrAxQz4K|P2%blUGKjzMu| z{n^CgJw0@6D5RIWaH;y^tiHVyhwO4Vmmw>%gJg{Q?(h*coJ^Rbb=%o>hA`S|*y%#0 zM8|!~cb0;CC*~5bK+}KYRR+k$As^52dGvQ?y0n-DK{1y>KYLdN{%f0ekxq0MAy#X6 zBC~{xQtY)PT5sdN;N5IQfy6ew+{1M{;uv?tLDxm3E$_|MYxSKJAe7F!XC9*>59uCg zv2n%sf(f_pj?qF9_lrLDlxRg3&Ar>K$WZ>f`cCfSSd$P-1p6?jAa+^P;((CXm|GTI zU?b|B*L?N3NaHFC^##l|mZ|A*a8}`G)10)NSOnx2r($2^X;L@zb!FgV?rX3oyXN_# z^a$aNkLSExwjKv9FlR-6JdxNgyZD3prJtu-^O_Jk;&MEp=XzA+BO-p7&?E3W1@g&@ z;L&2P{DU&8YdRb3nDS%pwXPvTEk$Af{ea+Is19X+?U8a4VYQ4^eQ^cBpxW4rg_%ySxpv@ZeFSLKA?S=SEB12(?-s7!5a zR>gA^$|BV0tnyYG2#{nPF#tv@w00!uZ@%)_*%=W3fC}oicxqw-tbkBKRju3T#Xn$) zv`5)rli_1a`1p~AkZ$O{v)EUhpZdbn{5Xry%3W5R+vzXb9;*krSr#E!YrN+h;BQ-@ zR&O~3k5U_9&BIM0q;$Y8R$*IOdJ9QfKIVoZU7eb2noe&tNjRSP;$1aBf5>E z&m!y>eiK2+9)Gv}K*Ya1)Jp=j`z(J=LIC(Bc)A~W9UhIIJ?`uWQ=cL|kV^>uQ+#;~ zZV_n72)2zt?mIoIK>|M;q@=#*cbRxc&GJ5Ni{JFpE<} z*5^GB66$*a&Rb2pCSympFx+FTT?Xw_o$oA@*WMRrra@={`dAQPJ1X|$X*kR{g;73> zXeltDdh6(Aw*C`BQj71IOOoZoBXb6p%xz18;%_-y4hgj&WTbgNt6BNl2{;mydv;vY znMwf69F6qBuP4Hy)6{107&*kJYFyHw-&WIpVW4{>vajPDBtrd=#_e;7HsDIUnoOTZ z-rV8Izq=w+1|<=r6#Hc2Lv+y1n|1rn@|PFQmGV;n4WxD|+%gOQP5sf|M#G7bn&}6O zaDy3j`3nxK7#Z#16UR~yM3osF1$p;C{wmYJc5Ulj8gD$l3i3BWPVmE*CRjHU_Rr1b z8)7PAp7;r+CY$KP6}2=Z1n(2Z%igE@yzDcqM}Ne&`iPjy-90(^XU7xlXx_bL^L@nE-Uk2 z<0m*tl^Z_nzi(UhS8_~wPDdBd^we5!z~sHIhnbsMj!b|9*fYf(f6Ixw!lwiWvZ~I8 ztA3tjT#45glFJQ%p>`GWR*Ke>@B<1??~SbaCND{32?u#j4J_f(_r-DdM{R`{c%~95 z?L-0P?wD0|h;?Q?KA->nnX?!0Ib_3a;QYd>lwO6Y_}9`e>3*X{5c3esTBL%iElU~OWcP6eX%y;UpwHU-Ra7!o0c(nS+O`Cwr->o?A zQ|L5V84G=Bn+3$!zq4(du;^lJw3eVivJUE=)HCL)^hLLQr|w4mGIeS@{IGX z(>tZ^+m~RJzckVN{CCsfGU3wxP>o{LfCN%-^fah;f!ByYR5JCK?Z=m#on{K+z{c;T zZ-2?g>LwdKlz{D2DS4eY^k%Dtr;6q$!D$!V(b0Zp{I;d{9Q5u#{HsyWpjydGqj7Vvl=osq!yhFBGZBF^aWnlcdCe!qF!P?R<2qCYfj-$C#`|cJ#LcCme+95KJ zxC9g+?=5I`HjTF)2pQ^7*?8dktfhFN%AuDHl{tX%ES>V6JU<)@*TRlZCzz?lL$gww zH~jzAs~Fyt7Emql7jxb-36?e=O9BfkaK^++R(9r-(y++#&KDC7zac@GHCbW$_uA7| z4(kaMzgzA%=2d6~>JyOy3W#1Mi`E6=Y5Fh?HIl4VzDX{twMz@1eoNi2RxnzP(XCW5 z&|I`sYfc5_-$w`=8r}V-?Z`&J4~O}dw&avk9A;osm5V>AMTU&wRFfP0Eb=?OLn2mb zHG~8Z@vxPJjcrrL;D%Xh#v<4hK1Ki@w$PPE~u@zbpQxX4l!kdpp_ z*%ZMt^pN+N`baeyCr@?yfk>$|0N;G99&9L4cRkKtqbChCuhNV8L0o{bsV~Z;7u0(L z@<>_k6B|O9jaaquEkS0QQ+p`-rFl5W{zUfuq$-g~(lvC~Gs(eiEG)<#NllJ{d*U96 z?@s2hBD~%HB3?RAUKAyg_4NOdxyYt~p8MC@9y|Ld5&o@uh`=YkA=YZMHW?$N0r738 zEKglms{owG-d}1;3j29;N={ENL$cpq(N_M5byW^lgQe}H(hsPzu42;#7LCzH)b zwD?pLKqGcFrG2{!9Bb&ewR-XVrGnIP!W)Q3`;QuKjtZk%+XxF-ub?>CUG+n!4+Y!A z!(cKtQFl>c;46k_brGn~XkiRlExtf4YW1w3R=_#K*-z90p~1lb!)Hk*O2+)jpY%{W zC7@0Ob5yYYEptupxEr%tp4~zXy&m9Y_;k<~J#-~%^*jTyPJhnWDXEb@$DF+XQib2< zW$GKQu13g{sC)No*dKp~)U+)v2mio(mz~s8oK*4(U|*_j9Bu&PB4gRVFWRs=0nlBZ zFc6mbwH#3A^T^||Rp@RB<|$pG=Jb@Z7LQqnimZ8n6>Wp#^Dy=TFan18w5*c&nVt=?sAuIwf3Lbuag2)w8O29Xlbu?_*#`yQr{Yx zx2Jheo_rj9C!6DA6l}m(LuhU<-j*++ev`>L&54uwS&5x!b6!8S5+`VnU6}5cwbzmp zj0e5h3QzzhU!E7K6+ZNa=OajDD<6b^#WDPP-2|v%@OFCgC4(%-nU`(Me46UHBSDQPzNxwh zAeD|%E5GN~UQ-c0O6@#fTqU}lwgoXg-8$i|)s%^~HQwxhH@Hc3|5e}z(Q_NlRzHY* znXOSY1=K0Ye8;wZTmR)2h3`b^S>08!R}(UWX1S)C(}8?JiwT?oc@lKw7xXr|$5HXv z(zK3UE1RzkrPrR6SP_6mb1qUCan%tUy_!o=F)Qk&q=O36Lx-aHQ^S4 zD4SQELTS=VkPUM8!e762+KF`r>BF*XneO!U-EKN^OgrMc3+taOT)eh`&uiQLD#n%-VnI3oaKk=5WZP2Ctl+eZtf8rjL|KV!*=cLrt_IdbK)c9KKCh z!h)JM;mI~F){a%O0*OAZcu4(=yhrvzz{%{}$ay0Ui`7xm`k?lG zofOJGWYv6by^uft^?|-b^5z|%YsDUuS*Z}KwcO?iHDu-52fZLIQPI|X;aHE~+nIEo zAh6Q+yXMs|&8wPmqcvTYcwL%a&PCtpSxS28D6U1=bvj^dxvJEKT-t|`>ra*lv#L|R zyGgd#w1uRM{J1fZTzj|PFVjI%{J`Rdyd4CGXef;$oeka~SMS9e=C$*Me7wUDC&e1PMLKL`eviCpVjq z@SAuSAjST(cFT7{w_O0;y5>~AlSpgZR&5T9kG&tCB)v8;NzdHZLg41W@i#N7wf&z} zw!<1`A%$W>zSDj6FpsnoBj-AuzK75T7B{?*l*c$Z%`hMfQ@Sz3*X@mCcJ&`DrfD1& zp)y+6aLE?Whs*`c=ccW!yV`*|tkn|8yNO>De+*LBn4(qQnLd zaJqGRg|F@;f$l-mg#JrXvT=jEAc7dwlncE?%jAN zKm>)Czbk!nSwM;R!2B_|`_JW_8VfZLjjf^kfP|4ot{Bt5641+E_q3Z{GPeCNC}gCT z{u8guGHSh3JEqY$_-Z7przrDj+4qbq`I%Y~dg7th$UwX+E8yjCv@tkXiwUJ^gUsSD zJy#YfDJ!jdbAL{FME?;xWf?U}Zeoz^o^%qrTyx_upZ8y%LSR~RIq|kQ(Xp8fl4MUU zcuk;#mXk2eH)y;W*(>+bnI+#VDvuU2pIf!2@nWlSHLJooIAL;BrGwz@LQj|W+w@(& z!ssvJUf}AucS_{SeIydL$>ad~vsSZqtp`n3Fu^7%Yr$w3yRuwqSuhzX0LN zm_ezb#N(*6Hy3~S9;*GMKa{(5XC&Q*sfmjQQFApj)r^dSso|yVka1VxGHK+6g15*k zSrvD47`BekJY8$xK4!IHCDt+GM>(Ott;>cyT-h6d@>C@8Ut}7qhFLi`0|~~$!Br3O zES0<=3@^u#{PBls4SfOeoD3dbj)}@!ipeyll#jtCSPdXS zKwChtH64`cUcqG7q^a+=WG+liiv{3MpMq}=N-&n8BrVwJ+|zV`a79D$txBLa9R<>& z84Fx>a4~>Sd+AF5%QnWExa_}yJ&RL9wrD4O9x$={x0J!Pu}p^;T|=!~gmgdX%d?z+ zR~iP4!Il5&>th6xCu?q0+$C|`AXiJ_28fNQ z8t1++!iti}`I-9@GIr!okTK=hntXYJDy$V1;Qp?W9n;4=5>aSv+CUF;&8c+Pd#@6J zFQ5H3KSt64Nh~*HkYJ%$tk1lyh9pbpdAAiAnpOE6pC9W{A4c}KZ14VIBI9x5ZjTfp zjqRhwNin+5FpXY;Oe#)PIEbp@8eqSV-MuPFZ51DR1FrBZxd=jQ1cpH(KF3nU^ni)U zZF5iG0nMnrTT=N~Wl{0EB%_3}sO*hZ>oUCxzSJC2`5rCO+kRgpTKq!E{V?(TXYHc_ z0&l+^K>>5icGhpfJt0)`Y|loc!H7Gf6)G434yq)46@DvKK9Tn|u#YzMijiq>RE|6* z+j}`;yDQrI5x^E-vA<7{dYvRUtt+bw}h1}t_Uo63`D}(>mAPs6%5V2k#iX9+j*yw$xP%PXuGrsIPqSg$^7d00g63FWZo&-b>&4M6D zQPQZc*JPv$pmcg@or1V%92rM6ML&9gp7F(jyn^&w^9cQ53$$&G5;$P6$67H@H2zW^ z-b1fvo8VdstZm&Fc|IcW(g>3ZctA=fG>IS7qxHbNA0Zi|Z~F$AD0L0p<4f26k$Fz- zy%t_+Of1)YgWWR$y4-Q>K)LVj7CgrVBS^~VEl8mwJferqdS}lHI!q5mk24cNv{aJ8 z=rg2BqF7^IBTA(}3{6w<osd%bS76`3${kKdCHtTEI}n8ONfHwg7IDc(isaSRK6^H* z$ZXW^hk8@XbxXHWP5C{ zpeC?=&HH3AaG9~v`Aj(9Slus!DPQ&}HB&wtMDQ8z(Cz8Q8g%fR*L!5i#l4Pl6Iz7$lYb zBN1#YYmWG8Baf#ED6B6MTPxc7B5ZQu=#0PVO}TQl$1U}KiYraLQof&SBzupfgpOVZ z9v9LH?3pSia`aksAn0VT+Cf~ni>Fii1T9<5C+zNM%h9Q}QNOt%8Ivf$s9_~%XPn^j zs$I2|<={9K!7=4W=;*AT_^UVRZEXj|r8fEEzRE!G=eKK)C*u%3 zd(=MmRaralW})q)iJMa^6rhO>ysr4O_=3JD>+Jd#{jl%Rk>7%6;IL-kkfJ{o$HQ;| zD{PuyV8CgrkT&McR^wN>Y`x>)fUt4qIi@_Fz=hvBokkLW6nD2)UACSMrmu@J5;Smt zTrlNiw0GIn4K_VL0M;Wtj|-n%ut@8?Uu}K|yJ|7@Pf(~m*8(nh1ylvxlzN)>TY*6F zrb>DeBU~|;W1Sn5-=Ld5DZ?I461mM68#UZ7EIp^BTT32x_N^@q9XO%l2O z(H~d0OK%WYzYWhVC&90PV@@18n&ZZKVF4_7U10NzL1m7%PuyMpHT@`RQKb?yClxD~+gc zx=*eq z_d5yqE3_qoWT_9Wbo+B|EHRiXm$)jbT}cmh=bAX};5ykV$=Df9ht2fcnFX~?%+6U;xyn|$$|3O;s1U{rniu79fA8})a13#C{c5v5?>jKr_NdGd(gk%?iq(e$ zi!%%A>I8#OG*vsc_h!Dln2A2zEmi0AxHNUx#onKwgy(Q|7uZR?^gJk`wsx1MQNxFR zz#GCGq?}$NhROtKGUjw-N+@4;n@-)`T%bT?wJE!*<(|~84PpA3A9hX9Ro1vl)<*TD zW`E^$$PsJ~K?{BF{k_doPgL!))Gwji@#s*}vqjN_J))hpQ))5*2qCnQ&!{xTHl3#MP9Y4 z4JmoRMZ5F*4$MIyA}Z0EZV6une^;$DY8V}By-lWdoZU%`Exy=!^;Me0U2>0CUN#p^ z{z6Lmk6v9)%G6vBXBlWc_Vwv{3est0z$Ok{A3VQY9tW3;{@$yKv7c@djNdPSej7MA z=>tKM{Y&eT>`#sk($0TjD(`V#Db>bfQmzL)1T4`YnXtf^w*HgZSBR8HahL>RdxAEf zr0jh*7l6cN=)TMmiI{( zr(1rKqz79&QT5BH>9ek0@!xl=$&w5(fPYLXMLrMga$fEv$d#WE=hv16;`2d`k z-(`3pT;xUCcB<0!Y3!KfNS;F_1`>k@9Zp&{iF|>yp@(BK_SWas{IsB|6ly)McIK#l z_O!=4`$9QVLWsB1e!KT}lcsvc!KTs$JE@Aw`90|$O*nTM=lq5#S9Ae+5=#lEjX+t{ z4ywq-mC&;8qjkPD`=9yVy^q&cJ4i5wT-KV6{}0yGN>uW55P%8zQa6!pv|w{xfF(cK ziQ~gEsRs7*u0QF^2<&uioTPV03v{mU={Z8qTHi*4lzBb8IzdE+2ibO!BNF7r!lkaZ zFp#YMleGP&Hn{2Q2mFt-Re|#{mFU6md97S-F=n9*0is^G`*&-}2O>Verj4q`6tY72 zQL2PZC6Dm04l&oXXHP#~jJ0OaG{s#MJSk$lvy6yWCHtaP@mBlE{{({(eC`rLF&{|> zAaEbQ5J71uU@;IrkkTk5W@_d#xqu${wTZaiMJE_*l)wNU&yn&bTB5o7Kyo5U zCK?KG5Kwzk+z>_zoe$=esEyf;PyeKL=@$Y?3-c^SW)>Q=^e;gu?*ZOSoNhkQ{2MPfC2 z88@o|U1(@+36>FJa$3QW5MWB|1hlgxi{KWnH4FCXoU{OVy*}kd94`RoB$LHK%0cFG)R3Q1k^hg zTQGiO^E^H>20~lPVV@)tpt{i2e3=8_GY&MwA815jq#}m#=@X%9PVgxO1KhwTjWK4o z=Zyhx;3I)b$@u6abBlSsU6K6sJSDVUQBC=dZ%$KO9doVI4^fyg|(J+DMyoW|-BJyLSApu4oF^{n% zEsW`cF|}#pW5%GDxy_2|Wk~ z{bOAbLcZ5Fa53@BE$hfL<_S#*M?4{FYb?w~{G~4}5mhJT>Y@dK>ivW)9smXkKzjhG z<`pZ#Sj-Dymx2WSIYiZ5H^&4r!N)ql!}?3Z13CVt#r=;E#8aN3ef1ZQ8wZ}m2XPHN zi@x%NRl`7cJVc@BvpE!DXFYKd1UAhbUN%=Xo2vS#t5jz?&Nz@DIIUQ>X1Nd$AVu9U zk;wx_64<20q=|nD?3mghnWUHnNSP;qj$ zJ(x8PKA`(QLIMiFCB2ToF;OJ3??^fQBGrrw!(w_2o2v3A0}v%&YYTJK9WfZiM3JT` zd&%OEU~O`MIew7}4FnYnBtZpjnOK?!b7D-i#k@2J02&XbMmrzc9%C|@(I2g71HehZ zEcu-7mE_GV0|Ik_*)gHEYB^7UO5w4TRY6;c;(!<5(RgS_eWq=a)b1k(mx)fB5aD7b>0(AiV16K z6@mjK$xecknBE6~K*r2YGBGJn0@0GG9>_E|p)_C^K2c-DOkwIUhJXi9le+$9%F(zc z83ULglSqr05KOCW6M;#XQ~^N7k#ljBRbj^IzqWu8;4ncZF14ZnutpoTVZ0b#`59w# zpMEjXXkg|l)70-Q8tcI{6HSc)X<}L-L94XSRHJ2?TbR!LVk-VqO*9DY%pqn5R`;7* zVreW|i{^obBsd68X1sY~anwEH zf>PWBb4^esZ<-P#)F~YA=zYR{RKx*O$v>I}!6$u4qcE2kK z?eu}k1Q>)IO8~QCTH2SO46XGMP2A6{rgg^_|7mY73|ayZA;e_kV^=2DKl3UM!D<3h zCLwEpz@e?9#k3zV@qw9bc`thKHI=9VQf<;6G!sC_uQOJ2BydCP5)QO5ZL3|rKLM0^ z!w>w!x`d)HDgI4R)@X2DCi9aJp)eUt2IOo3T39xWqKKvEc# z38a%r8C}B9i*FWHguiFeC;|bj_r5z%g6anKCf} zgFa#qgBKz8ehkjfNU2gE%wb#@80cwWwQFf8j7sqEB~u_e64p-wOrXL203SaE*ag|@ zrgoZCPz^}K049!aWNdsPzV`u-zO?h0n~y3#!V35UGqSbnj-?H z3S<|{f{Ov9%y$}6&`exJAG7qQO+t*Dz>Uk2p1#neXa=M?H88GEO$Hf_?ve~9hq+ph z!t-K54*n!f%4ESr7)a+ZyiVjLn3~i|DNBRovlzGmRWmPA#9%Rv_AqcHX)4I;H1mS= zCE2})$x34jEY)>U_CL*HQV9=?mOu<`&3A}Ni~$J}|IfsFACMC&#vBs|qw@JoWL?N7 zF==9;BnT2XVo6}cNNe|-c!JQxWo=boqDceN9OXblW8@n3(-z@HDAMfwXhH%lX!N=% z!|%*v{{vD232^wR1a8**5>+Sh(UY~IP4h~NxgVJ7k_IqogFwo-!bl(R5vxMGS%c5V_?WRkUY8S%t!gG#9P5My7Kl$LM^UgQ0!D2BDPE4b8_i!2-W~<1iKop- zCDL05bwZ;6bBShTKt>H$QbA2G7fs_y4Zx2i*ME%S9rDs?iF*8%H zRv!o<<~hNLrmR9jmB}q=g}?D3MMGeQKIWQWB&;bBbB2eFAFohkiS>BKIQZq}3cm(` zgpkNCUe0NN{c@3UELeA!mSUD52;V_tv$7VDd&Ga&JaL?SaLG$Eu2zB&Oc3hiQ)erzTl zI0%TWlcK+gX2B3z#_JyR&E^O612FwT3w`msu^1P>hhh%m=lHmn7jOss;<3WioD(9(!L&yU zAR!O~Fmz^uN1G=gg)ZiVxtsNVRu&$%jtU?N&Lset<3?Clc!m(eyQ%Weq$Oloivnia zWBuquRvek)HHGxumZeGnJW-ejCZ_3_bS9Ug$oHRY= zVvYhF%Ol&`FcClyCNxaSd%8>37CtdXphOcsc9uc-wS=+f2{)i6r0Oz@%RJ$`oD$&uTo_7* z1r=9J{|ITc(>DUinDLFiMKfx{_$>*sh|DvdH0S!1t*8k+0<BqlG%0~#mc zV**Gz&t^ThmSw>JF&QzrHqjuH7C#WpOcEhb!}!`HL}GGB2!vzX$0=h%#_UuT|jf4?{onGC3|u|^w2L)L7X8s6`-5Bf@QBoUuV#L#5c%@mO~zGFI*oNRhdIg z!l?C`92CXurd4RZx*aPMm`SW*`+glQ?~nhT?`zHA8cnPjGWEW(nzwyMPOaISc9R7Y zccF&+Yej=9*lM5a#{Zf$P^(+iqGff9UETa0fYu;MU)e9QhDwVnbo;u&HBM1$8du=w z{tCEC*RgDs^r6zI)*h~f+xvaL*>F*pD#I`7Q>``Juc_9OJ@Jj}efhaiiQG|;W{Vc{ zl`7_A`uH6{nUpkY%(}cJrd*w*1UbfvS%(1WFmscS2b}EmoC{jhuPO*~E(}wPR%Frw zAQOU*!K~xM_-QGJNhcU0=;b?_EPbgARwt#VYSj>YWeoRKX064#D|1w!)%35rNxNo> zq>6p*SIy+;)2Jd$>LPv>I(cvURF@y>rj^WB%@(QPt*KQ#L-r>H)Kt4l!@j6^1z#Ay zGI5OrS0T}-lT{NqbJG`Is~a8a?zE~<>Uw3(Fse&b=|f+Ma;!v6<%cT3>W;ozc)lvJ zQIKMO{)e?e4t_Q-&~E%X8jPvXYnaM(wbOmdS#~L<^YO_5N0iWqZ@|>7QmY3?%qJ$2 zKo=nLZ-9{?$u1cFgb&|TyCR9KfJ(fo#cEnzO&`j5`^l-3So12!v|&G~VThU+Stq-% z*5Ci#Gh43(E7SBv!h2~RCaJ(1tJ7O8gKDYN|MdmmYFin5rCA+M-ObcnFntZA3ho|& zwcgc2dwJ{JjxB*ydiNGcpW<1o`1gg_E05KE3HAP7IR4kl3?5)B3!QV)MdE-HaH2Kp zfchg0`b`qOc~hgh+04MN`C%F`3yiPxWS(l;1Nh5bVQA1=Iq7+`S}kJ<=VK*%#%e~-RgI(R zny#r3*>p|UbWI?guIZYt38d3CT@y&BYr3Xu0_k*3*GhN&KUH?Nn|eo?_W%F@07*qo IM6N<$g0;9N9smFU literal 0 HcmV?d00001 diff --git a/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/system-test/risk.test.js b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/system-test/risk.test.js new file mode 100644 index 000000000..b62d937e0 --- /dev/null +++ b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/system-test/risk.test.js @@ -0,0 +1,208 @@ +// Copyright 2018 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// 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. + +'use strict'; + +const {assert} = require('chai'); +const {describe, it, before, after} = require('mocha'); +const uuid = require('uuid'); +const {PubSub} = require('@google-cloud/pubsub'); +const cp = require('child_process'); +const DLP = require('@google-cloud/dlp'); + +const execSync = cmd => { + return cp.execSync(cmd, { + encoding: 'utf-8', + stdio: [null, null, null], + }); +}; + +const dataset = 'integration_tests_dlp'; +const uniqueField = 'Name'; +const numericField = 'Age'; +const pubsub = new PubSub(); +const client = new DLP.DlpServiceClient(); + +/* + * The tests in this file rely on a table in BigQuery entitled + * "integration_tests_dlp.harmful" with the following fields: + * + * Age NUMERIC NULLABLE + * Name STRING NULLABLE + * + * Insert into this table a few rows of Age/Name pairs. + */ +describe('risk', () => { + let projectId; + // Create new custom topic/subscription + let topic, subscription, topicName, subscriptionName; + + before(async () => { + topicName = `dlp-risk-topic-${uuid.v4()}-${Date.now()}`; + subscriptionName = `dlp-risk-subscription-${uuid.v4()}-${Date.now()}`; + projectId = await client.getProjectId(); + [topic] = await pubsub.createTopic(topicName); + [subscription] = await topic.createSubscription(subscriptionName); + await deleteOldTopics(); + }); + + async function deleteOldTopics() { + const [topics] = await pubsub.getTopics(); + const now = Date.now(); + const TEN_HOURS_MS = 1000 * 60 * 60 * 10; + for (const topic of topics) { + const created = Number(topic.name.split('-').pop()); + if ( + topic.name.includes('dlp-risk-topic') && + now - created > TEN_HOURS_MS + ) { + const [subscriptions] = await topic.getSubscriptions(); + for (const subscription of subscriptions) { + console.info(`deleting ${subscription.name}`); + await subscription.delete(); + } + console.info(`deleting ${topic.name}`); + await topic.delete(); + } + } + } + + // Delete custom topic/subscription + after(async () => { + await subscription.delete(); + await topic.delete(); + }); + + // numericalRiskAnalysis + it('should perform numerical risk analysis', () => { + const output = execSync( + `node numericalRiskAnalysis.js ${projectId} ${projectId} ${dataset} harmful ${numericField} ${topicName} ${subscriptionName}` + ); + assert.match(output, /Value at 0% quantile:/); + assert.match(output, /Value at \d+% quantile:/); + }); + + it('should handle numerical risk analysis errors', () => { + let output; + try { + output = execSync( + `node numericalRiskAnalysis.js ${projectId} ${projectId} ${dataset} nonexistent ${numericField} ${topicName} ${subscriptionName}` + ); + } catch (err) { + output = err.message; + } + assert.include(output, 'NOT_FOUND'); + }); + + // categoricalRiskAnalysis + it('should perform categorical risk analysis on a string field', () => { + const output = execSync( + `node categoricalRiskAnalysis.js ${projectId} ${projectId} ${dataset} harmful ${uniqueField} ${topicName} ${subscriptionName}` + ); + assert.match(output, /Most common value occurs \d time\(s\)/); + }); + + it('should perform categorical risk analysis on a number field', () => { + const output = execSync( + `node categoricalRiskAnalysis.js ${projectId} ${projectId} ${dataset} harmful ${numericField} ${topicName} ${subscriptionName}` + ); + assert.match(output, /Most common value occurs \d time\(s\)/); + }); + + it('should handle categorical risk analysis errors', () => { + let output; + try { + output = execSync( + `node categoricalRiskAnalysis.js ${projectId} ${projectId} ${dataset} nonexistent ${uniqueField} ${topicName} ${subscriptionName}` + ); + } catch (err) { + output = err.message; + } + assert.include(output, 'fail'); + }); + + // kAnonymityAnalysis + it('should perform k-anonymity analysis on a single field', () => { + const output = execSync( + `node kAnonymityAnalysis.js ${projectId} ${projectId} ${dataset} harmful ${topicName} ${subscriptionName} ${numericField}` + ); + console.log(output); + assert.include(output, 'Quasi-ID values:'); + assert.include(output, 'Class size:'); + }); + + it('should handle k-anonymity analysis errors', () => { + let output; + try { + output = execSync( + `node kAnonymityAnalysis.js ${projectId} ${projectId} ${dataset} nonexistent ${topicName} ${subscriptionName} ${numericField}` + ); + } catch (err) { + output = err.message; + } + assert.include(output, 'fail'); + }); + + // kMapAnalysis + it('should perform k-map analysis on a single field', () => { + const output = execSync( + `node kMapEstimationAnalysis.js ${projectId} ${projectId} ${dataset} harmful ${topicName} ${subscriptionName} 'US' ${numericField} AGE` + ); + assert.match(output, /Anonymity range: \[\d+, \d+\]/); + assert.match(output, /Size: \d/); + assert.match(output, /Values: \d{2}/); + }); + + it('should handle k-map analysis errors', () => { + let output; + try { + output = execSync( + `node kMapEstimationAnalysis.js ${projectId} ${projectId} ${dataset} nonexistent ${topicName} ${subscriptionName} ${numericField} AGE` + ); + } catch (err) { + output = err.message; + } + assert.include(output, 'fail'); + }); + + it('should check that numbers of quasi-ids and info types are equal', () => { + assert.throws(() => { + execSync( + `node kMapEstimationAnalysis.js ${projectId} ${projectId} ${dataset} harmful ${topicName} ${subscriptionName} 'US' 'Age,Gender' AGE` + ); + }, /3 INVALID_ARGUMENT: InfoType name cannot be empty of a TaggedField/); + }); + + // lDiversityAnalysis + it('should perform l-diversity analysis on a single field', () => { + const output = execSync( + `node lDiversityAnalysis.js ${projectId} ${projectId} ${dataset} harmful ${topicName} ${subscriptionName} ${uniqueField} ${numericField}` + ); + assert.match(output, /Quasi-ID values:/); + assert.match(output, /Class size: \d/); + assert.match(output, /Sensitive value/); + }); + + it('should handle l-diversity analysis errors', () => { + let output; + try { + output = execSync( + `node lDiversityAnalysis.js ${projectId} ${projectId} ${dataset} nonexistent ${topicName} ${subscriptionName} ${numericField}` + ); + } catch (err) { + output = err.message; + } + assert.include(output, 'fail'); + }); +}); diff --git a/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/system-test/temp.result.csv b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/system-test/temp.result.csv new file mode 100644 index 000000000..2329cb63c --- /dev/null +++ b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/system-test/temp.result.csv @@ -0,0 +1,5 @@ +name,birth_date,register_date,credit_card +Ann,1/31/1980,8/20/1996,4532908762519852 +James,4/5/1988,5/9/2001,4301261899725540 +Dan,9/13/1945,12/15/2011,4620761856015295 +Laura,12/3/1992,2/3/2017,4564981067258901 diff --git a/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/system-test/templates.test.js b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/system-test/templates.test.js new file mode 100644 index 000000000..16b330d9d --- /dev/null +++ b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/system-test/templates.test.js @@ -0,0 +1,103 @@ +// Copyright 2018 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// 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. + +'use strict'; + +const {assert} = require('chai'); +const {describe, it, before} = require('mocha'); +const cp = require('child_process'); +const uuid = require('uuid'); +const DLP = require('@google-cloud/dlp'); + +const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'}); + +const templateName = ''; +const client = new DLP.DlpServiceClient(); + +describe('templates', () => { + let projectId; + let fullTemplateName; + const INFO_TYPE = 'PERSON_NAME'; + const MIN_LIKELIHOOD = 'VERY_LIKELY'; + const MAX_FINDINGS = 5; + const INCLUDE_QUOTE = false; + const DISPLAY_NAME = `My Template ${uuid.v4()}`; + const TEMPLATE_NAME = `my-template-${uuid.v4()}`; + + before(async () => { + projectId = await client.getProjectId(); + fullTemplateName = `projects/${projectId}/locations/global/inspectTemplates/${TEMPLATE_NAME}`; + }); + + // create_inspect_template + it('should create template', () => { + const output = execSync( + `node createInspectTemplate.js ${projectId} "${TEMPLATE_NAME}" "${DISPLAY_NAME}" ${INFO_TYPE} ${INCLUDE_QUOTE} ${MIN_LIKELIHOOD} ${MAX_FINDINGS}` + ); + console.log(output); + assert.include(output, `Successfully created template ${fullTemplateName}`); + }); + + it('should handle template creation errors', () => { + let output; + try { + output = execSync( + `node createInspectTemplate.js ${projectId} invalid_template#id` + ); + } catch (err) { + output = err.message; + } + assert.include(output, 'INVALID_ARGUMENT'); + }); + + // list_inspect_templates + it('should list templates', () => { + const output = execSync(`node listInspectTemplates.js ${projectId}`); + assert.include(output, `Template ${templateName}`); + assert.match(output, /Created: \d{1,2}\/\d{1,2}\/\d{4}/); + assert.match(output, /Updated: \d{1,2}\/\d{1,2}\/\d{4}/); + }); + + it('should pass creation settings to template', () => { + const output = execSync(`node listInspectTemplates.js ${projectId}`); + assert.include(output, fullTemplateName); + assert.include(output, DISPLAY_NAME); + assert.include(output, INFO_TYPE); + assert.include(output, MIN_LIKELIHOOD); + assert.include(output, MAX_FINDINGS); + }); + + // delete_inspect_template + it('should delete template', () => { + const output = execSync( + `node deleteInspectTemplate.js ${projectId} ${fullTemplateName}` + ); + assert.include( + output, + `Successfully deleted template ${fullTemplateName}.` + ); + }); + + it('should handle template deletion errors', () => { + let output; + try { + output = execSync( + `node deleteInspectTemplate.js ${projectId} BAD_TEMPLATE` + ); + } catch (err) { + output = err.message; + } + assert.include(output, 'INVALID_ARGUMENT'); + }); +}); diff --git a/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/system-test/triggers.test.js b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/system-test/triggers.test.js new file mode 100644 index 000000000..907b03b9d --- /dev/null +++ b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/samples/system-test/triggers.test.js @@ -0,0 +1,91 @@ +// Copyright 2018 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// 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. + +'use strict'; + +const {assert} = require('chai'); +const {describe, it, before} = require('mocha'); +const cp = require('child_process'); +const uuid = require('uuid'); +const DLP = require('@google-cloud/dlp'); + +const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'}); + +const client = new DLP.DlpServiceClient(); + +describe('triggers', () => { + let projectId; + let fullTriggerName; + const triggerName = `my-trigger-${uuid.v4()}`; + const triggerDisplayName = `My Trigger Display Name: ${uuid.v4()}`; + const triggerDescription = `My Trigger Description: ${uuid.v4()}`; + const infoType = 'PERSON_NAME'; + const minLikelihood = 'VERY_LIKELY'; + const maxFindings = 5; + const bucketName = process.env.BUCKET_NAME; + + before(async () => { + projectId = await client.getProjectId(); + fullTriggerName = `projects/${projectId}/locations/global/jobTriggers/${triggerName}`; + }); + + it('should create a trigger', () => { + const output = execSync( + `node createTrigger.js ${projectId} ${triggerName} "${triggerDisplayName}" "${triggerDescription}" ${bucketName} true '1' ${infoType} ${minLikelihood} ${maxFindings}` + ); + assert.include(output, `Successfully created trigger ${fullTriggerName}`); + }); + + it('should list triggers', () => { + const output = execSync(`node listTriggers.js ${projectId}`); + assert.include(output, `Trigger ${fullTriggerName}`); + assert.include(output, `Display Name: ${triggerDisplayName}`); + assert.include(output, `Description: ${triggerDescription}`); + assert.match(output, /Created: \d{1,2}\/\d{1,2}\/\d{4}/); + assert.match(output, /Updated: \d{1,2}\/\d{1,2}\/\d{4}/); + assert.match(output, /Status: HEALTHY/); + assert.match(output, /Error count: 0/); + }); + + it('should delete a trigger', () => { + const output = execSync( + `node deleteTrigger.js ${projectId} ${fullTriggerName}` + ); + assert.include(output, `Successfully deleted trigger ${fullTriggerName}.`); + }); + + it('should handle trigger creation errors', () => { + let output; + try { + output = execSync( + `node createTrigger.js ${projectId} 'name' "${triggerDisplayName}" ${bucketName} true 1 "@@@@@" ${minLikelihood} ${maxFindings}` + ); + } catch (err) { + output = err.message; + } + assert.include(output, 'fail'); + }); + + it('should handle trigger deletion errors', () => { + let output; + try { + output = execSync( + `node deleteTrigger.js ${projectId} 'bad-trigger-path'` + ); + } catch (err) { + output = err.message; + } + assert.include(output, 'fail'); + }); +}); diff --git a/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/src/index.ts b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/src/index.ts new file mode 100644 index 000000000..403aef83b --- /dev/null +++ b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/src/index.ts @@ -0,0 +1,29 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by synthtool. ** +// ** https://github.com/googleapis/synthtool ** +// ** 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}; + +// This is the original index.ts found in nodejs-dlp-with-staging/src. \ No newline at end of file diff --git a/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/src/service_proto_list.json b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/src/service_proto_list.json new file mode 100644 index 000000000..5a79338f1 --- /dev/null +++ b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/src/service_proto_list.json @@ -0,0 +1 @@ +["../protos/google/privacy/dlp/v2/dlp.proto", "../protos/google/privacy/dlp/v2/storage.proto"] \ No newline at end of file diff --git a/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/src/v2/dlp_service_client.ts b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/src/v2/dlp_service_client.ts new file mode 100644 index 000000000..a20755a10 --- /dev/null +++ b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/src/v2/dlp_service_client.ts @@ -0,0 +1,6109 @@ +// 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. +// +// ** 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 * as path from 'path'; + +import {Transform} from 'stream'; +import {RequestType} from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; +/** + * 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 _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: {}, + }; + 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; + 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 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}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + // For Node.js, pass the path to JSON proto file. + // For browsers, pass the JSON content. + + const nodejsProtoPath = path.join( + __dirname, + '..', + '..', + 'protos', + 'protos.json' + ); + this._protos = this._gaxGrpc.loadProto( + opts.fallback + ? // eslint-disable-next-line @typescript-eslint/no-var-requires + require('../../protos/protos.json') + : nodejsProtoPath + ); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + 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 = {}; + } + + /** + * 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 + ) 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 -- + // ------------------- + 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; + /** + * 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 + * const [response] = await client.inspectContent(request); + */ + 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); + } + 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; + /** + * 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 + * const [response] = await client.redactImage(request); + */ + 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); + } + 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; + /** + * 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 + * const [response] = await client.deidentifyContent(request); + */ + 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); + } + 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; + /** + * 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 + * const [response] = await client.reidentifyContent(request); + */ + 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); + } + 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; + /** + * 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 + * const [response] = await client.listInfoTypes(request); + */ + 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); + } + 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; + /** + * 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 + * const [response] = await client.createInspectTemplate(request); + */ + 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); + } + 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; + /** + * 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 + * const [response] = await client.updateInspectTemplate(request); + */ + 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); + } + 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; + /** + * 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 + * const [response] = await client.getInspectTemplate(request); + */ + 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); + } + 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; + /** + * 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 + * const [response] = await client.deleteInspectTemplate(request); + */ + 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); + } + 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; + /** + * 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 + * const [response] = await client.createDeidentifyTemplate(request); + */ + 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 + ); + } + 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; + /** + * 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 + * const [response] = await client.updateDeidentifyTemplate(request); + */ + 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 + ); + } + 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; + /** + * 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 + * const [response] = await client.getDeidentifyTemplate(request); + */ + 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); + } + 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; + /** + * 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 + * const [response] = await client.deleteDeidentifyTemplate(request); + */ + 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 + ); + } + 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; + /** + * 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 + * const [response] = await client.createJobTrigger(request); + */ + 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); + } + 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; + /** + * 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 + * const [response] = await client.updateJobTrigger(request); + */ + 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); + } + 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; + /** + * 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. + * Early access feature is in a pre-release state and might change or have + * limited support. For more information, see + * https://cloud.google.com/products#product-launch-stages. + * + * @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 + * const [response] = await client.hybridInspectJobTrigger(request); + */ + 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 + ); + } + 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; + /** + * 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 + * const [response] = await client.getJobTrigger(request); + */ + 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); + } + 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; + /** + * 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 + * const [response] = await client.deleteJobTrigger(request); + */ + 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); + } + 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; + /** + * 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 + * const [response] = await client.activateJobTrigger(request); + */ + 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); + } + 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; + /** + * 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 + * Set to control what and how to inspect. + * @param {google.privacy.dlp.v2.RiskAnalysisJobConfig} request.riskJob + * Set to choose what metric to calculate. + * @param {string} request.jobId + * The job id can contain uppercase and lowercase letters, + * numbers, and hyphens; that is, it must match the regular + * expression: `[a-zA-Z\d-_]+`. The maximum length is 100 + * characters. Can be empty to allow the system to generate one. + * @param {string} request.locationId + * 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 + * const [response] = await client.createDlpJob(request); + */ + 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); + } + 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; + /** + * 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 + * const [response] = await client.getDlpJob(request); + */ + 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); + } + 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; + /** + * 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 + * const [response] = await client.deleteDlpJob(request); + */ + 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); + } + 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; + /** + * 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 + * const [response] = await client.cancelDlpJob(request); + */ + 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); + } + 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; + /** + * 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 + * const [response] = await client.createStoredInfoType(request); + */ + 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); + } + 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; + /** + * 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 + * const [response] = await client.updateStoredInfoType(request); + */ + 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); + } + 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; + /** + * 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 + * const [response] = await client.getStoredInfoType(request); + */ + 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); + } + 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; + /** + * 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 + * const [response] = await client.deleteStoredInfoType(request); + */ + 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); + } + 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; + /** + * Inspect hybrid content and store findings to a job. + * To review the findings inspect the job. Inspection will occur + * asynchronously. + * Early access feature is in a pre-release state and might change or have + * limited support. For more information, see + * https://cloud.google.com/products#product-launch-stages. + * + * @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 + * const [response] = await client.hybridInspectDlpJob(request); + */ + 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); + } + 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; + /** + * Finish a running hybrid DlpJob. Triggers the finalization steps and running + * of any enabled actions that have not yet run. + * Early access feature is in a pre-release state and might change or have + * limited support. For more information, see + * https://cloud.google.com/products#product-launch-stages. + * + * @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 + * const [response] = await client.finishDlpJob(request); + */ + 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); + } + + 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; + /** + * 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, + 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 callSettings = new gax.CallSettings(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 + * const iterable = client.listInspectTemplatesAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + 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 || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.listInspectTemplates.asyncIterate( + this.innerApiCalls['listInspectTemplates'] as GaxCall, + (request as unknown) as RequestType, + callSettings + ) as AsyncIterable; + } + 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; + /** + * 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, + 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 callSettings = new gax.CallSettings(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 + * const iterable = client.listDeidentifyTemplatesAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + 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 || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.listDeidentifyTemplates.asyncIterate( + this.innerApiCalls['listDeidentifyTemplates'] as GaxCall, + (request as unknown) as RequestType, + callSettings + ) as AsyncIterable; + } + 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; + /** + * 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 jobs: + * - `status` - HEALTHY|PAUSED|CANCELLED + * - `inspected_storage` - DATASTORE|CLOUD_STORAGE|BIGQUERY + * - 'last_run_time` - RFC 3339 formatted timestamp, surrounded by + * quotation marks. Nanoseconds are ignored. + * - 'error_count' - Number of errors that have occurred while running. + * * The operator must be `=` or `!=` for status and inspected_storage. + * + * Examples: + * + * * inspected_storage = cloud_storage AND status = HEALTHY + * * inspected_storage = cloud_storage OR inspected_storage = bigquery + * * inspected_storage = cloud_storage AND (state = PAUSED OR state = HEALTHY) + * * last_run_time > \"2017-12-12T00:00:00+00:00\" + * + * The length of this field should be no more than 500 characters. + * @param {string} request.locationId + * 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, + 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 jobs: + * - `status` - HEALTHY|PAUSED|CANCELLED + * - `inspected_storage` - DATASTORE|CLOUD_STORAGE|BIGQUERY + * - 'last_run_time` - RFC 3339 formatted timestamp, surrounded by + * quotation marks. Nanoseconds are ignored. + * - 'error_count' - Number of errors that have occurred while running. + * * The operator must be `=` or `!=` for status and inspected_storage. + * + * Examples: + * + * * inspected_storage = cloud_storage AND status = HEALTHY + * * inspected_storage = cloud_storage OR inspected_storage = bigquery + * * inspected_storage = cloud_storage AND (state = PAUSED OR state = HEALTHY) + * * last_run_time > \"2017-12-12T00:00:00+00:00\" + * + * The length of this field should be no more than 500 characters. + * @param {string} request.locationId + * 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 callSettings = new gax.CallSettings(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 jobs: + * - `status` - HEALTHY|PAUSED|CANCELLED + * - `inspected_storage` - DATASTORE|CLOUD_STORAGE|BIGQUERY + * - 'last_run_time` - RFC 3339 formatted timestamp, surrounded by + * quotation marks. Nanoseconds are ignored. + * - 'error_count' - Number of errors that have occurred while running. + * * The operator must be `=` or `!=` for status and inspected_storage. + * + * Examples: + * + * * inspected_storage = cloud_storage AND status = HEALTHY + * * inspected_storage = cloud_storage OR inspected_storage = bigquery + * * inspected_storage = cloud_storage AND (state = PAUSED OR state = HEALTHY) + * * last_run_time > \"2017-12-12T00:00:00+00:00\" + * + * The length of this field should be no more than 500 characters. + * @param {string} request.locationId + * 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 + * const iterable = client.listJobTriggersAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + 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 || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.listJobTriggers.asyncIterate( + this.innerApiCalls['listJobTriggers'] as GaxCall, + (request as unknown) as RequestType, + callSettings + ) as AsyncIterable; + } + 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; + /** + * 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, + 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 callSettings = new gax.CallSettings(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 + * const iterable = client.listDlpJobsAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + 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 || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.listDlpJobs.asyncIterate( + this.innerApiCalls['listDlpJobs'] as GaxCall, + (request as unknown) as RequestType, + callSettings + ) as AsyncIterable; + } + 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; + /** + * 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, + 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 callSettings = new gax.CallSettings(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 + * const iterable = client.listStoredInfoTypesAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + 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 || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(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 { + this.initialize(); + if (!this._terminated) { + return this.dlpServiceStub!.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/src/v2/dlp_service_client_config.json b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/src/v2/dlp_service_client_config.json new file mode 100644 index 000000000..bcdbe63fe --- /dev/null +++ b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/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/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/src/v2/dlp_service_proto_list.json b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/src/v2/dlp_service_proto_list.json new file mode 100644 index 000000000..482924bde --- /dev/null +++ b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/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/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/src/v2/gapic_metadata.json b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/src/v2/gapic_metadata.json new file mode 100644 index 000000000..e82d006d6 --- /dev/null +++ b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/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/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/src/v2/index.ts b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/src/v2/index.ts new file mode 100644 index 000000000..2e558b1cf --- /dev/null +++ b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/src/v2/index.ts @@ -0,0 +1,19 @@ +// 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. +// +// ** 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/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/system-test/dlp_service_smoke_test.ts b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/system-test/dlp_service_smoke_test.ts new file mode 100644 index 000000000..1b900cd93 --- /dev/null +++ b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/system-test/dlp_service_smoke_test.ts @@ -0,0 +1,49 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import {describe, it} from 'mocha'; + +describe('DlpServiceSmokeTest', () => { + it('successfully makes a call to the service', done => { + // eslint-disable-next-line @typescript-eslint/no-var-requires + const dlp = require('../src'); + + const projectId = process.env['GCLOUD_PROJECT']; + const client = new dlp.v2.DlpServiceClient({}); + + const inspectConfig = { + infoTypes: [{name: 'PHONE_NUMBER'}], + minLikelihood: 'POSSIBLE', + }; + const type = 'text/plain'; + const value = 'my phone number is 215-512-1212'; + const item = { + type, + value, + }; + const request = { + inspectConfig, + item, + parent: client.projectPath(projectId), + }; + client + .inspectContent(request) + .then((responses: [{}]) => { + const response = responses[0]; + console.log(response); + }) + .then(done) + .catch(done); + }); +}); diff --git a/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/system-test/fixtures/sample/src/index.js b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/system-test/fixtures/sample/src/index.js new file mode 100644 index 000000000..dc4e25a56 --- /dev/null +++ b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/system-test/fixtures/sample/src/index.js @@ -0,0 +1,26 @@ +// 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. +// +// ** 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/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/system-test/fixtures/sample/src/index.ts b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/system-test/fixtures/sample/src/index.ts new file mode 100644 index 000000000..56e734bc1 --- /dev/null +++ b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/system-test/fixtures/sample/src/index.ts @@ -0,0 +1,32 @@ +// 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. +// +// ** 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/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/system-test/install.ts b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/system-test/install.ts new file mode 100644 index 000000000..d2d61c039 --- /dev/null +++ b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/system-test/install.ts @@ -0,0 +1,51 @@ +// 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. +// +// ** 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/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/test/gapic_dlp_service_v2.ts b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/test/gapic_dlp_service_v2.ts new file mode 100644 index 000000000..bfabed86e --- /dev/null +++ b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/test/gapic_dlp_service_v2.ts @@ -0,0 +1,6256 @@ +// 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. +// +// ** 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', () => { + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.close(); + }); + + 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) + ); + }); + }); + + 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) + ); + }); + }); + + 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) + ); + }); + }); + + 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) + ); + }); + }); + + 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) + ); + }); + }); + + 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) + ); + }); + }); + + 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) + ); + }); + }); + + 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) + ); + }); + }); + + 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) + ); + }); + }); + + 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) + ); + }); + }); + + 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) + ); + }); + }); + + 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) + ); + }); + }); + + 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) + ); + }); + }); + + 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) + ); + }); + }); + + 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) + ); + }); + }); + + 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) + ); + }); + }); + + 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) + ); + }); + }); + + 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) + ); + }); + }); + + 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) + ); + }); + }); + + 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) + ); + }); + }); + + 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) + ); + }); + }); + + 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) + ); + }); + }); + + 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) + ); + }); + }); + + 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) + ); + }); + }); + + 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) + ); + }); + }); + + 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) + ); + }); + }); + + 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) + ); + }); + }); + + 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) + ); + }); + }); + + 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) + ); + }); + }); + + 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/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/tsconfig.json b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/tsconfig.json new file mode 100644 index 000000000..c78f1c884 --- /dev/null +++ b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/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/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/webpack.config.js b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/webpack.config.js new file mode 100644 index 000000000..747ed575a --- /dev/null +++ b/tests/fixtures/nodejs_mono_repo_with_staging/packages/dlp/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', +}; diff --git a/tests/test_node_mono_repo.py b/tests/test_node_mono_repo.py new file mode 100644 index 000000000..92f58d148 --- /dev/null +++ b/tests/test_node_mono_repo.py @@ -0,0 +1,329 @@ +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import filecmp +import pathlib +import re +from pathlib import Path +from unittest import TestCase +from unittest.mock import patch + +import pytest + +import synthtool as s +from synthtool.languages import node_mono_repo +from . import util + +FIXTURES = Path(__file__).parent / "fixtures" +TEMPLATES = Path(__file__).parent.parent / "synthtool" / "gcp" / "templates" + + +def test_quickstart_metadata_with_snippet(): + with util.chdir(FIXTURES / "node_templates" / "standard"): + metadata = node_mono_repo.template_metadata( + FIXTURES / "node_templates" / "standard" + ) + + # should have loaded the special quickstart sample (ignoring header). + assert "ID of the Cloud Bigtable instance" in metadata["quickstart"] + assert "limitations under the License" not in metadata["quickstart"] + + assert isinstance(metadata["samples"], list) + + # should have a link to the quickstart in the samples + sample_names = list(map(lambda sample: sample["file"], metadata["samples"])) + assert ( + len( + list(filter((re.compile("samples/quickstart.js$")).match, sample_names)) + ) + == 0 + ) + + +def test_metadata_engines_field(): + with util.chdir(FIXTURES / "node_templates" / "standard"): + metadata = node_mono_repo.template_metadata( + FIXTURES / "node_templates" / "standard" + ) + assert "10" in metadata["engine"] + + +def test_quickstart_metadata_without_snippet(): + with util.chdir(FIXTURES / "node_templates" / "no_quickstart_snippet"): + metadata = node_mono_repo.template_metadata( + FIXTURES / "node_templates" / "no_quickstart_snippet" + ) + + # should not have populated the quickstart for the README + assert not metadata["quickstart"] + + assert isinstance(metadata["samples"], list) + + # should not have a link to the quickstart in the samples + sample_names = list(map(lambda sample: sample["file"], metadata["samples"])) + assert "samples/quickstart.js" not in sample_names + + +def test_no_samples(): + # use a non-nodejs template directory + with util.chdir(FIXTURES): + metadata = node_mono_repo.template_metadata(FIXTURES) + + # should not have populated the quickstart for the README + assert not metadata["quickstart"] + + assert isinstance(metadata["samples"], list) + assert len(metadata["samples"]) == 0 + + +def test_extract_clients_no_file(): + index_ts_path = pathlib.Path( + FIXTURES / "node_templates" / "index_samples" / "no_exist_index.ts" + ) + + with pytest.raises(FileNotFoundError): + clients = node_mono_repo.extract_clients(index_ts_path) + assert not clients + + +def test_extract_single_clients(): + index_ts_path = pathlib.Path( + FIXTURES / "node_templates" / "index_samples" / "single_index.ts" + ) + + clients = node_mono_repo.extract_clients(index_ts_path) + + assert len(clients) == 1 + assert clients[0] == "TextToSpeechClient" + + +def test_extract_multiple_clients(): + index_ts_path = pathlib.Path( + FIXTURES / "node_templates" / "index_samples" / "multiple_index.ts" + ) + + clients = node_mono_repo.extract_clients(index_ts_path) + + assert len(clients) == 2 + assert clients[0] == "StreamingVideoIntelligenceServiceClient" + assert clients[1] == "VideoIntelligenceServiceClient" + + +def test_generate_index_ts(): + # use a non-nodejs template directory + with util.chdir(FIXTURES / "node_templates" / "index_samples"): + node_mono_repo.generate_index_ts( + ["v1", "v1beta1"], + "v1", + relative_dir=(FIXTURES / "node_templates" / "index_samples"), + ) + generated_index_path = pathlib.Path( + FIXTURES / "node_templates" / "index_samples" / "src" / "index.ts" + ) + sample_index_path = pathlib.Path( + FIXTURES / "node_templates" / "index_samples" / "sample_index.ts" + ) + assert filecmp.cmp(generated_index_path, sample_index_path) + + +def test_generate_index_ts_empty_versions(): + # use a non-nodejs template directory + with util.chdir(FIXTURES / "node_templates" / "index_samples"): + with pytest.raises(AttributeError) as err: + node_mono_repo.generate_index_ts( + [], "v1", relative_dir=(FIXTURES / "node_templates" / "index_samples") + ) + assert "can't be empty" in err.args + + +def test_generate_index_ts_invalid_default_version(): + # use a non-nodejs template directory + with util.chdir(FIXTURES / "node_templates" / "index_samples"): + versions = ["v1beta1"] + default_version = "v1" + + with pytest.raises(AttributeError) as err: + node_mono_repo.generate_index_ts( + versions, + default_version, + relative_dir=(FIXTURES / "node_templates" / "index_samples"), + ) + assert f"must contain default version {default_version}" in err.args + + +def test_generate_index_ts_no_clients(): + # use a non-nodejs template directory + with util.chdir(FIXTURES / "node_templates" / "index_samples"): + versions = ["v1", "v1beta1", "invalid_index"] + default_version = "invalid_index" + + with pytest.raises(AttributeError) as err: + node_mono_repo.generate_index_ts( + versions, + default_version, + relative_dir=(FIXTURES / "node_templates" / "index_samples"), + ) + assert ( + f"No client is exported in the default version's({default_version}) index.ts ." + in err.args + ) + + +class TestPostprocess(TestCase): + @patch("synthtool.shell.run") + def test_install(self, shell_run_mock): + node_mono_repo.install() + calls = shell_run_mock.call_args_list + assert any(["npm install" in " ".join(call[0][0]) for call in calls]) + + @patch("synthtool.shell.run") + def test_fix(self, shell_run_mock): + node_mono_repo.fix() + calls = shell_run_mock.call_args_list + assert any(["npm run fix" in " ".join(call[0][0]) for call in calls]) + + @patch("synthtool.shell.run") + def test_compile_protos(self, shell_run_mock): + node_mono_repo.compile_protos() + calls = shell_run_mock.call_args_list + assert any(["npx compileProtos src" in " ".join(call[0][0]) for call in calls]) + + @patch("synthtool.shell.run") + def test_postprocess_gapic_library(self, shell_run_mock): + node_mono_repo.postprocess_gapic_library() + calls = shell_run_mock.call_args_list + assert any(["npm install" in " ".join(call[0][0]) for call in calls]) + assert any(["npm run fix" in " ".join(call[0][0]) for call in calls]) + assert any(["npx compileProtos src" in " ".join(call[0][0]) for call in calls]) + + +# postprocess_gapic_library_hermetic() must be mocked because it depends on node modules +# present in the docker image but absent while running unit tests. +@patch("synthtool.languages.node_mono_repo.postprocess_gapic_library_hermetic") +def test_owlbot_main(hermetic_mock): + with util.copied_fixtures_dir(FIXTURES / "nodejs_mono_repo_with_staging"): + # just confirm it doesn't throw an exception. + node_mono_repo.owlbot_entrypoint(template_path=TEMPLATES) + + +@pytest.fixture +def nodejs_mono_repo(): + """chdir to a copy of nodejs-dlp-with-staging.""" + with util.copied_fixtures_dir( + FIXTURES / "nodejs_mono_repo_with_staging" + ) as workdir: + yield workdir + + +@patch("synthtool.languages.node_mono_repo.postprocess_gapic_library_hermetic") +def test_owlbot_main_with_staging(hermetic_mock, nodejs_mono_repo): + original_text = open( + FIXTURES + / "nodejs_mono_repo_with_staging" + / "packages" + / "dlp" + / "src" + / "index.ts", + "rt", + ).read() + node_mono_repo.owlbot_entrypoint(template_path=TEMPLATES) + # confirm index.ts was overwritten by template-generated index.ts. + staging_text = open( + FIXTURES + / "nodejs_mono_repo_with_staging" + / "owl-bot-staging" + / "dlp" + / "v2" + / "src" + / "index.ts", + "rt", + ).read() + text = open("./packages/dlp/src/v2/index.ts", "rt").read() + assert staging_text != text + assert original_text != text + + +@patch("synthtool.languages.node_mono_repo.postprocess_gapic_library_hermetic") +def test_owlbot_main_with_staging_index_from_staging(hermetic_mock, nodejs_mono_repo): + node_mono_repo.owlbot_entrypoint( + template_path=TEMPLATES, + staging_excludes=["README.md", "package.json"], + templates_excludes=["src/index.ts"], + ) + # confirm index.ts was overwritten by staging index.ts. + staging_text = open( + FIXTURES + / "nodejs_mono_repo_with_staging" + / "owl-bot-staging" + / "dlp" + / "v2" + / "src" + / "index.ts", + "rt", + ).read() + text = open("./packages/dlp/src/index.ts", "rt").read() + assert staging_text == text + + +@patch("synthtool.languages.node_mono_repo.postprocess_gapic_library_hermetic") +def test_owlbot_main_with_staging_ignore_index(hermetic_mock, nodejs_mono_repo): + original_text = open( + FIXTURES + / "nodejs_mono_repo_with_staging" + / "packages" + / "dlp" + / "src" + / "index.ts", + "rt", + ).read() + node_mono_repo.owlbot_entrypoint( + template_path=TEMPLATES, templates_excludes=["src/index.ts"] + ) + # confirm index.ts was overwritten by staging index.ts. + text = open("./packages/dlp/src/index.ts", "rt").read() + assert original_text == text + + +@patch("synthtool.languages.node_mono_repo.postprocess_gapic_library_hermetic") +def test_owlbot_main_with_staging_patch_staging(hermetic_mock, nodejs_mono_repo): + def patch(library: Path): + s.replace(library / "src" / "index.ts", "import", "export") + + node_mono_repo.owlbot_entrypoint( + template_path=TEMPLATES, + staging_excludes=["README.md", "package.json"], + templates_excludes=["src/index.ts"], + patch_staging=patch, + ) + # confirm index.ts was overwritten by staging index.ts. + staging_text = open( + FIXTURES + / "nodejs_mono_repo_with_staging" + / "owl-bot-staging" + / "dlp" + / "v2" + / "src" + / "index.ts", + "rt", + ).read() + text = open("./packages/dlp/src/index.ts", "rt").read() + assert "import * as v2" in staging_text + assert "export * as v2" not in staging_text + assert "export * as v2" in text + + +def test_owlbot_main_without_version(): + with util.copied_fixtures_dir(FIXTURES / "node_templates" / "no_version"): + # just confirm it doesn't throw an exception. + node_mono_repo.owlbot_entrypoint(template_path=TEMPLATES)